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

Out-of-distribution (OOD) detection is critical when deploying machine learning models in the real world. Outlier exposure methods, which incorporate auxiliary outlier data in the training process, can drastically improve OOD detection performance compared to approaches without advanced training strategies. We introduce Hopfield Boosting, a boosting approach, which leverages modern Hopfield energy (MHE) to sharpen the decision boundary between the in-distribution and OOD data. Hopfield Boosting encourages the model to concentrate on hard-to-distinguish auxiliary outlier examples that lie close to the decision boundary between in-distribution and auxiliary outlier data. Our method achieves a new state-of-the-art in OOD detection with outlier exposure, improving the FPR95 metric from 2.28 to 0.92 on CIFAR-10 and from 11.76 to 7.94 on CIFAR-100.

Paper

References (95)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer BR8F7/10 · confidence 4/52024-07-07

Summary

The authors introduce Hopfield Boosting for addressing the out-of-distribution detection task. This algorithm trains a model with two heads: one for normal classification and the other for assigning an out-of-distribution score. The OOD score head maintains a list of in-distribution samples and out-of-distribution samples. It uses a modern Hopfield network to leverage the similarity between the inference sample and stored samples to assign the OOD score. They further improve their performance by first identifying OOD samples that are near the border of the decision boundary using an MHE-based energy function. Then, they use these samples as OOD samples for the OOD score head instead of all auxiliary OOD samples. They evaluated their method on CIFAR-10 and ImageNet-1k and achieved state-of-the-art results.

Strengths

1. Large-scale experiment on ImageNet. 2. Novel use of Hopfield Boosting. 3. Good toy examples that clearly illustrate their point. 4. Low computation requirement.

Weaknesses

1. Only 32x32 images were used. 2. OE methods generally require auxiliary OOD data. As a result, evaluation on a dataset that does not have common classes with the auxiliary OOD dataset is crucial to assess the method's generalization.

Questions

1. What is the relation between ImageNet-21k, which is used as auxiliary OOD data, and the OOD data used for testing? How many semantically similar classes does ImageNet-21k share with each of them? If it shares a considerable number of classes, a test dataset that shares fewer semantically similar classes would be helpful. 2. ImageNet augmentation: Please explain the augmentation used on in-distribution data for ImageNet. Is it the same as mentioned in line 970? Random cropping to 32x32 for images that are very large, like those in ImageNet-1k, seems unreasonable as 32x32 parts of the image 3. may not contain any meaningful object. Could you provide some examples of in-distribution images post-augmentation? 4. Can you provide the accuracy of classification head of the network? 5. What is the reason for cropping images to 32x32 in the ImageNet-1k case? Why not use the more common 224x224 image size?

Rating

7

Confidence

4

Soundness

3

Presentation

4

Contribution

3

Limitations

The authors presented the limitations of their work in section H.6, which could suggest that their method lacks generalization in at least some areas.

Reviewer UgW18/10 · confidence 4/52024-07-12

Summary

A novel method for identifying OOD samples is presented using Hopfield boosting. A classifier is trained using a loss function which sharpens the decision boundary between inlier and outlier data samples, where outlier data samples are purposefully drawn from an auxiliary dataset. By sampling examples close to the decision boundary and determining the modern hopfield energy of the sample, the decision boundary is adjusted to exclude OOD samples from the auxilliary dataset. The method is demonstrated twice using a low resolution and high resolution example. In both examples, the Hopfield boosting method outperforms state of the art on average. An extensive appendix includes additional background, theoretical results, and experimental results.

Strengths

The method is original, theoretically sound, and useful. The results are clearly presented, to the point where a reader may be able to implement the algorithm without referencing the provided code. The research question is impactful, and the result presented in this paper is a theoretical and experimental advancement in the field.

Weaknesses

The primary weakness is that the paper does not conclusively show that the method does not lead to overfitting. The models are trained with a classification loss, but the authors state "the toy example does not consider the inlier classification task that would induce secondary processes, which would obscure the explanations." However, failure to report these results in the context of the decision boundary refinements shown in Figure 2, 3b and 6 opens the work to questions of model overfitting. This concern is only partially lifted by near perfect results on the test datasets. Because the false positive rate (FPR) is reported with respect to an OOD test dataset, there is a question of whether the model is losing in-distribution detections. Robustness to OOD samples of the original dataset, robustness to adversarial instances, and catastrophic forgetting are all implicated in the sharpening of decision boundaries; this work avoids acknowledging these cases and prevents inference about the implications by omitting the classifier performance for the trained models. This can be resolved by reporting the model F1 scores in the appendix for the ID classification task. If the models were trained using the Hopfield Boosting alone, then this would not be necessary. But the presence of the classifier loss means the secondary effects have implications for the semantic meaning of the decision boundary.

Questions

1. How do these results compliment/contrast with results suggesting that a smooth decision boundary is more robust to adversarial samples? See for example [Anderson (2022)](https://proceedings.mlr.press/v168/anderson22a) 2. Most computer vision datasets are expected to have some features in common, which motivates transfer learning techniques. What justification was used to determine that the test datasets would be strictly OOD w.r.t. the training datasets CIFAR or ImageNet? 3. Is there any analysis which shows that the decision boundaries sharpened during Hopfield Boosting are semantically meaningful, and not based on noise of the dataset? 4. The ResNet-50 model is fine-tuned rather than trained from scratch; what dataset was used to train the pre-initialized weights? Why was the model not trained from scratch? Because the feature space was already formed (4 epochs is not enough to significantly shift the model), does this imply that the model classification layer is likely identifying noise?

Rating

8

Confidence

4

Soundness

4

Presentation

4

Contribution

4

Limitations

Please see the questions above. The remaining limitations are thoroughly addressed in the work.

Authorsrebuttal2024-08-07

Hopfield Boosting ID Classification Results CIFAR-10

We provide the detailed ID classification results (including the F1 scores) of a model trained using Hopfield Boosting on CIFAR-10: ``` precision recall f1-score support 0 0.934 0.947 0.940 1000 1 0.961 0.974 0.967 1000 2 0.928 0.914 0.921 1000 3 0.860 0.873 0.867 1000 4 0.933 0.950 0.942 1000 5 0.881 0.892 0.886 1000 6 0.963 0.955 0.959 1000 7 0.978 0.947 0.962 1000 8 0.961 0.961 0.961 1000 9 0.967 0.949 0.958 1000 accuracy 0.936 10000 macro avg 0.937 0.936 0.936 10000 weighted avg 0.937 0.936 0.936 10000 ```

Reviewer UgW12024-08-09

I thank the authors for their attention to the weaknesses of the paper and reporting the ID results. My concerns are addressed.

Reviewer DQmw6/10 · confidence 5/52024-07-12

Summary

- The paper introduces a novel approach to improve OOD detection by leveraging modern Hopfield energy. The proposed method, called Hopfield Boosting, utilizes auxiliary outlier data to refine the decision boundary between ID and OOD data. By focusing on hard-to-distinguish auxiliary outlier samples near the decision boundary, the method enhances the ability to detect OOD samples.

Strengths

- The incorporation of modern Hopfield energy and auxiliary outlier data for OOD detection is interesting. The method effectively sharpens the decision boundary between ID and OOD data by utilizing the energy measure, which quantifies dissimilarity between data instances and stored patterns. By sampling informative outliers close to the decision boundary, Hopfield Boosting ensures that the model learns a more precise boundary, leading to better OOD detection performance. - The proposed method achieves significant improvements in OOD detection metrics compared to existing methods.

Weaknesses

- The experimental results in Table 3 show that the effect of weighted sampling is not very significant. Despite this, the proposed method still outperforms existing approaches. It is unclear whether these performance gains are primarily due to the model's structure (two heads for classification and energy computation), the OOD score defined in Equation (13), or the proposed $L\_{OOD}$. This ambiguity makes it difficult to pinpoint the key factors contributing to the improved performance and understand the true efficacy of each component of the proposed method. More detailed ablation studies are needed to disentangle and evaluate the contributions of these individual components. - The paper lacks a detailed explanation of how the hyperparameter $\beta$ is determined. While it is mentioned that $\beta$ is selected through a validation process, the specific metrics or criteria used to decide the optimal value are not discussed. Providing a clear methodology for $\beta$ selection, including the validation metrics used, would enhance the reproducibility and transparency of the proposed approach. - There is a need for discussion regarding the impact of the proposed method on in-distribution (ID) accuracy. The proposed method could potentially negatively affect the performance of the classification head, which would undermine its overall utility. Addressing how the method influences ID accuracy and providing empirical evidence to show that it does not significantly degrade classification performance is crucial for establishing the method's efficacy and practical value.

Questions

The questions related to the methodology and experimental results have been addressed in the Weaknesses section.

Rating

6

Confidence

5

Soundness

2

Presentation

3

Contribution

3

Limitations

The authors have adequately discussed the limitations of their work.

Reviewer qRFa6/10 · confidence 4/52024-07-12

Summary

This paper addresses the crucial task of out-of-distribution (OOD) detection, essential for the safe deployment of machine learning models in real-world scenarios. Within the domain of OOD detection, outlier exposure methods, which use auxiliary outlier data during training, have shown significant improvements in OOD detection performance. In this paper, the authors introduce Hopfield Boosting, a boosting approach that utilizes modern Hopfield energy together with the OOD data to refine the decision boundary between in-distribution (ID) and OOD data. By focusing on hard-to-distinguish auxiliary outlier examples near the decision boundary, Hopfield Boosting enhances the model's ability to differentiate between ID and OOD data. The authors of the paper demonstrates the effectiveness of the proposed method empirically with several benchmark datasets.

Strengths

- The paper is mostly well written and easy to follow. - The proposed method is technically sound. - Authors of the paper carry out ample experiments. - The proposed method achieves good performance.

Weaknesses

- A major complaint I have for the paper is the lack of novelty. As mentioned by the authors of the paper in Section 3.4, the proposed method is an incremental extension of the prior work which also proposed to use Hopfield Energy for OOD detection. The main difference lies in the fact that the proposed method also utilizes auxiliary OOD data. Despite the effectiveness of the proposed method, outlier exposure is a well understood method to enhance the effectiveness of OOD detection, and it is not surprising to me that utilizing OOD data with Hopfield Energy enhances the effectiveness of the proposed method.

Questions

- The paper introduces the MHE-based energy function to combine OOD data with Hopfield Energy. Would it be possible to leverage OOD data in other ways so that it is more similar to HE or SHE in the prior work [1]? If so, how does the proposed method compare to such a naive way of combining HE/SHE with outlier exposure? I think an ablation study like this would help strengthen the novelty of the paper. - It was stated that 50k samples were used during inference to compute the OOD score. How much better/worse does the proposed method get when we vary the number of samples used? - What if IN and OOD data are highly imbalanced? [1] "Out-of-distribution detection based on in-distribution data patterns memorization with modern Hopfield energy"

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

Yes the authors of the paper adequately addressed the limitations.

Reviewer DQmw2024-08-09

Thank you for the rebuttal. My concerns have been sufficiently addressed, so I raised the score to 6.

Reviewer BR8F2024-08-09

Thank you for the rebuttal. My concerns have been addressed, so I will raise my score to 7. I believe it is crucial that you provide augmentation details for both in-distribution (ID) and out-of-distribution (OOD) data, or at least reference a work that explains them in detail. This is important because datasets sometimes require different augmentation techniques for ID and OOD data, which can result in different types of artifacts in the images. Models are very adept at picking up on these artifacts and may base their predictions on them.

Authorsrebuttal2024-08-09

We thank the reviewer for the response/hints. We agree with this sentiment and also think that it is imperative to include a detailed description of the pre-processing steps.

Reviewer qRFa2024-08-09

I would like to thank the authors for addressing my concerns. I have updated my score to 6 upon reading other reviews and the rebuttal.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC