Practical overview
When it fits
Use DeepRobust when you need code-based experiments with adversarial attacks or defenses for image or graph models, rather than a hosted assessment service.
Who it is for
- Researchers studying adversarial robustness in image classifiers.
- Machine-learning developers evaluating graph neural networks under attack.
- Teams prototyping and comparing adversarial defense approaches.
Documented uses
- Generate adversarial image examples to examine a model's response.
- Train or assess image-model defenses, including the documented PGD-training example.
- Evaluate graph-model robustness with the library's graph attack and defense methods.
Requirements & limits
The project is publicly available under the MIT license. The README documents pip installation and installation from source.
- The library covers both image and graph machine-learning tasks.
- It is a Python/PyTorch code library that requires a local environment and dependency management.
- The README's image PGD example uses CUDA and a CIFAR-10 ResNet-18 checkpoint.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Generate an image adversarial example with PGD
Follow the README's example to apply PGD to a CIFAR-10 image batch.
Before you start
- DeepRobust and its required Python packages
- PyTorch and torchvision
- CUDA device, as used by the example
- CIFAR-10 data and the example ResNet-18 model checkpoint
Steps
Download the example CIFAR-10 ResNet-18 checkpoint using the README's model URL and load it into the provided ResNet-18 model.
Set the model to evaluation mode and prepare the CIFAR-10 test data loader with the documented tensor transform.
Retrieve a batch, move its images to CUDA, and instantiate the PGD attack with the model and CUDA device.
Call
generatewith the batch, labels, and the documentedPGD_CIFAR10attack parameters.
Expected outcome
The example assigns the generated adversarial images to `Adv_img`.
Guide limitations
- The README's snippet uses placeholder
$MODEL_PATH$; choose a local checkpoint path when adapting it. - The example requires the specific model, dataset, device, and dependencies to be available; it does not establish compatibility with other configurations.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 4 November 2026
- Original website title
- DSE-MSU/DeepRobust · Official homepage title · retained in its source language

