# mintesnot96/deepmedscan architecture

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

- Interactive diagram: https://gitdiagram.com/mintesnot96/deepmedscan
- Repository: https://github.com/mintesnot96/deepmedscan

## Overview

DeepMedScan is a Flask web app for uploading medical images and predicting four conditions. The main workflow is condition-page selection, image upload and validation, condition-specific preprocessing and model inference, then display of a result page. The README also describes X-ray and MRI support and computer-vision preprocessing; the tumor workflow’s crop and VGG16 preprocessing are visible in app.py. The graph reflects the sampled app and documented capabilities; it does not infer training or unsampled implementation details.

Main entry points: [`app.py`](https://github.com/mintesnot96/deepmedscan/blob/main/app.py) (Flask routes), [`templates/homepage.html`](https://github.com/mintesnot96/deepmedscan/blob/main/templates/homepage.html) (Home page), [`templates/covid.html`](https://github.com/mintesnot96/deepmedscan/blob/main/templates/covid.html) (COVID page), [`templates/braintumor.html`](https://github.com/mintesnot96/deepmedscan/blob/main/templates/braintumor.html) (Tumor page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app["Flask routes<br/>[app.py]"]
  node_upload["Upload handling<br/>[app.py]"]
  node_home["Home page<br/>[homepage.html]"]
  node_covid_page["COVID page<br/>[covid.html]"]
  node_tumor_page["Tumor page<br/>[braintumor.html]"]
  node_alz_page["Alzheimer page<br/>[alzheimer.html]"]
  node_pneumonia_page["Pneumonia page<br/>[pneumonia.html]"]
  node_covid_result["COVID result<br/>[resultc.html]"]
  node_tumor_result["Tumor result<br/>[resultbt.html]"]
  node_alz_result["Alzheimer result<br/>[resulta.html]"]
  node_pneumonia_result["Pneumonia result<br/>[resultp.html]"]
end

subgraph group_inference["Image inference"]
  node_preprocess["Image preprocessing<br/>[app.py]"]
end

subgraph group_assets["Model artifacts"]
  node_covid_model["COVID model<br/>[modelcovid19.h5]"]
  node_tumor_model["Tumor model<br/>[modelbraintumor.h5]"]
  node_alz_model["Alzheimer model<br/>[modelalzheimer.h5]"]
  node_pneumonia_model["Pneumonia model<br/>[modelpneumonia.h5]"]
end

node_user(("User"))

node_user -->|"opens app"| node_app
node_app -->|"renders"| node_home
node_app -->|"renders"| node_covid_page
node_app -->|"renders"| node_tumor_page
node_app -->|"renders"| node_alz_page
node_app -->|"renders"| node_pneumonia_page
node_user -->|"uploads image"| node_upload
node_app -->|"validates and saves"| node_upload
node_app -->|"preprocesses image"| node_preprocess
node_app -->|"loads and predicts"| node_covid_model
node_app -->|"loads and predicts"| node_tumor_model
node_app -->|"loads and predicts"| node_alz_model
node_app -->|"loads and predicts"| node_pneumonia_model
node_app -->|"renders result"| node_covid_result
node_app -->|"renders result"| node_tumor_result
node_app -->|"renders result"| node_alz_result
node_app -->|"renders result"| node_pneumonia_result

click node_app "https://github.com/mintesnot96/deepmedscan/blob/main/app.py"
click node_upload "https://github.com/mintesnot96/deepmedscan/blob/main/app.py"
click node_home "https://github.com/mintesnot96/deepmedscan/blob/main/templates/homepage.html"
click node_covid_page "https://github.com/mintesnot96/deepmedscan/blob/main/templates/covid.html"
click node_tumor_page "https://github.com/mintesnot96/deepmedscan/blob/main/templates/braintumor.html"
click node_alz_page "https://github.com/mintesnot96/deepmedscan/blob/main/templates/alzheimer.html"
click node_pneumonia_page "https://github.com/mintesnot96/deepmedscan/blob/main/templates/pneumonia.html"
click node_preprocess "https://github.com/mintesnot96/deepmedscan/blob/main/app.py"
click node_covid_model "https://github.com/mintesnot96/deepmedscan/blob/main/models/modelcovid19.h5"
click node_tumor_model "https://github.com/mintesnot96/deepmedscan/blob/main/models/modelbraintumor.h5"
click node_alz_model "https://github.com/mintesnot96/deepmedscan/blob/main/models/modelalzheimer.h5"
click node_pneumonia_model "https://github.com/mintesnot96/deepmedscan/blob/main/models/modelpneumonia.h5"
click node_covid_result "https://github.com/mintesnot96/deepmedscan/blob/main/templates/resultc.html"
click node_tumor_result "https://github.com/mintesnot96/deepmedscan/blob/main/templates/resultbt.html"
click node_alz_result "https://github.com/mintesnot96/deepmedscan/blob/main/templates/resulta.html"
click node_pneumonia_result "https://github.com/mintesnot96/deepmedscan/blob/main/templates/resultp.html"

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_app,node_upload,node_home,node_covid_page,node_tumor_page,node_alz_page,node_pneumonia_page,node_covid_result,node_tumor_result,node_alz_result,node_pneumonia_result,node_user toneBlue
class node_preprocess toneAmber
class node_covid_model,node_tumor_model,node_alz_model,node_pneumonia_model toneMint
```

## Components

### Web interface

- [Flask routes](https://github.com/mintesnot96/deepmedscan/blob/main/app.py): `app.py`
- [Upload handling](https://github.com/mintesnot96/deepmedscan/blob/main/app.py): `app.py`
- [Home page](https://github.com/mintesnot96/deepmedscan/blob/main/templates/homepage.html): `templates/homepage.html`
- [COVID page](https://github.com/mintesnot96/deepmedscan/blob/main/templates/covid.html): `templates/covid.html`
- [Tumor page](https://github.com/mintesnot96/deepmedscan/blob/main/templates/braintumor.html): `templates/braintumor.html`
- [Alzheimer page](https://github.com/mintesnot96/deepmedscan/blob/main/templates/alzheimer.html): `templates/alzheimer.html`
- [Pneumonia page](https://github.com/mintesnot96/deepmedscan/blob/main/templates/pneumonia.html): `templates/pneumonia.html`
- [COVID result](https://github.com/mintesnot96/deepmedscan/blob/main/templates/resultc.html): `templates/resultc.html`
- [Tumor result](https://github.com/mintesnot96/deepmedscan/blob/main/templates/resultbt.html): `templates/resultbt.html`
- [Alzheimer result](https://github.com/mintesnot96/deepmedscan/blob/main/templates/resulta.html): `templates/resulta.html`
- [Pneumonia result](https://github.com/mintesnot96/deepmedscan/blob/main/templates/resultp.html): `templates/resultp.html`

### Image inference

- [Image preprocessing](https://github.com/mintesnot96/deepmedscan/blob/main/app.py): `app.py`

### Model artifacts

- [COVID model](https://github.com/mintesnot96/deepmedscan/blob/main/models/modelcovid19.h5): `models/modelcovid19.h5`
- [Tumor model](https://github.com/mintesnot96/deepmedscan/blob/main/models/modelbraintumor.h5): `models/modelbraintumor.h5`
- [Alzheimer model](https://github.com/mintesnot96/deepmedscan/blob/main/models/modelalzheimer.h5): `models/modelalzheimer.h5`
- [Pneumonia model](https://github.com/mintesnot96/deepmedscan/blob/main/models/modelpneumonia.h5): `models/modelpneumonia.h5`

### Other components

- **User**

## Connections

- User → Flask routes: opens app (evidence: `README.md`)
- Flask routes → Home page: renders (evidence: `app.py`)
- Flask routes → COVID page: renders (evidence: `app.py`)
- Flask routes → Tumor page: renders (evidence: `app.py`)
- Flask routes → Alzheimer page: renders (evidence: `app.py`)
- Flask routes → Pneumonia page: renders (evidence: `app.py`)
- User → Upload handling: uploads image (evidence: `README.md`)
- Flask routes → Upload handling: validates and saves (evidence: `app.py`)
- Flask routes → Image preprocessing: preprocesses image (evidence: `app.py`)
- Flask routes → COVID model: loads and predicts (evidence: `app.py`)
- Flask routes → Tumor model: loads and predicts (evidence: `app.py`)
- Flask routes → Alzheimer model: loads and predicts (evidence: `app.py`)
- Flask routes → Pneumonia model: loads and predicts (evidence: `app.py`)
- Flask routes → COVID result: renders result (evidence: `app.py`)
- Flask routes → Tumor result: renders result (evidence: `app.py`)
- Flask routes → Alzheimer result: renders result (evidence: `app.py`)
- Flask routes → Pneumonia result: renders result (evidence: `app.py`)
