filipradenovic / cnnimageretrieval-pytorch

CNN Image Retrieval in PyTorch: Training and evaluating CNNs for Image Retrieval in PyTorch
http://cmp.felk.cvut.cz/cnnimageretrieval
MIT License
1.43k stars 322 forks source link

Finetuned VGG16 R-MAC model #16

Closed bkj closed 5 years ago

bkj commented 5 years ago

The "CNN Image Retrieval Learns from BoW" paper describes a VGG16 R-MAC model in the bottom row of Table 1. Are you able to make that model available?

I'm trying to reproduce some diffusion results, and they report results from that R-MAC model rather than the GEM models that this repo includes.

Thanks! ~ Ben

filipradenovic commented 5 years ago

This repository is providing only the GeM models, as they are the best performing. However, you can run the training script to train the model that was used in the mentioned paper, with the same training hyper-parameters, i.e., use this script:

python3 -m cirtorch.examples.train YOUR_EXPORT_DIR --gpu-id '0' --training-dataset 'retrieval-SfM-120k' 
            --test-datasets 'roxford5k,rparis6k' --arch 'vgg16' --pool 'mac' --loss 'contrastive' 
            --loss-margin 0.75 --optimizer 'adam' --lr 1e-6 --neg-num 5 --query-size=2000 
            --pool-size=20000 --batch-size 5 --image-size 362

Then, after the training, you can extract R-MAC vectors, as it was done in the CNN learns from BoW paper, and the diffusion paper.

Another option is to use our MATLAB/MatConvNet implementation and provided models, that were actually used in the original papers. This implementation is available here.

I hope this helps.