https://github.com/18mahi/digital_cave
An intermediate-level deep learning project that compares Convolutional Neural Networks (CNN) and Multi-Layer Perceptrons (MLP) on the MNIST handwritten digits dataset. This project demonstrates data augmentation, learning rate scheduling, and visual comparison of model performance
https://github.com/18mahi/digital_cave
cnn confusion-matrix data-augmentation data-science deep-learning evaluation-metrics jupyter-notebook keras learning-rate-scheduler machine-learning matplotlib mlp numpy python3 scikit-learn seaborn tensorflow
Last synced: 4 months ago
JSON representation
An intermediate-level deep learning project that compares Convolutional Neural Networks (CNN) and Multi-Layer Perceptrons (MLP) on the MNIST handwritten digits dataset. This project demonstrates data augmentation, learning rate scheduling, and visual comparison of model performance
- Host: GitHub
- URL: https://github.com/18mahi/digital_cave
- Owner: 18mahi
- License: mit
- Created: 2025-10-04T18:37:49.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-10-04T19:13:07.000Z (4 months ago)
- Last Synced: 2025-10-04T21:21:59.313Z (4 months ago)
- Topics: cnn, confusion-matrix, data-augmentation, data-science, deep-learning, evaluation-metrics, jupyter-notebook, keras, learning-rate-scheduler, machine-learning, matplotlib, mlp, numpy, python3, scikit-learn, seaborn, tensorflow
- Language: Jupyter Notebook
- Homepage:
- Size: 118 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ง Digit Cave โ Handwritten Digit Recognition (CNN vs MLP)
An intermediate-level deep learning project that compares Convolutional Neural Networks (CNN) and Multi-Layer Perceptrons (MLP) on the MNIST handwritten digits dataset.
This project demonstrates data augmentation, learning rate scheduling, and visual comparison of model performance โ ideal for students and developers building a solid foundation in image classification and model optimization.
# ๐ Project Overview
The Digit Cave aims to explore how architectural depth and feature extraction impact performance in handwritten digit recognition.
Two models were trained:
1. ๐งฉ MLP (Baseline) โ Fully connected layers with flattened 28ร28 inputs.
2. ๐ฏ CNN (Enhanced) โ Convolutional and pooling layers for spatial pattern extraction.
Dataset: MNIST Handwritten Digits
Images: 70,000 grayscale digits (28ร28 px)
# โ๏ธ Features Implemented
โ
Model comparison: CNN vs MLP
๐ Data augmentation (rotation, shift, zoom)
๐ Learning rate scheduler (ReduceLROnPlateau)
๐งฎ Accuracy, loss, and confusion matrix visualizations
๐ Evaluation metrics: precision, recall, F1-score
๐ผ๏ธ Sample prediction visualization
# ๐งฉ Model Architecture
## CNN
- 2 Conv2D layers (ReLU + MaxPooling)
- Dropout regularization
- Dense(128) โ Output(10, softmax)
## MLP
- Flatten input โ Dense(512) โ Dropout โ Output(10, softmax)
# ๐ Results and Comparison

# ๐ Performance Visualization
## Training vs Validation Accuracy

## Training vs Validation Loss

## Confusion Matrix (CNN)

# ๐ง Insights
- CNNs significantly outperform MLPs in spatial recognition tasks like MNIST.
- Data augmentation improves generalization and prevents overfitting.
- ReduceLROnPlateau dynamically lowers the learning rate, stabilizing convergence.
- Even small CNN architectures can achieve >99% accuracy on MNIST with tuning.
# ๐งฐ Tech Stack
- Language: Python 3.x
- Frameworks: TensorFlow / Keras
- Libraries: NumPy, Matplotlib, Seaborn, Scikit-learn
- Environment: Jupyter Notebook
# ๐ฆ How to Run
## Clone this repo:
git clone https://github.com/18mahi/digital_cave.git
-cd Digit-Cave
## Install dependencies:
pip install -r requirements.txt
### ๐งพ requirements.txt
Create a file named requirements.txt in your project folder with the following content:
- tensorflow==2.16.1
- numpy==1.26.4
- matplotlib==3.9.0
- seaborn==0.13.2
- scikit-learn==1.5.0
- pandas==2.2.2
- jupyter==1.1.0
## Run the notebook:
jupyter notebook Digit_Cave.ipynb
# ๐ Future Improvements
- Add deeper CNNs (LeNet, VGG-style)
- Experiment with dropout rates and batch normalization
- Deploy via Streamlit for interactive digit recognition
# ๐งโ๐ป Author
Mahi Jindal
๐ CSE (AI/ML) | Passionate about Deep Learning & Robotics
๐ LinkedIn-https://www.linkedin.com/in/mahi-jindal-867109245/
โข GitHub- https://github.com/18mahi
# ๐ License
This project is open-source under the MIT License.