Giter Site home page Giter Site logo

robustnorm's Introduction

Towards an Adversarially Robust Normalization Approach

This is code of the paper "Towards an adversarially Robust Normalization Approach".

Prerequisites

File structure

.
├── models                  # containt different neural networks
│    ├── create_model.py    # Select model
│    ├── norm.py            # Different normalizations are defineded in it
│    ├── resnet.py          # resnet for cifar is defined
│    ├── resnet_imagenet.py # resnet for imagenet, pytorch torch.vision resnet is modidfied
│    ├── vgg.py             # vgg for cifar 
├── utils                   # functions of many different types that are not related to main paper are defined here
│    ├── data.py            # functions for dataloder for diffeerent datasets 
├── attacks.py              # function to select adversarial attacks from advertorch package 
├── functions.py            # functions to use in training and testing 
├── test_cifar.py
├── test_imagenet.py
├── train_cifar.py
├── train_imagenet.py
├── run.sh
└── README.md

Training Examples

Training ResNet-50 on CIFAR-100 using RobustNorm

python train_cifar.py --dataset cifar100 --depth 20 --norm RNT --checkpoint checkpoints/cifar100-resnet50-RNT

Testing

python test_cifar.py --dataset cifar10 --model resnet --depth 20 --norm BN --resume checkpoints/Adverserial/cifar10-resnet20-BN/model_best.pth.tar --lr 0.1 --train-batch 128 --gpu 0

Train ResNet18 on ImageNet using RobustNorm

python3 train_imagenet.py --dataset imagenet --model resnet18 --norm RNT --gpu 0,1,2,3 --checkpoint checkpoints/imagenet/imagenet-resnet18-RN

References

Some parts of this code are based on this repository

robustnorm's People

Contributors

awaisrauf avatar

Stargazers

An-zhi WANG avatar JiaHao Lu avatar frozenheart3k avatar  avatar Fahad Shamshad avatar 朱群喜(QQ囍-海疯习习) avatar Yxt avatar

Watchers

James Cloos avatar  avatar  avatar paper2code - bot avatar

Forkers

mldl

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.