This repository contains three tasks as part of the CENG403 course, designed to provide hands-on experience with Convolutional Neural Networks (CNNs) and transfer learning using PyTorch. The tasks include implementing naive convolution and pooling operations, building a CNN with PyTorch, and finetuning a pretrained ResNet18 for CIFAR10.
CENG403_THE3_Part1.ipynb
: Implementation of naive convolution and pooling operations.CENG403_THE3_Part2.ipynb
: Implementation of a CNN using PyTorch.CENG403_THE3_Part3.ipynb
: Finetuning a pretrained ResNet18 for CIFAR10.
Implement convolution and pooling operations manually to understand their inner workings, including both forward and backward passes.
- Import the Modules: Importing necessary Python libraries.
- Implementing Convolution Operation: Step-by-step implementation of the convolution operation.
- Implementing Pooling Operation: Step-by-step implementation of the pooling operation.
- Backpropagation: Implementing the backpropagation for both convolution and pooling layers.
Open and run CENG403_THE3_Part1.ipynb
directly in Jupyter Notebook or Google Colab. Follow the instructions and cells sequentially to understand and execute the code.
Implement and train a CNN using PyTorch, including defining the network architecture, training the model, and evaluating its performance.
- Import the Modules: Importing necessary Python libraries and PyTorch modules.
- Building the CNN: Defining the architecture of the CNN.
- Training the CNN: Training the CNN on a dataset.
- Evaluating the Model: Evaluating the performance of the trained model.
Open and run CENG403_THE3_Part2.ipynb
directly in Jupyter Notebook or Google Colab. Follow the instructions and cells sequentially to understand and execute the code.
Adapt and finetune a ResNet18 model, pretrained on ImageNet, for the CIFAR10 dataset. This includes loading the pretrained model, modifying it for CIFAR10, and training the modified model.
- Download and Test Pretrained ResNet18: Downloading and testing the pretrained ResNet18 model.
- Adapting ResNet18 for CIFAR10: Modifying the model architecture to suit the CIFAR10 dataset.
- Finetuning the Model: Training the adapted model on CIFAR10.
- Evaluating the Model: Evaluating the performance of the finetuned model.
Open and run CENG403_THE3_Part3.ipynb
directly in Jupyter Notebook or Google Colab. Follow the instructions and cells sequentially to understand and execute the code.