Skip to main content

This package provides UAPs for robustness evaluation.

Project description

X-Transfer Attacks: Towards Super Transferable Adversarial Attacks on CLIP

XTransfer Logo
arXiv HuggingFace Community License Made with Python

Code for ICML2025 Paper "X-Transfer Attacks: Towards Super Transferable Adversarial Attacks on CLIP"


X-TransferBench

X-TransferBench is an open-source benchmark that offers a comprehensive collection of Universal Adversarial Perturbations (UAPs) capable of achieving super adversarial transferability. These UAPs can simultaneously transfer across data distributions, domains, model architectures, and downstream tasks. In essence, they are perturbations that can convert virtually any input sample into an adversarial example—effective against any model and any task.


Installation

git clone https://github.com/hanxunh/XTransferBench.git
cd XTransferBench
pip3 install .

Usage

import XTransferBench
import XTransferBench.zoo

# List threat models
print(XTransferBench.zoo.list_threat_model())

# List UAPs under L_inf threat model
print(XTransferBench.zoo.list_attacker('linf_non_targeted'))

# Load X-Transfer with the Large search space (N=64) non-targeted
attacker = XTransferBench.zoo.load_attacker('linf_non_targeted', 'xtransfer_large_linf_eps12_non_targeted')

# Perturbe images to adversarial example
images = # Tensor [b, 3, h, w]
adv_images = attacker(images) 

Demo

We provide a web demo using X-TransferBench that allows you to transform any image into an adversarial example using our curated collection of UAPs and TUAPs. You can access the demo at the link below. Once generated, the adversarial example can be tested on any model and task of your choice.


UAPs/TUAPs Collections


Reproduce results from the paper

The repository includes sample code and all necessary files to reproduce the results reported in the paper.

For evaluation instructions, please refer to evaluations/README.md.

For generating UAPs/TUAPs, see xtransfer/README.md.


Security and Ethical Use Statement

The perturbations provided in this project are intended solely for research purposes. They are shared with the academic and research community to advance understanding of super transferable attacks and defenses.

Any other use of the data, model weights, or methods derived from this project, including but not limited to unauthorized access, modification, or malicious deployment, is strictly prohibited and not endorsed by this project. The authors and contributors of this project are not responsible for any misuse or unethical applications of the provided resources. Users are expected to adhere to ethical standards and ensure that their use of this research aligns with applicable laws and guidelines.


Citation

@inproceedings{
  huang2025xtransfer,
  title={X-Transfer Attacks: Towards Super Transferable Adversarial Attacks on CLIP},
  author={Hanxun Huang and Sarah Erfani and Yige Li and Xingjun Ma and James Bailey},
  booktitle={ICML},
  year={2025},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xtransferbench-0.1.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xtransferbench-0.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file xtransferbench-0.1.1.tar.gz.

File metadata

  • Download URL: xtransferbench-0.1.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for xtransferbench-0.1.1.tar.gz
Algorithm Hash digest
SHA256 40cc96f8052e78784d13d18228721062721d1feca9ce34c59da7a0d4317ac670
MD5 00118c3447af7317582bfef369ea0bb5
BLAKE2b-256 21d8796023cc4332297b901eae171b9f130b6ab71d0106a5e437254a7ce8d885

See more details on using hashes here.

File details

Details for the file xtransferbench-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xtransferbench-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for xtransferbench-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a0790974080c391cef9b381106d83f22776a56e9b90d32aa056e61fbd0fa825
MD5 4130805590e507cacefbd5d10e3fc2cb
BLAKE2b-256 da7c8eff11b3415fc3ce48e45d4dbfd62c605d87df85f542810e7ca4dbc747bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page