# rudrasalokhe/dr-binary-classifier-mobilenet architecture

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

- Interactive diagram: https://gitdiagram.com/rudrasalokhe/dr-binary-classifier-mobilenet
- Repository: https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet

## Overview

RetinaScope is a Flask retinal-image screening app. A user uploads a fundus image in the web interface; the browser submits it to the prediction route, which validates and decodes it, preprocesses it, runs CNN inference, and returns class confidences for display. The graph includes the documented Grad-CAM capability, but no implementation or connection for it appears in the supplied source. The README describes additional preprocessing details that differ from the sampled implementation, so the graph follows the code where available.

Main entry points: [`app.py`](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py) (Flask routes), [`static/script.js`](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/static/script.js) (Upload and results UI), [`templates`](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/tree/main/templates) (Web pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_web["Web pages"]
  node_client["Upload and results UI<br/>[script.js]"]
  node_results["Confidence display<br/>[script.js]"]
end

subgraph group_backend["Prediction backend"]
  node_flask["Flask routes<br/>[app.py]"]
  node_validation["Upload validation<br/>[app.py]"]
  node_response["Class confidences<br/>[app.py]"]
end

subgraph group_vision["Image analysis"]
  node_decode["Image decoding<br/>[app.py]"]
  node_preprocess["Fundus preprocessing<br/>[app.py]"]
  node_fov["FOV and illumination<br/>[app.py]"]
  node_enhance["Contrast and features<br/>[app.py]"]
  node_normalize["Stack and normalize<br/>[app.py]"]
  node_cnn["Keras CNN"]
end

subgraph group_interpretability["Interpretability"]
  node_gradcam["Grad-CAM support"]
end

node_user(("Image uploader"))

node_user -->|"opens"| node_web
node_user -->|"uploads image"| node_client
node_flask -->|"renders pages"| node_web
node_client -->|"posts image"| node_flask
node_flask -->|"validates upload"| node_validation
node_flask -->|"decodes image"| node_decode
node_flask -->|"preprocesses image"| node_preprocess
node_preprocess -->|"masks and corrects"| node_fov
node_preprocess -->|"enhances features"| node_enhance
node_preprocess -->|"stacks and resizes"| node_normalize
node_flask -->|"runs inference"| node_cnn
node_flask -->|"builds response"| node_response
node_client -->|"renders confidences"| node_results
node_gradcam -.->|"interprets model"| node_cnn

click node_web "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/tree/main/templates"
click node_client "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/static/script.js"
click node_flask "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py"
click node_validation "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py"
click node_decode "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py"
click node_preprocess "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py"
click node_fov "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py"
click node_enhance "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py"
click node_normalize "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py"
click node_response "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py"
click node_results "https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/static/script.js"

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_web,node_client,node_results toneBlue
class node_flask,node_validation,node_response toneAmber
class node_decode,node_preprocess,node_fov,node_enhance,node_normalize,node_cnn toneMint
class node_gradcam toneRose
class node_user toneIndigo
```

## Components

### Web interface

- [Web pages](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/tree/main/templates): `templates`
- [Upload and results UI](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/static/script.js): `static/script.js`
- [Confidence display](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/static/script.js): `static/script.js`

### Prediction backend

- [Flask routes](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py): `app.py`
- [Upload validation](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py): `app.py`
- [Class confidences](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py): `app.py`

### Image analysis

- [Image decoding](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py): `app.py`
- [Fundus preprocessing](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py): `app.py`
- [FOV and illumination](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py): `app.py`
- [Contrast and features](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py): `app.py`
- [Stack and normalize](https://github.com/rudrasalokhe/dr-binary-classifier-mobilenet/blob/main/app.py): `app.py`
- **Keras CNN**

### Interpretability

- **Grad-CAM support**

### Other components

- **Image uploader**

## Connections

- Image uploader → Web pages: opens (evidence: `README.md`)
- Image uploader → Upload and results UI: uploads image (evidence: `README.md`)
- Flask routes → Web pages: renders pages (evidence: `app.py`)
- Upload and results UI → Flask routes: posts image (evidence: `static/script.js`)
- Flask routes → Upload validation: validates upload (evidence: `app.py`)
- Flask routes → Image decoding: decodes image (evidence: `app.py`)
- Flask routes → Fundus preprocessing: preprocesses image (evidence: `app.py`)
- Fundus preprocessing → FOV and illumination: masks and corrects (evidence: `app.py`)
- Fundus preprocessing → Contrast and features: enhances features (evidence: `app.py`)
- Fundus preprocessing → Stack and normalize: stacks and resizes (evidence: `app.py`)
- Flask routes → Keras CNN: runs inference (evidence: `app.py`)
- Flask routes → Class confidences: builds response (evidence: `app.py`)
- Upload and results UI → Confidence display: renders confidences (evidence: `static/script.js`)
- Grad-CAM support → Keras CNN: interprets model
