FedBM: Stealing Knowledge from Pre-trained Language Models for Heterogeneous Federated Learning

Meilu Zhu, Qiushi Yang, Zhifan Gao, Yixuan Yuan, Jun Liu

TL;DR

FedBM (Federated Bias eliMinating) tackles the severe performance drops caused by data heterogeneity in federated learning. By leveraging pre-trained language models (PLMs), it constructs a frozen, semantically rich global classifier and a conditional generator to provide domain-invariant pseudo-data, effectively neutralizing both classifier and feature extractor biases across decentralized clients.

What Problem Does This Paper Address?

Federated Learning (FL) allows multiple institutions (like hospitals) to collaboratively train machine learning models without sharing their private, raw data. However, medical data is notoriously heterogeneous; different hospitals use different imaging protocols, scanners, and see varying patient demographics.

This data heterogeneity leads to local learning bias in two main ways:

  1. Classifier Bias: Local classifiers are dominated by the specific class distributions of their local client, leading to shifted and inconsistent decision boundaries across the network.
  2. Feature Extractor Bias: Local feature extractors map the same underlying medical condition to vastly different feature spaces depending on the client's local data distribution.
Fig. 1. Data heterogeneity causes local learning bias, including classifier bias and feature extractor bias. (Best viewed in color)

When the server aggregates these biased local models, the resulting global model performs poorly. Existing methods try to fix this by constraining model parameters or using visual prototypes, but they often struggle to balance optimization with strict regularization.

Methods

The authors introduce FedBM, a framework that "steals" linguistic knowledge from vision-language foundation models (like BiomedCLIP) to anchor the federated training process. It consists of two main modules:

1. Linguistic Knowledge-based Classifier Construction (LKCC)

Instead of learning a classifier from skewed visual data, LKCC pre-constructs a global classifier using text. It takes class names (e.g., "Polyp", "Esophagitis") and wraps them in diverse prompts (e.g., "An image of {}"). These are passed through a frozen PLM text encoder to generate a distribution of concept embeddings.

Through theoretical derivation, the authors model these text embeddings as a Gaussian distribution ($\mu, \Sigma$) and define a fixed, softmax-based surrogate classifier. This high-quality classifier is distributed to all clients and frozen throughout FL training, completely eliminating classifier drift.

2. Concept-guided Global Distribution Estimation (CGDE)

To fix feature extractor bias, the server trains a lightweight conditional generator. Instead of mapping random Gaussian noise to images (which lacks structure), this generator takes probabilistic concept embeddings sampled from the LKCC text distributions as its input conditions.

The generator is optimized using three regularization terms:

  • Semantic Regularization ($L_{sem}$): Ensures generated samples are highly recognizable by the global model.
  • Diversity Regularization ($L_{div}$): Prevents mode collapse by forcing the generator to produce diverse images for similar text inputs.
  • Distribution Regularization ($L_{dis}$): Aligns the batch normalization statistics of the synthetic data with the global model.

This generator is shared with clients, who use the generated pseudo-data alongside their local data to calibrate and align their feature extractors toward a unified global distribution.

Overview of the FedBM framework showing LKCC and CGDE modules.

Datasets

FedBM was evaluated across five public medical and benchmark datasets:

  • OCT-C8: 24,000 retinal optical coherence tomography images across 8 categories.
  • Kvasir-v2: 8,000 gastrointestinal endoscopic images across 8 categories.
  • HAM10000: 10,015 dermatoscopic skin lesion images.
  • PBC: 17,092 microscopic peripheral blood cell images.
  • FEMNIST: A standard non-IID handwritten digit/letter dataset (62 classes) used to test scalability.

Data heterogeneity was simulated using a Dirichlet distribution with parameters $\beta = 0.05$ (extreme heterogeneity) and $\beta = 0.1$.

Key Insights and Ideas

  • The Power of Freezing: The authors discovered that simply freezing a randomly initialized classifier for all clients outperforms standard FedAvg under high heterogeneity. This proved that local classifier drift is a major bottleneck.
  • Text as a Universal Anchor: Text embeddings from large PLMs are inherently domain-agnostic and capture rich inter-class relationships. By aligning visual features to a fixed linguistic space, clients learn representations that generalize far better.
  • Distribution over Prototypes: Instead of using a single averaged text vector per class, modeling the text prompts as a continuous distribution (mean and variance) allows the model to capture the natural semantic diversification of visual concepts.

Key Results

FedBM consistently outperformed state-of-the-art federated learning methods (including FedAvg, FedProx, FedProto, FedNH, and FedETF), particularly in highly heterogeneous settings ($\beta = 0.05$):

  • OCT-C8: FedBM achieved 84.84% Accuracy and 84.55% F1-score, outperforming the runner-up (FedNH) by nearly 5% in accuracy.
  • Kvasir-v2: FedBM achieved 71.31% Accuracy, gapping the next best method (FedETF) by 7.54%.
  • Robustness to Scale: As the number of clients scaled up, competing methods showed sharp performance fluctuations, whereas FedBM maintained a stable, high-performance trend.

Limitations and Future Work

  • Extreme Semantic Overlap: The method may struggle with highly similar fine-grained concepts or open-set scenarios where text descriptions overlap significantly.
  • Prompt Engineering Dependency: The quality of the global classifier depends on the diversity and number of text prompts used. Automating optimal prompt selection remains an open question.
  • Privacy and Copyright: While the generator does not directly expose user-level data, a globally shared generator could theoretically be misused to synthesize data for unintended purposes. The authors suggest exploring generators that output intermediate feature maps rather than raw images to mitigate this risk.

Summary updated

BibTeX
@article{zhu2025fedbm,
  author = {Meilu Zhu and Qiushi Yang and Zhifan Gao and Yixuan Yuan and Jun Liu},
  title = {{FedBM: Stealing Knowledge from Pre-trained Language Models for Heterogeneous Federated Learning}},
  journal = {Medical Image Analysis},
  year = {2025},
  doi = {10.1016/j.media.2025.103524},
}
Figure