Giter Site home page Giter Site logo

towards-robust-neural-networks-via-close-loop-control's Introduction

Towards-Robust-Neural-Networks-via-Close-loop-Control

This repo contains necessary code for the paper Towards Robust Neural Networks via Close-loop Control by Zhuotong Chen, Qianxiao Li and Zheng Zhang.

Description

The proposed Close-loop control neural network (CLC-NN) is a optimal control theory inspried defense method against various perturbations. It can be applied to any classifier to improve its robustness. Given unknown data, the CLC-NN performes the Pontryagin's Maximum Principle (PMP) dynamics on the entire state trajectory, the controlled state trajectory is used for final prediction.

The Controlled structure

alt text

The demonstration of controlling both input and hidden states

alt text

Dependencies

Python == 3.6.9
Pytorch == 1.5.1
numpy == 1.19.0

Running demonstration

The code in this repo are capable of doing the follwoing tasks:

  • Performing standard and robust training with FGSM, PGD, label-smoothing (main_train_models.py).
  • Evaluating the model performance against random, FGSM, PGD, CW and Manifold-based perturbations, and the PMP defense performance (main_evaluation.py).
  • Training a set of auto-encoders of all hidden states for a given neural netowrk (main_train_encoders.py).

Running description

  1. Train a neural network with a specified training method (main_train_models.py)
  2. For the linear defense
    • Generate the linear embedding for all input and hidden states.
    • Search for the optimal learning rate and maximum iteration number for the PMP dynamics (main_evaluation.py --pmp_select_parameters).
    • For evaluation with the defense, select defense_type (None, layer_wise_projection, linear_pmp), perturbation type and magnitude.
  3. For the nonlinear defense
    • Train a set of auto-encoders for all input and hidden states (main_train_encoders.py)
    • Search for the optimal learning rate and maximum iteration number for the PMP dynamics (main_evaluation.py --pmp_select_parameters).
    • For evaluation with the defense, select defense_type (None, layer_wise_projection, linear_pmp), perturbation type and magnitude.

License

This project is licensed under the MIT license - see the LICENSE file for more details.

Citation

If you use this code for your research, please cite our paper:

@article{chentowards,
  title={TOWARDS ROBUST NEURAL NETWORKS VIA CLOSE-LOOP CONTROL},
  author={Chen, Zhuotong and Li, Qianxiao and Zhang, Zheng}
}

Contact

Please contact [email protected] or [email protected] if you have any question on the code.

towards-robust-neural-networks-via-close-loop-control's People

Contributors

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