This repository contains the original code and the links for data and pretrained models. If you have any questions about our paper, please feel free to contact Me (sunguolei.kaust AT gmail.com)
To use our loss, please first generate CAMs following this line.
Our loss can be found in HNC_mse and HNC_kd. The usage of loss can be found in this line, where our loss takes two arguments: CAMs and ground-truth label.
Note: 1. you may need to tune lambda, which is the weight balancing both HNC loss and cross entropy loss. Higher weight means higher influence of HNC loss; 2. you may need to tune k, which is the number of negative CAMs to suppress. Smaller k means focusing on more confusing classes.
1). prepare ImageNet dataset
2). for running commands, please refer to './imagenet/running-script.sh'
If you find this repository helpful, please consider citing:
@article{sun2020fixing,
title={Fixing Localization Errors to Improve Image Classification},
author={Sun, Guolei and Khan, Salman and Li, Wen and Cholakkal, Hisham and Khan, Fahad and Van Gool, Luc},
journal={ECCV},
year={2020} }
This repository is based on CBAM, thanks for their excellent work.