This repository contains a Jupyter notebook implementing the shallow CNN architecture described in “Shallow Convolutional Neural Network for Image Classification”. I demonstrate its performance on MNIST, Fashion‑MNIST, and CIFAR‑10 datasets.
-
Clone this repo
git clone https://github.com/AryaKoureshi/shallow-cnn-image-classification.git cd shallow-cnn-image-classification
-
Create a virtual environment
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
The notebook (Shallow_CNN_for_Image_Classification.ipynb
) contains:
-
Data Loading & Preprocessing
- MNIST, Fashion‑MNIST, CIFAR‑10
- Normalization, one‑hot encoding, optional resizing
-
Model Definition
- Shallow CNN: 2×Conv2D → MaxPooling → Flatten → Dense
- BatchNormalization & Dropout for regularization
- SGD optimizer
-
Training & Evaluation
- Trained for 10–20 epochs
- Plots of training vs. validation accuracy & loss
- Final test accuracy on each dataset
-
Results Summary
- MNIST: ~98% test accuracy
- Fashion‑MNIST: ~91% test accuracy
- CIFAR‑10: ~60% test accuracy
(See the notebook’s final cells for precise numbers and graphs.)
The notebook produces:
- Accuracy curves for training vs. validation
- Loss curves for training vs. validation
- Bar chart comparing final test accuracies across datasets
-
Launch Jupyter:
jupyter lab
-
Open
Shallow_CNN_for_Image_Classification.ipynb
. -
Run all cells sequentially.
All figures and final metrics will appear in‑notebook.