Abstract
As machine learning systems become increasingly integrated into real-world applications, accurately representing uncertainty is crucial for enhancing their safety, robustness, and reliability. Training neural networks to fit high-dimensional probability distributions via maximum likelihood has become an effective method for uncertainty quantification. However, such models often exhibit poor calibration, leading to overconfident predictions. Traditional metrics like Expected Calibration Error (ECE) and Negative Log Likelihood (NLL) have limitations, including biases and parametric assumptions. This paper proposes a new approach using conditional kernel mean embeddings to measure calibration discrepancies without these biases and assumptions. Preliminary experiments on synthetic data demonstrate the method's potential, with future work planned for more complex applications.
Introduction
In modern machine learning, particularly for high-stakes regression tasks like medical diagnosis or financial forecasting, point estimates are insufficient. We require probabilistic neural networks that output a full probability distribution, allowing for rigorous uncertainty quantification. However, a significant challenge remains: these models are frequently misaligned with the true data distribution, often exhibiting overconfidence or failing to capture the underlying data shape.
Standard metrics for evaluating this fit, such as Expected Calibration Error (ECE), primarily assess marginal calibration—the average performance across a dataset. This can be misleading; a model can achieve a near-perfect ECE by simply predicting the global average distribution, while being completely wrong for any specific individual input. This paper introduces Conditional Congruence Error (CCE), a localized metric designed to diagnose the reliability of individual predictions by measuring how well a model's forecast matches the true distribution at a specific point in the input space.
The Conditional Congruence Error (CCE)
A model is considered "congruent" if its predicted distribution for a specific input $x$ exactly matches the true distribution of the data at that point. To quantify deviations from this ideal, we propose the CCE, which utilizes Maximum Conditional Mean Discrepancy (MCMD).
The methodology involves three key steps:
- Feature Encoding: Complex inputs (e.g., images) are transformed into feature vectors using a pre-trained encoder like CLIP.
- Kernel Embeddings: Probability distributions are represented as kernel mean embeddings in a high-dimensional space, facilitating distance calculations between distributions.
- Local Comparison: CCE calculates the distance between the model’s predicted distribution and the empirical distribution found in a reference dataset for inputs with similar features.
Crucially, CCE is robust to outliers and, unlike ECE, is not mathematically biased when applied to discrete or count-based data distributions.
Experimental Evaluation
We evaluated CCE across synthetic and real-world datasets, including age prediction (FG-Net, AAF), person counting (COCO-People), and aesthetic scoring (EVA).
In synthetic 1D tests, we demonstrated the "marginal trap": a model can have a near-zero ECE (0.007) while failing to capture local noise patterns. As shown in the figure above, while the marginal densities (b) match well, the CCE (d) successfully identifies specific regions of $X$ where the model is misaligned.
Furthermore, CCE proved capable of identifying demographic biases. In an age-prediction task, CCE flagged high errors for older, Caucasian faces—a minority group in the training data—despite the model appearing well-calibrated on average. This highlights CCE's utility as a diagnostic tool for model fairness and reliability on unlabeled test streams.
Conclusion
While CCE offers a more granular and unbiased assessment of probabilistic fit than traditional metrics, it comes with higher computational costs due to its $O(n^3)$ time complexity. Future work will focus on integrating CCE as a regularizer during training to directly improve model congruence and utilizing it as an acquisition function in active learning to identify the most informative data points for human labeling.
Summary updated