Coder Social home page Coder Social logo

pixleattack's Introduction

Pixle: a fast and effective black-box attack based on rearranging pixels

This repository contains a PyTorch implementation of the paper:

Jary Pomponi, Simone Scardapane, Aurelio Uncini

Abstract

Recent research has found that neural networks are vulnerable to several types of adversarial attacks, where the input samples are modified in such a way that the model produces a wrong prediction that misclassifies the adversarial sample. In this paper we focus on black-box adversarial attacks, that can be performed without knowing the inner structure of the attacked model, nor the training procedure, and we propose a novel attack that is capable of correctly attacking a high percentage of samples by rearranging a small number of pixels within the attacked image. We demonstrate that our attack works on a large number of datasets and models, that it requires a small number of iterations, and that the distance between the original sample and the adversarial one is negligible to the human eye.

Main Dependencies

  • pytorch==1.7.1
  • python=3.8.5
  • torchvision==0.8.2
  • pyyaml==5.3.1
  • tqdm

Experiments files

The folder './configs/' contains all the yaml files used for the experiments presented in the paper.

The folder './config/attacks' contains the files containing all the attacks with the respective hyperparameters.

Attacks implementation

The attack can be found in the file attacks/psa.py

Training

The only training file is main.py.

So see how to use it to lunch the experiments, please refer to the files:

  • experiments.sh
  • experiments_targeted.sh
  • experiments_dimensions.sh

All the above files take as input the dataset, the architecture and the device to be used, with some limitations. Please refer to each file to understand how to launch it.

Cite

Please cite our work if you find it useful:

@ARTICLE{2022arXiv220202236P,
       author = {{Pomponi}, Jary and {Scardapane}, Simone and {Uncini}, Aurelio},
        title = "{Pixle: a fast and effective black-box attack based on rearranging pixels}",
      journal = {arXiv e-prints},
     keywords = {Computer Science - Machine Learning, Statistics - Machine Learning},
         year = 2022,
        month = feb,
          eid = {arXiv:2202.02236},
        pages = {arXiv:2202.02236},
archivePrefix = {arXiv},
       eprint = {2202.02236},
 primaryClass = {cs.LG},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2022arXiv220202236P},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

pixleattack's People

Contributors

jaryp avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

trellixvulnteam

pixleattack's Issues

omegaconf.errors.ConfigKeyError

003 1
I've already encountered this problem twice. The first time was on line 81 of the main.py, and my solution was OmegaConf.update(cfg, "training.devicces", 1, force_add=True) to force the addition.When I continue to run it, I encountered this problem again.And there are many similar uses like cfg['model'] .
003 2
Did I make a mistake in my configuration? Is there a fundamental solution?

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.