Skip to content

Class activation maps, Weight Updates, Optimizers & LR Schedulers

Notifications You must be signed in to change notification settings

gokul-pv/AdvancedTrainingConcepts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Advanced Training Concepts

Class activation maps, Weight Updates, Optimizers & LR Schedulers

The model is trained using CIFAR-10 dataset. It consists of 60000 32x32 color (3-channel) images in 10 classes, with 6000 images per class. There are 50000 training images and 10000 test images. It has the classes: ‘airplane’, ‘automobile’, ‘bird’, ‘cat’, ‘deer’, ‘dog’, ‘frog’, ‘horse’, ‘ship’, ‘truck’.

Forwarding
Figure 1 : Random images from dataset

Target

  • Apply Transformation using Albumentation Library ( RandomCrop(32, padding=4) and CutOut(16x16))
  • Implement GradCam.
  • Train ResNet18 on Cifar10 for 20 Epochs

Code Explanation

All the python scripts are cloned from repository MyMainRepo. The repo has the following structure

  1. models/restnet.py (contains the Resnet18 model)
  2. main.py (contains training and testing function)
  3. utils.py (contains image augmentation, gradcam functions ...)

Albumentation

The transformation is applied using library albumentations.

Forwarding
Figure 2 : transformation applied different times on same image

The summary of the model is shown below

Forwarding
Figure 3 : Model summary

Result

The training log for 20 eposchs is shown below

Forwarding
Figure 4.1 : log1 (epoch 1 to 8)

Forwarding
Figure 4.2 : log2 (epoch 8 to 14)

Forwarding
Figure 4.3 : log3 (epoch 14 to 20)

The test and validation loss and accuracy are shown below

Forwarding
Figure 5 : Plot for loss and accuracy

Forwarding
Figure 6 : Accuracy per class

Misclassified Images during validation

Misclassified images during validation for all the three models are shown below

Forwarding
Figure 7 : Misclassified images

GradCam output on misclassified images Gradient-weighted Class Activation Mapping (GradCAM) uses the gradients of any target concept (say logits for 'dog' or even a caption), flowing into the final convolution layer to produce a coarse localization map highlighting the important regions in the image for predicting the concept

Forwarding
Figure 8.1 : Gradcam on misclassified images 1

Forwarding
Figure 8.2 : Gradcam on misclassified images 2

About

Class activation maps, Weight Updates, Optimizers & LR Schedulers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages