Class-Specific Thresholding for Heterogeneous Feature Distributions

41 concepts22 papers1 proposal

In many core machine learning tasks—such as open-set recognition, anomaly detection, and biometric verification—a model must decide not just which class an input belongs to, but whether it belongs to a known class at all. Traditionally, this "pass/fail" decision relies on a single global threshold applied uniformly across all categories.

However, a global threshold assumes that all classes occupy identically sized, perfectly uniform, and equally dense regions in the feature space. In reality, real-world semantic categories exhibit massive heterogeneity in their internal diversity. Applying a uniform threshold forces a false dichotomy: the boundary will either be too restrictive for highly diverse classes or too lenient for highly uniform ones.

To resolve this, a prominent research direction replaces rigid global decision boundaries with localized, class-specific thresholds. By tailoring boundaries to the unique statistical distribution and variance of each individual category, models achieve significantly higher precision and robustness.

The Failure of the One-Size-Fits-All Boundary

To understand why global thresholds fail, consider the geometric layout of a deep neural network's embedding space. Different classes naturally occupy regions of vastly different sizes and densities. As noted by Xiang Fang et al. in Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribution Detection, a visually consistent category (such as a specific breed of cat) occupies a tight, compact cluster, while a highly diverse category (such as "ox" or "furniture") spreads across a much larger volume.

When a model uses a single global threshold to detect anomalies or out-of-distribution (OOD) samples, it creates severe classification errors:

  • Over-rejection: Valid but high-variance samples belonging to a broad category are discarded as outliers because they fall outside the narrow global boundary.
  • Under-rejection: Anomalies or unknown objects are mistakenly accepted into a tight category because the global threshold is too loose to protect that specific class's boundaries.

This limitation spans multiple domains. In computer vision, Fausto Giunchiglia et al. point out in Towards Visual Semantics that uniform similarity thresholds fail because the visual features defining identity vary drastically across different object classes. Similarly, in multi-class industrial anomaly detection, Jaehyuk Heo et al. demonstrate in Multi-class Image Anomaly Detection for Practical Applications: Requirements and Robust Solutions that the normal range of feature variance differs significantly between product types, making a single global threshold highly ineffective.

Tailoring Boundaries to Local Geometry

Class-specific thresholding solves this problem by calibrating the decision boundary to the local density and intra-class variance of each category. Instead of drawing a single large circle around all known data, the model draws custom-fit boundaries around each individual class cluster.

Global Thresholding (Suboptimal)         Class-Specific Thresholding (Optimal)

     +---------+                              +---+    
     |  O   O  |                              |O O|    
     |   O     |                              +---+    
     |      X  | <--- False Acceptance          X      <--- Correct Rejection
     |         |                              +-------+
     | O   O   |                              |O   O  |
     |   O   O |                              |  O   O|
     +---------+                              +-------+

In open-set scenarios, where a system must flag entirely unseen categories, this localized approach is vital. Fabio Cermelli et al. show in Boosting Deep Open World Recognition by Clustering that optimizing unique distance boundaries for every category prevents the overlap that occurs when a single manual threshold is forced onto diverse object types.

By adjusting the boundary to match the cluster's radius, the model ensures that the distance required to reject an unknown sample is proportional to the density of the nearest known category. For instance, Guoliang Kang et al. leverage this in Attract or Distract: Exploit the Margin of Open Set by utilizing adaptive margins that reflect the internal radius of individual class clusters, ensuring precise feature separation between knowns and unknowns.

Mechanisms for Setting Local Thresholds

Researchers have developed several distinct strategies to calculate and update these class-specific boundaries:

1. Statistical and Quantile-Based Estimation

Thresholds can be derived directly from the empirical distribution of the training data. In Robust tactile object recognition in open-set scenarios using Gaussian prototype learning, Wendong Zheng et al. set individual rejection criteria based on the maximum distance of training samples from their respective class prototypes.

For more complex distributions, quantiles offer a robust alternative. Joona Kareinen et al. demonstrate in Open-Set Plankton Recognition that deriving thresholds from feature distribution quantiles stabilizes anomaly detection across varying environmental conditions. In a similar vein, Liang Chen et al. introduce a heterogeneous thresholding approach in Evidential Neighborhood Contrastive Learning for Universal Domain Adaptation, calculating category-specific thresholds from the mean and variance of evidence scores to surgically separate difficult known samples from true outliers.

2. Learnable Boundary Parameters

Rather than calculating thresholds post-hoc, boundaries can be treated as parameters optimized directly during backpropagation. Linhao Li et al. implement this in Adaptive Decision Boundary for Few-Shot Class-Incremental Learning, assigning a unique, learnable boundary parameter to every individual class. This allows the model to dynamically reshape its feature space and prevent "space conflicts" when incrementally introducing new categories.

3. Meta-Learning and Sub-networks

Thresholds can also be predicted dynamically by an auxiliary network. In Adaptive Label Noise Cleaning with Meta-Supervision for Deep Face Recognition, Yaobin Zhang et al. utilize a sub-network to analyze the score distribution within a specific identity class. This "threshold adapter" predicts a tailored decision boundary that accounts for varying feature densities across different human faces, successfully filtering out label noise.

Applications Across Machine Learning Domains

The transition from global to class-specific thresholding has resolved long-standing bottlenecks across a wide variety of tasks:

  • Biometric Verification: In identity verification, individuals with common facial or biometric features require stricter matching criteria to prevent false positives, while individuals with highly unique features can use more relaxed thresholds. Ognjen Arandjelovic demonstrates in A framework for improving the performance of verification algorithms with a low false positive rate requirement and limited training data that replacing global boundaries with individualized limits tailored to an identity's specific feature distribution drastically improves precision under tight security constraints.
  • Intent and OOD Detection: In natural language processing, user intents vary widely in semantic breadth. Yanan Wu et al. show in Revisit Overconfidence for OOD Detection: Reassigned Contrastive Learning with Adaptive Class-dependent Threshold that local class-dependent thresholds successfully counteract neural network overconfidence, drawing precise boundaries between known user intents and out-of-domain queries.
  • Label-Noise Learning: When training on datasets with corrupted labels, models often use a global loss threshold to separate clean data from noise. However, complex classes naturally exhibit higher baseline losses. As shown by Peitian Ma et al. in CTW: Confident Time-Warping for Time-Series Label-Noise Learning, a global threshold mistakenly discards valid samples from complex classes. Class-normalized selection fixes this by adjusting the filtering criteria to each class's baseline difficulty.
  • Performance Estimation and Covariate Shift: When models encounter data drift, measuring the distance of new samples to training clusters helps estimate performance drop-offs. Ben Glocker et al. demonstrate in Distance Matters For Improving Performance Estimation Under Covariate Shift that class-wise distance thresholds prevent high-variance categories from being misclassified as drifted outliers, yielding highly accurate reliability estimates.
  • Action Recognition: In temporal video processing, uniform thresholds fail because certain activities (such as complex social interactions) are inherently noisier and more prone to false positives than simple, isolated movements. This challenge was highlighted early on by Zhe Wang et al. in Exploring Fisher vector and deep networks for action spotting and later formalized by Yemin Shi et al. in ODN: Opening the Deep Network for Open-set Action Recognition, proving that class-specific boundaries are essential for opening deep networks to real-world environments.

Ultimately, class-specific thresholding represents a shift from rigid, global geometric assumptions to flexible, localized statistical reasoning. By acknowledging that categories do not behave uniformly, it allows deep networks to form tighter, fairer, and more accurate boundaries across the entire data distribution.

Key Foundational Work

A framework for improving the performance of verification algorithms with a low false positive rate requirement and limited training data (2014) — contributed 3 concept elements to this direction.
Exploring Fisher vector and deep networks for action spotting (2015) — contributed 1 concept elements to this direction.
Enrichment procedures for soft clusters: A statistical test and its applications (2014) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_class_specific_thresholding_4f42ca4f,
  title = {class-specific thresholding},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/class-specific-thresholding/rdr_4f42ca4fc73a48a9a2454b2bd1276c13},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-21},
}

This exact version (version 1, frozen text):

@misc{lacuna_class_specific_thresholding_4f42ca4f_v1,
  title = {class-specific thresholding},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/class-specific-thresholding/rdr_4f42ca4fc73a48a9a2454b2bd1276c13/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-21},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake