Abstract
Federated learning enables building a shared model from multicentre data while storing the training data locally for privacy. In this paper, we present an evaluation (called CXR-FL) of deep learning-based models for chest X-ray image analysis using the federated learning method. We examine the impact of federated learning parameters on the performance of central models. Additionally, we show that classification models perform worse if trained on a region of interest reduced to segmentation of the lung compared to the full image. However, focusing training of the classification model on the lung area may result in improved pathology interpretability during inference. We also find that federated learning helps maintain model generalizability. The pre-trained weights and code are publicly available at (https://github.com/SanoScience/CXR-FL).
Introduction
Medical imaging research frequently encounters significant barriers due to data privacy regulations such as GDPR and HIPAA. While high-performing deep learning models require massive, diverse datasets, hospitals are often restricted from sharing raw patient images. Federated Learning (FL) offers a paradigm shift by bringing the model to the data rather than the data to the model. This study, CXR-FL, explores the implementation of FL for chest X-ray analysis, focusing on how decentralized training parameters affect performance and how image preprocessing—specifically lung segmentation—impacts both diagnostic accuracy and clinical interpretability.
Methodology
The CXR-FL framework utilizes a two-stage cascading pipeline designed to operate within a federated environment:
- Federated Segmentation: A UNet++ model with an EfficientNet-B4 backbone is trained to isolate lung regions from the background. This stage ensures that subsequent classification can be focused specifically on the anatomical area of interest.
- Federated Classification: Using the masks generated in the first stage, classification models (ResNet50 and DenseNet121) are trained on two data variants: original full images and segmented lung-only images.
The training process employs the FedAvg (Federated Averaging) algorithm via the Flower framework. In each communication round, clients download the global model, perform local fine-tuning, and return updated weights to a central server for aggregation. To evaluate clinical relevance, Grad-CAM (Gradient-weighted Class Activation Mapping) is used to visualize the regions influencing the models' decisions.
Data and Experimental Setup
The study utilized two distinct data sources:
- Segmentation Dataset: A combined dataset of 6,380 images used to train the UNet++ model.
- RSNA 2018 Dataset: 26,684 images from the RSNA Pneumonia Detection Challenge, categorized into "Normal," "No Lung Opacity / Not Normal," and "Lung Opacity."
Experiments were conducted by varying the number of clients (up to 3), the number of local epochs, and the fraction of participating clients per round to observe convergence dynamics and model stability.
Results and Discussion
The Interpretability-Accuracy Trade-off
A primary finding of the research is the trade-off between raw performance and interpretability. Models trained on full images generally achieved higher accuracy (up to 0.757 with ResNet50). However, Grad-CAM visualizations revealed that these models often relied on "shortcuts" or background noise outside the lung area. Conversely, models trained on segmented images, while slightly less accurate, demonstrated much higher clinical reliability by focusing strictly on lung pathology.
Federated Learning as a Regularizer
The study observed that FL acts as an inherent regularizer. Models trained on a single client's data exhibited rapid overfitting. In contrast, the multi-client federated environment helped maintain model generalizability, as the aggregation of weights from diverse local distributions prevented the global model from over-specializing on a single site's data characteristics.
Convergence and Stability
In the segmentation task, the model achieved a high-quality Jaccard score of 0.924. Increasing the number of local epochs and the fraction of participating clients led to faster convergence. Among the classification architectures, ResNet50 proved more stable than DenseNet121 in the FL setting, maintaining lower and more consistent loss values across various client configurations.
Conclusion
CXR-FL demonstrates that federated learning is a viable and robust method for training chest X-ray analysis models while preserving patient privacy. While full-image training currently yields higher accuracy, the improved interpretability offered by lung segmentation suggests it may be more suitable for clinical deployment where trust and transparency are paramount. Future work will focus on scaling the number of clients and addressing the challenges of non-IID (Independent and Identically Distributed) data in larger, more heterogeneous hospital networks.
Summary updated