Beyond the Mean: Distribution-Aware Loss Functions for Bimodal Regression
Authors: Abolfazl Mohammadi-Seif, Carlos Soares, Rita P. Ribeiro, Ricardo Baeza-Yates
Organizations: Department of Engineering, Universitat Pompeu Fabra, Roc Boronat St., Barcelona, 08018, Barcelona, Spain. · Department of Engineering, University of Porto, Praça de Gomes Teixeira, Porto, 4099-002, Portugal. · Faculty of Sciences, University of Porto, 4169-007 Porto, Portugal. · INESC TEC, 4200-465 Porto, Portugal.
Despite the strong predictive performance achieved by machine learning models across many application domains, assessing their trustworthiness through reliable estimates of predictive confidence remains a critical challenge. This issue arises in scenarios where the likelihood of error inferred from learned representations follows a bimodal distribution, resulting from the coexistence of confident and ambiguous predictions. Standard regression approaches often struggle to adequately express this predictive uncertainty, as they implicitly assume unimodal Gaussian noise, leading to mean-collapse behavior in such settings. Although Mixture Density Networks (MDNs) can represent different distributions, they suffer from severe optimization instability. We propose a family of distribution-aware loss functions integrating normalized RMSE with Wasserstein and Cramér distances. When applied to standard deep regression models, our approach recovers bimodal distributions without the volatility of mixture models. Validated across four experimental stages, our results show that the proposed Wasserstein loss establishes a new Pareto efficiency frontier: matching the stability of standard regression losses like MSE in unimodal tasks while reducing Jensen-Shannon Divergence by 45% on complex bimodal datasets. Our framework strictly dominates MDNs in both fidelity and robustness, offering a reliable tool for aleatoric uncertainty estimation in trustworthy AI systems.
Figures & tables
Figure 1: Bimodal distribution of targets (a). Standard regression models trained with MSE fail to capture the underlying bimodal distribution (b).
Table 1: Summary of the 17 datasets used across the four-stage experimental protocol.
Figure 2: Qualitative comparison of predictive distributions (Orange) versus Ground Truth (Blue) on the Two Path dataset.
Configuration
Test Loss
RMSE ↓
Wasserstein ↓
JS Div ↓
ΔBC↓
Wasser-Simple
0.535
2.62
1.80
0.63
0.29
Wasser-Range
0.581
2.90
1.71
0.59
0.34
Cramer-Simple
0.542
2.77
1.73
0.62
0.14
Cramer-Range
0.576
2.94
1.38
0.54
0.39
Wasser-Simple (Def)
0.777
3.65
0.30
0.37
0.03
MDN (NLL)
0.071
3.82
1.61
0.54
0.15
Table 2: Performance comparison on synthetic datasets.
Unimodal ( S=0 )
Transition ( S=0.5 )
Bimodal ( S=1 )
Configuration
RMSE
JS Div
RMSE
JS Div
RMSE
JS Div
ΔBC
Proposed Methods
Wasser-Simple
0.939
0.427
0.467
0.387
0.509
0.441
0.105
Wasser-Range
0.977
0.430
0.491
0.366
0.532
0.436
0.171
Cramer-Simple
0.951
0.457
0.481
0.392
0.501
0.472
0.129
Cramer-Range
0.988
0.440
0.480
0.378
0.518
0.441
0.156
Table 3: Performance snapshots at critical separation intervals ( S ) in synthetic datasets.
Figure 3: Evolution of predictive densities on Bike Sharing (Hour) . Blue Area: Ground Truth. Orange Area: Predicted Distribution.
Configuration
Test Loss
RMSE ↓
Wasserstein ↓
JS Div ↓
ΔBC↓
Wasser-Simple
0.232
0.330
0.083
0.306
0.045
Wasser-Range
0.251
0.342
0.079
0.300
0.112
Cramer-Simple
0.222
0.324
0.085
0.306
0.046
Cramer-Range
0.249
0.344
0.101
0.329
0.071
Wasser-Simple (Def)
0.342
0.367
0.081
0.291
0.018
MDN (NLL)
-0.246
0.525
0.084
0.300
0.033
Table 4: Aggregated performance on Real-World Bimodal Datasets.
Figure 4: Qualitative comparison on the Protein Structure dataset. Top Row: MSE and HMLP collapse to unimodal averages in sparse regions, while MDN captures bimodality but exhibits disjoint peaks. Bottom Row: MLPQ and Proposed method (Center) provide a strong approximation. Notably, increasing to α=7 (Right) results in high coverage of the bimodal support.
Configuration
Test Loss
RMSE ↓
Wasserstein ↓
JS Div ↓
ΔBC↓
Wasser-Simple
0.092
0.088
0.052
0.402
0.060
Wasser-Range
0.109
0.088
0.058
0.434
0.032
Cramer-Simple
0.099
0.108
0.071
0.437
0.061
Cramer-Range
0.131
0.118
0.086
0.413
0.040
Wasser-Simple (Def)
0.237
0.153
0.112
0.452
0.044
MDN (NLL)
-2.105
0.069
0.024
0.338
0.046
Table 5: Performance on the Trimodal Bike Sharing dataset.
Complexity
Configuration
RMSE ↓
Wasserstein ↓
JS Div. ↓
ΔBC↓
Unimodal
Wasser-Simple
1.050
0.254
0.441
0.151
Wasser-Range
1.060
0.253
0.471
0.134
Cramer-Simple
1.036
0.280
0.536
0.146
Cramer-Range
1.068
0.251
0.506
0.149
Wasser-Simple (Def)
1.089
0.172
0.157
0.147
MDN
1.066
0.261
0.218
0.040
Table 6: Comprehensive performance on Image Complexity Assessment.
Figure 5: Distributional Fidelity (JS Divergence) across all Image Datasets.
Figure 6: Pareto Efficiency Frontier (stage IV Bimodal Datasets).