DANet: Divergent Activation for Weakly Supervised Object Localization,in ICCV 2019
We propose a divergent activation (DA) approach, and target at learning complementary and discriminative visual patterns for image classification and weakly supervised object localization from the perspective of discrepancy. To this end, we design hierarchical divergent activation (HDA), which leverages the semantic discrepancy to spread feature activation, implicitly. We also propose discrepant divergent activation (DDA), which pursues object extent by learning mutually exclusive visual patterns, explicitly.
-
Clone this repo:
DANet_ROOT=/path/to/clone/DANet git clone --recursive https://github.com/xuehaolan/DANet $DANet_ROOT cd $DANet_ROOT
-
Create an Anaconda environment with python2.7 and PyTorch>=0.4.0
-
Download the images of CUB-200-2011 dataset and place the data at $DANet_ROOT/data/CUB-200-2011
-
Train
cd scripts sh train_DA_cub.sh
-
Test
Download the pretrained model at GoogleDrive(https://drive.google.com/open?id=114zDDJe6zYbRjashntibbN1D4DM0E1uw)
cd scripts sh val_DA_cub.sh
-
Note
- Using modified VGG(vgg_DA_p) could achieve higher performance for both CAM and DANet.
- The valiation code uses simple thresholding, using localization method provided by CAM(https://github.com/metalbubble/CAM) may gets greater localization results.