# utkarsh0141/malaria-detection-using-machine-learning- architecture

> Architecture diagram of the GitHub repository utkarsh0141/malaria-detection-using-machine-learning-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/utkarsh0141/malaria-detection-using-machine-learning-
- Repository: https://github.com/utkarsh0141/malaria-detection-using-machine-learning-

## Overview

This is a Flask-based malaria cell-image classifier, with scripts for preparing data, training candidate models, inspecting the dataset, and evaluating a selected model. The main user flow is image upload, preprocessing, model inference, label/confidence calculation, and HTML response. The dataset itself is not present in the tree, and the training script’s saved model names do not establish how best_malaria_model.h5 was selected; those links are left unspecified.

Main entry points: [`app.py`](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/app.py) (Flask app), [`train_model.py`](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/train_model.py) (Model training), [`split_dataset.py`](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/split_dataset.py) (Dataset splitting), [`evaluation.py`](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/evaluation.py) (Model evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Web inference"]
  node_app["Flask app<br/>[app.py]"]
  node_image["Image preprocessing<br/>[app.py]"]
  node_classifier["Malaria classifier"]
  node_page["Result page<br/>[index.html]"]
end

subgraph group_development["Data and training"]
  node_split["Dataset splitting<br/>[split_dataset.py]"]
  node_visualization["Dataset inspection<br/>[visualization.py]"]
  node_training["Model training<br/>[train_model.py]"]
  node_mobilenet["MobileNetV2 model"]
  node_efficientnet["EfficientNetB0 model"]
end

subgraph group_evaluation["Model evaluation"]
  node_evaluation["Model evaluation<br/>[evaluation.py]"]
  node_plots["Evaluation plots"]
end

node_user(("Image user"))
node_source_data[("Cell image dataset")]
node_train_data[("Training data")]
node_validation_data[("Validation data")]

node_user -->|"uploads image"| node_app
node_app -->|"renders page"| node_page
node_app -->|"prepares image"| node_image
node_image -->|"provides tensor"| node_classifier
node_app -->|"requests prediction"| node_classifier
node_app -->|"renders result"| node_page
node_source_data -->|"reads images"| node_split
node_split -->|"copies training set"| node_train_data
node_split -->|"copies validation set"| node_validation_data
node_source_data -->|"reads samples"| node_visualization
node_train_data -->|"loads images"| node_training
node_validation_data -->|"validates models"| node_training
node_training -->|"saves model"| node_mobilenet
node_training -->|"saves model"| node_efficientnet
node_validation_data -->|"loads images"| node_evaluation
node_evaluation -->|"loads and predicts"| node_classifier
node_evaluation -->|"displays metrics"| node_plots

click node_app "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/app.py"
click node_image "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/app.py"
click node_classifier "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/best_malaria_model.h5"
click node_page "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/templates/index.html"
click node_split "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/split_dataset.py"
click node_visualization "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/visualization.py"
click node_training "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/train_model.py"
click node_mobilenet "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/MobileNetV2_model.h5"
click node_efficientnet "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/EfficientNetB0_model.h5"
click node_evaluation "https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/evaluation.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_app,node_image,node_classifier,node_page,node_user toneBlue
class node_split,node_visualization,node_training,node_mobilenet,node_efficientnet,node_source_data,node_train_data,node_validation_data toneAmber
class node_evaluation,node_plots toneMint
```

## Components

### Web inference

- [Flask app](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/app.py): `app.py`
- [Image preprocessing](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/app.py): `app.py`
- [Malaria classifier](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/best_malaria_model.h5): `best_malaria_model.h5`
- [Result page](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/templates/index.html): `templates/index.html`

### Data and training

- [Dataset splitting](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/split_dataset.py): `split_dataset.py`
- [Dataset inspection](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/visualization.py): `visualization.py`
- [Model training](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/train_model.py): `train_model.py`
- [MobileNetV2 model](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/MobileNetV2_model.h5): `MobileNetV2_model.h5`
- [EfficientNetB0 model](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/EfficientNetB0_model.h5): `EfficientNetB0_model.h5`

### Model evaluation

- [Model evaluation](https://github.com/utkarsh0141/malaria-detection-using-machine-learning-/blob/main/evaluation.py): `evaluation.py`
- **Evaluation plots**

### Other components

- **Image user**
- **Cell image dataset**
- **Training data**
- **Validation data**

## Connections

- Image user → Flask app: uploads image
- Flask app → Result page: renders page
- Flask app → Image preprocessing: prepares image
- Image preprocessing → Malaria classifier: provides tensor
- Flask app → Malaria classifier: requests prediction
- Flask app → Result page: renders result
- Cell image dataset → Dataset splitting: reads images
- Dataset splitting → Training data: copies training set
- Dataset splitting → Validation data: copies validation set
- Cell image dataset → Dataset inspection: reads samples
- Training data → Model training: loads images
- Validation data → Model training: validates models
- Model training → MobileNetV2 model: saves model
- Model training → EfficientNetB0 model: saves model
- Validation data → Model evaluation: loads images
- Model evaluation → Malaria classifier: loads and predicts
- Model evaluation → Evaluation plots: displays metrics
