Giter Site home page Giter Site logo

henry8527 / gce Goto Github PK

View Code? Open in Web Editor NEW
39.0 4.0 2.0 37 KB

[ICCV'19] Improving Adversarial Robustness via Guided Complement Entropy

Python 100.00%
pytorch adversarial-robust mnist robustness pgd-adversarial-attacks iccv19 iccv2019 complement-entropy

gce's Introduction

Overview

This repository contains the PyTorch implementation with adversarial-robust training objective introduced in the following paper:

Improving Adversarial Robustness via Guided Complement Entropy.
Hao-Yun Chen*, Jhao-Hong Liang*, Shih-Chieh Chang, Jia-Yu Pan, Yu-Ting Chen, Wei Wei, Da-Cheng Juan.
https://arxiv.org/abs/1903.09799

Introduction

In this paper, we propose a new training paradigm called Guided Complement Entropy (GCE) that is capable of achieving "adversarial defense for free," which involves no additional procedures in the process of improving adversarial robustness. In addition to maximizing model probabilities on the ground-truth class like cross-entropy, we neutralize its probabilities on the incorrect classes along with a "guided" term to balance between these two terms. We show in the experiments that our method achieves better model robustness with even better performance compared to the commonly used cross-entropy training objective.

Robustness under White-Box attacks

We demonstrate model accuracies trained with different training objective: Baseline (cross-entropy) and GCE (Guided Complement Entropy) under various of SOTA white-box attacks.

MNIST is used to be the benchmark dataset and the perturbations are all set to be 0.2.

Attack Baseline GCE
FGSM (Goodfellow et al. 2015) 38.88% 62.74%
MIM (Dong et al. 2018) 2.29% 39.81%
PGD (Madry et al. 2018) 1.58% 9.55%

Usage

For training a robust model with Guided Complement Entropy. (alpha as the strength in our proposed guided factor)

python main.py --GCE --alpha 0.333 

For testing the robustness to PGD adversarial attacks on the previous training model.

python LinfPGDAttack.py --GCE --model <model path>

Dependencies

  • Python 3.6
  • Pytorch 1.0 +

Acknowledgement

The implementations for PGD adversarial attacks are adapted from Advertorch.

gce's People

Contributors

henry8527 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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