GuoleiSun / HNC_loss

Code for eccv2020 paper: Fixing Localization Errors to Improve Image Classification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code for eccv2020 paper: Fixing Localization Errors to Improve Image Classification

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)

block images

HNC loss

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.

ImageNet classification

1). prepare ImageNet dataset

2). for running commands, please refer to './imagenet/running-script.sh'

Citation

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} }

Acknowledgements

This repository is based on CBAM, thanks for their excellent work.

About

Code for eccv2020 paper: Fixing Localization Errors to Improve Image Classification


Languages

Language:Python 98.3%Language:Shell 1.7%