# bavan1223/convnext_oral_cancer_detection architecture

> Architecture diagram of the GitHub repository bavan1223/convnext_oral_cancer_detection, 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/bavan1223/convnext_oral_cancer_detection
- Repository: https://github.com/bavan1223/convnext_oral_cancer_detection

## Overview

This Flask application accepts oral-lesion images, screens and classifies them, then presents a clinical-style result. The README also documents Grad-CAM heatmaps, but the sampled source does not show their implementation or wiring; that documented capability is shown separately. The model weights and upload directory are not present in the tree, so no separate repository paths are assigned to them.

Main entry points: [`app.py`](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py) (Flask routes), [`templates/index.html`](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/index.html) (Upload page), [`static/js/script.js`](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/static/js/script.js) (File check), [`templates/result.html`](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/result.html) (Result page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_upload_page["Upload page<br/>[index.html]"]
  node_form_check["File check<br/>[script.js]"]
  node_web_app["Flask routes<br/>[app.py]"]
  node_about_page["About page<br/>[about.html]"]
  node_contact_page["Contact page<br/>[contact.html]"]
end

subgraph group_analysis["Image analysis"]
  node_upload_store[("Uploaded images<br/>[app.py]")]
  node_oral_filter["Oral image filter<br/>[app.py]"]
  node_preprocess["Image preprocessing<br/>[app.py]"]
  node_classifier["ConvNeXt classifier<br/>[app.py]"]
end

subgraph group_results["Diagnosis and review"]
  node_clinical_logic["Clinical classification<br/>[app.py]"]
  node_result_page["Result page<br/>[result.html]"]
  node_gradcam["Grad-CAM heatmaps"]
end

node_user(("Image submitter"))
node_clinician(("Clinician reviewer"))

node_user -->|"opens"| node_upload_page
node_upload_page -->|"checks file"| node_form_check
node_user -->|"submits image"| node_web_app
node_web_app -->|"saves image"| node_upload_store
node_web_app -->|"checks image"| node_oral_filter
node_oral_filter -->|"returns validity"| node_web_app
node_web_app -->|"transforms image"| node_preprocess
node_web_app -->|"runs inference"| node_classifier
node_web_app -->|"assigns diagnosis"| node_clinical_logic
node_web_app -->|"renders result"| node_result_page
node_classifier -.->|"generates heatmap"| node_gradcam
node_gradcam -.->|"supports review"| node_clinician

click node_upload_page "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/index.html"
click node_form_check "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/static/js/script.js"
click node_web_app "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py"
click node_about_page "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/about.html"
click node_contact_page "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/contact.html"
click node_upload_store "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py"
click node_oral_filter "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py"
click node_preprocess "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py"
click node_classifier "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py"
click node_clinical_logic "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py"
click node_result_page "https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/result.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_upload_page,node_form_check,node_web_app,node_about_page,node_contact_page,node_clinician toneBlue
class node_upload_store,node_oral_filter,node_preprocess,node_classifier toneAmber
class node_clinical_logic,node_result_page,node_gradcam toneMint
class node_user toneIndigo
```

## Components

### Web interface

- [Upload page](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/index.html): `templates/index.html`
- [File check](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/static/js/script.js): `static/js/script.js`
- [Flask routes](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py): `app.py`
- [About page](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/about.html): `templates/about.html`
- [Contact page](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/contact.html): `templates/contact.html`

### Image analysis

- [Uploaded images](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py): `app.py`
- [Oral image filter](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py): `app.py`
- [Image preprocessing](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py): `app.py`
- [ConvNeXt classifier](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py): `app.py`

### Diagnosis and review

- [Clinical classification](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/app.py): `app.py`
- [Result page](https://github.com/bavan1223/convnext_oral_cancer_detection/blob/main/templates/result.html): `templates/result.html`
- **Grad-CAM heatmaps**

### Other components

- **Image submitter**
- **Clinician reviewer**

## Connections

- Image submitter → Upload page: opens
- Upload page → File check: checks file
- Image submitter → Flask routes: submits image
- Flask routes → Uploaded images: saves image
- Flask routes → Oral image filter: checks image
- Oral image filter → Flask routes: returns validity
- Flask routes → Image preprocessing: transforms image
- Flask routes → ConvNeXt classifier: runs inference
- Flask routes → Clinical classification: assigns diagnosis
- Flask routes → Result page: renders result
- ConvNeXt classifier → Grad-CAM heatmaps: generates heatmap
- Grad-CAM heatmaps → Clinician reviewer: supports review
