Skip to content

Increasing the Perceptual Image Quality of Adversarial Queries for Content-based Image Retrieval

License

Notifications You must be signed in to change notification settings

SamSweere/CV-PIRE

Repository files navigation

Bachelor Thesis: Increasing the Perceptual Image Quality of Adversarial Queries for Content-based Image Retrieval

Author: Sam Sweere

This repository contains the source code of the pytorch implementation of "CV-PIRE" in my thesis. The thesis and the presentation I gave on this thesis is also included in the repository.

CV-PIRE was build on the code of PIRE [1].

CV-PIRE is tested on:

  1. State-of-the-art CNN-based CBIR method GeM[2] with pre-trained ResNet-101-GeMsupports model and feature extraction codes provided by cnnimageretrieval-pytorch.

  2. Off-the-shelf ResNet-101 pre-trained on ImageNet by replacing the original AvgPool2d with adaptiveAvgPool2d for allowing arbitrary size of the input image, and adding an additional L2N layer for feature normalization.

In order to generate adversarial queries for different models, please specific the parameter 'cnnmodel' when running the main file gen_pire.py.

Pytorch implementaiton of CV-PIRE:

Prerequisites

Python3
PyTorch 1.0.0

Both CPU and GPU supported
(Code tested with Python 3.6.6 on Ubuntu 16.04)

How to use the code:

  • Clone the code and put your own image queries in folder ./img_input/.
git clone https://github.com/SamSweere/CV-PIRE
cd CV-PIRE
  • To get the adversarial queries generated by the best-performed CV-PIRE (T = 100) in the thesis, please run:
python3 gen_cv_pire.py -T "100" -saveIter "100" -treshold "50" -kernelsize "5" -sigma "1" -gpu_id "-1" -cnnmodel "gem" -in_dir "./img_input/" -out_dir "./img_output/"
  • Detailed explanation of CV-PIRE's parameters can be reached by:
python3 gen_cv_pire.py -h

The copyright of all the images belongs to the image owners.

References

[1] Z. Liu, Z. Zhao, and M. Larson, “Who’s afraid of adversarial queries? the impact of image modifications on content-based image retrieval,” in ACM International Conference on Multimedia Retrieval (ICMR), ACM, 2019.
[2] Radenović, Filip, Giorgos Tolias, and Ondrej Chum. "Fine-tuning CNN image retrieval with no human annotation." IEEE Transactions on Pattern Analysis and Machine Intelligence (2018).

About

Increasing the Perceptual Image Quality of Adversarial Queries for Content-based Image Retrieval

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages