- convolution layer - 1
- Layer1 -
X = Conv 3x3 (s1, p1) >> MaxPool2D >> BN >> RELU
R1 = ResBlock( (Conv-BN-ReLU-Conv-BN-ReLU))(X) - Add(X, R1)
- Layer 2 -
Conv 3x3
MaxPooling2D
BN
ReLU - Layer 3 -
X = Conv 3x3 (s1, p1) >> MaxPool2D >> BN >> RELU
R2 = ResBlock( (Conv-BN-ReLU-Conv-BN-ReLU))(X)
Add(X, R2)
MaxPooling with Kernel Size 4 - Layer 4 -
X = Conv 3x3 (s1, p1) >> MaxPool2D >> BN >> RELU
R2 = ResBlock( (Conv-BN-ReLU-Conv-BN-ReLU))(X)
Add(X, R2)
MaxPooling with Kernel Size 4 - FC Layer
- SoftMax
Uses One Cycle Policy such that:
Uses this transform -RandomCrop 32, 32 (after padding of 4) >> FlipLR >> Followed by CutOut(16, 16)
Batch size = 512
Use SGD, and CrossEntropyLoss
Clone the project as shown below:-
$ git clone [email protected]:pankaja0285/era_v1_session11_pankaja.git
$ cd era_v1_session11_pankaja
About the file structure
|__config
__config.yaml
|__data
|__data_analysis
|__data_loader
__load_data.py
__albumentation.py
|__models
__resnet.py
|__utils
__engine.py
__gradcam_viz.py
__helper.py
__plot_metrics.py
__test.py
__train.py
|__CiFAR_S10.ipynb
|__README.md
NOTE: List of libraries required: torch and torchsummary, tqdm for progress bar, which are installed using requirements.txt
One of 2 ways to run any of the notebooks, for instance Submission_CiFAR_S11_GradCam.ipynb notebook:
- Using Anaconda prompt - Run as an administrator start jupyter notebook from the folder era_v1_session11_pankaja and run it off of your localhost
NOTE: Without Admin privileges, the installs will not be correct and further import libraries will fail.
jupyter notebook
- Upload the notebook folder era_v1_session11_pankaja to google colab at colab.google.com and run it on colab
File used: models/resnet.py **
Target: - Resnet18 model with grad-CAM applied and with RandomCrop
Results:
- Total parameters: 11,173,962
- Train accuracy of 91.05 and test accuracy of 89.17
Analysis:
- To see how the grad-cam - heat map of the presence of the object
File used: models/resnet.py **
Target: - Resnet18 model with grad-CAM applied and with RandomCrop and cutout applied via Albumentations
Results:
- Total parameters: 11,173,962
- Train accuracy of 84.52 and test accuracy of 88.66
Analysis:
- To see how the grad-cam visualizes in the 4th layer - basically a heat map for the presence of the object
For any questions, bug(even typos) and/or features requests do not hesitate to contact me or open an issue!