Git Product home page Git Product logo

self-adaptive-training's Introduction

Self-Adaptive Training

This is the PyTorch implementation of the paper Self-Adaptive Training: beyond Empirical Risk Minimization.

Requirements

  • Python >= 3.6
  • PyTorch >= 1.0
  • CUDA
  • Numpy

Usage

Standard training

The main.py contains training and evaluation functions in standard training setting.

Runnable scripts

  • Training and evaluation using the default parameters

    We provides our training scripts in directory scripts/. For a concrete example, we can use the command as below to train the default model (i.e., ResNet-34) on CIFAR10 dataset with uniform label noise injected (e.g., 40%):

    $ bash scripts/cifar10/run_sat.sh [TRIAL_NAME]
    

    The argument TRIAL_NAME is optional, it helps us to identify different trials of the same experiments without modifying the training script. The evaluation is automatically performed when training is finished.

  • Additional arguments

    • noise-rate: the percentage of data that being corrupted
    • noise-type: type of random corruptions (i.e., corrupted_label, Gaussian,random_pixel, shuffled_pixel)
    • sat-es: initial epochs of our approach
    • sat-alpha: the momentum term $\alpha$ of our approach

Results on CIFAR datasets under uniform label noise

  • CIFAR10
Noise Rate 0.2 0.4 0.6 0.8
Test Accuracy(%) 94.14 92.64 89.23 78.58
  • CIFA100
Noise Rate 0.2 0.4 0.6 0.8
Test Accuracy(%) 75.77 71.38 62.69 38.72

Adversarial training

We use state-of-the-art adversarial training algorithm TRADES as our baseline. The main_adv.py contains training and evaluation functions in adversarial training setting on CIFAR10 dataset.

Training scripts

  • Training and evaluation using the default parameters

    We provides our training scripts in directory scripts/cifar10. For a concrete example, we can use the command as below to train the default model (i.e., WRN34-10) on CIFAR10 dataset with PGD-10 attack ($\epsilon$=0.031) to generate adversarial examples:

    $ bash scripts/cifar10/run_trades_sat.sh [TRIAL_NAME]
    
  • Additional arguments

    • beta: hyper-parameter $1/\lambda$ in TRADES that controls the trade-off between natural accuracy and adversarial robustness
    • sat-es: initial epochs of our approach
    • sat-alpha: the momentum term $\alpha$ of our approach

Evaluation script

Evaluate robust WRN-34-10 models on CIFAR10 by PGD-20 attack:

  $ python pgd_attack.py --model-dir "/path/to/checkpoints"

This command evaluate 71-st to 100-th checkpoints in the specified path.

Results

Self-Adaptive Training mitigates the overfitting issue and consistently improves TRADES.

Reference

For technical details, please check the paper.

@article{huang2020sat,
        title = {Self-Adaptive Training: beyond Empirical Risk Minimizatio},
        author = {Lang Huang and Chao Zhang and Hongyang Zhang},
        journal = {arXiv preprint arXiv:2002.10319},
        year = {2020}
}

self-adaptive-training's People

Contributors

layneh avatar

Watchers

James Cloos avatar  avatar paper2code - bot 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.