Fashion-MNIST Image Classification
This project focuses on the classification of the Fashion-MNIST dataset using deep learning. Fashion-MNIST is a popular benchmark dataset consisting of 28 \times 28 grayscale images of 10 different clothing categories (such as shirts, trousers, dresses, and sneakers). It serves as a more challenging drop-in replacement for the classic digits MNIST dataset.
The primary objective of this project is to build, train, and evaluate Convolutional Neural Network (CNN) architectures in PyTorch. Specifically, it compares a standard CNN against a Batch-Normalized CNN to observe how batch normalization influences training speed, loss reduction, and overall validation accuracy.
Key Components & Methodology
Data Preprocessing: Images are resized down to 16 \times 16 pixels using PyTorch's transforms.Resize and converted to tensors using transforms.ToTensor to reduce computational overhead while preserving essential spatial features.
Network Architectures:
Standard CNN: A sequential model featuring two convolutional layers, ReLU activation functions, max-pooling layers, and a final fully connected linear layer.
Batch-Normalized CNN: An optimized version of the network that inserts batch normalization layers (BatchNorm2d and BatchNorm1d) after the convolutional and fully connected layers to stabilize and accelerate training.
Training & Optimization: Both models are trained using Stochastic Gradient Descent (SGD) and Cross-Entropy Loss over 5 epochs.
Evaluation & Visualization: The model tracks cost and accuracy on the validation dataset after each epoch. These metrics are plotted on a dual-axis line chart using Matplotlib to visually analyze convergence and model performance.
Languages & Frameworks Used
Programming Language: Python
Deep Learning Framework: PyTorch (torch, torchvision)
Scientific Computing & Data Manipulation: NumPy, Pandas, Pillow (PIL)
Data Visualization: Matplotlib