Home

Awesome

Energy-based Hopfield Boosting for Out-of-Distribution Detection

arXiv License: MIT

This is the official implementation of "Energy-based Hopfield Boosting for Out-of-Distribution Detection". The paper is available here.

https://github.com/claushofmann/hopfield-classifier/assets/23155858/83021bdf-755b-4e79-8b52-4dc999cbc56f

Installation

Weights and Biases

Data Sets

To run, you need the following data sets. We follow the established benchmark, which is also used by e.g. Lui et al. (2020) and Ming et al. (2022).

In-Distribution Data Sets

Auxiliary Outlier Data Set

Out-of-Distribution Validation Data Sets

Out-of-Distribution Test Data Sets

The OOD test data is comprised of a selection of vision data sets:

We have included a Python script that conveniently downloads all OOD Test data sets. To execute it, simply run

python -m hopfield_boosting.download_data

The downloaded data sets will be placed in the currently active directory under downloaded_datasets/.

How to Run

📓 Demo Notebook

We have provided a demo notebook here where we demonstrate the capability of Hopfeild Boosting to detect OOD inputs. We provide a pre-trained model trained on CIFAR-10 for running the notebook, which is available for download here.

To run, first set the paths to the data sets and the model in hopfield_boosting_notebook_config.yaml. The notebook uses additional data sets. You can find the link to download these data sets in the notebook itself.

📚 Citation

If you found this repository helpful, consider giving it a ⭐ and cite our paper:

@article{hofmann2024energybased,
      title={Energy-based Hopfield Boosting for Out-of-Distribution Detection}, 
      author={Claus Hofmann and Simon Schmid and Bernhard Lehner and Daniel Klotz and Sepp Hochreiter},
      year={2024},
      journal={arXiv preprint arXiv:2405.08766}
}