Skip to content
Back to skills

Vit Robustness Eval

ASecurity

Evaluates the robustness of Vision Transformer models against input perturbations including adversarial attacks (FGSM/PGD), spatial transformations, and restricted attention. It probes whether ViTs maintain classification performance under distribution shifts and targeted attacks compared to standard CNNs. Use when the user wants to benchmark on Unspecified, or asks about evaluating this task. Reports accuracy.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 11, 2026
researchpythonperformance

Works with

  • cli

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill vit-robustness-eval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Vit Robustness Eval?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Vit Robustness Eval
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-vit-robustness-eval/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-vit-robustness-eval)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: vit-robustness-eval
description: Evaluates the robustness of Vision Transformer models against input perturbations including adversarial attacks (FGSM/PGD), spatial transformations, and restricted attention. It probes whether ViTs maintain classification performance under distribution shifts and targeted attacks compared to standard CNNs. Use when the user wants to benchmark on Unspecified, or asks about evaluating this task. Reports accuracy.
metadata:
  skill_kind: dataset_eval
  source_arxiv: 2103.14586
  bibtex_key: [REDACTED]
  confidence: medium
---

# vit-robustness-eval

> Understanding Robustness of Transformers for Image Classification — Bhojanapalli et al. (2021) (arXiv:2103.14586, 2021)

## What this evaluates

Evaluates the robustness of Vision Transformer models against input perturbations including adversarial attacks (FGSM/PGD), spatial transformations, and restricted attention. It probes whether ViTs maintain classification performance under distribution shifts and targeted attacks compared to standard CNNs.

## Datasets

- **Unspecified** — total ?; splits: test (-1)

## Metrics

- `accuracy` **(primary)** — range: [0, 1]
  - Proportion of correctly classified images out of the total test set. For robustness evaluations, computed as the accuracy on perturbed inputs (adversarial or spatially transformed).

## Input / output format

**Input**: RGB images resized to 384x384 without cropping, with intensities normalized to the model's expected range.

**Output**: Discrete class label prediction for each input image.

## Scoring recipe

```python
correct = 0
for img, label in test_set:
    pred = model(img)
    if pred == label:
        correct += 1
accuracy = correct / len(test_set)
```

## Common pitfalls

- Using standard center-crop preprocessing instead of the specified direct resize without cropping, which changes the evaluation distribution.
- Failing to clip adversarial perturbations to the valid pixel intensity range after each gradient step, leading to invalid inputs.
- Misinterpreting the spatial attack success condition; it requires checking if any transformation in the 2511-element grid causes misclassification, not just the maximum perturbation.

## Evidence (verbatim from paper)

> The attack is considered successful if any of the transformed images is incorrectly classified by the corresponding model model. The same fixed set of 2511(9×9×31) transformations was used for all images and all models.

## Citation

```bibtex
@misc{bhojanapalli2021understanding,
  title={Understanding Robustness of Transformers for Image Classification},
  author={Bhojanapalli et al. (2021)},
  year={2021},
  note={arXiv:2103.14586}
}
```

- arXiv: 2103.14586

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.