RoobanSappani / Attack-and-Defense-of-Adversarial-Images

I have implemented three types of adversarial attacks that can be used on a trained CNN model. T countermeasure these attacks, a defense algorithm is also implemented

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attack-and-Defense-of-Adversarial-Images

I have implemented three types of adversarial attacks that can be used on a trained CNN model. To countermeasure these attacks, a defense algorithm is also implemented. The dataset is used is MNIST.

Attack of Adversarial Images

Adversarial examples are inputs to machine learning models that an attacker has intentionally designed to cause the model to make a mistake. They’re like optical illusions for machines.

I have implemented three types of white box attacks:

  1. Fast Gradient Sign Method
  2. Iterative Fast Gradient Sign Method
  3. Momentum Iterative Fast Gradient Sign Method

Below given is the training and validation loss accross all the epochs.

training

Fast Gradient Sign Method

Test Accuracy after FGSM attack

fgsm_graph

Examples of some adversarial images:

fgsm_example

Iterative Fast Gradient Sign Method

Test Accuracy after I-FGSM attack

ifgsm

Examples of some adversarial images:

ifgsm_example

Momentum Iterative Fast Gradient Sign Method

Test Accuracy after MI_FGSM attack

mifgsm_graph

Examples of some adversarial images:

mifgsm_example

Defense Distillation for Adversarial Images

To countermeasure the above attacks, distillation was implemented.

Below given is the training and validation loss for netowrkf and networkf1

collage

Defense against FGSM

Below is the Test accuracy after defending the FGSM attack

defense_fgsm

Examples of the predicitions after defense:

fgsm_defense_example

Defense against I-FGSM

Below is the Test accuracy after defending the I-FGSM attack

ifgsm_defense

Examples of the predicitions after defense:

ifgsm_defense_example

Defense against MI-FGSM

Below is the Test accuracy after defending the MI-FGSM attack

mifgsm_defense

Examples of the predicitions after defense:

mifgsm_defense_example

About

I have implemented three types of adversarial attacks that can be used on a trained CNN model. T countermeasure these attacks, a defense algorithm is also implemented

License:MIT License


Languages

Language:Jupyter Notebook 100.0%