All Projects → EQuiw → 2019 Scalingattack

EQuiw / 2019 Scalingattack

Licence: gpl-3.0
Image-Scaling Attacks and Defenses

Projects that are alternatives of or similar to 2019 Scalingattack

Modular Rl
[ICML 2020] PyTorch Code for "One Policy to Control Them All: Shared Modular Policies for Agent-Agnostic Control"
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Alfnet
Code for 'Learning Efficient Single-stage Pedestrian Detectors by Asymptotic Localization Fitting' in ECCV2018
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Deepkoopman
neural networks to learn Koopman eigenfunctions
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Understandingbdl
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Cmucomputationalphotography
Jupyter Notebooks for CMU Computational Photography Course 15.463
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Simplestockanalysispython
Stock Analysis Tutorial in Python
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Python Audio
Some Jupyter notebooks about audio signal processing with Python
Stars: ✭ 125 (-1.57%)
Mutual labels:  jupyter-notebook
Lisa
Linux Integrated System Analysis
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Normalizing Flows
Understanding normalizing flows
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
L4 Optimizer
Code for paper "L4: Practical loss-based stepsize adaptation for deep learning"
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
The Data Science Workshop
A New, Interactive Approach to Learning Data Science
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Meteorological Books
气象相关书籍合集(持续更新)
Stars: ✭ 125 (-1.57%)
Mutual labels:  jupyter-notebook
Python
利用python来分析一些财务报表数据
Stars: ✭ 125 (-1.57%)
Mutual labels:  jupyter-notebook
Distance Encoding
Distance Encoding for GNN Design
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Reptilesomething
抓点什么玩玩~
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Scir Training Day
a small training program for new crews of HIT-SCIR
Stars: ✭ 125 (-1.57%)
Mutual labels:  jupyter-notebook
Examples
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Ajax Movie Recommendation System With Sentiment Analysis
Content-Based Recommender System recommends movies similar to the movie user likes and analyses the sentiments on the reviews given by the user for that movie.
Stars: ✭ 127 (+0%)
Mutual labels:  jupyter-notebook
Stockperformanceclassification
Keras 1D CNN on Azure ML Workbench to classify 4 week stock performance based on text in public earnings statements
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook
Nlpmetrics
Python code for various NLP metrics
Stars: ✭ 126 (-0.79%)
Mutual labels:  jupyter-notebook

Image-Scaling Attacks & Defenses

This repository belongs to our publication:


Erwin Quiring, David Klein, Daniel Arp, Martin Johns and Konrad Rieck. Adversarial Preprocessing: Understanding and Preventing Image-Scaling Attacks in Machine Learning. Proc. of USENIX Security Symposium, 2020.


Background

For an introduction together with current works on this topic, please visit our website.

Principle of image-scaling attacks

In short, image-scaling attacks enable an adversary to manipulate images, such that they change their appearance/content after downscaling. In particular, the attack generates an image A by slightly perturbing the source image S, such that its scaled version D matches a target image T. This process is illustrated in the figure above.

Getting Started

This repository contains the main code for the attacks and defenses. It has a simple API and can be easily used for own projects. The whole project consists of python code (and some cython additions).

Installation

In short, you just need the following steps (assuming you have Anaconda).

Get the repository:

git clone https://github.com/EQuiw/2019-scalingattack
cd 2019-scalingattack/scaleatt

Create a python environment (to keep your system clean):

conda create --name scaling-attack python=3.6
conda activate scaling-attack

Install python packages and compile cython extensions:

pip install -r requirements.txt
python setup.py build_ext --inplace

Check the README in the scaleatt directory for a detailed introduction how to set up the project (in case of problems).

That's it. For instance, to run the tutorial, you can use (assuming you're still in directory scaleatt and use BASH for $(pwd)):

PYTHONPATH=$(pwd) python tutorial/defense1/step1_non_adaptive_attack.py

Tutorial

Jupyter Notebook

For a quick introduction, I recommend you to look at this jupyter notebook.

Main Tutorial

Check the directory scaleatt/tutorial/ for a detailed tutorial how to run the attacks and defenses.

The directory has the same structure as our evaluation. Each subdirectory corresponds to the subsection from our paper:

  • The directory defense1 corresponds to experiments from Section 5.2 and 5.3
  • The directory defense2 corresponds to experiments from Section 5.4 and 5.5
    • Each subdirectory contains some python scripts that describe the API and the respective steps.

My recommendation: Open each file (in the order of the steps), and then use a python console to run the code step by step interactively.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].