Giter Club home page Giter Club logo

metaadv's Introduction

MetaAdv

Platform

  • Python: 3.7
  • PyTorch: 1.5.0

Dataset

We use the benchmark dataset MiniImageNet, which can be download here

Model

We use a four-layer-conv NN model

Standard MAML training

Run MAML_TrainStd.ipynb, associate files include MAMLMeta.py, attack.py, learner.py

  • Attack power level has to be changed in MAMLMeta.py
  • The device in MAML_TrainStd.ipynb and attack.py should set to be the same. (same in the following adversarial training)

MAML + FGSM-RS (random start)

Run trainfgsmrs.ipynb, associate files include metafgsm.py, attack.py, learner.py. To incorporate adversarial training in the inner-loop, please replace metafgsm.py with metafgsminout.py

MAML + TRADES-RS

Run train_trade.ipynb, associate files include MetaFT.py, LoadUnlableData.py. The unlabled data can be downloaded from here

Standard training + few-short fine-tuning (Meta-tesing)

Run StandardTransNew.ipynb, associate files include LoadDataST.py, StandardTrans.py. StandardTransAdv.ipynb contains adversarial training in the model training process.

Unlabeled data selection

Run figureselection.ipynb, associate files include

Visualization

Run robust_vis_neuron.ipynb, associate files include Visualization.py, vis_tool.py, MODELMETA.py.

  • By maximizing the output of a nueron with a perturbation in th input, the feature is shown in the input under a robust model, while "random noise" is shown in the input under a standard MAML model.
  • The fine-tuned model has the similar feature to the original model in the same neuron. This suggests that the robustness is kept in the fine-tuned model even without adding the adversarial training in the fine-tuning.

metaadv's People

Contributors

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