Add ORA postprocessor#311
Open
berkerdemirel wants to merge 3 commits into
Open
Conversation
ORA (OOD detection with Relative Angles) projects each test feature onto every class's decision boundary using the linear classifier weights, then scores the sample by the maximum angle between the feature and its boundary projection (both centred at the mean of the per-class training feature means). It is a post-hoc detector that needs only the ID training loader for setup and exposes no tunable hyperparameters. Method published at NeurIPS: https://github.com/berkerdemirel/ORA-OOD-Detection-with-Relative-Angles Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds ORA (OOD detection with Relative Angles, NeurIPS 2025) as a new post-hoc OOD postprocessor.
For each test feature, ORA projects it onto every class's decision boundary using the linear classifier weights, then measures the angle between the
feature and its boundary projection — both centered at the mean of the per-class training feature means. The per-class angles are aggregated into a
single OOD score; the postprocessor exposes
aggregation∈ {mean,max,min}.Reference implementation: https://github.com/berkerdemirel/ORA-OOD-Detection-with-Relative-Angles
Changes
openood/postprocessors/ora_postprocessor.py— newORAPostprocessor(BasePostprocessor).setup()streamsid_loader_dict['train']once to computeper-class feature means;
postprocess()returns(pred, score)wherescoreis the max relative angle across classes.configs/postprocessors/ora.yml— minimal config,APS_mode: False, no sweep.openood/postprocessors/__init__.py,openood/postprocessors/utils.py— register'ora': ORAPostprocessor.README.md— add ORA to the post-hoc methods list.