https://github.com/akshay-gupta123/moorkh
A Python toolbox to create adversarial examples that fool neural networks in PyTorch.
https://github.com/akshay-gupta123/moorkh
adversarial-attacks adversarial-examples deep-learning pytorch
Last synced: about 2 months ago
JSON representation
A Python toolbox to create adversarial examples that fool neural networks in PyTorch.
- Host: GitHub
- URL: https://github.com/akshay-gupta123/moorkh
- Owner: akshay-gupta123
- License: mit
- Created: 2021-06-04T12:19:27.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-05T11:01:25.000Z (almost 5 years ago)
- Last Synced: 2025-09-30T06:09:37.688Z (8 months ago)
- Topics: adversarial-attacks, adversarial-examples, deep-learning, pytorch
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# moorkh : Adversarial Attacks in Pytorch
**moorkh** is a Pytorch library for generating adversarial examples with full support for batches of images in all attacks.
## About the name
The name moorkh is a Hindi word meaning Fool in English, that's what we are making to Neural networks by generating advesarial examples. Although we also do so for making them more robust.
## Usage
### Installation
- `pip install moorkh` or
- `git clone https://github.com/akshay-gupta123/moorkh`
```python
import moorkh
norm_layer = moorkh.Normalize(mean,std)
model = nn.Sequential(
norm_layer,
model
)
model.eval()
attak = moorkh.FGSM(model)
adversarial_images = attack(images, labels)
```
## Implemented Attacks
* **[`EXPLAINING AND HARNESSING ADVERSARIAL EXAMPLES: FGSM`](https://arxiv.org/abs/1412.6572)**
* **[`ADVERSARIAL EXAMPLES IN THE PHYSICAL WORLD: IFGSM`](https://arxiv.org/abs/1607.02533)**
* **[`ON THE LIMITATION OF CONVULATIONSAL NEURAL NETWORK IN RECOGNIZING NEGATIVE IMAGES: Semantic`](https://arxiv.org/abs/1703.06857)**
* **[`ADDING NOISE: Noise`](https://arxiv.org/abs/1802.00420)**
* **[`TOWARDS DEEP LEARNING MODELS RESISTANT TO ADVERSARIAL ATTACKS: PGD\L2`](https://arxiv.org/abs/1706.06083)**
* **[`ESEMBLE ADVERSAIAL TRAINING: ATTACKS and DEFENSE: RFGSM`](https://arxiv.org/abs/1705.07204)**
## To-Do's
* Adding more Attacks
* Making Documentation
* Adding demo notebooks
* Adding Summaries of Implemented papers(for my own undestanding)
## Contribution
This library is developed as a part of my learning, if you find any **bug** feel free to create a PR. All kind of contributions are always welcome!
## References
* [Adversarial=Robustness-Toolbox](https://github.com/IBM/adversarial-robustness-toolbox) by IBM.
* [Foolbox](https://github.com/bethgelab/foolbox) by Bethgelab.
* [Cleverhans](https://github.com/tensorflow/cleverhans) by Google brain
* [Reliable and Interpretable Artificial Intelligence](https://www.sri.inf.ethz.ch/teaching/riai2020) A Eth Zurich course
* [Adversarial Robustness - Theory and Practice](https://adversarial-ml-tutorial.org/) Tutorial by Zico Kolter and Aleksander Madry