This project explores deep learning architectures for image classification on the CIFAR-10 dataset using PyTorch. The goal is to classify images into one of 10 classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, and truck.
This repository contains a single Python script that handles:
- Data Loading – Automatically downloads the CIFAR-10 dataset and prepares training, validation, and test splits.
- Model Definitions – Includes linear, non-linear (fully connected with ReLU), and convolutional neural network (CNN) models.
- Training and Evaluation – Trains models using SGD, evaluates on validation and test sets, and calculates accuracy.
- Hyperparameter Search – Implements random and grid search to find top-performing model configurations.
- Plotting – Generates plots of training and validation accuracy for the top hyperparameter configurations.
- PyTorch deep learning framework
- Convolutional Neural Networks (CNNs)
- Fully connected neural networks with ReLU activation
- Data preprocessing and batching with DataLoader
- Hyperparameter tuning (random search, grid search)
- Model evaluation, plotting, and visualization
Validation and training accuracy over number of filters, filter size and pooling size
Fully-connected output, 1 fully-connected hidden layer
Modify the train and parameter_search functions to experiment with different architectures, optimizers, or hyperparameter ranges.
- Python 3.8+
- PyTorch 2.x
- torchvision
- matplotlib
- numpy
- tqdm
Install the dependencies with:
pip install torch torchvision matplotlib numpy tqdm
## Project Structure
cifar10_classification/
│
├─ cifar10_classification.py # Main script (data, models, training, hyperparameter search, plotting)
├─ README.md # Project overview-- you're here :)
├─- `figures/` # plots of MSE results
└─ data/ # CIFAR-10 dataset will be downloaded here automatically
