HarmoFL: Harmonizing Local and Global Drifts in Federated Learning on Heterogeneous Medical Images

Meirui Jiang, Zirui Wang, Qi Dou

Abstract

Federated Learning (FL) in medical imaging faces significant challenges due to feature heterogeneity across different clinical sites, leading to local and global optimization drifts. We present HarmoFL, a framework that harmonizes these drifts through frequency-domain amplitude normalization and weight perturbation. By aligning local feature distributions and seeking flat optima in the loss landscape, HarmoFL enables robust model aggregation without additional communication overhead. Experimental results across multiple medical imaging tasks demonstrate that HarmoFL significantly outperforms existing state-of-the-art FL methods.

Introduction

Federated Learning (FL) facilitates collaborative model training across multiple institutions while preserving data privacy. However, medical images often exhibit substantial "feature heterogeneity" due to variations in scanner hardware, imaging protocols, and staining techniques. This non-IID (non-independent and identically distributed) nature of data causes two distinct but coupled optimization challenges:

  1. Local Drift: Individual client models overfit to site-specific image styles rather than generalizable medical features.
  2. Global Drift: Aggregating divergent local models at a central server results in a suboptimal global model because local solutions reside in disparate regions of the parameter space.

HarmoFL addresses these issues by jointly harmonizing local feature spaces and global optimization trajectories.

Methodology

HarmoFL introduces two complementary strategies to mitigate optimization drift.

Local Harmonization: Amplitude Normalization

To address local drift, HarmoFL leverages the properties of the Fourier transform. In the frequency domain, an image's amplitude component typically represents low-level stylistic information (e.g., contrast, brightness), while the phase component preserves high-level structural and anatomical details.

Amplitude normalization process using FFT to align local features while preserving structural phase information.

As shown in the figure above, HarmoFL normalizes the amplitude of local images to a shared global amplitude. This process standardizes the "style" of images across all clients without requiring the exchange of raw data, forcing models to learn from a harmonized feature space.

Global Harmonization: Weight Perturbation for Flat Optima

To resolve global drift, HarmoFL aims to find "flat optima" in the loss landscape. Standard optimization often converges to sharp minima, where small parameter changes lead to large loss increases. Sharp minima from different clients are difficult to aggregate effectively.

Comparison of loss landscapes showing how HarmoFL (Local + Global) aligns local solutions within a flat region, facilitating better global aggregation.

HarmoFL applies a self-generated weight perturbation during local training. This encourages the model to converge to a region where the loss is consistently low (a flat minimum). As illustrated in the loss landscape comparison, this approach ensures that local solutions ($F_i^*$) are closer to the optimal global solution ($F^*$), making the simple averaging process of Federated Averaging (FedAvg) significantly more effective.

Experimental Evaluation

The framework was validated on three diverse medical imaging datasets: breast cancer histology classification (Camelyon17), multi-source histology nuclei segmentation, and multi-site prostate MRI segmentation.

Key Results

HarmoFL consistently outperformed state-of-the-art methods, including FedBN, FedProx, and MOON:

  • Superior Accuracy: In the breast cancer classification task, HarmoFL achieved an average accuracy of 95.48%, compared to 87.33% for FedBN.
  • Enhanced Segmentation: The method improved the Dice coefficient by at least 4% across nuclei segmentation tasks.
  • Robustness and Convergence: HarmoFL demonstrated stable convergence and maintained high performance even with increased local training epochs, a scenario where traditional FL methods typically degrade due to extreme drift.

Conclusion

HarmoFL provides a communication-efficient solution to the problem of feature heterogeneity in medical FL. By combining frequency-domain normalization with flatness-aware optimization, it effectively harmonizes local and global drifts. Future work will explore the impact of label shift and further theoretical refinements of the drift bounds in highly heterogeneous environments.

Summary updated

BibTeX
@inproceedings{jiang2022harmofl,
  author = {Meirui Jiang and Zirui Wang and Qi Dou},
  title = {{HarmoFL: Harmonizing Local and Global Drifts in Federated Learning on Heterogeneous Medical Images}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i1.19993},
}
Figure