All Projects → columbia → Metric_Learning_Adversarial_Robustness

columbia / Metric_Learning_Adversarial_Robustness

Licence: other
Code for NeurIPS 2019 Paper

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Metric Learning Adversarial Robustness

Magnetloss Pytorch
PyTorch implementation of a deep metric learning technique called "Magnet Loss" from Facebook AI Research (FAIR) in ICLR 2016.
Stars: ✭ 217 (+393.18%)
Mutual labels:  classification, metric-learning
Humpback Whale Identification 1st
https://www.kaggle.com/c/humpback-whale-identification
Stars: ✭ 591 (+1243.18%)
Mutual labels:  classification, metric-learning
Online-Category-Learning
ML algorithm for real-time classification
Stars: ✭ 67 (+52.27%)
Mutual labels:  classification
BIRADS classifier
High-resolution breast cancer screening with multi-view deep convolutional neural networks
Stars: ✭ 122 (+177.27%)
Mutual labels:  classification
classy
Super simple text classifier using Naive Bayes. Plug-and-play, no dependencies
Stars: ✭ 12 (-72.73%)
Mutual labels:  classification
vita
Vita - Genetic Programming Framework
Stars: ✭ 24 (-45.45%)
Mutual labels:  classification
R-Machine-Learning
D-Lab's 6 hour introduction to machine learning in R. Learn the fundamentals of machine learning, regression, and classification, using tidymodels in R.
Stars: ✭ 27 (-38.64%)
Mutual labels:  classification
MHCLN
Deep Metric and Hash Code Learning Network for Content Based Retrieval of Remote Sensing Images
Stars: ✭ 30 (-31.82%)
Mutual labels:  metric-learning
ml-competition-template-titanic
Kaggle Titanic example
Stars: ✭ 51 (+15.91%)
Mutual labels:  classification
Conformer
Official code for Conformer: Local Features Coupling Global Representations for Visual Recognition
Stars: ✭ 345 (+684.09%)
Mutual labels:  classification
TNCR Dataset
Deep learning, Convolutional neural networks, Image processing, Document processing, Table detection, Page object detection, Table classification. https://www.sciencedirect.com/science/article/pii/S0925231221018142
Stars: ✭ 37 (-15.91%)
Mutual labels:  classification
lfda
Local Fisher Discriminant Analysis in R
Stars: ✭ 74 (+68.18%)
Mutual labels:  metric-learning
Color-Identification-using-Machine-Learning
This project explores colors in various images and then enables the user to query the images based on a given color.
Stars: ✭ 93 (+111.36%)
Mutual labels:  classification
MoeFlow
Repository for anime characters recognition website, powered by TensorFlow
Stars: ✭ 113 (+156.82%)
Mutual labels:  classification
SafeAI
Reusable, Easy-to-use Uncertainty module package built with Tensorflow, Keras
Stars: ✭ 13 (-70.45%)
Mutual labels:  classification
flexinfer
A flexible Python front-end inference SDK based on TensorRT
Stars: ✭ 83 (+88.64%)
Mutual labels:  classification
Relation-Classification
Relation Classification - SEMEVAL 2010 task 8 dataset
Stars: ✭ 46 (+4.55%)
Mutual labels:  classification
ATMC
[NeurIPS'2019] Shupeng Gui, Haotao Wang, Haichuan Yang, Chen Yu, Zhangyang Wang, Ji Liu, “Model Compression with Adversarial Robustness: A Unified Optimization Framework”
Stars: ✭ 41 (-6.82%)
Mutual labels:  robustness
HateALERT-EVALITA
Code for replicating results of team 'hateminers' at EVALITA-2018 for AMI task
Stars: ✭ 13 (-70.45%)
Mutual labels:  classification
TIGER
Python toolbox to evaluate graph vulnerability and robustness (CIKM 2021)
Stars: ✭ 103 (+134.09%)
Mutual labels:  robustness

Metric Learning for Adversarial Robustness

If you find this work is useful, please cite the following:

@inproceedings{Mao2019MetricRobust,
title = {Metric Learning for Adversarial Robustness},
author = {Mao, Chengzhi and Zhong, Ziyuan and Yang, Junfeng and Vondrick, Carl and Ray, Baishakhi},
booktitle = {Advances in Neural Information Processing Systems 32},
pages = {478--489},
year = {2019},
}

Requirement

Install tensorflow:

pip install -r requirements.txt

All of our experiments are conducted on Amazon AWS EC2 server, with pre-installed tensorflow on the V100 GPU. If you use AWS server, can activate the conda environment: source activate tensorflow_p36

MNIST

Prepare MNIST dataset

run

python utils_folder/save_mnist.py

Running experiemnts

All the hyper parameters are set up in config_mnist.json

Then run:

python train_update_fast_triplet.py

To reproduce the TLA algorithm

For baseline models:

Madry et al's

python train_at_madry.py

Note that this TLA algorithm takes almost the same time as Madry's baseline to converge, thus patience is needed.

Evaluations

First, set the path to the directory where the MNIST model is saved. Set up the attack type, the steps, the step size, and random start.

Then run python eval.py to evaluate the model under certain attack

CIFAR-10

Prepare CIFAR-10 dataset

Download the data from https://github.com/MadryLab/cifar10_challenge/tree/master/cifar10_data into the folder cifar10_data

Running experiemnts

All the hyper parameters are set up in config_cifar.json

Then run:

python train_update_fast_triplet.py --dataset cifar10

To reproduce the ATL algorithm

For baseline models:

Madry et al's

python train_at_madry.py --dataset cifar10

t-SNE

Change the parameters inside the file (especially "mode" and "model_folder_dir") to reproduce results for Figure 1 and Figure 2, respectively.

python tSNE.py

Evaluations

First update the path to the saved CIFAR10 model. Set up the attack type, the steps, the step size, and random start.

Then run python eval.py to evaluate the saved model under the given attack.

Tiny ImageNet

Prepare Tiny ImageNet dataset

Download dataset: https://tiny-imagenet.herokuapp.com to subfolder imagenet_data

run

python utils_folder/save_imagenet.py

to produce preprocessed dataset.

Running experiemnts

Finetuning version

We have Res20 and Res50 architecture option.

set up the config_imagenet.json

first run

python train_at_madry.py --dataset imagenet

Then set up the finetuning model path in config_imagenet.json, and run

python train_update_fast_triplet.py --dataset imagenet --diff_neg

Evaluations

First update the path to the saved ImageNet model. Set up the attack type, the steps, the step size, and random start.

Then run python eval.py to evaluate the saved model under the given attack.

Notice, AWS need first launch tmux, then activate the tensorflow

Tips: AAP and A1Ap both can give a bit higher performance

For cifar10, when using small models, the negative dictionary size need to decrease such that the selected negative is not too hard for the metric learning loss.

Model Weights Download

CIFAR-10: www.cs.columbia.edu/~mcz/publication/upload-cifar-models.zip

Tiny-ImageNet: http://www.cs.columbia.edu/~mcz/publication/TLA-tiny-imagenet.zip

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].