A complete Deep Learning project for handwritten digit recognition using the MNIST dataset. The project covers the entire workflow, from dataset exploration to model optimization with Keras Tuner, concluding with an interactive visualization of the trained neural network.
The animation illustrates the complete inference pipeline:
- Real class highlighted in green
- Predicted class highlighted in cyan
- Hidden layers represented in red
- Prediction confidence
- Loss and Accuracy curves
- Classification probabilities
The objective of this project is to demonstrate the complete development cycle of a Convolutional Neural Network (CNN) for handwritten digit recognition.
The project includes:
- Dataset exploration
- CNN implementation using TensorFlow/Keras
- Performance evaluation
- Data Augmentation
- Hyperparameter optimization using Keras Tuner
- External image classification
- Interactive neural network visualization
.
├── app.py
├── data/
├── images/
├── models/
├── notebooks/
├── requirements.txt
├── src/
└── tuner/
| Notebook | Description |
|---|---|
| 01_about_the_base.ipynb | MNIST dataset exploration |
| 02_mnist_first_model.ipynb | First CNN model |
| 03_mnist_data_augmentation.ipynb | CNN with Data Augmentation |
| 04_mnist_keras_tuner.ipynb | Hyperparameter optimization using Keras Tuner |
The final model consists of:
- Input Layer (28×28×1)
- Rescaling
- Random Rotation
- Random Translation
- Random Zoom
- Conv2D
- MaxPooling2D
- Dropout
- Conv2D
- MaxPooling2D
- Dropout
- Flatten
- Dense (Softmax)
- Python
- TensorFlow
- Keras
- Keras Tuner
- NumPy
- Pandas
- Matplotlib
- Streamlit
The training and validation loss decrease consistently throughout the optimization process, indicating stable convergence.
The model reaches an accuracy close to 99%, demonstrating excellent generalization capability on unseen samples.
The trained model successfully classifies handwritten digits with very high confidence.
The model is also capable of correctly classifying external handwritten digits after proper preprocessing.
Clone the repository
git clone https://github.com/your_username/mnist-deep-learning-project.gitCreate a virtual environment (optional)
python -m venv .venvInstall the dependencies
pip install -r requirements.txtstreamlit run app.pyThe application displays:
- Training curves
- Input image
- Neural network representation
- Prediction confidence
- Classification probabilities
| Metric | Value |
|---|---|
| Test Accuracy | 98.8% |
| Test Loss | 0.040 |
- Deep Learning
- Convolutional Neural Networks (CNN)
- Data Augmentation
- Hyperparameter Optimization
- TensorFlow/Keras
- Keras Tuner
- Model Evaluation
- Computer Vision
- Streamlit Dashboard
- Neural Network Visualization
Dr. Flavio R. Rusch
Data Scientist | Machine Learning | Deep Learning | Statistical Physics | Computational Modeling
GitHub: https://github.com/ruschh
LinkedIn: (add your profile here)
⭐ If you found this project useful, consider giving it a star.x




