FedCal: Achieving Local and Global Calibration in Federated Learning via Aggregated Parameterized Scaler

Hongyi Peng, Han Yu, Xiaoli Tang, Xiaoxiao Li

Abstract

Federated Learning (FL) enables collaborative model training across decentralized clients without sharing raw data. However, the inherent heterogeneity of local data distributions (non-IIDness) often leads to poorly calibrated models, where predicted confidence scores do not reflect actual accuracy. We introduce FedCal, a framework designed to address this "confidence crisis." FedCal utilizes parameterized MLP-based scalers with order-preserving constraints, aggregated via weight matching, to significantly improve both local and global calibration. Experimental results demonstrate that FedCal reduces global calibration error by an average of 47.66% across multiple benchmarks while maintaining high predictive accuracy.

Introduction: The Calibration Crisis in Federated Learning

In safety-critical domains such as healthcare and autonomous driving, a model's reliability is as crucial as its accuracy. A well-calibrated model ensures that a predicted probability of 0.9 corresponds to a 90% likelihood of being correct. In Federated Learning, the non-IID nature of client data introduces significant discrepancies between local and global distributions, leading to models that are often over-confident or under-confident.

Conceptual diagram illustrating the discrepancy between local and global calibration in Federated Learning environments.

Traditional FL methods prioritize accuracy, often neglecting the calibration gap. FedCal addresses this by focusing on aligning confidence scores across the federation, ensuring that the global model remains reliable regardless of local data variance.

The FedCal Framework

FedCal moves beyond simple post-hoc adjustments like temperature scaling. It introduces a sophisticated architecture for calibration:

  1. Parameterized MLP Scalers: Each client trains a small Multi-Layer Perceptron (MLP) to map raw model outputs (logits) to calibrated probabilities.
  2. Order-Preserving Constraints: To prevent the calibration process from altering the model's predicted class, the MLP architecture enforces monotonicity, ensuring that the highest logit remains the highest probability.
  3. Weight Matching and Aggregation: Due to permutation symmetries in neural networks, simple averaging of weights is insufficient. FedCal employs a weight-matching algorithm to align local scalers before global aggregation.
  4. Periodic Synchronization: Unlike static post-hoc methods, FedCal synchronizes scalers during the FL training process, allowing the calibration mechanism to evolve alongside the global model.

Experimental Evaluation

The framework was evaluated on MNIST, SVHN, CIFAR-10, and CIFAR-100 datasets. To simulate real-world heterogeneity, label skew was introduced using a Dirichlet distribution across 20 clients.

Impact of Data Heterogeneity

A key finding is the relationship between data non-IIDness and model performance. As the degree of non-IIDness increases (represented by higher $-\log(\beta)$ values), both accuracy and calibration typically degrade.

Performance metrics (Accuracy and Calibration Error) as a function of the degree of non-IIDness across MNIST and CIFAR-10 datasets.

FedCal demonstrates remarkable robustness, maintaining stability even under extreme label skew where baseline methods fail. The authors provide a mathematical proof that global calibration error has an asymptotic lower bound in non-IID settings, highlighting the necessity of specialized frameworks like FedCal.

Key Results and Discussion

  • Significant Error Reduction: FedCal outperformed five state-of-the-art baselines, achieving an average reduction of 47.66% in global Expected Calibration Error (ECE).
  • Accuracy Preservation: The order-preserving design ensures that calibration improvements do not come at the cost of top-k accuracy; in some cases, accuracy even saw marginal improvements.
  • Robustness: While other methods like Deep Ensembles struggle as data becomes more diverse, FedCal remains effective even under extreme heterogeneity.

Conclusion and Future Directions

FedCal effectively bridges the reliability gap in Federated Learning. While it introduces a slight communication overhead and requires local validation sets, it provides a robust path toward trustworthy AI in decentralized settings. Future work may involve integrating privacy-preserving techniques like Homomorphic Encryption or Differential Privacy to further secure the parameter aggregation process against potential information leakage.

Summary updated

BibTeX
@inproceedings{peng2024fedcal,
  author = {Hongyi Peng and Han Yu and Xiaoli Tang and Xiaoxiao Li},
  title = {{FedCal: Achieving Local and Global Calibration in Federated Learning via Aggregated Parameterized Scaler}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=XecUTmB9yD},
}
Figure