Datasets:
XAI Attack Detection: Imagenette targeted BIM/PGD on ViT-B/16
Private research dataset of paired clean and targeted adversarial Imagenette images. It is built to study how adversarial attacks change a Vision Transformer's explanation maps and to support later work on attack detection. Each row is one source image with its clean and its attacked version.
Summary
| Pairs | 12,420 (train 8,690 · validation 1,860 · test 1,870) |
| Source images | Imagenette v2, 320 px (fastai/imagenette), resized 248 bicubic + center crop 224 |
| Classifier | timm/vit_base_patch16_224.augreg2_in21k_ft_in1k at revision 063c6c38a5d8, 10 Imagenette logits taken from the ImageNet head, no fine-tuning |
| Attacks | targeted BIM, i.e. iterative FGSM (ε ∈ {2/255, 4/255, 8/255}, 10 steps, step size ε/10, no random start) and targeted L∞ PGD (ε ∈ {2/255, 4/255, 8/255}, steps ∈ {10, 20, 40}, step size 2.5·ε/steps, random start) |
| Target hit rate (after PNG) | 88.9% |
| Label flip rate (after PNG) | 88.9% |
| Plan signature | 089f5ba81783f0cd |
How it was built
- The pinned ViT-B/16 classified all 13,394 Imagenette images with the 10
Imagenette logits of its 1000-class head. Fine-tuning was not needed (see notebook
01_model_check.ipynb). - Only correctly classified images were eligible. Every class contributes the same number of images (1,242), split 70/15/15 inside each class.
- Each image received one attack: a target class that is never its own class, an attack type, and that attack's hyperparameters. The assignment is random but constrained, so target classes, attack types, hyperparameter settings, source classes, and splits are all evenly represented (balance table below).
- Attacks minimize float32 cross-entropy toward the target over the 10 Imagenette logits. Results are rounded to 8 bits, stored as lossless PNG, decoded, and re-classified.
- Every attempt is kept, including failed ones.
target_hitandlabel_flippedrecord the outcome after the PNG round trip. Keeping failures preserves the balance; filter on these flags for success-only subsets (that subset is no longer balanced).
Balance
spread is the largest max − min count difference inside any group.
| property | mean_count | spread | allowed |
|---|---|---|---|
| source class — overall | 1242.0 | 0 | 0 |
| source class — per split | 414.0 | 0 | 0 |
| target class — overall | 1242.0 | 0 | 0 |
| target class — per split | 414.0 | 0 | 0 |
| source → target pair (own class excluded) | 138.0 | 0 | 1 |
| attack — overall | 6210.0 | 0 | 6 |
| attack — per split | 2070.0 | 2 | 8 |
| attack — per source class | 621.0 | 2 | 8 |
| attack — per target class | 621.0 | 2 | 8 |
| attack — per split × source | 207.0 | 3 | 10 |
| attack — per split × target | 207.0 | 4 | 10 |
| attack — per source × target | 69.0 | 2 | 10 |
| attack — per split × source × target | 23.0 | 4 | 10 |
| bim setting — overall | 2070.0 | 0 | 6 |
| bim setting — per split | 690.0 | 2 | 8 |
| bim setting — per source class | 207.0 | 4 | 8 |
| bim setting — per target class | 207.0 | 5 | 8 |
| bim setting — per source × target | 23.0 | 4 | 10 |
| pgd setting — overall | 690.0 | 3 | 6 |
| pgd setting — per split | 230.0 | 4 | 8 |
| pgd setting — per source class | 69.0 | 3 | 8 |
| pgd setting — per target class | 69.0 | 4 | 8 |
| pgd setting — per source × target | 7.7 | 4 | 10 |
| ε (both attacks) — overall | 4140.0 | 3 | 6 |
| PGD steps — overall | 2070.0 | 2 | 6 |
| ε (both attacks) — per split | 1380.0 | 4 | 8 |
| PGD steps — per split | 690.0 | 3 | 8 |
| ε (both attacks) — per source class | 414.0 | 4 | 8 |
| PGD steps — per source class | 207.0 | 3 | 8 |
| ε (both attacks) — per target class | 414.0 | 3 | 8 |
| PGD steps — per target class | 207.0 | 3 | 8 |
Attack success by setting
| config_id | epsilon | pairs | target_hit_rate | label_flip_rate | imagenet_target_hit_rate |
|---|---|---|---|---|---|
| bim_eps2 | 2/255 | 2070 | 65.9% | 65.9% | 38.4% |
| bim_eps4 | 4/255 | 2070 | 87.2% | 87.2% | 68.5% |
| bim_eps8 | 8/255 | 2070 | 94.9% | 95.1% | 85.4% |
| pgd_eps2_steps10 | 2/255 | 691 | 74.8% | 75.0% | 49.8% |
| pgd_eps2_steps20 | 2/255 | 690 | 95.1% | 95.1% | 82.9% |
| pgd_eps2_steps40 | 2/255 | 688 | 99.7% | 99.7% | 96.1% |
| pgd_eps4_steps10 | 4/255 | 689 | 92.3% | 92.3% | 72.7% |
| pgd_eps4_steps20 | 4/255 | 690 | 98.6% | 98.6% | 93.2% |
| pgd_eps4_steps40 | 4/255 | 690 | 100.0% | 100.0% | 99.7% |
| pgd_eps8_steps10 | 8/255 | 691 | 96.2% | 96.2% | 82.8% |
| pgd_eps8_steps20 | 8/255 | 690 | 99.4% | 99.4% | 95.7% |
| pgd_eps8_steps40 | 8/255 | 691 | 100.0% | 100.0% | 99.4% |
Misclassified-class distribution
Predicted class of attacked images whose label flipped. Targets are balanced, so these counts should be roughly even across classes:
| predicted class | bim | pgd |
|---|---|---|
| tench | 507 | 583 |
| English springer | 512 | 588 |
| cassette player | 498 | 587 |
| chain saw | 530 | 589 |
| church | 507 | 593 |
| French horn | 487 | 580 |
| garbage truck | 517 | 593 |
| gas pump | 508 | 589 |
| golf ball | 546 | 605 |
| parachute | 526 | 601 |
| attack | misclassified_images | min_per_class | max_per_class | largest_class_share | on_assigned_target | uniform_p_value |
|---|---|---|---|---|---|---|
| bim | 5138 | 487 | 546 | 10.6% | 99.9% | 0.837 |
| pgd | 5908 | 580 | 605 | 10.2% | 100.0% | 1.000 |
ImageNet training-set overlap
About 96% of Imagenette images come from the ImageNet-1k training split, which the
classifier was trained on. imagenet_origin tells the two apart (val = never seen in training):
| imagenet_origin | pairs | target_hit_rate | label_flip_rate |
|---|---|---|---|
| train | 11962 | 88.8% | 88.9% |
| val | 458 | 90.2% | 90.2% |
Fields
- Identity:
pair_id,split,source_dataset,source_id(path inside the Imagenette archive),imagenette_split,imagenet_origin,true_wnid,true_label,true_class_name - Images:
clean_image,adversarial_image(224×224 RGB PNG) - Attack:
attack,config_id,epsilon_level(ε × 255),epsilon,steps,step_size,random_start,attack_seed,target_label,target_class_name - Clean result:
clean_prediction,clean_prediction_name,clean_confidence,clean_correct,clean_imagenet_top1 - Adversarial result:
adversarial_prediction,adversarial_prediction_name,adversarial_confidence,adversarial_target_probability,adversarial_true_probability,adversarial_imagenet_top1 - Outcome:
target_hit,label_flipped,target_hit_before_png,label_flipped_before_png,imagenet_target_hit - Perturbation (8-bit):
perturbation_linf_levels,perturbation_linf,perturbation_l2 - Provenance:
clean_sha256,adversarial_sha256,model_id,model_revision,device_name
Probabilities and predictions are over the 10 Imagenette classes unless the name contains imagenet.
metadata/ holds the frozen attack plan, manifest, generation report, audit report, and figures.
Loading
from datasets import load_dataset
pairs = load_dataset("nimaeb/xai-attack-detection-imagenette", split="train")
hits = pairs.filter(lambda row: row["target_hit"])
Limitations
- One classifier, one source dataset, and two closely related white-box L∞ attacks (BIM is PGD without the random start).
- Targets are restricted to the 10 Imagenette classes. The attack does not steer the 1000-class output.
- All images are in the 8-bit PNG domain.
- Clean accuracy is inflated by the ImageNet training overlap described above.
License and access
Private research artifact with no reuse license. Imagenette is a subset of ImageNet, so ImageNet's terms of access apply to the images. Review licensing before any public release.
- Downloads last month
- 37