Current collected state Current
Observed since 20 Oct, 20:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A library for adversarial attacks on neural networks
A library for adversarial attacks on neural networks. This package provides several common adversarial attack methods, including FGSM, PGD, and more, to test and evaluate the robustness of deep learning models. these are all gradient attacks
You can install adversarialattacknn directly from GitHub using pip:
pip install git+https://github.com/yourusername/adversarialattacknn.git
git clone https://github.com/yourusername/adversarialattacknn.git
cd adversarialattacknn
pip install -e .
import torch
from adversarialattacknn import Attack
# Initialize the model (replace with your own model)
model = YourModel()
# Example of using the Attack class
attack = Attack(
attack='fgsm',
model_name='resnet18', # or your custom model
epsilon=0.1,
targeted=False,
random_start=True,
norm='linfty',
loss='crossentropy'
)
# Sample data (replace with actual data)
data = torch.randn((1, 3, 224, 224)) # Batch of images
label = torch.tensor([0]) # Ground-truth label
# Perform the attack
perturbation = attack(data, label)
# Apply perturbation to input data
adversarial_example = data + perturbation
-santhoshkumar
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.1 | 13 Mar 2025 | 4 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 20:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:744aa40718ed71c86977d1bcdf832a4af82380eddd6ea21926d27055955f54f9