Research
Federated CLIP for Resource-Efficient Heterogeneous Medical Image Classification
Overview Research area: Federated learning and vision-language models applied to medical image classification. Technical level: Intermediate — readers should be comfortable with federated learning bas
- arXiv
- 2511.07929
- Published
- 2025-11-11
- Authors
- Yihang Wu, Ahmad Chaddad
AI summary
Overview
Research area: Federated learning and vision-language models applied to medical image classification.
Technical level: Intermediate — readers should be comfortable with federated learning basics, contrastive language-image pre-training (CLIP), and parameter-efficient fine-tuning concepts.
Scope: This paper introduces FedMedCLIP, a federated learning framework that adapts a frozen CLIP model to heterogeneous, multi-institution medical imaging data using a compact masked feature adaptation module, a private local classifier, and class-wise distillation, while keeping communication and computation costs low.
What This Paper Is About
Hospitals cannot share patient images, so federated learning is used to train a shared model across institutions without moving raw data. However, medical data across hospitals is highly heterogeneous (different scanners, modalities, and anatomy sites), and full CLIP models are far too large to transmit and train repeatedly in a federated setting. This paper asks how to adapt CLIP for federated medical classification so that local clients get strong personalized performance, the global model still generalizes, and the resource cost stays practical.
Key Contributions
-
A masked Feature Adaptation Module (FAM) as the communication unit. The FAM is a compact attention-mask layer (~5×10⁵ parameters) inserted into CLIP. Only FAM parameters are uploaded to the server, while the CLIP image and text encoders stay frozen, dramatically cutting both computation and bandwidth.
-
A masked multi-layer perceptron (MLP) as a private local classifier. Each client keeps its own MLP that never leaves the client, allowing task-specific adaptation without being diluted by global averaging.
-
Class-wise adaptive KL divergence distillation. A dynamically weighted (entropy-based) consistency loss lets the shared FAM and the private MLP teach each other class-by-class, rather than forcing a single global alignment that would hurt heterogeneous clients.
-
Model compression plus ensemble inference. Parameters are cast to float16, serialized in big-endian byte order, and zlib-compressed before transmission; at inference, FAM and MLP predictions are ensembled using the same adaptive weight.
Main Findings
-
Large gains on heterogeneous skin cancer data (ISIC2019): FedMedCLIP reaches 80.4% average accuracy versus 72.21% for the best baseline (FedAPT) — roughly an 8-point improvement — and 64.65% average F1 versus weaker F1 scores for baselines that overfit class-imbalanced clients.
-
Substantially lower resource cost: On ISIC2019, FedAVG consumes 95.58 minutes and 7.569 GB of communication, while FedMedCLIP uses 68.56 minutes and 0.063 GB — roughly a 120× reduction in transmitted data. Costs are comparable to much lighter baselines such as FedAPT and FedCLIP.
-
Robustness to varying client counts and settings: FedAVG and other baselines degrade noticeably as the number of clients increases (e.g., ~5% accuracy drop for FACMIC from 5 to 10 clients on ICH), while FedMedCLIP stays stable above roughly 66% average accuracy.
-
Each component matters: Ablations show the local MLP loss adds about 7% accuracy on local clients, and the KL consistency loss adds about 1.32% average accuracy on top of that. Removing aggregation entirely collapses a client to 17.17% accuracy, confirming aggregation is still essential.
-
Strong statistical significance: Wilcoxon signed-rank tests against baselines on ISIC2019 yield p-values below 10⁻¹¹ in several client comparisons.
-
Better adversarial robustness: Under FGSM and PGD attacks on ISIC2019, PEFT baselines like FedCLIP and LoRA drop by roughly 10% on average, whereas FedMedCLIP retains higher accuracy (e.g., ~25% higher than LoRA on one client under PGD).
-
Better calibrated predictions: FedMedCLIP achieves lower expected calibration error on local clients (e.g., 1.93% on C₁ versus 2.32% for LoRA), with comparable global calibration.
-
Adapts to other backbones: Swapping in ViT-L/14, ConvNext_Large, or MambaOut-Base preserves performance (81.83% and 80.2% average accuracy, respectively), showing the approach is not tied to one architecture.
-
Compression is nearly lossless: Converting FAM weights to float16 shrinks the module from 2.01 MB to 1.36 MB with only a 0.08-point average accuracy change.
-
Known limitation: On BraTS, the global FAM underperforms prompt-based methods (64.66% versus 74.04% for FedAPT), suggesting that when feature shifts are extreme — such as across MRI modalities — a frozen CLIP backbone plus a small mask module has limited global generalization capacity.
Methodology in Plain English
The authors start with a pre-trained CLIP model and freeze both its image and text encoders. Medical images pass through the image encoder normally, while text prompts of the form "a picture of a {class}" pass through the text encoder to form class prototypes.
On top of the frozen image features, each client trains a small Feature Adaptation Module. This module outputs a per-dimension attention mask between 0 and 1 that reweights the image features, highlighting the dimensions that matter for that client's data. A similar masking trick is applied inside a small MLP classifier that lives only on the client.
Training combines three losses: a contrastive loss that aligns image and text features, a cross-entropy loss on the private MLP's predictions, and a class-wise KL divergence loss that pushes the FAM and MLP to agree. The weight on the KL loss is set dynamically based on which of the two is more confident (measured by entropy), so the more reliable branch leads the learning.
Only the FAM parameters are sent to the server, where they are averaged across clients and sent back. Before transmission, parameters are halved in precision (float32 → float16), packed with metadata, and zlib-compressed. At test time, the FAM's similarity-based predictions and the MLP's logits are combined using the same adaptive weight to produce the final classification.
Why This Matters
Research impact. The paper shows that vision-language models can be adapted to federated medical imaging without full re-pretraining or domain-matched source datasets — a constraint that previous work like FACMIC depended on. It also demonstrates that personalization (private MLP) and generalization (shared FAM) can coexist through distillation rather than being traded off.
Real-world applications:
- Multi-hospital skin cancer screening, where different dermatology clinics collect data from different body sites and need personalized yet shippable models.
- Brain tumor grading across institutions using different MRI modalities (FLAIR, T1, T1-CE, T2), where cross-modal heterogeneity is severe.
- Prostate cancer classification across hospitals with different scanner vendors, a setting the paper evaluates directly.
- Intracranial hemorrhage subtyping in distributed emergency radiology networks, where rapid, reliable predictions matter and data cannot leave the hospital.
Industry relevance. Medical AI vendors and hospital consortia face strict privacy regulation plus real bandwidth and GPU constraints. A framework whose transmitted module is under 1.5 MB and whose training finishes in a fraction of the time of standard FedAVG is far easier to deploy on modest infrastructure, and its robustness to adversarial perturbation and better calibration are directly relevant to clinical trust and regulatory review.
Future Directions
-
Improving global generalization under large feature shifts. The BraTS results show that a frozen CLIP backbone plus a small mask module struggles when modalities differ drastically. Investigating lightweight modality-aware adaptation or partially unfrozen layers could close this gap.
-
Testing on larger and more diverse client populations. Experiments use between 4 and 15 clients. Whether the stability held under 50 or 100 hospitals — with realistic stragglers and dropouts — remains open.
-
Privacy guarantees beyond data locality. The paper assumes federated learning prevents leakage, but no formal differential privacy analysis or gradient-inversion defense is provided. Adding these would strengthen the clinical case.
-
Bridging the specific approach with prompt-based methods. Prompt-based federated CLIP variants outperform the FAM on the global BraTS setting. Combining FAM with prompt learning, or ensembling across both, is a natural next step.
-
Extending beyond classification. Segmentation, detection, and report generation are the dominant tasks in clinical imaging; whether the masked adaptation and distillation scheme transfers to them is untested.
Target Audience
This paper is most useful for federated learning and medical imaging researchers, especially those working on parameter-efficient adaptation of large vision-language models. It will also appeal to applied machine learning engineers building privacy-preserving clinical AI systems, and to graduate students seeking a concrete example of combining PEFT, knowledge distillation, and model compression within a single federated pipeline. Readers should have prior familiarity with CLIP and standard federated aggregation methods such as FedAVG to fully appreciate the design choices.
Authors’ abstract
Despite the remarkable performance of deep models in medical imaging, they still require source data for training, which limits their potential in light of privacy concerns. Federated learning (FL), as a decentralized learning framework that trains a shared model with multiple hospitals (a.k.a., FL clients), provides a feasible solution. However, data heterogeneity and resource costs hinder the deployment of FL models, especially when using vision language models (VLM). To address these challenges, we propose a novel contrastive language-image pre-training (CLIP) based FL approach for medical image classification (FedMedCLIP). Specifically, we introduce a masked feature adaptation module (FAM) as a communication module to reduce the communication load while freezing the CLIP encoders to reduce the computational overhead. Furthermore, we propose a masked multi-layer perceptron (MLP) as a private local classifier to adapt to the client tasks. Moreover, we design an adaptive Kullback-Leibler (KL) divergence-based distillation regularization method to enable mutual learning between FAM and MLP. Finally, we incorporate model compression to transmit the FAM parameters while using ensemble predictions for classification. Extensive experiments on four publicly available medical datasets demonstrate that our model provides feasible performance (e.g., 8\% higher compared to second best baseline on ISIC2019) with reasonable resource cost (e.g., 120$\times$ faster than FedAVG).