misc 0 0 0

Abdullah08/AsymmetricAttack

published by @Abdullah08

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
6.7K
Last 30 days
576
Likes
-
Size
12.9 GB
Created on HF
2025-04-26
Age
1 years ago

Description

Asymmetric Bias in Text-to-Image Generation with Adversarial Attacks

This repository implements the concepts from the paper "Asymmetric Bias in Text-to-Image Generation with Adversarial Attacks." The study examines adversarial attacks on Text-to-Image (T2I) models like Stable Diffusion, introducing entity swapping via adversarial suffixes and gradient-based attacks. It reveals asymmetric attack success rates (ASRs) and proposes probing metrics to predict vulnerabilities based on model biases.… See the full description on the dataset page: https://huggingface.co/datasets/Abdullah08/AsymmetricAttack.

Tags

modality:imagearxiv:2312.14440region:us

README current version from Hugging Face

Asymmetric Bias in Text-to-Image Generation with Adversarial Attacks

This repository implements the concepts from the paper "Asymmetric Bias in Text-to-Image Generation with Adversarial Attacks." The study examines adversarial attacks on Text-to-Image (T2I) models like Stable Diffusion, introducing entity swapping via adversarial suffixes and gradient-based attacks. It reveals asymmetric attack success rates (ASRs) and proposes probing metrics to predict vulnerabilities based on model biases.

Citation
text@article{shahgir2023asymmetric,
title={Asymmetric Bias in Text-to-Image Generation with Adversarial Attacks},
author={Shahgir, Haz Sameen and Kong, Xianghao and Ver Steeg, Greg and Dong, Yue},
journal={arXiv preprint arXiv:2312.14440},
year={2023}
}

Key Contributions

  • New attack objective: Entity swapping using adversarial suffixes to probe prompt distributions and ASRs.
  • Gradient-based attacks: Single Token Perturbation (adapted from Greedy Coordinate Gradient) and Multiple Token Perturbation (inspired by Genetic Algorithms).
  • Probing metrics (BSR, Δ₁, Δ₂) to estimate ASR without executing attacks, linking to model biases.

Methodology

  1. Model: Stable Diffusion (U-Net, CLIP embeddings, 77-token prompts).
  2. Attacks: Optimize adversarial suffixes to swap entities (e.g., "human" to "robot") by maximizing cosine similarity scores.
  3. Evaluation: Use InstructBLIP classifier (79% accuracy) and human annotations for ASR; generate 5 images per prompt.
  4. Metrics: Base Success Rate (BSR), perplexity difference (Δ₁), baseline distance difference (Δ₂) for asymmetry analysis.

Results

  • Multiple Token Perturbation achieves higher ASR (26.4%) than Single Token (24.4%).
  • Asymmetric ASRs: e.g., swapping "swan" to "horse" fails (ASR ~0), but reverse succeeds (ASR 0.9).
  • Metrics predict ASR: BSR ≥0.9 and Δ₂<0 → ~60% success; BSR<0.9 and Δ₂≥0 → <5% success.

Usage

  1. Clone the repo and run experiments:
  2. textgit clone https://github.com/your-repo/asymmetric-bias-t2i
  3. pip install -r requirements.txt
  4. python attack.py --prompt "A human" --target "A robot"

License
MIT (or as per paper/repo). Refer to the original paper for details: arXiv:2312.14440.

README history 20 revisions

Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.

  1. 2025-08-09Update README.md6e5bddd2.2 KB
    Loading...
  2. 2025-08-09Update README.mdc98c9392.2 KB
    Loading...
  3. 2025-08-09Update README.mdfdb0c392.5 KB
    Loading...
  4. 2025-08-09Upload README.mdcd76b0b2.6 KB
    Loading...
  5. 2025-08-09Delete readme.mdc9ef0a00 B
    Loading...
  6. 2025-08-09Upload readme.mdb9ba7e70 B
    Loading...
  7. 2025-08-09Delete readme.md.txt9a72d0d0 B
    Loading...
  8. 2025-08-09Upload readme.md.txtaa0a5ca0 B
    Loading...
  9. 2025-08-09Upload 1095 files5dddd530 B
    Loading...
  10. 2025-05-03Upload train/coco_sd_xl/preferred_A bowl of black and white sprinkled doughnu...83e8be70 B
    Loading...
  11. 2025-05-03Upload train/coco_sd_xl/a bowl of black and white sprinkled doughnuts topped ...0978d130 B
    Loading...
  12. 2025-05-03Upload train/coco_sd_xl/preferred_A man standing in a open grass field..png w...79e76030 B
    Loading...
  13. 2025-05-03Upload train/coco_sd_xl/a man standing in a open grass field. photogenic shee...921a17e0 B
    Loading...
  14. 2025-05-03Upload train/coco_sd_xl/a man standing in a open grass field. sheep in aussia...2528dfb0 B
    Loading...
  15. 2025-05-03Upload train/coco_sd_xl/a man standing in a open grass field. sheep seemingly...37afac90 B
    Loading...
  16. 2025-05-03Upload train/coco_sd_xl/a man standing in a open grass field. crested sheep s...0acd4d00 B
    Loading...
  17. 2025-05-03Upload train/coco_sd_xl/a man standing in a open grass field. youngster sheep...33020240 B
    Loading...
  18. 2025-05-03Upload train/coco_sd_xl/a man standing in a open grass field. photogenic shee...71c474a0 B
    Loading...
  19. 2025-05-03Upload train/coco_sd_xl/a man standing in a open grass field. sheep making sn...975d3c40 B
    Loading...
  20. 2025-05-03Upload train/coco_sd_xl/a man standing in a open grass field. bse ): sheep sm...474303a0 B
    Loading...

Used by abliterated models none yet

No abliterated models in our catalog have declared this dataset in their YAML metadata yet. This can mean the dataset is used but not declared, is used outside abliteration workflows, or is new. The link will populate automatically as models are indexed.

Community discussions 1 thread · 1 open · 1 comments

Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, license clarifications. Click any thread to expand and read the full conversation inline. Newest first.

  1. 2025-04-27[bot] Conversion to Parquetopen1 💬#1
    Loading...

Related datasets same stage · misc

Read further

Repository

Download the dataset

0

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("Abdullah08/AsymmetricAttack")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="Abdullah08/AsymmetricAttack", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/Abdullah08/AsymmetricAttack
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration