Neighborhood Smoothing for Calibration
Organizations: Faculty of Data and Decision Sciences Technion Haifa, 3200003, IL
Abstract
Modern neural networks are often miscalibrated, with a tendency to overconfidence. Existing train-time calibration methods largely modify task losses or calibration penalties, leaving neighborhood structure in learned representations underexploited. We introduce graph smoothing as a general principle for train-time calibration, which encourages similar predictive distributions across neighboring samples in representation space. We analyze the effects of graph smoothing, deriving bounds that connect predictive divergence between neighboring samples to local confidence variation and to the propagation of pointwise calibration error, and characterize the conditions under which smoothing can or cannot improve calibration. In light of this analysis, we propose \modelNoSpace, a graph-based train-time regularizer that penalizes the Jensen--Shannon divergence between predictive distributions of neighboring samples. We present a thorough empirical analysis, showing that across standard calibration benchmarks, \model improves predictive quality, and the improvement is complementary to post-hoc calibration: after temperature scaling, \model attains the lowest NLL of all evaluated train-time methods in seven of the eight image and tabular settings. These findings demonstrate the value of graph smoothing over learned representations for neural network calibration.
Figures & tables
| Setting | CE | FL | LS | MMCE | MDCA | s-AvUC | MbLS | NeSCal |
|---|---|---|---|---|---|---|---|---|
| Base model | ||||||||
| CIFAR-10 / R50 | 0.2065 0.0091 | 0.1821 0.0045 | 0.2285 0.0064 | 0.2031 0.0043 | 0.2089 0.0074 | 0.2065 0.0052 | 0.2227 0.0052 | 0.1843 0.0058 |
| CIFAR-10 / WRN | 0.1972 0.0077 | 0.1572 0.0033 | 0.1838 0.0034 | 0.1791 0.0083 | 0.1951 0.0071 | 0.2090 0.0102 | 0.1791 0.0025 | 0.1752 0.0028 |
| CIFAR-100 / R50 | 0.8782 0.0249 | 0.8463 0.0044 | 0.8966 0.0186 | 0.8935 0.0393 | 0.8889 0.0139 | 0.8763 0.0170 | 0.8614 0.0174 | 0.8026 0.0155 |
| CIFAR-100 / WRN | 0.8785 0.0049 | 0.7681 0.0058 | 0.8388 0.0086 | 0.8838 0.0219 | 0.8786 0.0139 | 0.8691 0.0043 | 0.8206 0.0117 | 0.7760 0.0173 |
| Tiny-ImageNet | 1.4704 0.0254 | 1.4960 0.0101 | 1.4816 0.0254 | 1.4797 0.0344 | 1.4406 0.0225 | 1.4403 0.0317 | 1.4287 0.0251 | 1.4126 0.0254 |
| Setting | Edge JS | Edge agreement | NLL | Relative |
|---|---|---|---|---|
| Covertype | 0.003 | 0.958 | 0.0017 | |
| Amazon (binary) | 0.004 | 0.987 | 0.0014 | |
| Jannis | 0.009 | 0.935 | 0.0059 | |
| Amazon (5-class) | 0.013 | 0.909 | 0.0028 | |
| CIFAR-10 / WRN | 0.026 | 0.901 | 0.0220 | |
| 20NG | 0.027 | 0.748 | 0.0104 |
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Modality | Classes | Size | Split |
|---|---|---|---|---|
| CIFAR-10 / CIFAR-100 | image | 10 / 100 | 60,000 | 45k / 5k / 10k |
| Tiny-ImageNet | image | 200 | 110,000 | 90k / 10k / 10k |
| 20 Newsgroups | text | 20 | 18,846 | 13,570 / 1,507 / 3,769 |
| Amazon (binary) (frozen RoBERTa) | text | 2 | 11,349 | 7,264 / 1,816 / 2,269 |
| Amazon (5-class) (frozen RoBERTa) | text | 5 | 22,815 | 14,602 / 3,650 / 4,563 |
| Helena | tabular | 100 | 65,196 | 41,724 / 10,432 / 13,040 |
| Setting | Optimizer | LR | LR schedule | Epochs | Batch |
|---|---|---|---|---|---|
| CIFAR-10/100, ResNet-50 & WRN-28-10 | SGD ( , wd ) | at | 200 | 128 | |
| Tiny-ImageNet, ResNet-50 | SGD ( , wd ) | at | 100 | 64 | |
| 20 Newsgroups, GPCNN | Adam | constant | 50 | 128 | |
| Frozen encoder + MLP head | SGD ( , wd ) | constant | 50 (early stopping) | 256 | |
| Tabular, MLP (dropout ) | AdamW (wd ) | constant | 100 | 512 |
| Setting | Candidate onsets | grid (cosine / constant) |
|---|---|---|
| CIFAR-10, ResNet-50 | / | |
| CIFAR-10, WRN-28-10 | / | |
| CIFAR-100, ResNet-50 | / | |
| CIFAR-100, WRN-28-10 | / | |
| Tiny-ImageNet | / | |
| 20NG | / |
| Setting | CE | FL | LS | MMCE | MDCA | s-AvUC | MbLS | NeSCal |
|---|---|---|---|---|---|---|---|---|
| Brier score | ||||||||
| CIFAR-10 / R50 | 0.0953 0.0045 | 0.0866 0.0029 | 0.0872 0.0035 | 0.0988 0.0021 | 0.0943 0.0087 | 0.0949 0.0054 | 0.0948 0.0057 | 0.0872 0.0015 |
| CIFAR-10 / WRN | 0.0782 0.0051 | 0.0733 0.0016 | 0.0750 0.0019 | 0.0854 0.0030 | 0.0852 0.0066 | 0.0831 0.0052 | 0.0807 0.0052 | 0.0785 0.0018 |
| CIFAR-100 / R50 | 0.3447 0.0081 | 0.3296 0.0019 | 0.3430 0.0083 | 0.3481 0.0128 | 0.3482 0.0041 | 0.3443 0.0057 | 0.3372 0.0045 | 0.3178 0.0050 |
| CIFAR-100 / WRN | 0.3321 0.0033 | 0.3024 0.0022 | 0.3162 0.0015 | 0.3396 0.0066 | 0.3353 0.0058 | 0.3337 0.0025 | 0.3161 0.0060 | 0.3057 0.0061 |
| Tiny-ImageNet | 0.4778 0.0057 | 0.4991 0.0030 | 0.4757 0.0063 | 0.4819 0.0079 | 0.4696 0.0071 | 0.4691 0.0096 | 0.4651 0.0073 | 0.4693 0.0064 |
| Setting | CE | FL | LS | MMCE | MDCA | s-AvUC | MbLS | NeSCal |
|---|---|---|---|---|---|---|---|---|
| Base model | ||||||||
| CIFAR-10 / R50 | 2.46 0.49 | 1.14 0.04 | 3.98 0.21 | 0.83 0.10 | 2.56 0.40 | 2.55 0.53 | 2.08 0.49 | 2.29 0.11 |
| CIFAR-10 / WRN | 2.75 0.30 | 0.78 0.07 | 1.64 0.31 | 1.13 0.25 | 2.66 0.14 | 3.00 0.20 | 2.10 0.51 | 2.39 0.18 |
| CIFAR-100 / R50 | 5.90 0.58 | 2.73 0.50 | 1.39 0.18 | 6.02 0.49 | 6.08 0.24 | 5.83 0.94 | 3.84 0.51 | 3.95 0.67 |
| CIFAR-100 / WRN | 8.19 0.25 | 1.87 0.12 | 3.41 0.57 | 7.45 0.38 | 7.91 0.18 | 7.03 0.61 | 3.62 0.29 | 4.60 0.62 |
| Tiny-ImageNet | 5.75 0.29 | 3.12 0.23 | 4.63 0.29 | 4.56 0.35 | 6.00 0.25 | 6.27 0.47 | 2.69 0.63 | 2.02 0.36 |
| Setting | CE | FL | LS | MMCE | MDCA | s-AvUC | MbLS | NeSCal |
|---|---|---|---|---|---|---|---|---|
| Classwise ECE | ||||||||
| CIFAR-10 / R50 | 0.58 0.08 | 0.43 0.02 | 0.83 0.02 | 0.40 0.05 | 0.58 0.08 | 0.58 0.07 | 0.57 0.04 | 0.54 0.02 |
| CIFAR-10 / WRN | 0.61 0.06 | 0.45 0.04 | 0.53 0.04 | 0.42 0.02 | 0.61 0.03 | 0.68 0.04 | 0.50 0.07 | 0.59 0.03 |
| CIFAR-100 / R50 | 0.21 0.00 | 0.18 0.00 | 0.19 0.00 | 0.21 0.01 | 0.21 0.01 | 0.21 0.01 | 0.19 0.01 | 0.18 0.01 |
| CIFAR-100 / WRN | 0.24 0.00 | 0.18 0.00 | 0.20 0.01 | 0.23 0.01 | 0.24 0.01 | 0.22 0.01 | 0.20 0.00 | 0.19 0.00 |
| Tiny-ImageNet | 0.14 0.00 | 0.14 0.00 | 0.14 0.00 | 0.14 0.00 | 0.14 0.00 | 0.15 0.00 | 0.14 0.00 | 0.13 0.00 |
| NLL (all) | NLL (I+T) | NLL+TS (all) | NLL+TS (I+T) | Brier (all) | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| vs. | wins | wins | wins | wins | wins | |||||
| CE | 11/11 | 0.001 | 8/8 | 0.008 | 11/11 | 0.001 | 8/8 | 0.008 | 10/11 | 0.002 |
| FL | 7/11 | 0.067 | 5/8 | 0.109 | 10/11 | 0.014 | 8/8 | 0.008 | 7/11 | 0.083 |
| LS | 7/11 | 0.175 | 7/8 | 0.016 | 10/11 | 0.042 | 8/8 | 0.008 | 5/11 | 0.878 |
| MMCE | 8/11 | 0.206 | 8/8 | 0.008 | 8/11 | 0.083 | 8/8 | 0.008 | 8/11 | 0.240 |
| MDCA | 10/11 | 0.019 | 8/8 | 0.008 | 9/11 | 0.005 | 7/8 | 0.016 | 11/11 | 0.001 |
| Setting | CE | FL | LS | MMCE | MDCA | s-AvUC | MbLS | NeSCal |
|---|---|---|---|---|---|---|---|---|
| CIFAR-10 / R50 | 0.0424 0.0020 | 0.0470 0.0046 | 0.0381 0.0012 | 0.0439 0.0012 | 0.0420 0.0036 | 0.0424 0.0026 | 0.0424 0.0027 | 0.0388 0.0006 |
| CIFAR-10 / WRN | 0.0346 0.0024 | 0.0377 0.0038 | 0.0326 0.0008 | 0.0382 0.0011 | 0.0377 0.0030 | 0.0365 0.0023 | 0.0359 0.0023 | 0.0352 0.0010 |
| CIFAR-100 / R50 | 0.1242 0.0014 | 0.1229 0.0015 | 0.1249 0.0007 | 0.1239 0.0032 | 0.1248 0.0013 | 0.1237 0.0019 | 0.1231 0.0016 | 0.1160 0.0019 |
| CIFAR-100 / WRN | 0.1185 0.0018 | 0.1151 0.0010 | 0.1069 0.0005 | 0.1203 0.0016 | 0.1197 0.0018 | 0.1189 0.0009 | 0.1161 0.0026 | 0.1118 0.0014 |
| Tiny-ImageNet | 0.1463 0.0014 | 0.1558 0.0011 | 0.1497 0.0016 | 0.1484 0.0022 | 0.1448 0.0016 | 0.1434 0.0029 | 0.1468 0.0019 | 0.1453 0.0030 |
| Helena | 0.1777 0.0008 | 0.1789 0.0013 | 0.1772 0.0006 | 0.1770 0.0010 | 0.1767 0.0009 | 0.1762 0.0013 | 0.1772 0.0006 | 0.1773 0.0009 |
| Setting | CE | FL | LS | MMCE | MDCA | s-AvUC | MbLS | NeSCal |
|---|---|---|---|---|---|---|---|---|
| NLL | ||||||||
| CIFAR-10 / R50 | 0.1863 0.0084 T | 0.1790 0.0052 L | 0.2108 0.0046 D | 0.1993 0.0061 L | 0.1858 0.0144 T | 0.1855 0.0121 L | 0.2156 0.0064 A | 0.1698 0.0046 T |
| CIFAR-10 / WRN | 0.1495 0.0129 L | 0.1508 0.0043 L | 0.1637 0.0028 L | 0.1726 0.0063 L | 0.1618 0.0115 L | 0.1540 0.0117 L | 0.1599 0.0095 L | 0.1444 0.0041 L |
| CIFAR-100 / R50 | 0.8489 0.0267 T | 0.8452 0.0038 T | 0.8944 0.0190 A | 0.8631 0.0402 T | 0.8577 0.0137 T | 0.8478 0.0137 T | 0.8558 0.0168 T | 0.7944 0.0191 T |
| CIFAR-100 / WRN | 0.8070 0.0061 T | 0.7681 0.0057 T | 0.8334 0.0049 D | 0.8309 0.0151 T | 0.8141 0.0155 T | 0.8212 0.0099 T | 0.8173 0.0103 T | 0.7613 0.0178 T |
| Tiny-ImageNet | 1.4415 0.0246 T | 1.4950 0.0099 T | 1.4563 0.0255 T | 1.4614 0.0319 T | 1.4096 0.0228 T | 1.4066 0.0307 T | 1.4208 0.0246 T | 1.4098 0.0255 T |
| Setting | Metric | CE | FL | LS | MMCE | MDCA | s-AvUC | MbLS | NeSCal |
|---|---|---|---|---|---|---|---|---|---|
| CIFAR-10 / R50 | AUROC | 0.9357 | 0.9278 | 0.8537 | 0.9359 | 0.9351 | 0.9352 | 0.8995 | 0.9392 |
| AUROC+TS | 0.9352 | 0.9270 | 0.8563 | 0.9361 | 0.9349 | 0.9349 | 0.9001 | 0.9395 | |
| AURC | 6.60 | 8.57 | 19.08 | 7.25 | 6.53 | 6.53 | 11.21 | 5.58 | |
| AURC+TS | 6.64 | 8.66 | 18.69 | 7.24 | 6.55 | 6.55 | 11.11 | 5.57 | |
| CIFAR-10 / WRN | AUROC | 0.9343 | 0.9290 | 0.8951 | 0.9393 | 0.9379 | 0.9350 | 0.9340 | 0.9384 |
| AUROC+TS | 0.9316 | 0.9295 | 0.8957 | 0.9391 | 0.9362 | 0.9322 | 0.9331 | 0.9370 |
| Setting | CE | FL | LS | MMCE | MDCA | s-AvUC | MbLS | NeSCal |
|---|---|---|---|---|---|---|---|---|
| Corrupted NLL | ||||||||
| CIFAR-10 / R50 | 1.2363 | 0.9956 | 1.0565 | 0.9828 | 1.2799 | 1.2882 | 1.0554 | 1.2483 |
| CIFAR-10 / WRN | 1.3416 | 1.0069 | 1.0651 | 0.9919 | 1.3808 | 1.4140 | 1.1209 | 1.2342 |
| CIFAR-100 / R50 | 2.6843 | 2.4157 | 2.4532 | 2.6950 | 2.7057 | 2.6799 | 2.5766 | 2.4443 |
| CIFAR-100 / WRN | 3.1114 | 2.5448 | 2.6913 | 2.9448 | 3.1199 | 2.9370 | 2.6783 | 2.5604 |
| Tiny-ImageNet | 4.1629 | 4.0258 | 3.8927 | 4.1066 | 4.1212 | 4.1864 | 3.8153 | 3.9413 |
| Setting | CE | kNN | Random | Random (scaled) |
|---|---|---|---|---|
| CIFAR-10 / R50 | 0.2065 | 0.1843 | 0.2156 | 0.2058 |
| CIFAR-100 / R50 | 0.8782 | 0.8026 | 1.0386 | 0.8785 |
| Helena | 2.5651 | 2.5534 | 2.5890 | 2.5639 |
| Setting | Schedule | NLL | Brier | Accuracy | ECE |
|---|---|---|---|---|---|
| CIFAR-10 / R50 | Constant | 0.1917 0.0068 | 0.0941 0.0033 | 0.9358 0.0026 | 0.0155 0.0012 |
| Cosine | 0.1843 0.0058 | 0.0872 0.0015 | 0.9428 0.0015 | 0.0229 0.0011 | |
| CIFAR-10 / WRN | Constant | 0.1966 0.0092 | 0.0897 0.0037 | 0.9413 0.0028 | 0.0252 0.0021 |
| Cosine | 0.1752 0.0028 | 0.0785 0.0018 | 0.9494 0.0011 | 0.0239 0.0018 | |
| CIFAR-100 / R50 | Constant | 0.8728 0.0238 | 0.3423 0.0062 | 0.7541 0.0052 | 0.0539 0.0067 |
| Cosine | 0.8026 0.0155 | 0.3178 0.0050 | 0.7719 0.0052 | 0.0395 0.0067 |
| Arm | C10/R50 | C10/WRN | C100/R50 | C100/WRN | Helena | Jannis | Covertype | 20NG |
|---|---|---|---|---|---|---|---|---|
| Headline ( , JS, raw features) | 0.1843 | 0.1752 | 0.8026 | 0.7760 | 2.5534 | 0.7066 | 0.2499 | 0.8023 |
| Cross-entropy (no regularizer) | 0.2065 | 0.1972 | 0.8782 | 0.8785 | 2.5651 | 0.7125 | 0.2516 | 0.8127 |
| Random graph, same | 0.2156 | – | 1.0386 | – | 2.5890 | – | – | – |
| Random graph, matched penalty | 0.2058 | – | 0.8785 | – | 2.5639 | – | – | – |
| 0.1830 | 0.1736 | 0.8368 | 0.7936 | 2.5554 | 0.7069 | 0.2487 | 0.7466 | |
| 0.1789 | 0.1702 | 0.8148 | 0.7985 | 2.5553 | 0.7072 | 0.2531 | 0.7650 |
| Setting | Entropy drop | CWCC | Probe (hindsight) |
|---|---|---|---|
| CIFAR-10 / R50 | |||
| CIFAR-10 / WRN | |||
| CIFAR-100 / R50 | |||
| CIFAR-100 / WRN | |||
| Tiny-ImageNet | – | ||
| Helena | – | – |
| Setting | CE time | NeSCal time | Overhead | Graph build | CE memory | NeSCal memory |
|---|---|---|---|---|---|---|
| CIFAR-10 / R50 | 3430 | 3456 | 20.4 | 2.05 | 2.05 | |
| CIFAR-10 / WRN | 5028 | 5053 | 26.9 | 2.29 | 2.26 | |
| CIFAR-100 / R50 | 2702 | 2725 | 17.3 | 2.11 | 2.15 | |
| CIFAR-100 / WRN | 5068 | 5094 | 27.1 | 2.59 | 3.05 | |
| Tiny-ImageNet | 11036 | 11085 | 146.2 | 3.89 | 6.89 | |
| Helena | 36.5 | 50.1 | 1.49 | 0.04 | 1.44 |
| CIFAR-10 / R50 | CIFAR-100 / R50 | |||||
| Quantity | CE | NeSCal (const) | NeSCal (cos) | CE | NeSCal (const) | NeSCal (cos) |
| Bound violations (L1, confidence) | 0 | 0 | 0 | 0 | 0 | 0 |
| Confidence-bound tightness, median | 0.019 | 0.038 | 0.019 | 0.131 | 0.117 | 0.101 |
| Edges within the expansion’s regime | ||||||
| Across-seed dispersion proxy | 0.055 | 0.061 | 0.038 | 0.102 | 0.102 | 0.088 |
| Across-seed confidence spread | 0.059 | 0.059 | 0.035 | 0.103 | 0.112 | 0.076 |
| NLL | ECE (%) | Accuracy (%) | |||||
|---|---|---|---|---|---|---|---|
| Architecture | Noise | CE | NeSCal | CE | NeSCal | CE | NeSCal |
| ResNet-50 | 1.2521 | 1.3123 | 6.42 | 4.32 | 68.20 | 67.64 | |
| 1.7125 | 1.9218 | 15.96 | 9.66 | 61.01 | 56.95 | ||
| WRN-28-10 | 1.1743 | 1.1528 | 2.92 | 1.70 | 70.19 | 70.44 | |
| 1.5154 | 1.6212 | 9.58 | 4.85 | 64.35 | 61.74 | ||
| Architecture | Imbalance | Cross-entropy | JS | Fisher-weighted | Uniform ( ) |
|---|---|---|---|---|---|
| ResNet-50 | 1.8104 | 1.8018 | 1.8403 | 1.7629 | |
| 2.9898 | 3.0154 | 3.0717 | 2.8144 | ||
| 3.4013 | 3.4364 | 3.5764 | 3.2381 | ||
| WRN-28-10 | 1.7965 | 1.6838 | 1.6325 | 1.5680 | |
| 2.5238 | 2.4804 | 2.6973 | 2.3800 | ||
| 2.9397 | 2.9967 | 3.2001 | 2.8844 |