Skip to content

Home

torchattack

Ruff pypi python versions pypi version pypi weekly downloads lint

torchattack - A curated list of adversarial attacks in PyTorch, with a focus on transferable black-box attacks.

pip install torchattack

Highlights

  • 🛡️ A curated collection of adversarial attacks implemented in PyTorch.
  • 🔍 Focuses on gradient-based transferable black-box attacks.
  • 📦 Easily load pretrained models from torchvision or timm using AttackModel.
  • 🔄 Simple interface to initialize attacks with create_attack.
  • 🔧 Extensively typed for better code quality and safety.
  • 📊 Tooling for fooling rate metrics and model evaluation in eval.
  • 🔁 Numerous attacks reimplemented for readability and efficiency (TGR, VDC, etc.).

Next Steps

  • Usage


    Learn how to use abstractions of pretrained victim models, attack creations, and evaluations.

    Usage

  • Attacks


    Explore the comprehensive list of adversarial attacks available in torchattack.

    Attacks

  • Development


    On how to install dependencies, run tests, and build documentation.

    Development

License

torchattack is licensed under the MIT License.