Please, install the following packages
- numpy
- torch-0.3.1
- torchnet
- torchvision-0.2.0
- tqdm
Please unzip the files data.zip and checkpoint.zip.
checkpoint/coco (GoogleDrive)
checkpoint/voc (GoogleDrive)
noise = torch.from_numpy(np.random.laplace(0,1/epsilon,feature.size())).cuda().float()
You can add the noise Laplace noise into the model's input features, weights and output (in P2_models.py).
The regularization term can be added into the original loss function (in RP2_demo_voc2007_gcn.py or RP2_demo_voc2007_gcn.py).
python3 RP2_demo_voc2007_gcn.py data/voc --image-size 448 --batch-size 16 --epochs 40
python3 RP2_demo_coco_gcn.py data/coco --image-size 448 --batch-size 8 --epochs 20
python3 RP2_demo_voc2007_gcn.py data/voc --image-size 448 --batch-size 16 -e --resume checkpoint/voc/voc_checkpoint.pth.tar
python3 RP2_demo_coco_gcn.py data/coco --image-size 448 --batch-size 8 -e --resume checkpoint/coco/coco_checkpoint.pth.tar
The framework follows ML-GCN Multi-Label Image Recognition with Graph Convolutional Networks, CVPR 2019. And add the Laplace noise into the dot-produce of features and weights.
This project is based on https://github.com/Megvii-Nanjing/ML-GCN
If you have any questions about our work, please do not hesitate to contact us.