This is the source code for our paper Robust Fine-Grained Visual Recognition with Images Based on Internet of Things
The architecture of our proposed DDN model is as follows
After creating a virtual environment of python 3.5, run pip install -r requirements.txt
to install all dependencies.
The code is currently tested only on GPU.
-
Data Preparation
Download data into DDN root directory and uncompress them using
wget https://fgdata-sh.oss-cn-shanghai.aliyuncs.com/CUB200-Google-100-DDN.tar.gz wget https://fgdata-sh.oss-cn-shanghai.aliyuncs.com/CUB200-Google-100-Bilinear.tar.gz tar -xvf CUB200-Google-100-DDN.tar.gz tar -xvf CUB200-Google-100-Bilinear.tar.gz
-
Demo
If you just want to do a quick test on the model and check the final fine-grained recognition performance, please follow subsequent steps
-
Download one of the following trained models into
demo/model
usingwget https://fgdata-sh.oss-cn-shanghai.aliyuncs.com/Model/DDN_Performance_79.92.pth
Model Description Performance(%) DDN_Performance_79.92.pth leverages 100 web images for each category (DDN) 79.92 -
Rename the downloaded model to
step2_vgg_16_epoch_best.pth
-
Create Test data symbolic in
demo
byln -s ../CUB200-Google-100-Bilinear data
-
Activate virtual environment(e.g. conda)
-
Run demo code using
CUDA_VISIBLE_DEVICES=0 python demo.py
-
-
Source Code
If you want to train the whole network from beginning using source code, please follow subsequent steps (please make sure you have at least 200GB space)
- Modify
CUDA_VISIBLE_DEVICES
to proper cuda device id inrunall.sh
, - Activate virtual environment(e.g. conda) and then run the script
bash runall.sh
- Modify