⚖️🔁🔮🕵️‍♂️🦹🖼️ Code for *Measuring the Contribution of Multiple Model Representations in Detecting Adversarial Instances* paper.

Overview

Measuring the Contribution of Multiple Model Representations in Detecting Adversarial Instances

This repository contains the code for Measuring the Contribution of Multiple Model Representations in Detecting Adversarial Instances.

Reported running times are approximate, intended to give a general idea of how long each step will take. Estimates are based on times encountered while developing on Ubuntu 21.04 with hardware that includes an AMD Ryzen 9 3950X CPU, 64GB of memory, and an NVIDIA TITAN RTX GPU with 24GB of memory. The intermediate results utilize about 600 gigabytes of storage.

Requirements

The code was developed using Python 3.9 on Ubuntu 21.04. Other systems and Python versions may work, but have not been tested.

Python library dependencies are specified in requirements.txt. Versions are pinned for reproducibility.

Installation

  • Optionally create and activate a virtual environment.
python3 -m venv env
source env/bin/activate
  • Install Python dependencies, specified in requirements.txt.
    • 2 minutes
pip3 install -r requirements.txt

Running the Code

By default, output is saved to the ./workspace directory, which is created automatically.

  • Train ResNet classification models.
    • 6 weeks
python3 src/train_nets.py
  • Evaluate the models, extracting representations from the corresponding data.
    • 1 hour
python3 src/eval_nets.py
  • Adversarially perturb test images, evaluating and extracting representations from the corresponding data.
    • 21 hours
python3 src/attack.py
  • Train and evaluate model-wise control adversarial instance detectors, varying the number of underlying models used for generating features, where the underlying detectors are trained on representations from a single model.
    • 1 day
OMP_NUM_THREADS=1 python3 src/detect_model_wise_control.py
  • Train and evaluate model-wise treatment adversarial instance detectors, varying the number of underlying models used for generating features, where the underlying detectors are trained on representations from multiple models.
    • 1 day
OMP_NUM_THREADS=1 python3 src/detect_model_wise_treatment.py
  • Train and evaluate unit-wise control adversarial instance detectors, varying the number of units used for generating features, where the units come from a single underlying model.
    • 1 hour
OMP_NUM_THREADS=1 python3 src/detect_unit_wise_control.py
  • Train and evaluate unit-wise treatment adversarial instance detectors, varying the number of units used for generating features, where the units come from multiple underlying models.
    • 2 hours
OMP_NUM_THREADS=1 python3 src/detect_unit_wise_treatment.py
  • Generate plots.
    • 2 seconds
python3 src/plot.py

Citation

@misc{steinberg2021measuring,
      title={Measuring the Contribution of Multiple Model Representations in Detecting Adversarial Instances}, 
      author={Daniel Steinberg and Paul Munro},
      year={2021},
      eprint={2111.07035},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}
Code + pre-trained models for the paper Keeping Your Eye on the Ball Trajectory Attention in Video Transformers

Motionformer This is an official pytorch implementation of paper Keeping Your Eye on the Ball: Trajectory Attention in Video Transformers. In this rep

Facebook Research 192 Dec 23, 2022
Running Google MoveNet Multipose Tracking models on OpenVINO.

MoveNet MultiPose Tracking on OpenVINO

60 Nov 17, 2022
IGCN : Image-to-graph convolutional network

IGCN : Image-to-graph convolutional network IGCN is a learning framework for 2D/3D deformable model registration and alignment, and shape reconstructi

Megumi Nakao 7 Oct 27, 2022
Segcache: a memory-efficient and scalable in-memory key-value cache for small objects

Segcache: a memory-efficient and scalable in-memory key-value cache for small objects This repo contains the code of Segcache described in the followi

TheSys Group @ CMU CS 78 Jan 07, 2023
A method to perform unsupervised cross-region adaptation of crop classifiers trained with satellite image time series.

TimeMatch Official source code of TimeMatch: Unsupervised Cross-region Adaptation by Temporal Shift Estimation by Joachim Nyborg, Charlotte Pelletier,

Joachim Nyborg 17 Nov 01, 2022
shufflev2-yolov5:lighter, faster and easier to deploy

shufflev2-yolov5: lighter, faster and easier to deploy. Evolved from yolov5 and the size of model is only 1.7M (int8) and 3.3M (fp16). It can reach 10+ FPS on the Raspberry Pi 4B when the input size

pogg 1.5k Jan 05, 2023
MAUS: A Dataset for Mental Workload Assessment Using Wearable Sensor - Baseline system

MAUS: A Dataset for Mental Workload Assessment Using Wearable Sensor - Baseline system Getting started To start working on this assignment, you should

2 Aug 06, 2022
An Straight Dilated Network with Wavelet for image Deblurring

SDWNet: A Straight Dilated Network with Wavelet Transformation for Image Deblurring(offical) 1. Introduction This repo is not only used for our paper(

FlyEgle 41 Jan 04, 2023
Interpretable-contrastive-word-mover-s-embedding

Interpretable-contrastive-word-mover-s-embedding Paper Datasets Here is a Dropbox link to the datasets used in the paper: https://www.dropbox.com/sh/n

0 Nov 02, 2021
A demo of how to use JAX to create a simple gravity simulation

JAX Gravity This repo contains a demo of how to use JAX to create a simple gravity simulation. It uses JAX's experimental ode package to solve the dif

Cristian Garcia 16 Sep 22, 2022
The Official TensorFlow Implementation for SPatchGAN (ICCV2021)

SPatchGAN: Official TensorFlow Implementation Paper "SPatchGAN: A Statistical Feature Based Discriminator for Unsupervised Image-to-Image Translation"

39 Dec 30, 2022
The spiritual successor to knockknock for PyTorch Lightning, get notified when your training ends

Who's there? The spiritual successor to knockknock for PyTorch Lightning, to get a notification when your training is complete or when it crashes duri

twsl 70 Oct 06, 2022
(Personalized) Page-Rank computation using PyTorch

torch-ppr This package allows calculating page-rank and personalized page-rank via power iteration with PyTorch, which also supports calculation on GP

Max Berrendorf 69 Dec 03, 2022
Pytorch implementations of Bayes By Backprop, MC Dropout, SGLD, the Local Reparametrization Trick, KF-Laplace, SG-HMC and more

Bayesian Neural Networks Pytorch implementations for the following approximate inference methods: Bayes by Backprop Bayes by Backprop + Local Reparame

1.4k Jan 07, 2023
gtfs2vec - Learning GTFS Embeddings for comparing PublicTransport Offer in Microregions

gtfs2vec This is a companion repository for a gtfs2vec - Learning GTFS Embeddings for comparing PublicTransport Offer in Microregions publication. Vis

Politechnika Wrocławska - repozytorium dla informatyków 5 Oct 10, 2022
Edge Restoration Quality Assessment

ERQA - Edge Restoration Quality Assessment ERQA - a full-reference quality metric designed to analyze how good image and video restoration methods (SR

MSU Video Group 27 Dec 17, 2022
ChainerRL is a deep reinforcement learning library built on top of Chainer.

ChainerRL and PFRL ChainerRL (this repository) is a deep reinforcement learning library that implements various state-of-the-art deep reinforcement al

Chainer 1.1k Jan 01, 2023
Awesome-AI-books - Some awesome AI related books and pdfs for learning and downloading

Awesome AI books Some awesome AI related books and pdfs for downloading and learning. Preface This repo only used for learning, do not use in business

luckyzhou 1k Jan 01, 2023
AdaShare: Learning What To Share For Efficient Deep Multi-Task Learning

AdaShare: Learning What To Share For Efficient Deep Multi-Task Learning (NeurIPS 2020) Introduction AdaShare is a novel and differentiable approach fo

94 Dec 22, 2022
Group-Free 3D Object Detection via Transformers

Group-Free 3D Object Detection via Transformers By Ze Liu, Zheng Zhang, Yue Cao, Han Hu, Xin Tong. This repo is the official implementation of "Group-

Ze Liu 213 Dec 07, 2022