Skip to content

Repository files navigation

CNN Architecture Evolution — LeNet to ResNet-50

Python PyTorch Jupyter FashionMNIST

Three-part deep learning project tracing CNN evolution from LeNet-5 to ResNet-50 — all architectures built from scratch in PyTorch, with a batch normalization ablation study and full training benchmarks on FashionMNIST.

Live Project Report

Full results, training curves, and architecture breakdown: https://sadhanageddam27.github.io/cnn-architecture-evolution/


Project Structure

cnn-architecture-evolution/
├── Part1/
│   ├── Part1.ipynb
│   ├── LeNet.ipynb
│   ├── LeNet_MNIST.ipynb
│   └── Visualization.ipynb
├── Part2/
│   └── Batch_Norm.ipynb
└── Part3/
    ├── ResNet_part1.ipynb
    └── ResNet_part2.ipynb

What This Project Covers

Part 1 — LeNet-5 and Modernized LeNet

Component Original LeNet Modernized LeNet
Activation Sigmoid ReLU
Pooling Average Max
Convergence Slow Faster

Trained across 5, 10, and 20 epoch configurations on MNIST and FashionMNIST.

Part 2 — Batch Normalization from Scratch

Implemented batch normalization manually with learnable gamma and beta parameters. Three variants compared: full BN, mean-only, and variance-only. Ablation study tested selective BN placement across layers.

Part 3 — ResNet-18, ResNet-34, ResNet-50

BasicResidual block for ResNet-18/34: two 3x3 convolutions with skip connection. Bottleneck block for ResNet-50: 1x1 → 3x3 → 1x1 with skip connection, mid_channels = out_channels divided by 4.


Results

Model Best Accuracy Final Train Loss Training Time
ResNet-18 90.37% 0.2081 62.4s
ResNet-34 89.70% 0.2327 88.8s
ResNet-50 88.27% 0.2756 53.4s

ResNet-18 achieved the highest accuracy despite fewer parameters. All three models converge without overfitting, confirming the effectiveness of residual connections.


Setup and Usage

git clone https://github.com/sadhanageddam27/cnn-architecture-evolution.git
cd cnn-architecture-evolution
pip install torch torchvision matplotlib jupyter d2l
jupyter notebook

Tech Stack

Python · PyTorch · torchvision · d2l · Jupyter · Matplotlib

Topics

deep-learning pytorch cnn resnet lenet batch-normalization computer-vision fashionmnist python

About

LeNet-5 to ResNet-50 implemented from scratch in PyTorch — batch normalization ablation study, residual block comparison, trained on FashionMNIST with 90.37% accuracy

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages