Density-Routed Contrastive Learning Under Label Noise

A dataset with noisy labels contains at least three different kinds of bad training examples, and they need different fixes. Some images do not belong to any class in the dataset, such as a web-crawled logo filed under "dog". Some images are ordinary but carry the wrong label, such as a clear cat labeled "dog". Some images are ambiguous, such as a man holding a fish, where two labels are both defensible. Current noise-robust methods mostly produce a single "clean or noisy" score per example and then either discard or relabel it. That treats an intruder, a flipped label, and an honest ambiguity the same way. We propose to separate the three using a density model fitted on the learned feature space, and to handle each type differently inside a supervised contrastive loss. A supervised contrastive loss is a training objective that pulls same-label examples together in feature space and pushes different-label examples apart.

The density model is a class-conditional normalizing flow, meaning an invertible network that turns the feature distribution into a simple Gaussian so that exact likelihoods can be computed. It is refit continuously on the encoder's features as training proceeds. From it we read three quantities per example. The first is marginal likelihood, which asks whether the image has any support in the data distribution and flags intruders. The second is the agreement between the given label and the class the density favors, which flags flipped labels. The third is the spread of class evidence, which flags ambiguity. The claim to test is that routing examples by this three-way decomposition beats single-score routing, and that the decomposition matches ground truth we can actually check: annotator disagreement in CIFAR-N and known injected intruders in ImageNet32.

Core Claim

A mislabeled image is not an unusual image. Its feature vector sits comfortably inside the data distribution, just in the "wrong" class region. So the obvious move at this intersection is to score examples by latent log-likelihood and down-weight the low ones, which is the framing of Gap 1 in our file. That move is partly misguided. Marginal density catches out-of-distribution intruders but is nearly blind to label flips. Class-conditional density catches flips but conflates them with genuine ambiguity. Only the combination separates all three.

We use one shared flow $f$ on the contrastive projection features $z$, with a Gaussian base distribution that has one mean $\mu_c$ per class $c$. Under this design the class-conditional density is $p(z \mid c) = \mathcal{N}(f(z); \mu_c, I)\,|\det J_f(z)|$, where $J_f$ is the flow's Jacobian. The Jacobian term cancels in the class posterior $p(c \mid z)$ but not in the marginal $p(z) = \sum_c \pi_c\, p(z \mid c)$, where $\pi_c$ is the class frequency. This is a useful structural fact. The class-agreement and ambiguity signals depend only on geometry in flow space, while the intruder signal depends on the full likelihood including the Jacobian. Following the evidential construction of Natural Posterior Network and Graph Posterior Network, we turn these into Dirichlet pseudo-counts:

$$\alpha_c(z) = 1 + N\,\pi_c\,p(z \mid c),$$

where $N$ is a certainty budget. Total evidence $\sum_c \alpha_c$ measures support, which is the epistemic signal. The normalized counts give a soft class distribution whose entropy measures ambiguity, which is the aleatoric signal. The ratio of the given label's mass to the maximum class mass measures label agreement.

Research Program

Encoder and flow. The encoder is trained with a supervised contrastive loss on a 128-dimensional projection head. The flow is a discrete affine-coupling flow on that head, not the backbone. This sidesteps the dimension-matching constraint that pushed FlowCon onto a frozen backbone. It also avoids the ODE-solver cost that NoiseFlow reports (13 versus 8 hours on CIFAR-10).

Preventing collapse. The flow is trained on stop-gradient features, so the encoder cannot inflate likelihoods by shrinking its features. This is the feature-collapse failure that the evidential learning survey warns about. The flow is refit online every few hundred steps from a feature memory bank. Class means are estimated only from examples currently routed as clean.

Warm-up. Training begins with unsupervised SimCLR epochs. This follows Ghosh and Lan, who show that representation quality is the main bottleneck under severe noise.

Routing. Each example is handled according to its three scores. Low-support examples are removed from the supervised positive and negative sets and kept only in the instance-level SimCLR term, so they still shape features without being attracted to any class. Examples with high support and low label agreement are relabeled to the class with the most evidence. High-support, high-ambiguity examples become soft multi-positives, attracted to each class in proportion to their Dirichlet mean.

This last rule also speaks to the tension raised by D-SCL. That paper finds that nearly all human errors fall on visually similar "easy positive" pairs and down-weights such pairs heuristically. Our routing replaces that heuristic with a density-derived weight that is specific to ambiguous pairs.

How this differs from prior work. The closest bridges in the file each cover part of this.

  • FlowCon models latent density with a flow and a contrastive loss, but assumes clean labels and a frozen classifier, and is used only for detecting out-of-distribution inputs.
  • NoiseFlow uses a flow under label noise, but models the label given the features, never the feature density, so it has no intruder signal.
  • Manifold DivideMix separates intruders from label noise, but with two unrelated heuristics: global k-nearest-neighbor distance for intruders and a one-dimensional mixture fitted to losses for noisy labels.
  • PRCL and SNSCL attach a Gaussian variance to each instance but never model the global density.

None of these distinguishes ambiguity from label flips.

Baselines

The naive reference points are standard cross-entropy training and SimCLR pre-training followed by cross-entropy fine-tuning. The file gives numbers for both. On CIFAR-100 with 90% symmetric noise, Ghosh and Lan report 10.1% for cross-entropy and 52.11% for SimCLR plus cross-entropy. On CIFAR-10N Worst, the CIFAR-N study reports roughly 77% for cross-entropy. We rerun both in our codebase with the same backbone and epochs. Any gain we claim must be measured against these reruns, not the quoted numbers.

The strongest loss-mixture competitor is DivideMix, which splits clean from noisy by fitting a two-component mixture to per-example losses. It reports 76.0% on CIFAR-10 at 90% noise and 74.76% on Clothing1M. Its contrastive, stochastic-embedding descendant SNSCL reports 75.31% on Clothing1M.

The strongest method for data with both intruders and flipped labels is Manifold DivideMix. It reports 63.0% on ImageNet32 with 40% in-distribution plus 40% out-of-distribution noise, and 78.4% top-1 on mini-WebVision. It is the most direct competitor because it already attempts a two-way separation. NoiseFlow is the strongest flow-based competitor. It reports 60.4% on CIFAR-100 at 90% noise, 78.44% on WebVision, and 67.45% on Clothing1M. D-SCL is the relevant contrastive-loss competitor for human noise; the file reports it only as +1.6% over SupCon on ImageNet-1k.

We found no reported result on Lacuna for any of these methods on CIFAR-10N or CIFAR-100N beyond cross-entropy, so we will run DivideMix, D-SCL, and Manifold DivideMix there ourselves.

Fairness rules apply to every method we run:

  • Same backbone for all methods: PreAct ResNet-18 on CIFAR and ImageNet32, ResNet-50 on Clothing1M and mini-WebVision.
  • Same number of epochs.
  • Same SimCLR warm-up offered to every method that can use it.
  • A fixed budget of 20 hyperparameter trials per method, tuned on a small clean validation split.

Beating a baseline means exceeding it by more than the seed standard deviation over three seeds.

Three ablations isolate the key ingredient.

  1. Collapse the three scores into one clean-probability. This tests whether the decomposition, rather than density estimation as such, drives any gain.
  2. Replace the flow with a class-conditional Gaussian with no Jacobian term. Class agreement and ambiguity are preserved, but the marginal support signal becomes a Mahalanobis-style distance.
  3. Let density-loss gradients reach the encoder. This tests the collapse concern directly.

Why not just…?

Why not just freeze a SimCLR encoder and fit a density model on top? This is a real threat. Ghosh and Lan show that a frozen-then-fine-tuned SimCLR representation already beats DivideMix under extreme noise, and FlowCon gets strong detection from a flow on frozen features. We run this exact two-stage variant using our flow and our routing rules. If it matches the online version, the paper's claim reduces to the value of the three-way decomposition, which remains testable. Our expectation that online refitting helps rests on class means improving as relabeled examples accumulate. That effect is invisible to a frozen pipeline, especially under class-dependent noise, where SimCLR features do not separate confusable classes.

Why not just fit a one-dimensional mixture to losses, as DivideMix does? A scalar loss cannot tell a high-loss intruder from a high-loss flipped label, a point Manifold DivideMix makes explicitly. It also cannot tell either of those from an ambiguous image. The CIFAR-N study additionally shows that human noise is memorized fast, which blurs loss separation after warm-up. The ImageNet32 intruder benchmark and the annotator-disagreement analysis below measure exactly what a scalar score cannot express.

Why not just use k-nearest neighbors, whose distance, label vote, and vote entropy give the same three signals? This is the most serious alternative, and we treat it as a full baseline rather than a straw man. We build a three-way router from nearest-neighbor distance, neighbor-label agreement, and neighbor-label entropy, then run it under the identical routing rules. The flow's argued advantages are two. It scores each example in constant time, whereas global neighbor search is the scaling bottleneck Manifold DivideMix concedes. It also gives smoother likelihoods than neighbor distances in multi-modal spaces; FlowCon reports Mahalanobis at 42.54% versus 82.80% AUROC for near-OOD detection. If the neighbor router matches our accuracy on mini-WebVision at comparable cost, we will report that the decomposition, not the flow, is the contribution.

Why not just output a per-example variance, as PRCL and SNSCL do? A variance head measures how spread out one example's embedding is. It carries no information about whether that region of feature space contains data at all, which is the gap the evidential survey identifies. It also gives no per-class split of evidence, so it cannot tell "wrong label" from "two right labels." Our Mahalanobis ablation brackets this family from above.

Proposed Experiments

We evaluate on five benchmarks:

  • CIFAR-10 and CIFAR-100 with symmetric noise (20–90%) and asymmetric noise.
  • CIFAR-10N and CIFAR-100N with real human noise.
  • ImageNet32 with 40% in-distribution plus 40% out-of-distribution corruption.
  • Clothing1M.
  • mini-WebVision.

The metrics are test accuracy, training wall-clock time, and diagnostics for how well examples are routed.

Two checks decide whether the idea holds, independent of headline accuracy.

The first uses the three independent worker labels that ship with CIFAR-10N. We measure how well our ambiguity score ranks images by annotator disagreement, and how well our label-agreement score ranks images whose aggregate label is wrong. The decomposition claim requires that ambiguity predicts disagreement better than label agreement does, and vice versa for wrong labels. If the two scores are interchangeable, the three-way view is not real.

The second uses the ImageNet32 benchmark, where we know which images are injected intruders. We report detection AUROC for the support score against Manifold DivideMix's neighbor distance. We also report the fraction of intruders the router wrongly relabels into a class instead of removing. This error is exactly what single-score methods cannot avoid.

On accuracy, the proposal succeeds if it exceeds Manifold DivideMix's 63.0% on ImageNet32 and 78.4% on mini-WebVision. It must also beat the collapsed single-score ablation on CIFAR-10N Worst and CIFAR-100N, and do so at lower training cost than NoiseFlow. It fails informatively if the neighbor router or the frozen two-stage variant matches it. In that case the result becomes a clean empirical case for decomposed routing, and a negative result on online latent flows.