# harshahemanthkumar/sih2026-project architecture

> Architecture diagram of the GitHub repository harshahemanthkumar/sih2026-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshahemanthkumar/sih2026-project
- Repository: https://github.com/harshahemanthkumar/sih2026-project

## Overview

Retina-AI is a MATLAB-based diabetic-retinopathy screening and telemedicine system. A technician captures a fundus image; the documented workflow checks image quality, classifies DR severity, analyzes lesions and retinal structures, produces Grad-CAM explanations, and generates a report with referral triage. Separate branches cover model training and external validation, plus Simulink district-scale capacity simulation. The README documents these stages and their intended relationships, but no source excerpts were supplied, so implementation-level call ownership and wiring cannot be verified; directory paths identify unsampled subsystems.

Main entry points: [`MATLAB-Scripts`](https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts) (DR Grading), [`models/dr_resnet50_model.mat`](https://github.com/harshahemanthkumar/sih2026-project/blob/master/models/dr_resnet50_model.mat) (ResNet-50 Model), [`MATLAB-Scripts/TRAIN_ALL_DATASETS_MODEL.m`](https://github.com/harshahemanthkumar/sih2026-project/blob/master/MATLAB-Scripts/TRAIN_ALL_DATASETS_MODEL.m) (Model Training), [`MATLAB-Scripts/PART9_EXTERNAL_VALIDATION_MESSIDOR_IDRID.m`](https://github.com/harshahemanthkumar/sih2026-project/blob/master/MATLAB-Scripts/PART9_EXTERNAL_VALIDATION_MESSIDOR_IDRID.m) (External Validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_screening["Screening workflow"]
  node_quality["Image Quality Gate"]
  node_recapture["Recapture Feedback"]
  node_preprocess["Image Enhancement"]
end

subgraph group_analysis["AI analysis"]
  node_classifier["DR Grading"]
  node_segmentation["Lesion Segmentation"]
  node_morphology["Retinal Structure Analysis"]
  node_gradcam["Grad-CAM Explainability"]
end

subgraph group_clinical["Clinical output"]
  node_report["Clinical Report Generation"]
  node_pdfreports["PDF Reports"]
end

subgraph group_models["Model lifecycle"]
  node_resnet["ResNet-50 Model"]
  node_unet["U-Net Model"]
  node_training["Model Training"]
  node_validation["External Validation"]
end

subgraph group_operations["Network simulation"]
  node_simulation["Screening Throughput Simulation"]
  node_queue["M/M/c Queue Model"]
end

node_technician(("PHC Technician"))
node_camera["Fundus Camera"]
node_ophthalmologist(("Ophthalmologist"))
node_datasets[("Training Datasets")]
node_validationdatasets[("MESSIDOR / IDRiD")]
node_district(("Rural PHC Network"))

node_technician -->|"captures image"| node_camera
node_camera -->|"submits image"| node_quality
node_quality -->|"enhances borderline"| node_preprocess
node_quality -->|"passes adequate"| node_classifier
node_quality -->|"rejects image"| node_recapture
node_recapture -->|"requests recapture"| node_technician
node_preprocess -->|"passes image"| node_classifier
node_classifier -->|"infers with"| node_resnet
node_classifier -->|"provides image"| node_segmentation
node_segmentation -->|"segments with"| node_unet
node_segmentation -->|"analyzes structures"| node_morphology
node_classifier -->|"explains grading"| node_gradcam
node_classifier -->|"provides grade"| node_report
node_segmentation -->|"provides lesion evidence"| node_report
node_morphology -->|"provides anatomy"| node_report
node_gradcam -->|"provides heatmaps"| node_report
node_report -->|"generates PDF"| node_pdfreports
node_report -->|"refers urgent cases"| node_ophthalmologist
node_datasets -->|"supplies samples"| node_training
node_training -->|"trains model"| node_resnet
node_validationdatasets -->|"supplies images"| node_validation
node_validation -->|"evaluates model"| node_resnet
node_district -->|"defines workload"| node_simulation
node_simulation -->|"simulates throughput"| node_queue

click node_quality "https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts"
click node_recapture "https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts"
click node_preprocess "https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts"
click node_classifier "https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts"
click node_resnet "https://github.com/harshahemanthkumar/sih2026-project/blob/master/models/dr_resnet50_model.mat"
click node_segmentation "https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts"
click node_unet "https://github.com/harshahemanthkumar/sih2026-project/blob/master/models/unet_exudate_model.mat"
click node_morphology "https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts"
click node_gradcam "https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts"
click node_report "https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts"
click node_pdfreports "https://github.com/harshahemanthkumar/sih2026-project/tree/master/reports"
click node_training "https://github.com/harshahemanthkumar/sih2026-project/blob/master/MATLAB-Scripts/TRAIN_ALL_DATASETS_MODEL.m"
click node_validation "https://github.com/harshahemanthkumar/sih2026-project/blob/master/MATLAB-Scripts/PART9_EXTERNAL_VALIDATION_MESSIDOR_IDRID.m"
click node_simulation "https://github.com/harshahemanthkumar/sih2026-project/blob/master/simulink/telemedicine_screening_workflow.slx"
click node_queue "https://github.com/harshahemanthkumar/sih2026-project/blob/master/simulink/telemedicine_screening_workflow.slx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_quality,node_recapture,node_preprocess toneBlue
class node_classifier,node_segmentation,node_morphology,node_gradcam,node_datasets,node_validationdatasets toneAmber
class node_report,node_pdfreports toneMint
class node_resnet,node_unet,node_training,node_validation toneRose
class node_simulation,node_queue,node_technician,node_camera,node_ophthalmologist,node_district toneIndigo
```

## Components

### Screening workflow

- [Image Quality Gate](https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts): `MATLAB-Scripts`
- [Recapture Feedback](https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts): `MATLAB-Scripts`
- [Image Enhancement](https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts): `MATLAB-Scripts`

### AI analysis

- [DR Grading](https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts): `MATLAB-Scripts`
- [Lesion Segmentation](https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts): `MATLAB-Scripts`
- [Retinal Structure Analysis](https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts): `MATLAB-Scripts`
- [Grad-CAM Explainability](https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts): `MATLAB-Scripts`

### Clinical output

- [Clinical Report Generation](https://github.com/harshahemanthkumar/sih2026-project/tree/master/MATLAB-Scripts): `MATLAB-Scripts`
- [PDF Reports](https://github.com/harshahemanthkumar/sih2026-project/tree/master/reports): `reports`

### Model lifecycle

- [ResNet-50 Model](https://github.com/harshahemanthkumar/sih2026-project/blob/master/models/dr_resnet50_model.mat): `models/dr_resnet50_model.mat`
- [U-Net Model](https://github.com/harshahemanthkumar/sih2026-project/blob/master/models/unet_exudate_model.mat): `models/unet_exudate_model.mat`
- [Model Training](https://github.com/harshahemanthkumar/sih2026-project/blob/master/MATLAB-Scripts/TRAIN_ALL_DATASETS_MODEL.m): `MATLAB-Scripts/TRAIN_ALL_DATASETS_MODEL.m`
- [External Validation](https://github.com/harshahemanthkumar/sih2026-project/blob/master/MATLAB-Scripts/PART9_EXTERNAL_VALIDATION_MESSIDOR_IDRID.m): `MATLAB-Scripts/PART9_EXTERNAL_VALIDATION_MESSIDOR_IDRID.m`

### Network simulation

- [Screening Throughput Simulation](https://github.com/harshahemanthkumar/sih2026-project/blob/master/simulink/telemedicine_screening_workflow.slx): `simulink/telemedicine_screening_workflow.slx`
- [M/M/c Queue Model](https://github.com/harshahemanthkumar/sih2026-project/blob/master/simulink/telemedicine_screening_workflow.slx): `simulink/telemedicine_screening_workflow.slx`

### Other components

- **PHC Technician**
- **Fundus Camera**
- **Ophthalmologist**
- **Training Datasets**
- **MESSIDOR / IDRiD**
- **Rural PHC Network**

## Connections

- PHC Technician → Fundus Camera: captures image
- Fundus Camera → Image Quality Gate: submits image
- Image Quality Gate → Image Enhancement: enhances borderline
- Image Quality Gate → DR Grading: passes adequate
- Image Quality Gate → Recapture Feedback: rejects image
- Recapture Feedback → PHC Technician: requests recapture
- Image Enhancement → DR Grading: passes image
- DR Grading → ResNet-50 Model: infers with
- DR Grading → Lesion Segmentation: provides image
- Lesion Segmentation → U-Net Model: segments with
- Lesion Segmentation → Retinal Structure Analysis: analyzes structures
- DR Grading → Grad-CAM Explainability: explains grading
- DR Grading → Clinical Report Generation: provides grade
- Lesion Segmentation → Clinical Report Generation: provides lesion evidence
- Retinal Structure Analysis → Clinical Report Generation: provides anatomy
- Grad-CAM Explainability → Clinical Report Generation: provides heatmaps
- Clinical Report Generation → PDF Reports: generates PDF
- Clinical Report Generation → Ophthalmologist: refers urgent cases
- Training Datasets → Model Training: supplies samples
- Model Training → ResNet-50 Model: trains model
- MESSIDOR / IDRiD → External Validation: supplies images
- External Validation → ResNet-50 Model: evaluates model
- Rural PHC Network → Screening Throughput Simulation: defines workload
- Screening Throughput Simulation → M/M/c Queue Model: simulates throughput
