Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIFAR-100 Image Classification with CNNs

Exploring CNN architectures, noise robustness, and transfer learning for 100-class image recognition

Python PyTorch License Report

View the report ->


Highlights

Model Clean Accuracy Noisy Accuracy Accuracy Drop Parameters
CNN (scratch) 69.1% 1.2% 67.8% ~2.4M
CNN (noise-augmented) 64.9% 47.3% 17.6% ~2.4M
VGG-16 + MLP 63.3% 1.5% 61.8% 138M + 157K

Project Structure

├── CIFAR100_cnn_image_classification.ipynb       # Main experiment notebook
├── index.html       # Interactive HTML report
├── README.md       # Interactive HTML report
├── checkpoints/
│   ├── a1_cnn_best.pth        # Best CNN model (clean training)
│   ├── a3_cnn_noisy_best.pth  # Best noise-augmented CNN
│   └── a4_mlp_best.pth        # VGG-16 MLP classifier
├── images/                    # All training plots & visualizations
└── requirements.txt

Overview

This project investigates CNN-based approaches for classifying images from CIFAR-100 — a challenging benchmark with 100 fine-grained categories and only 500 training images per class. We address three key questions:

  1. How well can a moderate CNN perform when trained from scratch?
  2. How robust are learned features to input noise, and can we improve robustness?
  3. Does transfer learning from ImageNet provide better features?

Architecture

The CNN uses three convolutional blocks with progressive regularization:

Block 1: Conv(3→64) → BN → ReLU → Conv(64→64) → BN → ReLU → MaxPool → Dropout(0.2)
Block 2: Conv(64→128) → BN → ReLU → Conv(128→128) → BN → ReLU → MaxPool → Dropout(0.3)
Block 3: Conv(128→256) → BN → ReLU → Conv(256→256) → BN → ReLU → MaxPool → Dropout(0.4)
Classifier: AdaptiveAvgPool(1,1) → FC(256→512) → ReLU → Dropout(0.5) → FC(512→100)

Design choices:

  • Batch normalization after each convolution for stable training
  • Increasing dropout rates (0.2 → 0.5) for progressive regularization
  • Kaiming He initialization for proper gradient flow
  • ~2.4M parameters — moderate and efficient

Experiments

CNN Trained from Scratch

Metric Value
Training Accuracy 79.5%
Validation Accuracy 69.0%
Test Accuracy 69.1%

Training: Adam (lr=1e-3, weight_decay=5e-4), CosineAnnealingLR, 100 epochs, batch size 128.

Training Curves

Noise Robustness

We inject additive Gaussian noise (σ²=0.05) to evaluate model robustness:

Clean vs Noisy

The standard CNN drops from 69.1% → 1.2% under noise — a catastrophic 67.8% degradation. By training with 30% noisy samples, the noise-augmented model achieves:

  • 64.9% clean accuracy (only −4.2% trade-off)
  • 47.3% noisy accuracy (vs 1.2% without augmentation)
  • 17.6% accuracy drop (vs 67.8%)

Noise-Augmented Training

Transfer Learning (VGG-16)

Using frozen VGG-16 features with a lightweight MLP classifier (157K trainable params):

Condition Accuracy
Clean Test 63.3%
Noisy Test 1.5%

VGG-16 achieves competitive accuracy with minimal training, but is equally vulnerable to noise.

Full Comparison

Comparison

Comparison


Key Findings

  • Best clean accuracy: CNN from scratch (69.1%) — small and effective for CIFAR-100
  • Best robustness: Noise-augmented training reduces accuracy drop by (67.8% → 17.6%)
  • Transfer learning trade-off: VGG-16 provides strong results with minimal training, but no inherent noise robustness
  • Noise augmentation works: A simple 70/30 clean-to-noisy training ratio dramatically improves resilience

Quick Start

pip install -r requirements.txt
jupyter notebook CIFAR100_cnn_image_classification.ipynb

References

  • Krizhevsky, A. Learning Multiple Layers of Features from Tiny Images
  • Simonyan, K. & Zisserman, A. Very Deep Convolutional Networks for Large-Scale Image Recognition (ICLR 2015)

Author

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages