FedSSMCoOp: SSM Encoders for light-weight Federated Prompt Learning for Few-shot Classification
Organizations: Department of Computer Science and Engineering Indian Institute of Technology Hyderabad · Department of Artificial Intelligence Indian Institute of Technology Hyderabad · Department of Electrical Engineering Indian Institute of Technology Hyderabad
Abstract
Vision-Language Models (VLMs) have shown strong performance across a wide range of downstream vision tasks, thanks to the complementary information contained in the respective domains. Despite the performance gains, most of these approaches rely on aligning these domains using the cosine similarity metric, which fails to capture token-level structure and cross-modal interactions prior to the classification stage. This is especially critical in biomedical applications under federated constraints, where data sharing is restricted, labeled data is scarce at each site, and it differs widely across institutions, leading to substantial statistical heterogeneity. To overcome this issue, we propose FedSSMCoOp, a federated few-shot image classification framework that enables multimodal learning while preserving data privacy. With the help of the SSM-based Vision Mamba and Cross Mamba blocks, and by optimizing only the soft-prompt and communication-prompt updates in the federated setting, the framework prioritizes both computation and performance. Importantly, this eliminates the need to use an external Large Language Model (LLM) for feature alignment. The framework is further trained and evaluated on various biomedical image datasets, and its performance is assessed. The proposed framework delivers stable performance relative to the baselines and is, on average, 1.96 times lighter. The corresponding script will be made available soon.
Figures & tables
| Method | FL | PL | Vim | MIB | Medical | Few-shot |
| Federated Learning | ||||||
| FedAvg McMahan et al. (2017) | ✓ | ✗ | ✗ | ✗ | ✗ | |
| FedProx Li et al. (2020) | ✓ | ✗ | ✗ | ✗ | ✗ | |
| SCAFFOLD Karimireddy et al. (2020) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| Prompt Learning | ||||||
| CoOp Zhou et al. (2022b) | ✗ | ✓ | ✗ | ✗ | ✗ | ✓ |
| Dataset | Modality | Organ | #Cls | Classes | Train / Test / Val |
| BTMRI 1 | Brain MRI | Brain | 4 | Glioma, Meningioma, Normal, Pituitary | 2854 / 1717 / 1141 |
| BUSI Al-Dhabyani et al. (2020) | Breast US | Breast | 3 | Benign, Malignant, Normal | 389 / 236 / 155 |
| CHMNIST Kather et al. (2016) | Histopathology | Colon | 8 | Adipose, Complex Stroma, Debris, Empty, Immune, Normal Mucosa, Simple Stroma, Tumor Epithelium | 2496 / 1504 / 1000 |
| COVID Tahir et al. (2021) | Chest X-ray | Lungs | 4 | COVID-19, Lung Opacity, Normal, Viral Pneumonia | 10582 / 6351 / 4232 |
| LC25000 Borkowski et al. (1912) | Histopathology | Lung & Colon | 5 | Colon Adeno., Colon Benign, Lung Adeno., Lung Benign, Lung SCC | 12500 / 7500 / 5000 |
| OCTMNIST Kermany et al. (2018) | Retinal OCT | Retina | 4 | CNV, Drusen, DME, Normal | 97477 / 1000 / 10832 |
| Model/Modality | BioMedCLIP | CoCoOp | KgCoOp | PromptFL | PromptFL+FedProx | FedOTP | BioMedCoOp | FedSSMCoOp |
| Vision Modality | 86M | 86M | 86M | 38M | 38M | 38M | 86M | 26M |
| Text Modality | 110M | 38M | 38M | 38M | 38M | 38M | 38M | 38M |
| Others | - | Prompt (35k) | Prompt (659k) | Prompt (2k) | Prompt (2k) | Prompt (4k) | Prompt (86M) | Cross-Mamba (5M) |
| Total Parameters | 196M | 124M | 125M | 77M | 77M | 77M | 210M | 69M |
| Dataset | FedBiomedCLIP | FedCoCoOp | FedKgCoOp | PromptFL | PromptFL+FedProx | FedOTP | FedTPG | FedMVP | FedMPT | FedBiomedCoOp | FedSSMCoOp (Ours) |
| BTMRI | 57.08 0.00 | 48.86 7.92 | 51.19 4.62 | 41.60 3.29 | 36.93 5.44 | 31.43 3.93 | 47.13 10.10 | 44.321 | 23.12 | 50.67 4.74 | 53.64 1.78 |
| BUSI | 51.27 0.00 | 43.22 6.27 | 39.69 4.73 | 43.30 12.72 | 37.43 12.65 | 33.33 6.91 | 37.57 7.95 | 40.678 | 55.93 | 46.61 7.79 | 40.11 6.75 |
| CHMNIST | 29.06 0.00 | 49.53 1.90 | 45.48 2.53 | 30.57 6.17 | 33.60 3.78 | 34.06 9.48 | 50.82 5.69 | 50.931 | 12.50 | 52.87 2.43 | 53.39 1.67 |
| COVID | 45.84 0.00 | 44.69 1.03 | 43.52 11.06 | 42.35 8.13 | 42.30 8.20 | 37.50 2.70 | 46.31 8.46 | 41.474 | 17.08 | 43.59 16.49 | 46.71 10.13 |
| LC25000 | 51.20 0.00 | 58.72 2.63 | 55.99 7.84 | 42.90 5.52 | 55.50 5.33 | 26.25 8.40 | 64.97 4.24 | 37.840 | 20.00 | 61.88 2.99 | 68.61 4.67 |
| OCTMNIST | 35.00 0.00 | 43.30 2.18 | 32.43 2.00 | 41.80 9.72 | 40.65 9.55 | 26.25 8.40 | 35.23 4.45 | 22.100 | 25.00 | 32.57 9.67 | 34.93 5.76 |
| Component / Objective | No-LLM (FedSSMCoOp) | LLM-Server | LLM-Client | LLM-Client+Server |
| LLM prototype bank | ✗ | Server-side | Client-side | Both |
| Client text branch | Prompt only | Prompt only | Dual (prompt+ ) | Dual (prompt+ ) |
| Prompt–prototype fusion | ✗ | ✗ | Learnable | Learnable |
| Classification loss | ✓ | ✓ | ✓ | ✓ |
| Alignment loss | ✗ | ✓ | ✗ | ✓ |
| Distillation loss | ✗ | ✗ | ✗ | ✓ |
| Dataset | No-LLM | LLM-Server | LLM-Client | LLM-Client+Server |
| BTMRI | 53.64 1.78 | 44.05 7.55 | 50.55 2.64 | 46.11 6.81 |
| BUSI | 40.11 6.75 | 39.55 2.83 | 39.41 9.32 | 37.71 1.84 |
| CHMNIST | 53.39 1.67 | 52.24 1.25 | 54.01 2.25 | 52.22 1.47 |
| COVID | 46.71 10.13 | 41.90 8.94 | 45.59 11.29 | 41.99 11.27 |
| LC25000 | 68.61 4.67 | 64.38 6.39 | 71.78 4.15 | 64.67 6.39 |
| OCTMNIST | 34.93 5.76 | 31.13 5.92 | 32.73 6.22 | 31.60 6.98 |
| Dataset | ViT + no LLM | ViT + LLM | Vim + no LLM | Vim + LLM | Ours (w/o LLM) | Ours (with LLM) |
| BTMRI | 58.33 11.79 | 50.67 4.74 | 49.79 2.45 | 47.20 5.77 | 53.64 1.78 | 44.05 7.55 |
| BUSI | 41.24 2.04 | 46.61 7.79 | 39.55 10.51 | 37.15 9.91 | 40.11 6.75 | 39.55 2.83 |
| CHMNIST | 42.75 2.38 | 57.87 2.43 | 47.72 2.01 | 39.07 1.85 | 53.39 1.67 | 52.24 1.25 |
| COVID | 45.37 7.75 | 43.59 16.49 | 41.11 3.10 | 37.60 6.21 | 46.71 10.13 | 41.90 8.94 |
| LC25000 | 60.94 5.61 | 61.88 2.99 | 65.49 2.25 | 51.48 2.78 | 68.61 4.67 | 64.38 6.39 |
| OCTMNIST | 33.83 5.88 | 31.57 9.67 | 35.47 3.51 | 28.90 4.53 | 34.93 5.76 | 31.13 5.92 |
| Dataset | 4 Clients | 8 Clients | 16 Clients | ||||||
| =0.1 | =0.5 | =1.0 | =0.1 | =0.5 | =1.0 | =0.1 | =0.5 | =1.0 | |
| BTMRI | 31.59 12.96 | 32.17 12.90 | 32.81 15.43 | 33.72 15.92 | 53.64 1.78 | 42.46 6.20 | 34.50 15.50 | 52.21 7.94 | 33.59 16.13 |
| BUSI | 40.53 10.81 | 40.96 9.76 | 41.24 10.81 | 40.82 11.71 | 40.11 6.75 | 40.11 10.17 | 41.00 11.20 | 42.30 11.00 | 38.72 5.63 |
| CHMNIST | 36.37 3.80 | 36.30 4.84 | 36.19 4.37 | 33.38 4.91 | 53.39 1.67 | 36.39 3.82 | 34.22 4.82 | 35.18 4.15 | 37.20 5.94 |
| COVID | 34.84 6.65 | 34.82 6.49 | 34.56 7.49 | 34.10 7.20 | 46.71 10.13 | 34.88 6.62 | 33.68 6.99 | 34.29 6.58 | 34.84 7.12 |
| LC25000 | 48.56 3.63 | 48.77 3.72 | 49.17 3.41 | 48.49 2.79 | 68.61 4.67 | 48.67 3.41 | 48.54 3.07 | 48.72 3.31 | 48.92 2.92 |
| Model | BTMRI | BUSI | CHMNIST | COVID | LC25000 | OCTMNIST | DermaMNIST | RetinaMNIST | Kvasir | CTKidney | KneeXray |
| FedBiomedCLIP | 33.70G | 33.70G | 33.70G | 33.70G | 33.70G | 33.70G | 33.70G | 33.70G | 33.70G | 33.70G | 33.70G |
| FedCoCoOp | 38.04G | 34.17G | 53.55G | 38.04G | 38.04G | 49.67G | 41.92G | 53.55G | 41.92G | 38.04G | 38.04G |
| FedKgCoOp | 38.04G | 34.17G | 53.55G | 38.04G | 38.04G | 49.67G | 41.61G | 53.55G | 41.92G | 38.04G | 38.04G |
| PromptFL | 26.33G | 22.46G | 41.84G | 26.33G | 30.21G | 26.33G | 37.96G | 26.33G | 41.84G | 26.33G | 30.21G |
| PromptFL + FedProx | 26.33G | 22.46G | 41.84G | 26.33G | 30.21G | 26.33G | 37.96G | 26.33G | 41.84G | 26.33G | 30.21G |
| FedOTP | 41.94G | 34.13G | 73.14G | 41.94G | 49.74G | 41.94G | 65.34G | 49.74G | 73.14G | 41.94G | 41.94G |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Description |
| Federated setup | |
| Number of clients (hospitals) | |
| Client index, | |
| Communication round index | |
| Total number of communication rounds | |
| Number of local epochs per round | |
| Dataset | FedBiomedCLIP | FedCoCoOp | FedKgCoOp | FedBiomedCoOp | FedSSMCoOp (Ours) |
| BTMRI | 57.08 | 26.42 4.40 | 23.30 | 31.00 | 23.74 2.67 |
| BUSI | 51.27 | 37.85 13.23 | 17.37 | 22.10 | 36.44 13.15 |
| CHMNIST | 29.06 | 22.07 1.95 | 23.14 | 22.85 | 17.87 1.75 |
| COVID | 45.84 | 25.29 7.30 | 31.29 | 29.40 | 30.23 8.98 |
| LungColon | 51.20 | 22.97 3.69 | 28.80 | 26.15 | 20.80 6.52 |
| OCTMNIST | 35.00 | 25.40 0.86 | 21.80 | 22.45 | 19.03 5.72 |
| Dataset | FedBiomedCLIP | FedCoCoOp | FedKgCoOp | PromptFL | PromptFL+FedProx | FedOTP | FedBiomedCoOp | FedSSMCoOp (Ours) |
| BTMRI | 57.08 0.00 | 48.86 7.92 | 51.19 4.62 | 41.60 3.29 | 36.93 5.44 | 31.43 3.93 | 50.67 4.74 | 53.64 1.78 |
| BUSI Al-Dhabyani et al. (2020) | 51.27 0.00 | 43.22 6.27 | 39.69 4.73 | 43.30 12.72 | 37.43 12.65 | 33.33 6.91 | 46.61 7.79 | 40.11 6.75 |
| CHMNIST Kather et al. (2016) | 29.06 0.00 | 49.53 1.90 | 45.48 2.53 | 30.57 6.17 | 33.60 3.78 | 34.06 9.48 | 52.87 2.43 | 53.39 1.67 |
| COVID Tahir et al. (2021) | 45.84 0.00 | 44.69 1.03 | 43.52 11.06 | 42.35 8.13 | 42.30 8.20 | 37.50 2.70 | 43.59 16.49 | 46.71 10.13 |
| LC25000 | 51.20 0.00 | 58.72 2.63 | 55.99 7.84 | 42.90 5.52 | 55.50 5.33 | 26.25 8.40 | 61.88 2.99 | 68.61 4.67 |
| OCTMNIST | 35.00 0.00 | 43.30 2.18 | 32.43 2.00 | 41.80 9.72 | 40.65 9.55 | 26.25 8.40 | 32.57 9.67 | 34.93 5.76 |
| Dataset | FedCoCoOp | FedKgCoOp | PromptFL | PromptFL+FedProx | FedOTP | FedSSMCoOp (Ours) |
| BTMRI | 49.80 3.56 | 53.37 6.67 | 37.20 6.41 | 34.20 5.38 | 39.42 11.99 | 57.40 4.59 |
| BUSI | 48.31 3.00 | 42.66 7.50 | 32.43 7.02 | 26.80 | 57.73 0.24 | 45.48 3.21 |
| CHMNIST | 53.08 1.51 | 44.99 3.10 | 26.27 12.55 | 32.93 5.60 | 23.40 5.15 | 60.61 2.68 |
| COVID | 41.78 11.49 | 28.72 6.34 | 20.90 7.79 | 37.63 18.39 | 26.32 14.12 | 54.17 7.22 |
| LungColon | 53.17 12.04 | 46.44 6.89 | 46.44 6.89 | 45.90 4.92 | 40.81 16.30 | 79.09 6.20 |
| OCTMNIST | 37.33 5.00 | 33.10 2.45 | 31.40 6.10 | 31.57 9.67 | 40.00 4.81 | 32.50 5.80 |
| Dataset | FedCoCoOp | FedKgCoOp | PromptFL | PromptFL+FedProx | FedOTP | FedSSMCoOp (Ours) |
| BTMRI | 51.20 4.10 | 48.71 0.32 | 46.80 4.00 | 32.23 5.86 | 46.67 12.04 | 60.12 2.07 |
| BUSI | 47.46 15.16 | 46.33 2.34 | 56.43 0.71 | 55.55 2.75 | 39.30 12.10 | 55.08 5.96 |
| CHMNIST | 46.65 9.26 | 40.43 6.76 | 36.33 3.68 | 33.70 0.86 | 37.33 3.07 | 71.23 2.84 |
| COVID | 37.14 5.31 | 40.56 13.44 | 48.40 0.71 | 48.10 1.66 | 27.10 8.49 | 53.81 8.96 |
| LungColon | 55.00 2.88 | 44.65 6.88 | 48.27 0.88 | 46.50 4.15 | 52.80 2.49 | 88.24 1.67 |
| OCTMNIST | 47.27 7.45 | 41.35 3.10 | 38.37 5.68 | 31.23 14.20 | 36.53 14.48 | 48.03 1.90 |
| Dataset | FedCoCoOp | FedKgCoOp | PromptFL | PromptFL+FedProx | FedOTP | FedSSMCoOp (Ours) |
| BTMRI | 55.12 4.20 | 52.28 4.14 | 48.00 3.77 | 30.03 5.95 | 41.83 4.10 | 73.62 1.64 |
| BUSI | 49.43 11.53 | 40.68 14.56 | 46.50 8.20 | 43.10 6.45 | 36.47 8.73 | 61.30 8.86 |
| CHMNIST | 57.45 5.08 | 41.29 1.05 | 42.10 4.90 | 39.25 3.10 | 42.47 7.77 | 78.01 0.60 |
| COVID | 52.69 6.43 | 42.59 8.91 | 46.80 5.15 | 44.20 2.80 | 31.97 12.54 | 64.03 4.18 |
| LungColon | 65.01 4.54 | 50.32 4.11 | 51.15 3.20 | 48.40 4.10 | 44.77 4.98 | 92.40 1.10 |
| OCTMNIST | 47.47 3.40 | 44.25 2.90 | 40.10 5.10 | 34.80 9.15 | 32.80 12.95 | 61.20 1.70 |
| Dataset | FedCoCoOp | FedKgCoOp | PromptFL | PromptFL+FedProx | FedOTP | FedSSMCoOp (Ours) |
| BTMRI | 60.86 5.00 | 53.21 3.14 | 52.60 5.11 | 37.00 8.65 | 48.23 6.49 | 76.06 1.31 |
| BUSI BUSI | 60.87 6.20 | 51.70 5.34 | 50.15 7.40 | 47.50 5.10 | 40.30 10.28 | 69.21 5.04 |
| CHMNIST | 62.17 3.35 | 48.23 0.79 | 46.40 4.30 | 43.10 2.85 | 49.93 8.58 | 81.51 1.71 |
| COVID | 44.54 2.50 | 29.59 9.41 | 41.20 5.90 | 39.80 3.40 | 23.20 11.15 | 72.52 1.62 |
| LungColon | 73.71 4.01 | 52.30 3.90 | 54.80 2.15 | 51.20 3.50 | 55.67 5.09 | 92.97 1.32 |
| OCTMNIST | 57.13 8.04 | 47.10 3.15 | 43.40 5.25 | 38.50 8.60 | 39.87 16.34 | 57.60 3.95 |
| Dataset | Discriminative signal | Favoured backbone |
| CHMNIST | Global morphology | Vision Mamba |
| COVID | Global context | Vision Mamba |
| LC25000 | Tissue context | Vision Mamba |
| RetinaMNIST | Global structures | Vision Mamba |
| CTKidney | Fine details | Shot-dependent |
| BUSI | Local lesions | Attention |