An open API service indexing awesome lists of open source software.

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

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
image

# ๐Ÿ“‰ Performance Visualization
## Training vs Validation Accuracy

image

## Training vs Validation Loss

image

## Confusion Matrix (CNN)

image

# ๐Ÿง  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.