Code Monkey home page Code Monkey logo

perc-adversarial's Introduction

About

PyTorch code for our paper:

Zhengyu Zhao, Zhuoran Liu, Martha Larson, "Towards Large yet Imperceptible Adversarial Image Perturbations with Perceptual Color Distance", CVPR 2020.

Specifically, we propose to strategically relax tight Lp-norm constraints while still maintaining imperceptibility by using perceptual color distance (CIEDE2000). The resulting large yet imperceptible perturbations lead to improved robustness and transferability.

Implementation

Overview

This code contains the implementations of:

  1. A PyTorch's autograd-compitable differentiable solution of the conversion from RGB to CIELAB space and of CIEDE2000 metric,
  2. Two approaches (PerC-C&W and PerC-AL) to creating imperceptible adversarial perturbations with optimization on perceptual color distance,
  3. Evaluation on success rate, robustness and transferability on 1000 ImageNet-Compatible images.

Requirements

torch>=1.1.0; torchvision>=0.3.0; tqdm>=4.31.1; pillow>=5.4.1; matplotlib>=3.0.3; numpy>=1.16.4;

Dataset

The 1000 images of the ImageNet-Compatible dataset are provided in the folder dataset/images, along with their descriptions in dataset/images.csv, including their URLs, cropping bounding boxes, classification labels and some other metadata. More details on this dataset can be found in its official repository.

Experiments

Code for all the experiments along with descriptions can be found in the Jupyter Notebook file main.ipynb. Detailed parameter settings for the proposed two approach are described in perc_cw.py and perc_al.py.

Examples

perc-adversarial's People

Contributors

zhengyuzhao avatar dependabot[bot] avatar liuzrcc avatar

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.