Fitting Frequency-Tier Yields at Deployment Time for Long-Tailed Recognition

Classifiers trained on long-tailed data, where a few common classes have thousands of examples and most classes have only a handful, carry a hidden assumption about how often each class will appear when deployed. Balanced Softmax bakes in the training frequencies and assumes a uniform test set. Group-softmax methods split classes into frequency tiers ("Many", "Medium", "Few") and then stitch the tier outputs back together with hand-tuned rescaling. Neither approach asks the deployment data how many rare-class examples are actually present. High-energy physics answers this kind of question routinely with the unbinned extended maximum-likelihood fit. This is a fit in which every event contributes its own continuous measurement, and in which the number of events from each source (its "yield") is a Poisson-distributed parameter estimated directly, with an error bar.

We propose treating the frequency tiers of a long-tailed classifier the way a physicist treats signal and background processes. A trained network supplies a low-dimensional score per test example, playing the role of a kinematic variable. Each tier contributes a template density for that score, estimated on held-out labeled data. An unknown-class component plays the role of a poorly modeled background. On an unlabeled deployment batch, an extended likelihood fit estimates the yield of each tier and of the unknown component. Those fitted yields then decide, per example, how much to trust each tier's within-tier classifier. The result has three parts: tier proportions with confidence intervals, a principled replacement for the heuristic group recombination in group-softmax methods, and an estimate of the open-set rate. All three come from one objective.

Core Claim

The bottleneck in partitioned long-tailed recognition is deciding which tier a sample belongs to, not the within-tier classifier. Mutual Exclusive Modulator for Long-Tailed Recognition (MEM) shows this with an oracle experiment: telling the model each sample's frequency group raises Few-shot accuracy on ImageNet-LT from 24.9% to 67.9%. MEM also reports that more than 70% of tail errors land in the Many group.

Tier membership depends on two things. One is the sample's features. The other is the deployment-time prior over tiers, which no existing method estimates. We claim that fitting tier yields with a small number of parameters on the deployment data closes part of the oracle gap, and does so in proportion to how far the deployment distribution departs from the one the model implicitly assumes. Tying yields within tiers is the key design choice. It reduces the fit to a handful of parameters, so it stays stable at batch sizes where a full per-class prior fit would be noise.

Concretely, let $s_i$ be a two- or three-dimensional score for test example $i$, such as the log-sum-exp of each tier head's logits. Let $f_t(s;\nu)$ be the template density of that score for true tier $t$, with nuisance parameters $\nu$ that allow mild shape distortion. Let $f_u$ be a deliberately broad density for unknown classes. Let $\mu_t$ and $\mu_u$ be the expected counts (yields). We minimize

$$-\ln \mathcal{L}(\mu,\nu) = \sum_t \mu_t + \mu_u - \sum_{i=1}^{N} \ln\Big(\sum_t \mu_t f_t(s_i;\nu) + \mu_u f_u(s_i)\Big) + \tfrac{1}{2}\lVert \nu \rVert^2,$$

where the last term is a Gaussian penalty that keeps the shape distortions near the held-out templates. The fitted per-example tier weights $w_t(s_i)=\hat\mu_t f_t(s_i)/\sum_{t'}\hat\mu_{t'} f_{t'}(s_i)$ combine the within-tier softmax heads as $p(y\mid x_i)=\sum_t w_t(s_i)\,p(y\mid x_i, t)$.

The extended form matters, and we are careful about where. For point estimates of tier fractions, the extended and non-extended fits give the same maximum. The Poisson term earns its place in three settings. It gives intervals on absolute counts. It combines deployment batches of different sizes coherently. And it lets a known external rate (for example, a historical count of known-class traffic) constrain the unknown yield, which is how physics separates a signal from an unconstrained background.

Relation to Prior Work

The method draws on three lines of work.

The physics side supplies the estimator. Update of the search for the neutrinoless decay τ→μγ replaced counting events inside a cut box with an unbinned extended fit in two continuous variables, and obtained a tighter limit. Observation of B+→ωK+ shows the trick we copy: it compresses many event-shape variables into a one-dimensional Fisher discriminant and fits that, rather than a high-dimensional density. Compressing scores this way is how we sidestep the intractability of exact densities over deep embeddings. Signal estimation in on/off measurements including event-by-event variables shows that per-event likelihood weighting beats hard cuts by 15–20% in precision at 10% signal-to-noise. That result motivates our soft tier weights over hard tier assignment. None of these works touches learned classifiers or frequency structure.

The long-tail side supplies the partition and the gap. Overcoming Classifier Imbalance for Long-Tail Object Detection With Balanced Group Softmax (BAGS) trains a separate softmax per frequency tier, adds an "others" class to each, and recombines tiers at test time with heuristic rescaling. We keep its training and replace the recombination with fitted yields. Balanced Meta-Softmax for Long-Tailed Visual Recognition (BALMS) corrects logits by training frequencies, which implicitly fixes the test prior to uniform. We estimate that prior instead. Large-Scale Long-Tailed Recognition in an Open World (OLTR) detects unknowns with distance heuristics. Our unknown component estimates their rate with an interval.

The closest work, and a constraint on the design, is Pairwise Maximum Likelihood For Multi-Class Logistic Regression Model With Multiple Rare Classes (PMLE). It proves that when one class dominates, maximum-likelihood estimates for the separate rare classes become asymptotically independent, so the joint fit decomposes into pairwise fits. That result supports fitting the Few tier against the dominant tiers without tracking every rare-rare interaction. However, PMLE is a training-time estimator for logistic weights on fixed features. It assumes a flat tail, fits no yields, and has no Poisson term. Our contribution is a deployment-time yield fit over a multi-tier tail, which PMLE explicitly leaves open.

Research Program

We first train tiered backbones on ImageNet-LT, CIFAR-100-LT and iNaturalist 2018. The main backbone is the BAGS-style group head on a ResNet-50, with tiers set at the standard Many (>100 images), Medium (20–100) and Few (<20) thresholds. We build on the RIDE-LongTailRecognition codebase so that backbones, samplers and training budgets match the published baselines.

We hold out a labeled calibration split of the training data. On it we estimate the tier templates $f_t$ with a kernel density estimate in two or three dimensions, and parametrize $\nu$ as a shift and scale of each template.

Next we build shifted deployment streams by resampling the balanced test sets. Tier proportions are drawn from a grid that includes uniform, the training long-tail, an inverted tail, and a Few-heavy regime, at batch sizes from 50 to 10,000. Unknown classes come from the ImageNet-LT open-set protocol of OLTR.

The analytical question is when tier-tying helps. With $K$ classes and $N$ test samples, a per-class prior fit has variance that grows roughly like $K/N$, since each class proportion is estimated from about $N/K$ effective samples. A three-tier fit has variance that grows roughly like $3/N$, plus a bias that comes from non-uniform proportions inside a tier. We will measure where these two curves cross.

A secondary study asks whether tier boundaries themselves can be chosen statistically. For this we select the thresholds that maximize the profile-likelihood separation of the templates on the calibration split, which addresses the arbitrary-threshold problem in the long-tail literature.

Baselines

The naive reference point is the BAGS-style tiered model with its original heuristic recombination and no deployment-time fitting. It shares our backbone exactly, so any gain is attributable to the fit.

The second reference is Balanced Softmax as in BALMS, which assumes a uniform test prior. On a uniform test set it should be hard to beat. BALMS reports 81.5% accuracy on CIFAR-10-LT at imbalance factor 200. On ImageNet-LT we found no reported BALMS result on Lacuna, so we will run it ourselves with the same backbone and schedule.

The strongest accuracy method in the file is MEM, at 64.9% top-1 on ImageNet-LT. It also learns a per-sample tier diagnosis, which makes it the most direct competitor on our core question of tier assignment. We will apply our yield fit on top of MEM's Many/Medium/Few subnetworks as well. If the fit helps MEM, the contribution is orthogonal to architecture.

For calibration, the comparison is label-aware smoothing from Improving Calibration for Long-Tailed Recognition. It reports CIFAR-100-LT (imbalance factor 100) accuracy of 47.0% and ECE of 4.83%.

For yield estimation itself, the physics-style naive baseline is cut-and-count. Each sample is assigned to its argmax tier, assignments are counted, and the counts are corrected by the confusion matrix measured on the calibration split.

The ablation that isolates our key ingredient is the same extended fit with one yield per class instead of per tier.

All methods share backbone, training data, calibration split and a matched hyperparameter search budget. Beating the field means two things. First, a lower absolute error in estimated tier proportions than cut-and-count and per-class fitting at batch sizes of 1,000 or fewer. Second, higher Few-tier accuracy than BALMS and MEM under every non-uniform shift, while staying within 0.5 points of them on the uniform test set.

Why not just…?

Why not just use Balanced Softmax and assume a uniform test set? On the standard benchmarks the test set is uniform, so BALMS already uses the right prior. On those benchmarks we expect only to match it, and the fit should recover near-uniform yields, which serves as a sanity check. The claim stands or falls on shifted streams, where any fixed prior is wrong by construction. If BALMS stays within noise of our method under inverted-tail shifts, the proposal fails.

Why not just re-estimate all class priors with expectation-maximization on the full posterior? This is the real threat. It is the standard label-shift correction, and it is exactly our per-class ablation without the Poisson term. We found no reported result on Lacuna for it on ImageNet-LT. Its weakness should appear at small batches, where 1,000 class proportions are fitted from a few hundred samples, and whenever unknown classes are present, since it has no component for them. The batch-size sweep settles the question. If per-class re-estimation matches tier-tied fitting at batch sizes of 500 or fewer, tier partitioning adds nothing, and we would report the extended per-class fit as the method.

Why not just train a tier classifier and use its outputs, as MEM does? A learned tier diagnosis inherits the training tier frequencies as its prior. MEM's own analysis, in which more than 70% of tail errors go to the Many group, is consistent with that bias. Our fit reweights MEM's diagnosis by deployment yields rather than replacing it, so the MEM-plus-fit experiment measures this directly.

Why not just recalibrate with temperature scaling or label-aware smoothing? These fix how confident the model is. They do not fix which tier the model believes is common. We report ECE alongside accuracy to show whether yield fitting improves calibration beyond label-aware smoothing under shift, or only matches it.

Decisive Checks

Four results would establish the method.

The first is the shift sweep on ImageNet-LT. Under inverted-tail and Few-heavy streams, Few-tier accuracy should exceed MEM and BALMS and move toward MEM's 67.9% oracle figure. The fraction of that oracle gap we close is the headline number.

The second is a coverage study for the yield intervals. Profile-likelihood 68% intervals on tier yields should contain the true counts about 68% of the time across resampled streams. A systematic shortfall would indicate that the templates are mis-specified, which is the failure the physics literature warns about, and the shape nuisance parameters $\nu$ are meant to absorb it.

The third is open-set rate estimation on the OLTR protocol. Alongside OLTR's reported F-measure of 0.474, we will report how far the fitted unknown yield is from the true number of unknowns. The test is whether the yield fit improves the F-measure when its posterior gates the rejection decision.

The fourth is the crossover plot between tier-tied and per-class yields as batch size grows. It is the cleanest test of whether frequency partitioning, rather than likelihood fitting alone, is doing the work.