Skip to content

Add ORA postprocessor#311

Open
berkerdemirel wants to merge 3 commits into
Jingkang50:mainfrom
berkerdemirel:add-ora-postprocessor
Open

Add ORA postprocessor#311
berkerdemirel wants to merge 3 commits into
Jingkang50:mainfrom
berkerdemirel:add-ora-postprocessor

Conversation

@berkerdemirel
Copy link
Copy Markdown

@berkerdemirel berkerdemirel commented May 11, 2026

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 — new ORAPostprocessor(BasePostprocessor). setup() streams id_loader_dict['train'] once to compute
    per-class feature means; postprocess() returns (pred, score) where score is 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.

berkerdemirel and others added 3 commits May 11, 2026 11:37
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant