Giter VIP home page Giter VIP logo

adversarial-contrastive's Introduction

Code used in the experiments in JMLR 2023 paper "An Analysis of Robustness of Non-Lipschitz Networks" by Nina Balcan (CMU), Avrim Blum (TTIC), Dravyansh Sharma (CMU), and Hongyang Zhang (U Waterloo), authors ordered alphabetically by last name.

Pre-requisites

  • Python
  • Pytorch
  • CUDA
  • numpy

Overview

We propose the Random Feature Subspace threat model to better understand the robustness of non-Lipschitz networks. Our code includes

  • Implementation of an exact attack under our threat model (Algorithm 3 in the paper).
  • Implementation and evaluation of robust error and abstention rates of our proposed abstention-based defense algorithm (Algorithm 1 in the paper).

We study our attack and defense in the supervised and self-supervised contrastive learning frameworks, i.e. the feature space under attack corresponds to feature embedding obtained under these frameworks.

Our algorithm is able to simultaneously obtain small robust error as well as small abstention rates, in both supervised and self-supervised contrastive learning settings.

Screenshot 2023-03-16 at 11 09 25 AM

Furthermore, our theory and experiments suggest that abstention is necessary to defend in our feature space attack model, and standard techniques without abstention are indefensible.

Screenshot 2023-03-16 at 11 11 07 AM

Summary of files in the repository

  • filter_outliers.py Performs pre-processing step 2 in Algorithm 1.

  • n3_1_robust_accuracy.py, dontknow.py Compute robust error and abstention rates for Algorithm 1.

  • n3_1__optimal_attack.py Optimal attack (Algorithm 3) is implemented for n3=1.

  • train_simclr.py to train a SimCLR representation

  • contrast\ defines the loss, learning rate scheduler, and other details.

Reference

For full technical details and experimental results, please check the paper.

@article{balcan2023analysis, 
	author = {Maria-Florina Balcan and Avrim Blum and Dravyansh Sharma and Hongyang Zhang}, 
	title = {An Analysis of Robustness of Non-Lipschitz Networks}, 
	journal = {Journal of Machine Learning Research},
	year = {2023}
}

Contact

[email protected] for further questions related to the paper. [email protected] or [email protected] for further questions related to code.

adversarial-contrastive's People

Contributors

hongyanz avatar dravyanshsharma avatar

Stargazers

 avatar

Watchers

 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.