Margin and Consistency Supervision for Calibrated and Robust Vision Models
Organizations: Talan Research Center, Paris, France.
Abstract
Deep vision classifiers often achieve high accuracy while remaining poorly calibrated and fragile under small distribution shifts. We present Margin and Consistency Supervision (MaCS), a simple, architecture-agnostic regularization framework that jointly enforces logit-space separation and local prediction stability. MaCS augments cross-entropy with (i) a hinge-squared margin penalty that enforces a target logit gap between the correct class and the strongest competitor, and (ii) a consistency regularizer that minimizes the KL divergence between predictions on clean inputs and mildly perturbed views. We provide a unifying theoretical analysis showing that increasing classification margin while reducing local sensitivity formalized via a Lipschitz-type stability proxy yields improved generalization guarantees and a provable robustness radius bound scaling with the margin-to-sensitivity ratio. Across several image classification benchmarks and several backbones spanning CNNs and Vision Transformers, MaCS consistently improves calibration (lower ECE and NLL) and robustness to common corruptions while preserving or improving top-1 accuracy. Our approach requires no additional data, no architectural changes, and negligible inference overhead, making it an effective drop-in replacement for standard training objectives.
Figures & tables
| Method | Accuracy | Robust |
| CIFAR-10 | ||
| Baseline (CE) | 87.63 ±0.51 | 39.92 ±0.33 |
| Focal Loss | 87.35 ±0.67 | 40.94 ±0.95 |
| Label Smoothing | 88.85 ±0.54 | 41.87 ±0.53 |
| Mixup | 89.63 ±0.60 | 42.68 ±0.36 |
| MaCS (Ours) | 91.10 ±0.55 | 43.48 ±0.28 |
| Perturbation | Acc | ECE | Robust |
| None (CE only) | 63.41 | 24.57 | 20.00 |
| Noise only | 67.82 | 4.21 | 23.14 |
| Blur only | 68.15 | 3.89 | 23.52 |
| Noise + Blur | 69.23 | 3.13 | 24.60 |
| Dataset | Method | ECE | NLL |
| CIFAR-10 | Baseline (CE) | 9.10 ±0.43 | 0.779 ±0.213 |
| Focal Loss | 3.31 ±0.24 | 0.408 ±0.017 | |
| Label Smoothing | 5.44 ±0.26 | 0.463 ±0.013 | |
| Mixup | 3.26 ±0.32 | 0.379 ±0.012 | |
| MaCS (Ours) | 2.48 ±0.22 | 0.329 ±0.019 | |
| CIFAR-100 | Baseline (CE) | 24.57 ±0.82 | 2.458 ±0.614 |
| ECE (%) | NLL | |||
| Method | Pre-TS | Post-TS | Pre-TS | Post-TS |
| Baseline (CE) | 24.57 | 3.42 | 2.458 | 1.385 |
| Focal Loss | 12.86 | 3.18 | 1.550 | 1.342 |
| Label Smooth. | 3.14 | 2.89 | 1.576 | 1.356 |
| Mixup | 7.52 | 2.95 | 1.407 | 1.298 |
| AugMix | 5.83 | 2.76 | 1.382 | 1.275 |
| Dataset | Model | Baseline | AugMix | MaCS | MaCS+Aug |
| C10-C | ConvNeXt-T | 46.1 ±.8 | 50.8 ±.6 | 51.2 ±.9 | 53.4 ±.7 |
| EffNet-B0 | 36.3 ±.7 | 38.1 ±.5 | 37.4 ±.6 | 39.2 ±.4 | |
| MobNetV3 | 33.4 ±.2 | 35.9 ±.3 | 36.8 ±.2 | 38.2 ±.2 | |
| ResNet-34 | 40.5 ±.5 | 43.2 ±.4 | 42.7 ±.4 | 46.4 ±.3 | |
| ResNet-50 | 42.4 ±.1 | 44.1 ±.3 | 46.1 ±.0 | 48.4 ±.2 | |
| C100-C | ConvNeXt-T | 24.8 ±.5 | 32.0 ±.5 | 33.3 ±.7 | 35.1 ±.4 |
| Method | Max Logit | Margin | |
| Baseline (CE) | 12.4 | 8.7 | 2.31 |
| Focal Loss | 9.8 | 6.2 | 1.89 |
| Label Smooth. | 10.1 | 6.8 | 2.15 |
| Mixup | 11.2 | 7.4 | 2.52 |
| MaCS | 13.1 | 9.2 | 3.64 |
| Method | Noise † | Blur † | Weather | Digital | Avg |
| Baseline | 31.2 | 38.5 | 47.8 | 52.1 | 42.4 |
| AugMix | 35.8 | 41.2 | 49.3 | 54.2 | 44.1 |
| MaCS | 33.9 | 40.8 | 48.6 | 53.4 | 43.1 |
| MaCS+Aug | 37.2 | 43.1 | 50.8 | 55.6 | 45.4 |
| Excluding noise/blur (no overlap): | |||||
| Baseline | – | – | 47.8 | 52.1 | 49.9 |
| Training Data | Baseline | MaCS | |
| 10% | 73.1 | 75.2 | +2.1 |
| 25% | 81.1 | 82.2 | +1.1 |
| 50% | 85.3 | 85.7 | +0.4 |
| 100% | 87.6 | 91.1 | +3.5 |
| Model | Focal | LS | Mixup | MaCS | AugMix |
| ResNet-34 | 1.05 | 1.00 | 1.05 | 2.11 | 3.03 |
| ResNet-50 | 1.00 | 1.05 | 1.01 | 2.04 | 3.45 |
| ConvNeXt-T | 1.00 | 1.03 | 1.04 | 1.74 | 2.39 |
| MobileNetV3 | 1.09 | 1.00 | 1.07 | 1.96 | 2.74 |
| ViT-S/16 | 1.01 | 1.02 | 1.08 | 2.07 | 3.46 |
| Swin-T | 1.03 | 1.00 | 1.04 | 1.85 | 2.76 |
| Method | Margin | Sensitivity | Ratio |
| Baseline | 2.31 | 4.87 | 0.47 |
| MaCS | 3.64 | 3.52 | 1.03 |
| Configuration | Acc | ECE | NLL |
| Baseline (CE only) | 75.53 | 19.29 | 2.112 |
| + Margin only ( ) | 75.89 | 16.45 | 1.856 |
| + Consistency only ( ) | 76.21 | 14.32 | 1.623 |
| Full MaCS | 77.65 | 12.62 | 1.399 |
Distribution Shift Robustness
Distribution shift robustness studies how to keep machine-learning predictions reliable when deployment data differ from training data.
See all 280 papers