# prakritibhandari07/mnist_digit_classification architecture

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

- Interactive diagram: https://gitdiagram.com/prakritibhandari07/mnist_digit_classification
- Repository: https://github.com/prakritibhandari07/mnist_digit_classification

## Overview

This is a Streamlit application for classifying uploaded handwritten digits with a saved TensorFlow/Keras CNN. The main workflow accepts an image, preprocesses it to MNIST-like input, runs prediction, and presents the digit, confidence, and probabilities. The README also documents MNIST training and evaluation, including confusion matrices and training curves, in the notebook. The app source was inspected; notebook internals were not, so its documented capabilities are included without inferred implementation links.

Main entry points: [`app.py`](https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/app.py) (Streamlit interface), [`mnist_cnn.keras`](https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/mnist_cnn.keras) (Saved CNN)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Digit classification"]
  node_interface["Streamlit interface<br/>[app.py]"]
  node_preprocessing["Image preprocessing<br/>[app.py]"]
  node_results["Prediction display<br/>[app.py]"]
end

subgraph group_model["CNN model"]
  node_inference["Digit inference<br/>[app.py]"]
  node_saved_model["Saved CNN<br/>[mnist_cnn.keras]"]
end

subgraph group_training["Training and evaluation"]
  node_training_evaluation["Training and evaluation"]
end

node_user(("Image uploader"))

node_user -->|"uploads image"| node_interface
node_interface -->|"preprocesses image"| node_preprocessing
node_interface -->|"loads model"| node_saved_model
node_interface -->|"requests prediction"| node_inference
node_inference -->|"predicts with"| node_saved_model
node_interface -->|"displays results"| node_results

click node_interface "https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/app.py"
click node_preprocessing "https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/app.py"
click node_inference "https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/app.py"
click node_saved_model "https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/mnist_cnn.keras"
click node_results "https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/app.py"
click node_training_evaluation "https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/MNIST_digit_classification.ipynb"

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_interface,node_preprocessing,node_results toneBlue
class node_inference,node_saved_model toneAmber
class node_training_evaluation toneMint
class node_user toneIndigo
```

## Components

### Digit classification

- [Streamlit interface](https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/app.py): `app.py`
- [Image preprocessing](https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/app.py): `app.py`
- [Prediction display](https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/app.py): `app.py`

### CNN model

- [Digit inference](https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/app.py): `app.py`
- [Saved CNN](https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/mnist_cnn.keras): `mnist_cnn.keras`

### Training and evaluation

- [Training and evaluation](https://github.com/prakritibhandari07/mnist_digit_classification/blob/main/MNIST_digit_classification.ipynb): `MNIST_digit_classification.ipynb`

### Other components

- **Image uploader**

## Connections

- Image uploader → Streamlit interface: uploads image (evidence: `app.py`)
- Streamlit interface → Image preprocessing: preprocesses image (evidence: `app.py`)
- Streamlit interface → Saved CNN: loads model (evidence: `app.py`)
- Streamlit interface → Digit inference: requests prediction (evidence: `app.py`)
- Digit inference → Saved CNN: predicts with (evidence: `app.py`)
- Streamlit interface → Prediction display: displays results (evidence: `app.py`)
