Skip to content

Applied Self Supervised Learning techniques such as Jigsaw as pretext task, SRGAN and SimCLR for fine-grained classification

Notifications You must be signed in to change notification settings

rush2406/Self-Supervised-Learning-for-Fine-grained-Image-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self Supervised Learning for Fine grained Image Classification

As part of our project we have worked on using self supervised learning for fine grained classification of cassava leaves diseases. We've explored 3 different methods for applying self supervised learning -

The features learnt during the pretext task are fine tuned for downstream classification. The code (implemented in Pytorch) is separated into these 3 folders.

Our Baseline is a supervised fine grained classification model Fine-Grained Visual Classification via Progressive Multi-Granularity Training of Jigsaw Patches.

Do give a read at the paper for more details and analysis!

Dataset

We have used the cassava leaves fine grained diseases dataset from Kaggle. The dataset has ~12K unlabelled images (extraimages.zip) and ~6K labelled images (train.zip). The dataset can be downloaded from here and here. It has 5 disease classes as shown in the following order - cbb,cbsd,cgm,cmd,healthy

cbb   cbsd   cgm   cmd   healthy

For the pretext task training, we've used the extra images (unlabelled). For the downstream task training, we've used the train images (labelled).

General dependencies

python >= 3.6
torch
PIL
torchvision : conda install -c pytorch torchvision 
Opencv : pip install python-opencv
numpy : pip install numpy
scikit-learn : pip install -U numpy scipy scikit-learn
scipy : pip install scipy

To run

We've included the code in the form of Jupyter notebooks to make it easy to visualize and run each cell. Further instructions have been provided in the README files of each folder.

Credits

We are thankful to the authors of these projects for open sourcing their code

SRGAN
Grad-CAM
SimCLR
Jigsaw pretext
PMG

Citation

If you find this project useful, consider starring the repo and citing us in your work:

@misc{breiki2021selfsupervised,
      title={Self-Supervised Learning for Fine-Grained Image Classification}, 
      author={Farha Al Breiki and Muhammad Ridzuan and Rushali Grandhe},
      year={2021},
      eprint={2107.13973},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

About

Applied Self Supervised Learning techniques such as Jigsaw as pretext task, SRGAN and SimCLR for fine-grained classification

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published