GTAFL: Addressing Test-Agnostic Long-Tailed Federated Learning in Medical Image

Guangyu Chen, Jingyun Zeng, Hui JiangarXiv 2026 · DOI

In the world of medical AI, two major hurdles often collide: data privacy and data imbalance. Federated Learning (FL) solves the first by training models across decentralized devices without sharing raw data. However, the second remains a thorn in the side of researchers. Real-world medical data is notoriously "long-tailed"—common conditions are overrepresented, while rare but critical diseases are scarce.

Most existing solutions assume that even if training data is imbalanced, the model will eventually be tested on a "uniform" distribution. But what if the test environment is unpredictable? A model trained on a population of mostly healthy individuals might suddenly face an epidemic where the "tail" (sick patients) becomes the "head."

A new paper, "GTAFL: Addressing Test-Agnostic Long-Tailed Federated Learning in Medical Image," introduces a framework designed to handle these unpredictable shifts in test-time distributions.

TL;DR

GTAFL is a federated learning framework that tackles "test-agnostic" long-tailed data—scenarios where the test distribution is unknown and potentially different from the training distribution. By using synthetic feature generation and server-side self-supervised learning, it trains multiple "expert" classifiers that collaboratively handle various data shifts, outperforming state-of-the-art methods by up to 8.5% on challenging test sets.

What Problem Does This Paper Address?

The authors identify a gap in current Federated Learning research: Test-Agnostic Long-Tailed (TALT) learning.

In medical settings, class imbalance exists at both global and local levels. Locally, one hospital might see mostly one type of pathology; globally, rare diseases are always in the minority. Existing FL methods typically optimize for a uniform test distribution. However, in practice, the test distribution is agnostic—it could be forward-leaning (matching the training tail), uniform, or even "backward" (where rare classes suddenly become common).

The challenge of class imbalance and unpredictable test distributions in federated settings.

As shown in Figure 1, existing methods fail when the test distribution deviates from the training assumptions. For instance, a model's performance can catastrophically degrade during an epidemic if it was only optimized for a "healthy-heavy" training set.

Methods

The GTAFL (Global Information-Guided Test-Agnostic Federated Learning) framework consists of four main pillars:

  1. Global Information-Guided Data Sampling (GI-GDS): This is a hybrid sampling strategy. It uses global class counts (shared by the server) to help clients balance their local training. If a client's local distribution is very different from the global average, it prioritizes local patterns; otherwise, it follows the global signal to avoid oversampling noisy rare classes.
  2. Expert Classifier Retraining with GFF: To handle different test scenarios, the server trains three specialized "expert" classifiers: Forward, Uniform, and Backward. Since the server cannot see raw data, it uses Global Federated Features (GFF)—synthetic features generated by matching the gradients sent by clients. This allows the server to "simulate" balanced or reverse-imbalanced datasets for retraining.
  3. Self-Supervised Refinement (SimCLR): The server uses unlabeled data (common in medical imaging) to refine the feature extractor using SimCLR. This helps the model learn robust, distribution-invariant representations without needing extra labels.
  4. Class-wise Experts Ensemble: During inference, the model doesn't just rely on one classifier. It uses a hard-voting ensemble of the three experts to make a final prediction, ensuring robustness regardless of the actual test distribution.
The GTAFL workflow: from local client training to server-side expert retraining and self-supervised refinement.

Datasets

The authors evaluated GTAFL on three benchmarks:

  • CIFAR10-LT: A long-tailed version of the classic object recognition dataset.
  • PathMNIST-LT: A colon pathology dataset (9 classes) with artificial long-tails.
  • OCTMNIST-LT: A retinal optical coherence tomography dataset (4 classes).

All datasets were partitioned using a Dirichlet distribution ($\alpha=0.5$) to simulate the non-IID (non-independent and identically distributed) nature of real-world federated clients.

Key Insights and Ideas

  • Specialization is Key: The authors found that a single classifier cannot be optimal for all test distributions. By training experts on synthetic features with different "priors" (Forward, Uniform, Backward), the model gains a "toolbox" for any test scenario.
  • Gradients as Data Proxies: The use of "Global Federated Features" is a clever privacy-preserving trick. By matching gradients, the server can reconstruct the essence of the data classes without ever seeing a single pixel of a patient's scan.
  • Self-Supervision Buffers Data Scarcity: One of the most striking findings was that server-side self-supervised learning (SimCLR) becomes increasingly valuable as labeled training data decreases. It helps maintain a high-quality feature space even when the classifiers are struggling with imbalance.

Key Results

GTAFL consistently outperformed baselines like FedAvg, FedProx, and CReFF across all test distributions.

  • Backward Robustness: On the "Backward50" test (where the rarest training classes are the most common test classes), GTAFL achieved a 76% improvement over FedAvg and a 6% gain over CReFF on CIFAR10-LT.
  • Average Performance: Across 11 different test distributions, GTAFL maintained the highest average accuracy (75.02% on CIFAR10-LT).
  • Data Scarcity: When training data was reduced to just 10% of the original size, GTAFL outperformed CReFF by nearly 5%, proving its robustness in data-poor medical environments.
Fig. 2: CReFF performance degradation with reduced training data size across different test distributions. Performance drops significantly as training data decreases from 100% to 10%, with Backward50 test showing the most severe degradation

Limitations and Future Work

While GTAFL is a significant step forward, the authors note a few areas for improvement:

  • Head-Class Trade-off: There is a slight "tax" on majority-class accuracy when optimizing heavily for backward distributions. Future work aims to improve "head-class fidelity" without sacrificing "tail-class robustness."
  • Computational Overhead: The server-side retraining and SimCLR refinement add computational time (though the authors argue this is acceptable since servers are typically powerful).
  • Privacy Enhancements: While the method is privacy-preserving by design, the authors suggest integrating Differential Privacy (DP) in future iterations to provide formal guarantees against sophisticated gradient-inversion attacks.

For those interested in the implementation, the code is available on GitHub.

Summary updated

Abstract

In healthcare, protecting patient privacy is crucial due to the sensitivity of medical data and its extensive accessibility. Federated Learning (FL) offers a decentralized and privacy-preserving training paradigm, making it an ideal solution for healthcare applications. A critical challenge in healthcare is that real-world medical data often exhibits long-tailed distributions in local and global views. Existing methods addressing long-tailed FL problem typically assume that the model will be evaluated on uniform test data distribution. However, practical test data in healthcare systems is often agnostic and unpredictable, leading to potential model failures in real-world scenarios. In this paper, we introduce a novel task termed Test-Agnostic Long-Tailed Federated Learning and propose GTAFL, a comprehensive framework to address this challenge. During the training stage, GTAFL employs adaptive re-sampling, expert classifier retraining, and self-supervised learning to correct biased classifiers and distorted feature spaces caused by long-tailed training distributions. During the inference stage, an ensemble mechanism combines retrained expert classifiers to handle test data with unknown distributions. Extensive experiments on CIFAR10 and two medical datasets manifest that our framework outperforms other state-of-the-art methods. The code is available at https://github.com/cgy-lavine/GTAFL
BibTeX
@misc{chen2026gtafl,
  author = {Guangyu Chen and Jingyun Zeng and Hui Jiang},
  title = {{GTAFL: Addressing Test-Agnostic Long-Tailed Federated Learning in Medical Image}},
  year = {2026},
  eprint = {2611.08021},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.08021},
}
Figure