FAA-CLIP: Federated Adversarial Adaptation of CLIP

Yihang Wu, Ahmad Chaddad, Christian Desrosiers, Tareef Daqqaq, Reem Kateb · DOI

TL;DR

FAA-CLIP introduces a communication-efficient and domain-robust framework for deploying Contrastive Language-Image Pre-training (CLIP) in federated learning settings. By freezing the core CLIP model and training a lightweight feature adaptation module alongside an adversarial domain classifier, it dramatically reduces communication overhead while bridging the performance gap on highly heterogeneous and medical datasets.

What Problem Does This Paper Address?

Federated Learning (FL) allows multiple institutions (like hospitals) to collaboratively train a machine learning model without sharing their private raw data. While Vision-Language Models (VLMs) like CLIP show incredible performance on general tasks, deploying them in an FL pipeline faces two major roadblocks:

  1. Massive Communication Costs: CLIP models are huge (often exceeding $10^8$ parameters). Constantly transmitting these weights between local clients and a central server creates a massive bandwidth bottleneck.
  2. Data Heterogeneity and Domain Shifts: Data across different clients is rarely distributed identically (non-IID). More importantly, models pre-trained on natural images (like cats and dogs) generalize poorly to specialized fields like medical imaging due to a severe domain gap.

The authors tackle these challenges by asking: How can we efficiently adapt a massive, pre-trained foundation model to diverse, decentralized datasets—especially medical ones—without melting our network bandwidth?

Methods

The authors propose FAA-CLIP (Federated Adversarial Adaptation of CLIP), which splits the learning process into two main components while keeping the heavy CLIP image and text encoders completely frozen.

Fig. 1: FAA-CLIP pipeline. Each client trains its local model separately, optimizing only the parameters of its local feature adaptation module (FAM) (atti) and domain classifier Di using contrastive and domain adaptation losses. After receiving the local client parameters, the server aggregates them into a global (FAM) (att∗) whose parameters are transmitted back to clients.
  • Feature Adaptation Module (FAM): Instead of fine-tuning CLIP, each client trains a local, lightweight FAM ($att_i$). The FAM takes the extracted CLIP features and applies a series of non-linear transformations to generate an attention mask. This mask filters and highlights task-relevant features via element-wise multiplication. Crucially, only the FAM parameters are transmitted and aggregated on the global server, reducing the payload from 345MB to just 2.5MB (a $140\times$ reduction).
  • Domain Adaptation (DA) Module: To handle data heterogeneity, each client trains a local domain classifier ($D_i$). This classifier attempts to distinguish between features from the client's local private data (source domain) and a globally available, unlabeled reference dataset (target domain). Using a gradient reversal layer, the FAM is forced to learn domain-invariant representations that trick the classifier, ensuring the model generalizes well to unseen target domains.

Datasets

The framework was evaluated across six diverse datasets split between natural and medical domains:

  • Natural Images: OfficeHome (65 classes across 4 domains), Multi-OF (a custom non-IID split of OfficeHome using a Dirichlet distribution), and ModernOffice31 (31 classes across 4 domains).
  • Medical Images: Brain Tumor (BT) (4 classes), Multi-source Skin Cancer (SC) (7 classes compiled from HAM10000 and ISIC2019), and HyperKvasir (HK) (23 gastrointestinal classes).

Key Insights and Ideas

  • The Power of Freezing: Keeping the foundation model frozen and tuning a tiny adapter is not just a computational saver; it prevents the catastrophic forgetting of robust, pre-trained features when adapting to niche domains like medicine.
  • Adversarial Alignment via Unlabeled Data: By utilizing a public, unlabeled dataset as a target domain anchor, the model successfully aligns disparate client distributions without violating user privacy.
  • The Batch Normalization Surprise: In traditional FL, keeping batch normalization (BN) parameters local (e.g., FedBN) is a standard trick to handle non-IID data. However, the authors found that for VLMs, sharing and aggregating BN parameters actually yielded better performance, challenging standard FL conventions.

Key Results

FAA-CLIP consistently outperformed state-of-the-art FL methods (including FedAvg, FedProx, MOON, LoRA, and FedCLIP) across both natural and medical benchmarks.

Fig. 3: Testing accuracy (ACC), balanced accuracy (BACC) and macro-F1 for each communication epoch using skin cancer (SC) dataset for FAA-CLIP, FedProx, FedAVG, FedCLIP, LoRAr=3, PromptFL and MOON.
  • Medical Performance Leap: On the highly challenging Skin Cancer (SC) dataset, FAA-CLIP outperformed the closely related FedCLIP by over 10% in both standard and balanced accuracy, achieving a macro-F1 score near 61% (compared to FedCLIP's ~41%).
  • Fast Convergence: As shown in the epoch-wise tracking, FAA-CLIP achieves high classification accuracy in significantly fewer communication rounds than alternative approaches.
  • Natural Image Accuracy: On the OfficeHome dataset, FAA-CLIP achieved the highest average target accuracy (84.49% on one of the splits), outperforming prompt-learning alternatives like PromptFL.

Limitations and Future Work

Despite its strong performance, the authors note a few areas for improvement:

  • Edge Device Constraints: While communication costs are low, the local computational overhead of running feature adaptation and domain classification might still challenge highly resource-constrained edge devices like mobile phones.
  • Severe Class Imbalance: In medical datasets with rare diseases, the model's accuracy did not always align perfectly with high F1-scores, indicating that severe class imbalance remains an open hurdle.
  • Future Directions: The team plans to explore separate feature adaptation modules for the text encoder and investigate specialized contrastive learning strategies tailored specifically for rare medical conditions.

Summary updated

BibTeX
@misc{wu2025faa,
  author = {Yihang Wu and Ahmad Chaddad and Christian Desrosiers and Tareef Daqqaq and Reem Kateb},
  title = {{FAA-CLIP: Federated Adversarial Adaptation of CLIP}},
  year = {2025},
  eprint = {2503.05776},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.05776},
}
Figure