This assignment focuses on developing skills to work with convolutional neural networks (CNNs) through three progressive tasks:
- Implementing the forward pass of a convolutional filter manually
- Developing a custom CNN for image classification
- Fine-tuning an existing CNN architecture for a similar task
Implement the forward pass of a convolutional layer to understand the underlying mechanics.
- Complete the implementation in the provided
conv.pyfile - Implement forward pass for two classes:
MyConvStub: A general convolution operation with parameters for:- Kernel size
- Input/output channels
- Bias term usage
- Stride
- Dilation
- Grouping
MyFilterStub: A channelwise blur filter application
- Pass all convolution unit tests in
test_conv.py - Correctly apply blur filters to input volumes
Design, implement, train and evaluate a simple CNN for image classification using the Imagenette dataset.
- Imagenette: 160×160 px version
- 10 easily classified classes from ImageNet (tench, English springer, cassette player, chain saw, church, French horn, garbage truck, gas pump, golf ball, parachute)
- Design a neural network with at most 5 layers deep (excluding pooling, normalization, and activation functions)
- Justify your choice of activation functions and pooling layers
- Follow PyTorch's "Build Model" and "Classifying CIFAR10" tutorials
Train your model with multiple configurations:
- With and without batch normalization after convolution layers
- With and without dropout regularization in final linear layers
- With and without data augmentation methods
- With all three techniques combined (batch norm, dropout, augmentation)
- Training/Test Loss curves and Accuracy curves for each experiment
- Comparative plots showing each technique's impact
- Confusion matrix for the 10 classes
- Achieve at least 60% accuracy on test data
- Train for a minimum of 20 epochs
Fine-tune a pre-trained convolutional neural network for the same image classification task.
- Use ResNet-18 (pre-trained on ImageNet) as the backbone
- Follow PyTorch's transfer learning tutorial to use ResNet-18 as a feature extractor
- Experiment with unfreezing BatchNormalization layers to adapt statistics to the new dataset
- Training/Test Loss curves
- Accuracy curves
- Confusion matrix
- Comparative analysis with your custom model from Task 2
- Analysis of BatchNorm layer unfreezing impact on performance
Submit the following:
- Completed implementation files
- Notebook or script files for model training and evaluation
- Report containing:
- Model architecture descriptions and justifications
- All required plots and visualizations
- Analysis of results
- Comparative discussions between experiments
- Conclusions about employed techniques
- PyTorch documentation
- "Build Model" and "Classifying CIFAR10" tutorials from PyTorch
- Transfer learning tutorial from PyTorch