SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.00865 · ICLR · 2024

Towards Optimal Feature-Shaping Methods for Out-of-Distribution Detection

Kartik Gupta, Liang Zheng, Stephen Gould, Ming Xu, Qinyu Zhao, Akshay Asthana

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 2 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2402.00865.json · badge: /api/ran/2402.00865.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
qinyu-allen-zhao/optfsood canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
FunctionStatusWhere it lives
np2th Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
qinyu-allen-zhao/optfsood/model/mlp_mixer.py
pointer only (licence: NONE) · get_code("7d8eaf5537f699e4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, qinyu-allen-zhao/optfsood when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

checkpoint_filter_fn Ran
ran; our contract draft was wrong, not the code
qinyu-allen-zhao/optfsood/model/vit_cifar.py
pointer only (licence: NONE) · get_code("9346577c5a71350d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, qinyu-allen-zhao/optfsood when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

conv1x1 Ran
ran; our contract draft was wrong, not the code
qinyu-allen-zhao/optfsood/model/resnet.py
pointer only (licence: NONE); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("2a80220dabcb742a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, qinyu-allen-zhao/optfsood when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

conv3x3 Ran
ran; our contract draft was wrong, not the code
qinyu-allen-zhao/optfsood/model/resnet.py
pointer only (licence: NONE); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("600ff2c45e0de056")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, qinyu-allen-zhao/optfsood when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_init_weights_vit Ran
ran; our contract draft was wrong, not the code
qinyu-allen-zhao/optfsood/model/vit_cifar.py
pointer only (licence: NONE) · get_code("b5dbfbeaf3d26a90")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, qinyu-allen-zhao/optfsood when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

resize_pos_embed Not yet run
unverified (harvested, no recorded run)
qinyu-allen-zhao/optfsood/model/vit_cifar.py
pointer only (licence: NONE) · get_code("ed04551ca8295bde")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, qinyu-allen-zhao/optfsood when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

shifted_window_attention Not yet run
unverified (harvested, no recorded run)
qinyu-allen-zhao/optfsood/model/swin.py
pointer only (licence: NONE) · get_code("4f6b58a81890f15c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, qinyu-allen-zhao/optfsood when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 6 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 2 the same month, 5 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
conv1x1 112 other papers
67 dated earlier, 3 the same month, 38 later, 4 same year, order not determinable · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 109 more not named here
conv3x3 111 other papers
68 dated earlier, 3 the same month, 36 later, 4 same year, order not determinable · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 108 more not named here
np2th 35 other papers
30 dated earlier, 4 later, 1 same year, order not determinable · 5 only as an assembly brick
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2102.04306 (2021-02)
TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
2103.07976 (2021-03)
TransFG: A Transformer Architecture for Fine-grained Recognition
and 32 more not named here
get_init_weights_vit 25 other papers
13 dated earlier, 12 later · 1 only as an assembly brick
2112.08654 (2021-12)
Learning to Prompt for Continual Learning
2207.12819 (2022-07)
S-Prompts Learning with Pre-trained Transformers: An Occam's Razor for Domain Incremental Learning
2210.08823 (2022-10)
Scaling & Shifting Your Features: A New Baseline for Efficient Model Tuning
and 22 more not named here
resize_pos_embed 3 other papers
3 later
2407.20171 (2024-07)
Diffusion Feedback Helps CLIP See Better
2409.10956 (2024-09)
Versatile Incremental Learning: Towards Class and Domain-Agnostic Incremental Learning
2409.17978 (2024-09)
HydraViT: Stacking Heads for a Scalable ViT
shifted_window_attention 1 other paper
1 dated earlier
2311.17243 (2023-11)
PHG-Net: Persistent Homology Guided Medical Image Classification

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Feature shaping refers to a family of methods that exhibit state-of-the-art performance for out-of-distribution (OOD) detection. These approaches manipulate the feature representation, typically from the penultimate layer of a pre-trained deep learning model, so as to better differentiate between in-distribution (ID) and OOD samples. However, existing feature-shaping methods usually employ rules manually designed for specific model architectures and OOD datasets, which consequently limit their generalization ability. To address this gap, we first formulate an abstract optimization framework for studying feature-shaping methods. We then propose a concrete reduction of the framework with a simple piecewise constant shaping function and show that existing feature-shaping methods approximate the optimal solution to the concrete optimization problem. Further, assuming that OOD data is inaccessible, we propose a formulation that yields a closed-form solution for the piecewise constant shaping function, utilizing solely the ID data. Through extensive experiments, we show that the feature-shaping function optimized by our method improves the generalization ability of OOD detection across a large variety of datasets and model architectures. 1

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2402.00865")
get_code_for_paper("2402.00865")
have("2402.00865")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2402.00865.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2402.00865.svg)](https://syntology.ai/paper/2402.00865)

Connect an agent — have() is free.