Giter VIP home page Giter VIP logo

cv-pire's Introduction

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).

cv-pire's People

Contributors

samsweere avatar

Watchers

James Cloos avatar

Forkers

fenhua

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.