In this work, we demonstrate that infusing domain knowledge in the form of superpixels-based radial graph improves the predictive performance of CNN-based classifiers. We would love to know about any issues found on this repository. Please create an issue for any queries, or contact us at [email protected].
- [18 May 2021]: Repository is made public.
You can find the structure of the repository (i.e., the sub-directories and files) here.
Clone the repository.
git clone https://github.com/abheesht17/super-pixels.git
cd super-pixels
Install the requirements.
make requirements
At times, especially on Colab, the above command fails. It is preferable that you run the following:
pip3 install --upgrade -r requirements.txt --find-links https://pytorch-geometric.com/whl/torch-1.8.0+cu101.html --find-links https://download.pytorch.org/whl/torch_stable.html
Note: Find the CUDA version and install accordingly.
All the datasets are available on Google Drive.
- MNIST
- FashionMNIST
- CIFAR-10
- CIFAR-100
- COVID X-Ray Detection
- LFW Face Recognition
- SOCOFing Fingerprint Identification
For all models and datasets, the configs are present in the configs/custom_trainer
directory. Choose a config according to the model and the dataset you want to run. For example, to do a Grid Search on the CNN+GAT model using the LFW dataset, you have to run the following command:
python train.py --config_dir ./configs/custom_trainer/graph_image/hybrid/cnn_gat_lfw --grid_search --validation
Currently, we guarantee that the "cnn" and "cnn_gat" models are in working condition. The rest have to be checked.
This will save the logs and the final model at the path specified in the logs
parameter. The default is the logs/<model_dataset_name>
folder.
Note: Performing Grid Search is not necessary. The default hyperparameters specified in the configs are the ones obtained after performing Grid Search; one can directly run the training and inference command given in the next subsection.
python train.py --config_dir ./configs/custom_trainer/graph_image/hybrid/cnn_gat_lfw
- Add Usage.
- Add Citation(s).
- Update
README.md
. - Add Directory Structure.
Dataset | CNN | CNN+GNN |
---|---|---|
MNIST | 99.30% | 99.21% |
FMNIST | 91.65% | 91.50% |
CIFAR-10 | 77.80% | 76.81% |
CIFAR-100 | 42.88% | 46.79% |
Dataset | CNN | CNN+GNN |
---|---|---|
COVID | 89.09% | 91.01% |
LFW | 60.83% | 66.12% |
SOCOFing | 65.68% | 93.58% |
Our paper is under review at ESANN 2021.
You can cite our work as:
@misc{chhablani2021superpixelbased,
title={Superpixel-based Domain-Knowledge Infusion in Computer Vision},
author={Gunjan Chhablani and Abheesht Sharma and Harshit Pandey and Tirtharaj Dash},
year={2021},
eprint={2105.09448},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
If you use any part of our code in your work, please use the following citation:
@misc{sharma2021superpixelsgithub,
author = {Abheesht Sharma and Gunjan Chhablani and Harshit Pandey and Tirtharaj Dash},
title = {abheesht17/super-pixels},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/abheesht17/super-pixels}},
}