Relaxing Local Robustness

Klas Leino, Matt Fredrikson

TL;DR

Standard adversarial robustness is often too rigid, forcing models to separate visually similar classes with a hard margin even when a "mistake" between them is acceptable. This paper introduces Relaxed Top-K (RTK) and Affinity Robustness, two flexible frameworks that allow for certifiable guarantees that better align with real-world tasks, significantly boosting verified accuracy while reducing unnecessary rejections.

The Problem with Strict Local Robustness

In the world of deep learning security, "local robustness" is the gold standard. It guarantees that if you take an image $x$, any small perturbation (like adversarial noise) within a certain radius $\epsilon$ will not change the model's prediction. We measure this using Verified Robust Accuracy (VRA)—the percentage of data points that are both correctly classified and provably robust.

However, standard local robustness is often an unnatural objective. Consider an image that contains both a "leopard" and a "jaguar." Forcing the model to maintain a strict margin between these two very similar classes might be unnecessary or even impossible. In many computer vision tasks, we already use "top-k accuracy" (where the model is "correct" if the true label is in the top 5 guesses) because fine-grained distinctions are hard. Standard robustness lacks an analogue for this; it’s all-or-nothing. This mismatch leads to high rejection rates and low VRAs in complex datasets.

Introducing Relaxed Robustness

The authors build upon GloRo Nets (Globally Robust Neural Networks), a method for deterministic $\ell_2$ robustness certification. GloRo Nets use the global Lipschitz constant of a network to calculate a "safety margin." If the gap between the highest logit and the others is large enough, the prediction is certified. If not, the model outputs a "reject" symbol ($\perp$).

To make this more practical, the paper introduces two novel relaxations:

  1. Relaxed Top-K (RTK) Robustness: A point is considered robust if there exists some $k \le K$ such that the set of the top-$k$ predicted classes remains invariant within the $\epsilon$-ball. This is the robustness equivalent of top-$k$ accuracy.
Illustration of top-1 vs top-2 robustness
  1. Affinity Robustness: This allows practitioners to define "affinity sets"—groups of classes that are allowed to be close to each other in the logit space without triggering a rejection. For example, you might group "car" and "truck" together, meaning the model only needs to be robust against flipping a "car" prediction into a "bird" prediction, but not into a "truck" prediction.

Crucially, these properties are baked into the training objective, making certification "essentially free" at runtime—requiring only a single forward pass.

Key Insights and Ideas

  • Robustness is not a Monolith: As illustrated above, "top-1" robustness is not a prerequisite for "top-2" robustness. A model can be robust in its top-1 prediction but fragile in its top-2, or vice versa.
  • Emergent Hierarchies: Interestingly, when models are trained for RTK robustness without any explicit hierarchy, they naturally start grouping logically related classes (e.g., "dolphin" and "whale") together in their "safe" prediction sets.
  • Supervising the Decision Surface: Affinity robustness gives engineers a "knob" to control the model's decision boundaries. By telling the model which classes are "close enough," you can guide the geometry of the decision surface to be more efficient and reduce dead zones.
Decision boundaries showing standard vs. affinity robustness

Key Results

The authors evaluated their approach on datasets where fine-grained labels or overlapping features make standard robustness difficult, such as EuroSAT, CIFAR-100, Tiny-Imagenet, and ACAS Xu. The relaxations led to dramatic improvements in verified performance across the board:

  • EuroSAT: Standard VRA was 74.9%. By moving to RT3 (Relaxed Top-3) robustness, the VRA jumped to 90.8%, and the rejection rate plummeted from 20.4% to just 7.3%. The model correctly identified that "highways" are often confused with "rivers" or "buildings" due to visual similarity, providing a useful guarantee where standard methods simply rejected the input.
  • CIFAR-100: Moving from standard robustness to RT5 increased VRA from 28.1% to 36.0%.
  • Clean Accuracy Boost: Training with relaxed objectives also improved "clean" (non-robust) accuracy. On CIFAR-100, the RT5 model achieved 70.6% accuracy compared to the standard robust model's 47.3%.
  • Efficiency Gains: For the ACAS Xu safety properties, Affinity GloRo Nets could certify "targeted safe regions" in a single forward pass, whereas traditional formal verification methods can take hours.

Limitations and Future Work

While highly effective, the method relies on calculating the Lipschitz constant. If this bound is loose, the model will still over-reject points. Tighter bounds would improve results further. Additionally, the current implementation focuses on the $\ell_2$ norm, leaving extensions to other threat models (like $\ell_\infty$ or geometric transformations) as an open area. Finally, while Affinity sets are powerful, they currently require manual definition; future work could explore ways to automatically discover optimal affinity sets during training.

Summary updated

BibTeX
@inproceedings{leino2021relaxing,
  author = {Klas Leino and Matt Fredrikson},
  title = {{Relaxing Local Robustness}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=ahrSWZgjkg},
}
Figure