Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings
Hossein Mirzaei, Mackenzie W. Mathis
TL;DR
This work tackles adversarially robust OOD detection by proposing AROS, which embeds ID and OOD data into a Lyapunov-stabilized Neural ODE framework to ensure perturbations decay toward distinct stable equilibria. AROS avoids collecting real OOD samples during training by crafting fake OOD embeddings from low-likelihood regions in the ID embedding space and leverages an orthogonal binary layer to maximize equilibrium separation. The approach yields substantial robustness gains against strong attacks (e.g., PGD and AutoAttack) across benchmarks such as CIFAR-10/100 and ImageNet, while maintaining competitive clean performance. The results demonstrate the practical impact of stability theory in neural representations for open-world detection and motivate further exploration with pretrained models and transfer learning to narrow any remaining clean-performance gap.
Abstract
Despite significant advancements in out-of-distribution (OOD) detection, existing methods still struggle to maintain robustness against adversarial attacks, compromising their reliability in critical real-world applications. Previous studies have attempted to address this challenge by exposing detectors to auxiliary OOD datasets alongside adversarial training. However, the increased data complexity inherent in adversarial training, and the myriad of ways that OOD samples can arise during testing, often prevent these approaches from establishing robust decision boundaries. To address these limitations, we propose AROS, a novel approach leveraging neural ordinary differential equations (NODEs) with Lyapunov stability theorem in order to obtain robust embeddings for OOD detection. By incorporating a tailored loss function, we apply Lyapunov stability theory to ensure that both in-distribution (ID) and OOD data converge to stable equilibrium points within the dynamical system. This approach encourages any perturbed input to return to its stable equilibrium, thereby enhancing the model's robustness against adversarial perturbations. To not use additional data, we generate fake OOD embeddings by sampling from low-likelihood regions of the ID data feature space, approximating the boundaries where OOD data are likely to reside. To then further enhance robustness, we propose the use of an orthogonal binary layer following the stable feature space, which maximizes the separation between the equilibrium points of ID and OOD samples. We validate our method through extensive experiments across several benchmarks, demonstrating superior performance, particularly under adversarial attacks. Notably, our approach improves robust detection performance from 37.8% to 80.1% on CIFAR-10 vs. CIFAR-100 and from 29.0% to 67.0% on CIFAR-100 vs. CIFAR-10.
