Giter Club home page Giter Club logo

a_little_fog_for_a_large_turn's Introduction

A Little Fog for a Large_Turn

Code for the WACV 2020 paper, "A Little Fog for a Large Turn"
Arxiv paper link : https://arxiv.org/abs/2001.05873
Website link : https://code-assasin.github.io/little_fog/

Abstract

Small, carefully crafted perturbations called adversarial perturbations can easily fool neural networks. However, these perturbations are largely additive and not naturally found. We turn our attention to the field of Autonomous navigation wherein adverse weather conditions such as fog have a drastic effect on the predictions of these systems. These weather conditions are capable of acting like natural adversaries that can help in testing models. To this end, we introduce a general notion of adversarial perturbations, which can be created using generative models and provide a methodology inspired by Cycle-Consistent Generative Adversarial Networks to generate adversarial weather conditions for a given image. Our formulation and results show that these images provide a suitable testbed for steering models used in Autonomous navigation models. Our work also presents a more natural and general definition of Adversarial perturbations based on Perceptual Similarity.

Examples

Some sample Deviations seen in popular steering angle predictors due to fog : alt text

Fooling Models: Ground truth Steering Angle (in radians) for each of the original test samples. The angles right below indicate the ordered pair of predicted steering angle by AutoPilot and Comma AI respectively. From the second row onward, we indicate the image translation model used and respective steering model it was trained on. The angle below each of those images indicates the prediction by the steering model for the generated foggy image.

Prerequisites

-  Linux or macOS
-  Python 3
-  Preferably NVIDIA GPU + CUDA CuDNN
-  Pytorch>=0.4.1
-  torchvision>=0.2.1
-  dominate>=2.3.1
-  visdom>=0.1.8.3

Note: For DistanceGAN code: Python2 is used by the original authors instead and we continue to use the same.

Usage

CycleGAN :

In the file "cycle_gan_code/models/cycle_gan_fool_model.py" update the steering model to be attacked and the alpha and theta values. Then come back to the CycleGAN folder (cycle_gan_code) and run:

python3 train.py --dataroot /gan_train/ --name model_name --model cycle_gan_fool --preprocess none --batch_size 40 --gpu_ids 0,1,2,3 --norm instance --init_type kaiming --display_port 8097 --no_dropout --lambda_identity 3 --niter_decay 500 --niter 100

Dataroot should have following subfolders: trainA trainB testA testB

DistanceGAN:

In the file "cycle_gan_code/models/cycle_gan_fool_model.py" update the steering model to be attacked and the alpha and theta values. Then come back to the CycleGAN folder (cycle_gan_code) and run:

CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py --dataroot /gan_train/ --name model_name --model distance_gan --loadSize 128 --fineSize 128 --batchSize 6 --norm instance --nThreads 8 --use_cycle_loss --max_items 5 --identity 3 --gpu_ids 1

Pretrained models:

Coming soon!!

Citation

If you use this work for your research, please cite our paper:

@misc{machiraju2020little,
    title={A Little Fog for a Large Turn},
    author={Harshitha Machiraju and Vineeth N Balasubramanian},
    year={2020},
    eprint={2001.05873},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

Acknowledegements

Our code is inspired by the following repositories:

  • CycleGAN repository link
  • DistanceGAN repository link
  • AutoPilot by SullyChen link
  • Comma AI link

a_little_fog_for_a_large_turn's People

Stargazers

 avatar

Watchers

James Cloos avatar Harshitha Machiraju avatar paper2code - bot avatar

Forkers

lab1055

a_little_fog_for_a_large_turn's Issues

Reproducible code

Hi! Trying to run your code, but having issues. First, thanks for making your code available! However, it is currently not easily reproducible. Some suggestions/comments:

  1. The toplevel README is not clear that there are actually two projects (each with their own README, requirements.txt, etc) Suggest to link to the two lower-level READMEs
  2. The READMEs are under-specified. Please expand text like "update the steering model to be attacked and the alpha and theta values. Then come back to the CycleGAN folder". These could be specific instructions: "change X to Y" and "cd cycle_gan_code", etc
  3. Your Python packages need to be pinned at specific versions. For example, the current torch requires "pillow<7". In addition, getting another error probably linked to wrong version of scipy:
python3 train.py --dataroot /gan_train/ --name model_name --model cycle_gan_fool --preprocess none --batch_size 40 --gpu_ids 0,1,2,3 --norm instance --init_type kaiming --display_port 8097 --no_dropout --lambda_identity 3 --niter_decay 500 --niter 100
Traceback (most recent call last):
  File "train.py", line 11, in <module>
    from util.visualizer import Visualizer
  File "/home/dblank/comet/academic/A_Little_fog_for_a_Large_Turn/cycle_gan_code/util/visualizer.py", line 8, in <module>
    from scipy.misc import imresize
ImportError: cannot import name 'imresize'
  1. Consider using pip freeze to get a list of all of the versions that you used.
  2. Also, consider using a automatic logging tool (such as https://comet.ml ) to log the training. It is free (pip install comet_ml, get api_key), and with two lines of code can create interactive webpages to explore training and performances. At the top of training file:
import comet_ml
experiment = comet_ml.Experiment(api_key="...")

Thanks again for sharing!

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.