Papers › Learning with Mixture of Prototypes for Out-of-Distribution Detection

Learning with Mixture of Prototypes for Out-of-Distribution Detection

5 Feb 2024arXiv:2402.02653archive 2025-07-28

Haodong Lu, Dong Gong, Shuo Wang, Jason Xue, Lina Yao, Kristen Moore

Out-of-distribution (OOD) detection aims to detect testing samples far away from the in-distribution (ID) training data, which is crucial for the safe deployment of machine learning models in the real world. Distance-based OOD detection methods have emerged with enhanced deep representation learning. They identify unseen OOD samples by measuring their distances from ID class centroids or prototypes. However, existing approaches learn the representation relying on oversimplified data assumptions, e.g, modeling ID data of each class with one centroid class prototype or using loss functions not designed for OOD detection, which overlook the natural diversities within the data. Naively enforcing data samples of each class to be compact around only one prototype leads to inadequate modeling of realistic data and limited performance. To tackle these issues, we propose PrototypicAl Learning with a Mixture of prototypes (PALM) which models each class with multiple prototypes to capture the sample diversities, and learns more faithful and compact samples embeddings to enhance OOD detection. Our method automatically identifies and dynamically updates prototypes, assigning each sample to a subset of prototypes via reciprocal neighbor soft assignment weights. PALM optimizes a maximum likelihood estimation (MLE) loss to encourage the sample embeddings to be compact around the associated prototypes, as well as a contrastive loss on all prototypes to enhance intra-class compactness and inter-class discrimination at the prototype level. Moreover, the automatic estimation of prototypes enables our approach to be extended to the challenging OOD detection task with unlabelled ID data. Extensive experiments demonstrate the superiority of PALM, achieving state-of-the-art average AUROC performance of 93.82 on the challenging CIFAR-100 benchmark. Code is available at https://github.com/jeff024/PALM.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.02653")

Code

Syntology Ran 7 of 12 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 1 ran · violated contract; 6 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 7 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

jeff024/palm officialmentioned in papermentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 7 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · violated contract
6ran
5unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from jeff024/PALM. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

compute_average_results jeff024/PALM/util/evaluations/metrics.py official repository ran MIT (permissive) · f259e39041e0c932 · report
get_encoder_dim jeff024/PALM/util/loaders/model_loader.py official repository ran MIT (permissive) · b02d7d54e0689e5d · report
get_normalizer jeff024/PALM/util/loaders/data_loader.py official repository ran MIT (permissive) · d017fdfac229b3be · report
get_optimizer jeff024/PALM/util/train_utils.py official repository ran MIT (permissive) · 361914e4b87a86ce · report
get_transform_eval jeff024/PALM/util/loaders/data_loader.py official repository ran MIT (permissive) · 8fccd664858970c5 · report
get_transform_test jeff024/PALM/util/loaders/data_loader.py official repository ran MIT (permissive) · cba4892d1837c843 · report
str2bool jeff024/PALM/util/loaders/args_loader.py official repository ran · violated contract MIT (permissive) · 7c508037b40522af · report
PALM jeff024/palm/util/loss_functions.py official repository unverified MIT (permissive) · ce4297de7af20dcf · report
accuracy jeff024/PALM/util/train_utils.py official repository unverified MIT (permissive) · 913d82af53065418 · report
cal_metric jeff024/PALM/util/evaluations/metrics.py official repository unverified MIT (permissive) · a81c47f74ffdeafe · report
get_criterion jeff024/PALM/util/loaders/model_loader.py official repository unverified MIT (permissive) · 4af821a58b36ebf4 · report
get_curve jeff024/PALM/util/evaluations/metrics.py official repository unverified MIT (permissive) · 7d491ca6c7c6459b · report

Tasks

Out of Distribution (OOD) DetectionOut-of-Distribution DetectionRepresentation Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

PaLM

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections