Abstract
Prompt learning in pretrained visual-language models has shown remarkable flexibility across various downstream tasks. Leveraging its inherent lightweight nature, recent research attempted to integrate the powerful pretrained models into federated learning frameworks to simultaneously reduce communication costs and promote local training on insufficient data. Despite these efforts, current federated prompt learning methods lack specialized designs to systematically address severe data heterogeneities, e.g., data distribution with both label and feature shifts involved. To address this challenge, we present Federated Prompts Cooperation via Optimal Transport (FedOTP), which introduces efficient collaborative prompt learning strategies to capture diverse category traits on a per-client basis. Specifically, for each client, we learn a global prompt to extract consensus knowledge among clients, and a local prompt to capture client-specific category characteristics. Unbalanced Optimal Transport is then employed to align local visual features with these prompts, striking a balance between global consensus and local personalization. By relaxing one of the equality constraints, FedOTP enables prompts to focus solely on the core regions of image patches. Extensive experiments on datasets with various types of heterogeneities have demonstrated that our FedOTP outperforms the state-of-the-art methods.
Introduction
Federated Learning (FL) aims to train AI models on decentralized data without compromising user privacy. However, training massive Vision-Language Models (VLMs) like CLIP across thousands of devices introduces significant challenges, primarily high communication costs and severe "data heterogeneity." Data heterogeneity occurs when users' data distributions differ significantly in terms of labels (Label Shift) or visual styles (Feature Shift).
Standard FL methods often struggle to find a single global consensus that fits all variations, leading to performance degradation. While prompt learning—tuning a small set of input vectors instead of the entire model—reduces communication overhead, existing federated prompt methods lack the mechanisms to effectively balance global shared knowledge with local personalization.
Methodology: The FedOTP Framework
To overcome these hurdles, we introduce FedOTP, a framework that utilizes a dual-prompt strategy and the mathematics of Optimal Transport to create a system that is both collaborative and deeply personalized.
1. Dual-Prompt Strategy
Instead of a single prompt, each client maintains two distinct types:
- Global Prompt ($P_g$): Shared and aggregated at the server to capture "consensus" knowledge (e.g., the general features of a class).
- Local Prompt ($P_{l,i}$): Maintained locally on the client's device to capture specific characteristics unique to that user's data (e.g., domain-specific traits).
2. Unbalanced Optimal Transport (UOT)
To align textual features from these prompts with visual image patches, FedOTP employs Unbalanced Optimal Transport (UOT). Unlike standard Optimal Transport, which forces every image patch to match a prompt, UOT allows the model to "ignore" irrelevant background noise (like grass or sky) and focus its attention solely on the core regions of the image. This alignment is implemented efficiently using a fast version of Dykstra’s algorithm.
Experimental Evaluation
FedOTP was evaluated against nine benchmark datasets representing various data shifts, including pathological label shifts (e.g., OxfordPets, Flowers102) and multi-domain feature shifts (e.g., DomainNet).
Key Results
FedOTP consistently outperformed state-of-the-art methods like pFedPrompt and PromptFL:
- Accuracy Gains: On the OxfordPets dataset, FedOTP achieved 98.82% accuracy, compared to 91.84% for pFedPrompt.
- Robustness to Domain Shift: On the challenging DomainNet dataset, FedOTP reached an average accuracy of 48.08%, nearly four times higher than standard PromptFL (10.29%).
- Few-Shot Efficiency: The model maintained a dominant edge even with as few as 2 or 8 images per class, proving its effectiveness in data-scarce scenarios.
Discussion and Visualization
Visual analysis through heatmaps demonstrates how the dual-prompt strategy functions. The global prompt focuses on common features (like faces or limbs), while the local prompt captures fine, client-specific details. The UOT mechanism acts as a spatial filter, preventing prompts from being "polluted" by background information.
Conclusion
FedOTP provides a sophisticated yet lightweight blueprint for the next generation of personalized, privacy-preserving vision models. By balancing global consensus with local personalization through UOT-based alignment, it effectively addresses the core challenges of data heterogeneity in federated learning. Future work will explore generalization to unseen clients and further computational optimizations for resource-constrained devices.
Summary updated