Metadata-Version: 2.2
Name: adversarialtorchattacks
Version: 1.0.0
Summary: A PyTorch package for adversarial attacks (FGSM, PGD, CW, MIFGSM, AutoAttack) with visualization.
Home-page: https://github.com/santhosh1705kumar/adversarialpytorchattackers
Author: Santhoshkumar K
Author-email: santhoshatwork17@gmail.com
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: torch>=1.9.0
Requires-Dist: torchvision>=0.10.0
Requires-Dist: matplotlib>=3.4.0
Requires-Dist: numpy>=1.19.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

## 📦 Installation
Install the package via pip:
```sh
pip install adversarialpytorchattack

## 📦 Or installation using Github 
Or install from source
```sh
git clone https://github.com/santhoshatwork17@gmail.com/adversarialpytorchattackers.git
cd adversarial_pytorch_attack


## 🛠️ Usage
```python
import torch
import torchvision.models as models
from adversarialpytorchattack.attacks import FGSM, PGD, CW
from adversarialpytorchattack.utils import visualize_perturbation, save_image

# pre-trained model
model = models.resnet18(pretrained=True).eval()

# input image
image = torch.rand((1, 3, 224, 224))  # Example input
label = torch.tensor([0])  # Example label

# Apply attack
fgsm_attack = FGSM(model, epsilon=0.03)
adv_image = fgsm_attack(image, label)

# Save the adversarial image
save_image(adv_image, "adv_fgsm.jpg")
