DFL-CNN : a fine-grained classifier
This is a pytorch re-implementation of Learning a Discriminative Filter Bank Within a CNN for Fine-Grained Recognition.
This work still need to be updated.
The features are summarized blow:
- Use VGG16 as base Network.
- Dataset CUB-200-2011, you can split trainset/testset by yourself.Or you can download dataset which has been split directly from BaiduYun Link.
- This work has been trained on 4 Titan V after epoch 120 with batchsize 56, Now I got best result Top1 85.140% Top5 96.237% which is lower than author's. You can download weights from weights.
- Part FCs is replaced by Global Average Pooling to reduce parameters.
- Every some epoches, ten best patches is visualized in vis_result directory, you can put images you want to visualize in vis_img named number.jpg.
- Update: ResNet-101 DFL-CNN and Multi-scale DFL-CNN need to be done.
Results and Visualization of ten boxes for discriminative patches:
This work has been trained on 4 Titan V after epoch 120 with batchsize 56, Now I got best result Top1 85.140% Top5 96.237% which is lower than author's. You can download weights from weights. If use TenCrop transform in code, result can improve further.
- Download dataset, you can split trainset/valset by yourself
- Or you can directly get it from BaiduYun Link
- Then link original dataset to our code root/dataset
ln -s ./train path/to/code/dataset/train ln -s ./test path/to/code/dataset/test
- Finally, Train and Test.
- Check you GPU resources and modify your run.sh.
- Visualization of ten best boxes is saved in vis_result/, img you want to visualize should be put
- Weight(checkpoint.pth.tar, model_best.pth.tar) is in weight/.
- Loss info is saved in log/.
Subscribe to Python Awesome
Get the latest posts delivered right to your inbox