Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Notebooks/AROS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"outputs": [],
"source": [
"!git clone https://github.com/MMathisLab/AROS.git"
"!git clone https://github.com/AdaptiveMotorControlLab/AROS"
]
},
{
Expand All @@ -57,9 +57,8 @@
},
"outputs": [],
"source": [
"%cd /content/AROS\n",
"%ls\n",
"!pip install -r requirements.txt"
"!pip install -r ./AROS/requirements.txt\n",
"cd ./AROS/AROS"
]
},
{
Expand Down
62 changes: 44 additions & 18 deletions Notebooks/Ablation_Study.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,52 @@
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/AdaptiveMotorControlLab/AROS/blob/main/Notebooks/Ablation_Study.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"source": [
"## AROS, Ablation Study"
],
"metadata": {
"id": "G1Ues10_fww5"
}
},
"source": [
"## AROS, Ablation Study"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!git clone https://github.com/AdaptiveMotorControlLab/AROS"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install -r ./AROS/requirements.txt\n",
"cd ./AROS/AROS"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import argparse\n",
"import torch\n",
"import torch.nn as nn\n",
"from tqdm.notebook import tqdm"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -91,10 +122,6 @@
}
],
"source": [
"!pip install -r requirements.txt\n",
"import argparse\n",
"import torch\n",
"import torch.nn as nn\n",
"from evaluate import *\n",
"from utils import *\n",
"from tqdm.notebook import tqdm\n",
Expand All @@ -112,8 +139,7 @@
"source": [
"parser = argparse.ArgumentParser(description=\"Hyperparameters for the script\")\n",
"\n",
"# Define the hyperparameters controlled via CLI 'Ding2020MMA'\n",
"\n",
" \n",
"parser.add_argument('--in_dataset', type=str, default='cifar100', choices=['cifar10', 'cifar100'], help='The in-distribution dataset to be used')\n",
"parser.add_argument('--threat_model', type=str, default='Linf', help='Adversarial threat model for robust training')\n",
"parser.add_argument('--noise_std', type=float, default=1, help='Standard deviation of noise for generating noisy fake embeddings')\n",
Expand Down Expand Up @@ -144,14 +170,14 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "g2TltXvg7MfF",
"outputId": "4df864e7-e14b-4db4-e1ae-06e33c9b11be",
"colab": {
"referenced_widgets": [
"59296a90b8c84b1c94648a4c5d68a43b",
"ad54c341af6e400280d000b3725f08ee"
]
}
},
"id": "g2TltXvg7MfF",
"outputId": "4df864e7-e14b-4db4-e1ae-06e33c9b11be"
},
"outputs": [
{
Expand Down Expand Up @@ -217,14 +243,14 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "QeC-30C5ImKg",
"outputId": "793be5f3-3307-4a3d-8e5f-177ac212d30a",
"colab": {
"referenced_widgets": [
"c9c97585bef049ca9974797d1d5964ab",
"97f0832ab970458f947318195735214b"
]
}
},
"id": "QeC-30C5ImKg",
"outputId": "793be5f3-3307-4a3d-8e5f-177ac212d30a"
},
"outputs": [
{
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@
## 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. An example of training and evaluation of the model on the CIFAR-10 and CIFAR-100 of both benchmark is available in this
[notebook](https://colab.research.google.com/drive/1-VrfWbnlW_2x_lybVfyCD70OOEelrSYB?usp=sharing), along with a notebook detailing the ablation study provided [here](https://colab.research.google.com/drive/1SdSQpXeEoZnlQww-gvec9aJxK1CiPFjl?usp=sharing
).





![AROS](https://github.com/user-attachments/assets/dd5d5dd9-2650-4746-9983-5abf6d7eedfc)
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.
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
geotorch
torchdiffeq
git+https://github.com/RobustBench/robustbench.git
git+https://github.com/RobustBench/robustbench.git
timm==1.0.9