# jishnudipsaha/eye-disease-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/jishnudipsaha/eye-disease-prediction
- Repository: https://github.com/jishnudipsaha/eye-disease-prediction

## Overview

This repository provides OCT retinal-image classification through a FastAPI web app, with a legacy Streamlit interface, class-specific recommendation text, and a training notebook/model artifacts. The sampled FastAPI source shows upload preprocessing, model inference, class/confidence selection, and recommendation lookup. The frontend file and notebooks were not sampled, so their internal behavior and wiring are not detailed.

Main entry points: [`app.py`](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app.py) (FastAPI app), [`app_streamlit.py`](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app_streamlit.py) (Streamlit app), [`static/index.html`](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/static/index.html) (Web interface), [`Trained_Model.h5`](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/Trained_Model.h5) (Trained weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web applications"]
  node_fastapi["FastAPI app<br/>[app.py]"]
  node_frontend["Web interface<br/>[index.html]"]
  node_streamlit["Streamlit app<br/>[app_streamlit.py]"]
end

subgraph group_ml["Model lifecycle"]
  node_preprocess["Image preprocessing<br/>[app.py]"]
  node_classifier["Classifier model<br/>[app.py]"]
  node_weights["Trained weights<br/>[Trained_Model.h5]"]
  node_kerasmodel["Keras model"]
  node_training["Model training"]
  node_inference["Inference notebook"]
end

subgraph group_guidance["Clinical guidance"]
  node_recommendations["Class recommendations<br/>[recommendation.py]"]
end

node_user(("User"))

node_user -->|"opens"| node_frontend
node_user -->|"uploads scan"| node_fastapi
node_fastapi -->|"serves page"| node_frontend
node_fastapi -->|"preprocesses image"| node_preprocess
node_preprocess -->|"provides tensor"| node_classifier
node_classifier -->|"loads weights"| node_weights
node_classifier -->|"selects class guidance"| node_recommendations
node_training -.->|"trains weights"| node_weights
node_inference -.->|"uses model"| node_kerasmodel
node_user -.->|"uses legacy app"| node_streamlit
node_streamlit -.->|"loads model"| node_kerasmodel
node_streamlit -.->|"displays guidance"| node_recommendations

click node_fastapi "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app.py"
click node_frontend "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/static/index.html"
click node_streamlit "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app_streamlit.py"
click node_preprocess "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app.py"
click node_classifier "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app.py"
click node_weights "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/Trained_Model.h5"
click node_kerasmodel "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/Trained_Model.keras"
click node_training "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/Training_model.ipynb"
click node_inference "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/Model_Prediction.ipynb"
click node_recommendations "https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/recommendation.py"

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_fastapi,node_frontend,node_streamlit,node_user toneBlue
class node_preprocess,node_classifier,node_weights,node_kerasmodel,node_training,node_inference toneAmber
class node_recommendations toneMint
```

## Components

### Web applications

- [FastAPI app](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app.py): `app.py`
- [Web interface](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/static/index.html): `static/index.html`
- [Streamlit app](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app_streamlit.py): `app_streamlit.py`

### Model lifecycle

- [Image preprocessing](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app.py): `app.py`
- [Classifier model](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/app.py): `app.py`
- [Trained weights](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/Trained_Model.h5): `Trained_Model.h5`
- [Keras model](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/Trained_Model.keras): `Trained_Model.keras`
- [Model training](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/Training_model.ipynb): `Training_model.ipynb`
- [Inference notebook](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/Model_Prediction.ipynb): `Model_Prediction.ipynb`

### Clinical guidance

- [Class recommendations](https://github.com/jishnudipsaha/eye-disease-prediction/blob/main/recommendation.py): `recommendation.py`

### Other components

- **User**

## Connections

- User → Web interface: opens
- User → FastAPI app: uploads scan
- FastAPI app → Web interface: serves page
- FastAPI app → Image preprocessing: preprocesses image
- Image preprocessing → Classifier model: provides tensor
- Classifier model → Trained weights: loads weights
- Classifier model → Class recommendations: selects class guidance
- Model training → Trained weights: trains weights
- Inference notebook → Keras model: uses model
- User → Streamlit app: uses legacy app
- Streamlit app → Keras model: loads model
- Streamlit app → Class recommendations: displays guidance
