Skip to main content

AROS: Adversarially Robust Out-of-Distribution Detection through Stability

Project description

AROS: Adversarially Robust Out-of-Distribution Detection through Stability

PyPI version PyPI Downloads License: Apache 2.0 Paper

Overview

This repository contains the code for the paper "Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings". The method, termed AROS, employs Neural Ordinary Differential Equations (NODEs) with Lyapunov stability to create robust embeddings for OOD detection, significantly improving performance against adversarial attacks. This repository contains the code for the paper "Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings". The method, termed AROS, employs Neural Ordinary Differential Equations (NODEs) with Lyapunov stability to create robust embeddings for OOD detection, significantly improving performance against adversarial attacks. Additionally, the repository includes two notebooks: one demonstrates the training and evaluation process on the CIFAR-10 and CIFAR-100 datasets, while the other focuses on the ablation study.

AROS

Publication

AROS 💍 is accepted to the International Conference on Learning Representations 2025 (ICLR 2025)!

@article{mirzaei2025aros,
      title={Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings}, 
      author={Hossein Mirzaei and Mackenzie W. Mathis},
      year={2025},
      journal={The Thirteenth International Conference on Learning Representations},
      url={https://openreview.net/forum?id=GrDne4055L}, 
}

Preprint

Check out our preprint now out on arXiv! Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings. Hossein Mirzaeri & Mackenzie W. Mathis. Oct 2024.

Key Features

  • Lyapunov Stability for OOD Detection: Ensures that perturbed inputs converge back to stable equilibrium points, improving robustness against adversarial attacks.
  • Fake Embedding Crafting Strategy: Generates fake OOD embeddings by sampling from the low-likelihood regions of the ID data feature space, eliminating the need for additional OOD datasets.
  • Orthogonal Binary Layer: Enhances separation between ID and OOD embeddings, further improving robustness.

Demo

  • Open In Colab This notebook is designed to replicate and analyze the results presented in Table 1 of the AROS paper, focusing on out-of-distribution detection performance under both attack scenarios and clean evaluation.
  • Open In Colab This notebook is designed to demo the ablation study.

Repository Structure

  • AROS/
    • data_loader.py: Contains the data loading utilities for training and evaluation.
    • evaluate.py: Implements the evaluation metrics and testing routines for the AROS model.
    • Main.py: The main script for training and testing AROS, combining all components.
    • stability_loss_function.py: Defines the Lyapunov-based loss function used for stabilizing the NODE dynamics.
    • utils.py: Includes various helper functions used throughout the project.
  • requirements.txt: Lists the dependencies required to run the project.
  • Notebooks/
    • AROS.ipynb
    • Notebooks/Ablation_Study.ipynb

Installation

To install the necessary packages, run:

pip install git+https://github.com/RobustBench/robustbench.git
pip install aros-node

To install the necessary packages from source (locally), run:

pip install -r requirements.txt

Citations

ICLR:

@article{mirzaei2025aros,
      title={Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings}, 
      author={Hossein Mirzaei and Mackenzie W. Mathis},
      year={2025},
      journal={The Thirteenth International Conference on Learning Representations},
      url={https://openreview.net/forum?id=GrDne4055L}, 
}

arXiv:

@article{mirzaei2024aros,
      title={Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings}, 
      author={Hossein Mirzaei and Mackenzie W. Mathis},
      year={2024},
      eprint={2410.10744},
      journal={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2410.10744}, 
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aros_node-0.0.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aros_node-0.0.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file aros_node-0.0.1.tar.gz.

File metadata

  • Download URL: aros_node-0.0.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for aros_node-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f075ba24dd4dbd4324efcbb369ec1f4c06577130424d1a00b7539a6a297130fc
MD5 a4ac059f079ea63cc05e8c1954fc1685
BLAKE2b-256 75af50a112e931130c4dcd94555ad1d872fa8352b2da71d9694fd5a063831ab7

See more details on using hashes here.

File details

Details for the file aros_node-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: aros_node-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for aros_node-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71ad884b144a7c5ca1d27e0dcca3f140801e7eb6a349bd454278f58a3665e576
MD5 6b641d42b1fc1ae74989c5b7b8730f9a
BLAKE2b-256 b60a899104950a54250439bd3df398e2150e30810d62abf5a6e59cab080c99b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page