AROS: Adversarially Robust Out-of-Distribution Detection through Stability
Project description
AROS: Adversarially Robust Out-of-Distribution Detection through Stability
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.
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
- 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.
- 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 -r requirements.txt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aros_node-0.0.1rc1.tar.gz
.
File metadata
- Download URL: aros_node-0.0.1rc1.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e6f15b4f001a0cf30b27d64b7c461b2b340d5723e43843a3db7af796f7af0b6 |
|
MD5 | fd0e44295eba50d56bfad915097dd088 |
|
BLAKE2b-256 | 4404f3792151bf1a243cabab65941f00241c1d2269321dc9ad0bc8b3590916d8 |
File details
Details for the file aros_node-0.0.1rc1-py3-none-any.whl
.
File metadata
- Download URL: aros_node-0.0.1rc1-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ff44653e784ae8b4dd86e9d95bcc75a3f6f3dbeb62e72e8df93f5aa041fef10 |
|
MD5 | 32acdee6085c442bf2fbb637248a107d |
|
BLAKE2b-256 | 52446aec0470468ddcf79e64a03a7254ca8c82f96e5e41b9ae2ef4eab95840d1 |