# yashwanth161102/braintumourclassification architecture

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

- Interactive diagram: https://gitdiagram.com/yashwanth161102/braintumourclassification
- Repository: https://github.com/yashwanth161102/braintumourclassification

## Overview

BrainTumorClassification is a Flask-based brain MRI classifier. A user uploads an image, the app crops and resizes it, runs the saved model, maps its scores to a tumor class, and renders a result; it also serves an information page. The repository includes a training notebook and image datasets, but their contents were not sampled, so links from those assets to training and the saved model are unverified. The README gives only the project name, so the runtime flow is based on app.py.

Main entry points: [`app.py`](https://github.com/yashwanth161102/braintumourclassification/blob/main/app.py) (Flask routes), [`Training.ipynb`](https://github.com/yashwanth161102/braintumourclassification/blob/main/Training.ipynb) (Model training), [`model.h5`](https://github.com/yashwanth161102/braintumourclassification/blob/main/model.h5) (Saved classifier), [`Datasets`](https://github.com/yashwanth161102/braintumourclassification/tree/main/Datasets) (MRI datasets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask routes<br/>[app.py]"]
end

subgraph group_inference["Image inference"]
  node_preprocess["Image preprocessing<br/>[app.py]"]
  node_model[("Saved classifier<br/>[model.h5]")]
  node_classmap["Class mapping<br/>[app.py]"]
end

subgraph group_training["Training assets"]
  node_dataset[("MRI datasets")]
  node_notebook["Model training<br/>[Training.ipynb]"]
end

subgraph group_views["Web views"]
  node_uploadview["Upload page<br/>[index.html]"]
  node_resultview["Result page<br/>[result.html]"]
  node_infoview["Information page<br/>[info.html]"]
end

node_user(("Image uploader"))

node_user -->|"uploads image"| node_app
node_app -->|"prepares image"| node_preprocess
node_app -->|"predicts with"| node_model
node_app -->|"maps scores"| node_classmap
node_app -->|"renders"| node_uploadview
node_app -->|"renders result"| node_resultview
node_app -->|"renders info"| node_infoview
node_dataset -.->|"may train"| node_notebook
node_notebook -.->|"may produce"| node_model

click node_app "https://github.com/yashwanth161102/braintumourclassification/blob/main/app.py"
click node_preprocess "https://github.com/yashwanth161102/braintumourclassification/blob/main/app.py"
click node_model "https://github.com/yashwanth161102/braintumourclassification/blob/main/model.h5"
click node_classmap "https://github.com/yashwanth161102/braintumourclassification/blob/main/app.py"
click node_dataset "https://github.com/yashwanth161102/braintumourclassification/tree/main/Datasets"
click node_notebook "https://github.com/yashwanth161102/braintumourclassification/blob/main/Training.ipynb"
click node_uploadview "https://github.com/yashwanth161102/braintumourclassification/blob/main/templates/index.html"
click node_resultview "https://github.com/yashwanth161102/braintumourclassification/blob/main/templates/result.html"
click node_infoview "https://github.com/yashwanth161102/braintumourclassification/blob/main/templates/info.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 toneBlue
class node_preprocess,node_model,node_classmap toneAmber
class node_dataset,node_notebook toneMint
class node_uploadview,node_resultview,node_infoview toneRose
class node_user toneIndigo
```

## Components

### Web application

- [Flask routes](https://github.com/yashwanth161102/braintumourclassification/blob/main/app.py): `app.py`

### Image inference

- [Image preprocessing](https://github.com/yashwanth161102/braintumourclassification/blob/main/app.py): `app.py`
- [Saved classifier](https://github.com/yashwanth161102/braintumourclassification/blob/main/model.h5): `model.h5`
- [Class mapping](https://github.com/yashwanth161102/braintumourclassification/blob/main/app.py): `app.py`

### Training assets

- [MRI datasets](https://github.com/yashwanth161102/braintumourclassification/tree/main/Datasets): `Datasets`
- [Model training](https://github.com/yashwanth161102/braintumourclassification/blob/main/Training.ipynb): `Training.ipynb`

### Web views

- [Upload page](https://github.com/yashwanth161102/braintumourclassification/blob/main/templates/index.html): `templates/index.html`
- [Result page](https://github.com/yashwanth161102/braintumourclassification/blob/main/templates/result.html): `templates/result.html`
- [Information page](https://github.com/yashwanth161102/braintumourclassification/blob/main/templates/info.html): `templates/info.html`

### Other components

- **Image uploader**

## Connections

- Image uploader → Flask routes: uploads image (evidence: `app.py`)
- Flask routes → Image preprocessing: prepares image (evidence: `app.py`)
- Flask routes → Saved classifier: predicts with (evidence: `app.py`)
- Flask routes → Class mapping: maps scores (evidence: `app.py`)
- Flask routes → Upload page: renders (evidence: `app.py`)
- Flask routes → Result page: renders result (evidence: `app.py`)
- Flask routes → Information page: renders info (evidence: `app.py`)
- MRI datasets → Model training: may train
- Model training → Saved classifier: may produce
