FedDifRC: Unlocking the Potential of Text-to-Image Diffusion Models in Heterogeneous Federated Learning

Huan Wang, Haoran Li, Huaming Chen, Jun Yan, Jiahua Shi, Jun Shen

TL;DR

This paper introduces FedDifRC, a novel federated learning framework that leverages the representational power of diffusion models to combat data heterogeneity. By employing text-driven contrastive learning and noise-driven consistency regularization, FedDifRC significantly improves model performance in challenging non-iid scenarios.

What Problem Does This Paper Address?

Federated Learning (FL) enables collaborative model training across multiple clients without sharing their private data, preserving privacy. However, a major hurdle in FL is data heterogeneity, where the data distributions across clients are non-independent and identically distributed (non-iid). This discrepancy can lead to conflicting local optimization objectives, slowing down convergence and degrading the overall model performance. Existing methods often struggle to effectively address this issue, leading to local models overfitting their specific data distributions. This paper explores how the rich semantic understanding capabilities of modern diffusion models can be harnessed to mitigate these challenges in FL.

Methods

The core of FedDifRC lies in its two novel modules:

  • Text-Driven Diffusion Contrastive Learning (TDCL): This module leverages pre-trained diffusion models (specifically Stable Diffusion) to generate conditional diffusion representations. For a given input image, TDCL uses a text prompt corresponding to its class label to guide the diffusion model. The resulting representations are used to construct an inter-contrastive learning strategy. The goal is to pull the client's local model embedding closer to these semantically rich, text-guided representations while pushing away representations from incorrect classes. This helps the local model learn more general class-relevant information.
  • Noise-Driven Diffusion Consistent Restriction (NDCR): To ensure stable convergence, NDCR utilizes the inherent denoising process of diffusion models. It extracts denoising feature maps from intermediate layers of the diffusion model's UNet during the reverse diffusion process. These features act as a "virtual teacher" to guide the local model's optimization. NDCR enforces a regularization penalty that pulls the local model's embedding towards these denoising representations, promoting uniformity in the feature space and preventing over-optimization on local data.

FedDifRC combines these two modules with the standard cross-entropy loss for local training. The framework can also be extended to a self-supervised setting by modifying the text prompts used for generating representations, eliminating the need for labeled data.

Datasets

The paper evaluates FedDifRC on several standard benchmark datasets:

  • CIFAR10 & CIFAR100: Used for evaluating performance under various non-iid scenarios.
  • TinyImageNet: Used for evaluating performance on a larger dataset.
  • Digits (MNIST, USPS, SVHN, SYN): Used to test performance in domain shift scenarios.
  • Office-Caltech: Another dataset used for domain shift evaluation.

The authors also create imbalanced versions of CIFAR10, CIFAR100, and TinyImageNet (denoted as CIFAR10-LT, CIFAR100-LT, and TinyImageNet-LT) by shaping the data into long-tailed distributions to simulate imbalance shift.

Key Insights and Ideas

  • Diffusion Models as "Steers" for FL: The paper posits that diffusion models, with their ability to capture rich semantic and structural information, can act as powerful "steers" to guide federated learning, especially in the presence of data heterogeneity.
  • Conditional Representations for Semantic Guidance: Using text prompts to condition diffusion models allows for the generation of semantically meaningful representations that can help align local models with broader class concepts, even when local data is biased.
  • Denoising Features for Stability: The denoising process of diffusion models inherently captures consistent semantic information across different layers. Leveraging these features provides a stable regularization signal, preventing local models from diverging too much.
  • Fused Features Outperform Single Layers: Combining diffusion features from multiple layers (via PCA and concatenation) yields better performance than using features from any single layer, indicating that a multi-faceted representation is most effective.
  • Self-Supervised Potential: The framework's ability to work in a self-supervised manner is a significant advantage, as it reduces reliance on labeled data, which is often scarce in real-world FL scenarios.

Key Results

  • FedDifRC consistently outperforms various state-of-the-art federated learning baselines across multiple non-iid scenarios (label shift, imbalance shift, domain shift).
  • Ablation studies show that both TDCL and NDCR contribute significantly to the overall performance, with their combination yielding the best results.
  • The fused features from diffusion models demonstrate superior performance compared to features from individual layers.
  • The paper shows that FedDifRC is robust to the choice of diffusion model parameters like time-steps ($t$) and temperature ($\tau$).
  • In self-supervised settings, FedDifRC achieves excellent performance without requiring any labeled data.

Limitations and Future Work

  • Computational Cost: While the paper doesn't explicitly detail computational overhead, using large pre-trained diffusion models can be computationally intensive.
  • Reliance on Pre-trained Models: The effectiveness of FedDifRC is dependent on the quality and relevance of the pre-trained diffusion models.
  • Future Work: The authors suggest exploring more advanced diffusion model architectures and further investigating the theoretical properties of FedDifRC. They also hint at extending the framework to other domains beyond image classification.

Summary updated

BibTeX
@inproceedings{wang2025feddifrc,
  author = {Huan Wang and Haoran Li and Huaming Chen and Jun Yan and Jiahua Shi and Jun Shen},
  title = {{FedDifRC: Unlocking the Potential of Text-to-Image Diffusion Models in Heterogeneous Federated Learning}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure