Related Experiment Video
Updated: Sep 2, 2026

A 3D Digital Model for the Diagnosis and Treatment of Pulmonary Nodules
Published on: May 19, 2023
Development and external validation of machine-learning models for diagnosing malignant pleural effusion
Aihua Wu1, Shanshan Wang1, Hongying Ma2
1Department of Laboratory Medicine, The First Affiliated Hospital of Ningbo University, Ningbo, Zhejiang, China.
Background:
Clinicians face challenges in diagnosing malignant pleural effusion (MPE) and distinguishing it from benign causes. This study aimed to develop and validate machine learning (ML) models for this purpose.
Methods:
The retrospective study included 1,530 untreated patients with pleural effusion (PE) between January 2016 and December 2025. Clinical variables, including age, sex, smoking status, and laboratory indices were collected for analysis. The patients were randomly divided into the training and test sets at a ratio of 7:3. Six ML algorithms were developed and compared to determine the best diagnostic model for MPE using seven metrics, calibration curve, and decision curve. The SHapley Additive exPlanations (SHAP) values were used to interpret the model. An independent cohort of 244 PE patients was used for external validation.
Results:
Based on the feature importance analysis, the XGBoost (extreme gradient boosting) model achieved the best diagnostic performance in the training set, with an AUC of 0.988 (95% CI: 0.982-0.993), the lowest brier score 0.037 (95% CI: 0.029-0.045), and high values for accuracy of 0.951, sensitivity of 0.891, specificity of 0.984, and F1 score of 0.928. Six features were included: fluid carcinoembryonic antigen (CEA), serum CEA, serum cytokeratin 19 fragment (CYFRA 21-1), fluid carbohydrate antigen 724 (CA724), fluid carbohydrate antigen CA199 (CA199), and fluid adenosine deaminase (ADA). SHAP analysis showed that fluid CEA, fluid ADA, and serum CYFRA21-1 were the three most important variables.
Conclusions:
We developed and validated an accurate and interpretable XGBoost model for distinguishing MPE from BPE using routine laboratory data, which might be applied in clinical practice and decision-making.