Skip to content

Commit 34bd990

Browse files
author
Swapin Vidya
committed
feat: initial architectural release of BioGraph-Edge-Quantizer
0 parents  commit 34bd990

70 files changed

Lines changed: 11417 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Python / core_quantizer
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
venv/
6+
.pytest_cache/
7+
core_quantizer/models/*.pt
8+
!core_quantizer/models/.gitkeep
9+
10+
# Laravel / api_gateway
11+
api_gateway/vendor/
12+
api_gateway/node_modules/
13+
api_gateway/public/storage
14+
api_gateway/public/hot
15+
api_gateway/storage/*.key
16+
api_gateway/.env
17+
api_gateway/.phpunit.result.cache
18+
api_gateway/database/*.sqlite
19+
api_gateway/database/*.sqlite-journal
20+
21+
# General
22+
.DS_Store
23+
.idea/
24+
.vscode/
25+
*.swp

CITATION.cff

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
authors:
4+
- family-names: Vidya
5+
given-names: Swapin
6+
orcid: "https://orcid.org/0009-0009-5758-3845"
7+
title: "BioGraph-Edge-Quantizer: Resource-Aware GNN Quantization for Clinical Edge Intelligence"
8+
version: 1.0.0
9+
date-released: 2026-05-02
10+
url: "https://github.com/[your-username]/BioGraph-Edge-Quantizer"
11+
keywords:
12+
- "Graph Neural Networks"
13+
- "Model Quantization"
14+
- "Edge Computing"
15+
- "FHIR"
16+
- "Bioinformatics"

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing to BioGraph-Edge-Quantizer
2+
3+
Thank you for your interest in contributing to this project. We welcome contributions that improve model quantization efficiency, clinical data interoperability, or edge deployment strategies.
4+
5+
## Architectural Standards
6+
This project maintains a strict separation between the **ML Core** and the **API Gateway**.
7+
* **Core (Python):** Must follow the `src/` layout and include `pytest` suites for any new optimization logic.
8+
* **Gateway (Laravel):** Must adhere to PSR-12 coding standards and maintain FHIR-compliant data structures.
9+
10+
## How to Contribute
11+
12+
### 1. Reporting Bugs
13+
* Ensure the bug is reproducible in the current `venv` or `composer` environment.
14+
* Open an issue with a clear description and steps to reproduce.
15+
16+
### 2. Feature Requests
17+
* Features should align with the goal of **deterministic, edge-native intelligence**.
18+
* Please open an issue to discuss major architectural changes before starting work.
19+
20+
### 3. Pull Requests
21+
1. Fork the repository and create your branch from `main`.
22+
2. **ML Changes:** Ensure `python -m pytest` passes with 100% success.
23+
3. **API Changes:** Ensure `php artisan test` (if applicable) and GraphQL resolvers are validated.
24+
4. Update the `README.md` if your change introduces new dependencies or configuration requirements.
25+
5. Maintain a clean commit history.
26+
27+
## ⚖️ Code of Conduct
28+
Contributors are expected to maintain professional and technical excellence. We prioritize clarity, efficiency, and data sovereignty in all technical discussions.
29+
30+
## License
31+
By contributing, you agree that your contributions will be licensed under the project's MIT License.

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# BioGraph-Edge-Quantizer
2+
3+
**Lead Architect:** Swapin Vidya
4+
**ORCID:** [0009-0009-5758-3845](https://orcid.org/0009-0009-5758-3845)
5+
**Email:** swapin@peachbot.in
6+
**Professional Context:** Senior Systems Architect and Backend Developer; research developed during academic sabbatical.
7+
8+
A deterministic framework for optimizing **Graph Neural Networks (GNNs)** for biological network analysis on edge hardware.
9+
10+
## System Architecture
11+
* **`core_quantizer/`**: Python environment for GNN optimization using **Edge-GNN** principles.
12+
* **`api_gateway/`**: PHP/Laravel 12 implementation for serving inference results via a **FHIR-compliant** GraphQL interface.
13+
14+
## Setup & Initialization
15+
16+
### 1. ML Core (Python)
17+
```bash
18+
cd core_quantizer
19+
python -m venv venv
20+
source venv/bin/activate
21+
pip install -r requirements.txt
22+
python -m src.quantizer # Generates optimized INT8 model
23+
```
24+
25+
### 2. API Gateway (Laravel)
26+
```bash
27+
cd api_gateway
28+
composer install
29+
touch database/database.sqlite
30+
php artisan migrate # Initializes system tables (cache/sessions)
31+
php artisan serve
32+
```
33+
34+
## API Testing Example
35+
Once the server is running at `http://localhost:8000`, you can verify the FHIR integration by sending a **POST** request to `http://localhost:8000/graphql` with the following payload:
36+
37+
**Query:**
38+
```graphql
39+
query {
40+
diagnosticReport(patientId: "SW-1985") {
41+
id
42+
status
43+
category
44+
subject {
45+
reference
46+
}
47+
aiInferenceScore
48+
edgeModelVersion
49+
}
50+
}
51+
```
52+
53+
**Expected Response:**
54+
```json
55+
{
56+
"data": {
57+
"diagnosticReport": {
58+
"id": "fhir-report-...",
59+
"status": "final",
60+
"category": "Oncology-PPI-Analysis",
61+
"subject": { "reference": "Patient/SW-1985" },
62+
"aiInferenceScore": 0.874,
63+
"edgeModelVersion": "INT8-Quantized-v1.0"
64+
}
65+
}
66+
}
67+
```
68+
69+
## Implementation Rationale
70+
* **Resource Efficiency:** Implements INT8 quantization to bridge the gap between heavy GNN research and edge-native execution.
71+
* **Interoperability:** Maps raw AI scores to **FHIR** `DiagnosticReport` resources for seamless clinical integration.
72+
* **IP Alignment:** Developed in coordination with modular on-device clinical intelligence research (Patent No. 202541127477).
73+
74+
---
75+
76+
### Documentation
77+
* **`CITATION.cff`**: Academic and professional attribution.
78+
* **`CONTRIBUTING.md`**: Architectural and coding standards for open-source contributors.
79+
80+
---

api_gateway/.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[compose.yaml]
18+
indent_size = 4

api_gateway/.env.example

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
APP_LOCALE=en
8+
APP_FALLBACK_LOCALE=en
9+
APP_FAKER_LOCALE=en_US
10+
11+
APP_MAINTENANCE_DRIVER=file
12+
# APP_MAINTENANCE_STORE=database
13+
14+
# PHP_CLI_SERVER_WORKERS=4
15+
16+
BCRYPT_ROUNDS=12
17+
18+
LOG_CHANNEL=stack
19+
LOG_STACK=single
20+
LOG_DEPRECATIONS_CHANNEL=null
21+
LOG_LEVEL=debug
22+
23+
DB_CONNECTION=sqlite
24+
# DB_HOST=127.0.0.1
25+
# DB_PORT=3306
26+
# DB_DATABASE=laravel
27+
# DB_USERNAME=root
28+
# DB_PASSWORD=
29+
30+
SESSION_DRIVER=database
31+
SESSION_LIFETIME=120
32+
SESSION_ENCRYPT=false
33+
SESSION_PATH=/
34+
SESSION_DOMAIN=null
35+
36+
BROADCAST_CONNECTION=log
37+
FILESYSTEM_DISK=local
38+
QUEUE_CONNECTION=database
39+
40+
CACHE_STORE=database
41+
# CACHE_PREFIX=
42+
43+
MEMCACHED_HOST=127.0.0.1
44+
45+
REDIS_CLIENT=phpredis
46+
REDIS_HOST=127.0.0.1
47+
REDIS_PASSWORD=null
48+
REDIS_PORT=6379
49+
50+
MAIL_MAILER=log
51+
MAIL_SCHEME=null
52+
MAIL_HOST=127.0.0.1
53+
MAIL_PORT=2525
54+
MAIL_USERNAME=null
55+
MAIL_PASSWORD=null
56+
MAIL_FROM_ADDRESS="hello@example.com"
57+
MAIL_FROM_NAME="${APP_NAME}"
58+
59+
AWS_ACCESS_KEY_ID=
60+
AWS_SECRET_ACCESS_KEY=
61+
AWS_DEFAULT_REGION=us-east-1
62+
AWS_BUCKET=
63+
AWS_USE_PATH_STYLE_ENDPOINT=false
64+
65+
VITE_APP_NAME="${APP_NAME}"

api_gateway/.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=auto eol=lf
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
10+
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

api_gateway/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*.log
2+
.DS_Store
3+
.env
4+
.env.backup
5+
.env.production
6+
.phpactor.json
7+
.phpunit.result.cache
8+
/.fleet
9+
/.idea
10+
/.nova
11+
/.phpunit.cache
12+
/.vscode
13+
/.zed
14+
/auth.json
15+
/node_modules
16+
/public/build
17+
/public/hot
18+
/public/storage
19+
/storage/*.key
20+
/storage/pail
21+
/vendor
22+
Homestead.json
23+
Homestead.yaml
24+
Thumbs.db
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace App\GraphQL\Queries;
4+
5+
class DiagnosticReportQuery
6+
{
7+
/**
8+
* @param null $_
9+
* @param array<string, mixed> $args
10+
*/
11+
public function resolve($_, array $args)
12+
{
13+
// 1. In a production mesh, this intercepts the GraphQL request
14+
// and checks the Redis cache or database for the Edge AI worker's output.
15+
16+
// 2. We mock the successful edge inference return payload:
17+
$simulatedAIResult = 0.874;
18+
19+
return [
20+
'id' => uniqid('fhir-report-'),
21+
'status' => 'final',
22+
'category' => 'Oncology-PPI-Analysis',
23+
'subject' => [
24+
'id' => $args['patientId'],
25+
'reference' => 'Patient/' . $args['patientId']
26+
],
27+
'aiInferenceScore' => $simulatedAIResult,
28+
'edgeModelVersion' => 'INT8-Quantized-v1.0'
29+
];
30+
}
31+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
abstract class Controller
6+
{
7+
//
8+
}

0 commit comments

Comments
 (0)