Practical overview
When it fits
Use it when a PyTorch image classifier needs evaluation across documented robustness benchmarks, or when building a robust-vision research experiment.
Who it is for
- Researchers comparing robustness of pretrained image-classification models.
- Developers training robust vision models or reproducing research methods.
Documented uses
- Benchmark a pretrained classifier on distribution-shift, corruption and adversarial evaluations.
- Train a robust image-classification model using implemented methods.
- Reproduce examples of published robust-vision approaches.
Requirements & limits
The repository is public and specifies the Apache-2.0 license.
- The documented evaluation workflow requires benchmark datasets at the expected paths; ImageNet data location is configured with ImageNetDataDir.
- ObjectNet evaluation is optional and noted as requiring substantial disk space.
- The Docker setup route specifies Docker and nvidia-docker; source and PyPI installation routes are also documented.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install EasyRobust from source and prepare ImageNet data
Install the package from its repository and set the ImageNet data directory for use.
Before you start
- Git and pip are available.
- An ImageNet dataset is available locally.
Steps
Clone the repository with the command below.
git clone https://github.com/alibaba/easyrobust.gitChange into the
easyrobustdirectory and install it with the command below.pip install -e .Place ImageNet data at
/path/to/imagenetand setImageNetDataDirwithexport ImageNetDataDir=/path/to/imagenet.Optionally download benchmark data with the command below when evaluating model robustness.
sh download_data.sh
Expected outcome
EasyRobust is installed from source, and the ImageNet path is set; optionally, benchmark data is downloaded.
Guide limitations
- The documentation does not specify system or package version requirements.
- Benchmark data download is optional and intended for robustness evaluation.
- The ImageNet dataset itself must be obtained separately.
Run the documented ResNet-50 robustness evaluation example
Evaluate a pretrained ResNet-50 on the listed ImageNet distribution-shift and adversarial benchmarks.
Before you start
- EasyRobust is installed.
- The pretrained ResNet-50 dependencies are available.
- The benchmark datasets are present at the paths used in the example.
Steps
Open
benchmarks/resnet50_example.pyand define the pretrained model astorchvision.models.resnet50(pretrained=True), then callmodel.eval(); move it to CUDA whentorch.cuda.is_available()is true.Use the example's evaluation calls for ImageNet validation, ImageNet-A, ImageNet-R, ImageNet-Sketch, ImageNet-V2, Stylized-ImageNet, ImageNet-C, and ImageNet AutoAttack, using their documented
benchmarks/data/...paths.Run the command below.
python benchmarks/resnet50_example.pyReview the printed top-1 accuracy results; the example also reports mCE for ImageNet-C.
Expected outcome
The example runs robustness evaluations and prints accuracy results for the listed datasets, including ImageNet-C mCE.
Guide limitations
- ObjectNet is skipped in the example because it requires substantial disk storage.
- The documented example paths require the datasets to be available there.
- The README's example output is illustrative and does not guarantee the same results for other environments or models.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 19 November 2026
- Original website title
- alibaba/easyrobust · Official homepage title · retained in its source language

