Abstract
Linear relaxation based perturbation analysis (LiRPA) for neural networks, which computes provable linear bounds of output neurons given a certain amount of input perturbation, has become a core component in robustness verification and certified defense. The majority of LiRPA-based methods focus on simple feed-forward networks and need particular manual derivations and implementations when extended to other architectures. In this paper, we develop an automatic framework to enable perturbation analysis on any neural network structures, by generalizing existing LiRPA algorithms such as CROWN to operate on general computational graphs. The flexibility, differentiability and ease of use of our framework allow us to obtain state-of-the-art results on LiRPA based certified defense on fairly complicated networks like DenseNet, ResNeXt and Transformer that are not supported by prior works. Our framework also enables loss fusion, a technique that significantly reduces the computational complexity of LiRPA for certified defense. For the first time, we demonstrate LiRPA based certified defense on Tiny ImageNet and Downscaled ImageNet where previous approaches cannot scale to due to the relatively large number of classes. Our work also yields an open-source library for the community to apply LiRPA to areas beyond certified defense without much LiRPA expertise.
Introduction
Neural networks are notoriously vulnerable to adversarial attacks—tiny, often invisible changes to inputs that completely flip the model's prediction. "Certified robustness" attempts to solve this by mathematically guaranteeing that a network's output will not change under a certain bounded amount of input perturbation.
A leading method for computing these guarantees is Linear Relaxation based Perturbation Analysis (LiRPA). However, LiRPA has historically suffered from two massive bottlenecks:
- Manual Derivation: Researchers had to manually derive and implement complex mathematical bounds for every new network architecture, limiting its use mostly to simple feed-forward networks.
- Poor Scalability: The computational cost of LiRPA scaled linearly with the number of output classes, making it virtually impossible to use on datasets with hundreds or thousands of labels (like ImageNet).
This paper introduces an automatic framework for LiRPA, allowing researchers to compute provable robustness bounds for any neural network architecture without manual mathematical derivations.
Methodology
The authors treat bound propagation much like how modern deep learning frameworks treat gradient backpropagation, abstracting it into an automatic, differentiable process on computational graphs.
Automatic Bound Propagation on DAGs
The framework generalizes LiRPA to operate on any general Directed Acyclic Graph (DAG). Given a model (e.g., in PyTorch), the algorithm automatically traverses the computational graph to compute linear bounds for output neurons. This "Auto-Diff for Robustness" approach democratizes the tool for non-experts.
Loss Fusion
Loss fusion is the paper's most critical algorithmic contribution. Previously, to train a robust model, researchers had to compute bounds for every single output logit (class), which is incredibly slow for datasets with many classes. Loss fusion treats the loss function itself (e.g., cross-entropy) as the final node in the computational graph. By applying LiRPA directly to the loss function, the output dimension drops from $K$ (number of classes) to $1$. This reduces the asymptotic time complexity to match a standard forward pass, making certified training only 3 to 4 times slower than standard training.
Experimental Results
The framework was evaluated on various datasets including CIFAR-10, Tiny-ImageNet (200 classes), and Downscaled ImageNet (1000 classes), as well as NLP tasks like SST-2.
Key results include:
- State-of-the-Art Vision Robustness: Achieved a verified error of 66.62% on CIFAR-10 (at $\epsilon=8/255$).
- Scalability: Successfully trained certifiably robust models on Tiny ImageNet and Downscaled ImageNet for the first time.
- Complex Architectures: Successfully applied certified defenses to complex models like DenseNet, ResNeXt, LSTMs, and Transformers.
Conclusion and Beyond Certified Robustness
Because the framework can perturb any independent node in the graph, it can handle discrete perturbations (like synonym substitutions in text) and even network weights. The authors demonstrated this by training a network with a provably "flat" optimization landscape, offering a novel way to test deep learning theories about flatness and generalization.
While loss fusion makes LiRPA vastly more efficient, it remains slower and more memory-intensive than standard training. Future work includes exploring forward mode LiRPA for generative models and applying the open-source auto_LiRPA library to safety-critical real-world systems.
Summary updated