Skip to main content
Journal of Thoracic Disease logoLink to Journal of Thoracic Disease
. 2026 Mar 20;18(4):378. doi: 10.21037/jtd-2025-1524

Transthoracic ultrasound features to differentiate tuberculous from malignant pleural effusion: development of a machine learning-based clinical prediction model

Sze Shyang Kho 1,✉, William Kian Boon Law 2, Larry Ellee Nyanti 3,4, Shirin Hui Tan 5, Nai Chien Huan 4, Chiou Perng Lee 6, Syazatul Syakirin Sirol Aflah 7, Khai Lip Ng 8, Chun Ian Soo 9, Sze Kye Teoh 1, Chan Sin Chai 1, Siew Teck Tie 1, Rong Lih Ho 4, Hema Yamini Devi Ramarmuty 4, Hui Xin Tan 6, Chen Yong Tan 7, Aida Abdul Aziz 10
PMCID: PMC13190023  PMID: 42182699

Abstract

Background

Tuberculous pleural effusion (TBE) and malignant pleural effusion (MPE) are the most common causes of exudative pleural effusion in tuberculosis-endemic regions. This study evaluates transthoracic ultrasound (TUS) features of TBE vs. MPE and incorporates clinical and pleural fluid (Pf) parameters into a machine learning-based random forest (RF) model for differentiation.

Methods

This prospective observational study was conducted over 6 months across six tertiary hospitals in Malaysia, involving patients undergoing diagnostic medical thoracoscopy (MT). Diagnostic confidence for TBE and MPE was determined based on final thoracoscopic diagnosis. Logistic regression and RF models were applied to predefined clinical, imaging, and laboratory variables.

Results

Among 187 recruited patients, 132 (70 TBE and 62 MPE) subjects with at least moderate diagnostic confidence were analyzed. On TUS, TBE was more likely to be non-hyperechoic, complex, and loculated, with the presence of fibrin and less pleural thickening, while MPE showed hyperechoic effusion and hemidiaphragm nodules. Independent predictors for TBE included younger age [adjusted odds ratio (aOR) =0.94], presence of fibrin (aOR =2.86), lower Pf lactate dehydrogenase (LDH) (aOR =0.996), and higher Pf adenosine deaminase (ADA) (aOR =1.10). Without Pf ADA, these parameters, along with the absence of hemidiaphragm nodules (aOR =0.33), remained significant for TBE prediction. The RF model outperformed logistic regression (92.6% vs. 87.9% accuracy), even without Pf ADA.

Conclusions

TUS parameters can aid in differentiating TBE from MPE. The RF model demonstrated superior diagnostic performance, offering a potential point-of-care tool, even in the absence of Pf ADA.

Keywords: Transthoracic ultrasound (TUS), clinical prediction model, machine learning, artificial intelligence, tuberculous pleural effusion (TBE)


Highlight box.

Key findings

• The presence of fibrin and the absence of hemidiaphragm nodules are key predictors for tuberculous pleural effusion (TBE).

What is known and what is new?

• The diagnosis of TBE still relies heavily on pleural biopsy. Current available prediction algorithms primarily include clinical and pleural fluid (Pf) parameters using conventional logistic regression models and are heavily dependent on Pf adenosine deaminase (ADA) levels.

• Incorporating transthoracic ultrasound (TUS) findings into these models may enhance diagnostic accuracy by using machine learning-based prediction approaches.

What is the implication, and what should change now?

• A clinical prediction model incorporating TUS variables using the random forest model achieved high diagnostic accuracy—even without Pf ADA—in differentiating TBE from malignant pleural effusion.

Introduction

Exudative pleural effusion commonly requires a biopsy to determine the underlying cause. In tuberculosis (TB)-endemic regions, tuberculous pleural effusion (TBE) and malignant pleural effusion (MPE) are the most frequent causes of exudative pleural effusion, and the leading diagnoses among patients undergoing medical thoracoscopic biopsy (1-3). While MPE cases often necessitate biopsy for diagnostic confirmation and molecular profiling, most TBE cases may not require biopsy or drainage.

Although pleural fluid (Pf) indices, such as adenosine deaminase (ADA), can help differentiate between the two in appropriate clinical circumstances, Pf ADA may not be readily accessible in resource-limited regions. Moreover, the optimal cut-off value varies depending on the local prevalence of TB (4). Consequently, the diagnosis of TBE in our region still heavily depends on the analysis of clinical, demographic, and Pf parameters, often still necessitating pleural biopsy for a confident diagnosis and importantly to differentiate from MPE (5-11). Therefore, a clinical prediction model to distinguish between these two conditions could help clinicians stratify patients and expedite treatment.

Point-of-care imaging, such as transthoracic ultrasound (TUS), may be helpful in TBE prediction but has rarely been described. Previous studies have shown that a complex ultrasound pattern in lymphocytic pleural effusion and the presence of fibrin can be a potentially useful diagnostic predictor to differentiate TBE from MPE, with a high positive predictive value (12,13). However, current TBE diagnostic algorithms typically include only clinical indices such as age and Pf parameters like differential cell count, ADA, protein, and lactate dehydrogenase (LDH) (5-11). The incorporation of point-of-care TUS findings into clinical diagnostic algorithms has not been extensively explored. Additionally, the use of machine learning algorithms has gained popularity recently and may improve conventional clinical prediction models (14,15).

In this study, we aim to assess the prevalence and diagnostic performance of pre-determined TUS features in predicting the diagnosis of TBE from MPE. Additionally, we seek to identify clinical, Pf, and TUS parameters that differ between TBE and MPE, and to develop a clinical prediction model for TBE using a random forest (RF) model. We present this article in accordance with the TRIPOD reporting checklist (available at https://jtd.amegroups.com/article/view/10.21037/jtd-2025-1524/rc).

Methods

Study design & setting

This is a prospective observational study involving six tertiary public and academic hospitals in Malaysia. All adult patients over 18 years old presenting with undiagnosed pleural effusion and scheduled for diagnostic medical thoracoscopy (MT) at the respective sites during the first quarter of 2023 for 6 months (1 March 2023 to 31 August 2023) were considered for inclusion. For the purpose of the study, only TBE and MPE with at least moderate confidence in diagnosis will be included in the final analysis. The study was conducted in accordance with the Declaration of Helsinki and its subsequent amendments. The study protocol was approved by the Medical Research & Ethics Committee, Ministry of Health Malaysia [NMRR ID-22-02920-7RL (IIR), dated 28 February 2023, ClinicalTrials.gov ID NCT05935696]. All participating hospitals were informed and agreed on the study. Written informed consent was obtained from each patient included in the study.

Workflow for undiagnosed exudative pleural effusion

All patients with pleural effusion were assessed as per standard international recommendations (16). After initial clinical assessment with history taking, physical examination, and preliminary laboratory investigations, diagnostic thoracentesis was performed and sent for routine biochemical (pH, protein, LDH, glucose, etc.), microbiological, and cytological analysis. Depending on clinical suspicion, other ancillary tests such as Pf ADA, triglyceride/cholesterol were sent as per physician’s discretion. Notably, quantitative cell counts and interferon-gamma release assay (IGRA) of Pf were not routinely performed in most institutions in our region. Pleural effusion was classified into transudative and exudative pleural effusion based on Light’s criteria. If the cause of exudative pleural effusion remained undetermined after initial clinical assessment, the patient was subjected to MT for pleural biopsy as per standard local practice. Procedural details of MT can be found in Appendix 1.

Workflow for TUS and validation of result

For all undiagnosed exudative pleural effusions planned for MT, point-of-care TUS was performed to assess the feasibility of the procedure and determine the preferred point of entry. All TUS was conducted by the managing pulmonologist using a low-frequency (1.5–4.5 MHz) convex transducer. Patients were assessed in both the sitting and lateral decubitus positions. A total of six zones were evaluated, and the pre-determined TUS parameters of interest were listed in Appendix 1.

A pilot validation project was conducted to ensure consistency and reliability in the evaluation of TUS findings. This involved 18 patients, whose recorded loops of TUS videos were independently scored by a total of 15 raters, including a senior thoracic radiologist and primary investigators from multiple sites. The raters assessed a set of predefined TUS parameters, and interrater reliability was analyzed using Fleiss’ kappa to evaluate agreement across the group. The overall Fleiss’ kappa value for the pilot study was 0.837 [95% confidence interval (CI): 0.824–0.849; P<0.001], indicating substantial agreement among the raters. The overall accuracy of the raters’ evaluation against the benchmark (senior thoracic radiologist) was 82.14%. These results demonstrate that the raters’ evaluations closely matched the gold standard. Further details on the data and analysis are available in Tables S1,S2. Before patient recruitment, all participating investigators attended a joint training and calibration session where representative TUS videos and still images were reviewed and scored collectively. This process clarified descriptor definitions and reduced inter-operator variability.

Diagnostic confidence for tuberculous and MPE

The criteria for TBE and MPE diagnosis for the purpose of the study are outlined below.

TBE

  • ❖ Definite: positive growth of Mycobacterium TB (MTB) culture, positive TB-polymerase chain reaction (PCR), or positive Xpert MTB/rifampicin (RIF) from pleural biopsy specimen;

  • ❖ High confidence: histological evidence of caseating granuloma from pleural biopsy without microbiological evidence;

  • ❖ Moderate confidence: histological evidence of non-caseating granuloma from pleural biopsy without microbiological evidence in patient with no other apparent cause of an exudative pleural effusion;

  • ❖ Low confidence: non-specific inflammatory pleuritis on biopsy specimen, but started on empirical anti-TB treatment based on clinical judgement.

MPE

  • ❖ Definite: histological or cytological evidence of a specific diagnosis of malignancy from pleural biopsy or Pf cytology;

  • ❖ Low confidence: non-specific inflammatory pleuritis on biopsy specimen in a patient with a background of advanced malignancy (para-malignant).

Statistical analysis

Data analysis was conducted using SPSS software (version 20; Chicago, IL, USA) and R version 4.3.1. The Shapiro-Wilk test was employed to assess normality. Normally distributed variables were presented as mean ± standard deviation (SD), while non-normally distributed variables were expressed as median and interquartile range (IQR). Categorical data were presented as frequency (n) and percentage (%), and comparisons were made using Pearson’s Chi-squared test or Fisher’s exact test. Independent t-tests and Mann-Whitney tests were utilized to compare normally and non-normally distributed variables between groups, respectively. A significance level of P<0.05 was applied.

Missing data were found in few variables of interest, such as Pf LDH, Pf ADA, and Pf glucose. Multivariate imputation by chained equations (MICE) with predictive mean matching (pmm) technique was applied to impute missing values using known values from other variables in the dataset. The imputation was performed in R version 4.3.1 and mice package in 10 imputations and 20 iterations to generate the final dataset for clinical prediction models (17). In this study, both regression and RF models were implemented in R version 4.3.1 using packages, such as glm, caret, pROC, and randomForest (18-20) (Appendix 1).

Results

Of the 187 patients recruited across all sites, a final diagnosis was established in 147 out of 187 cases (78.6%), while 40 cases (21.4%) remained non-diagnostic and were classified as non-specific pleuritis (NSP). TBE was diagnosed in 76 patients (40.6%), with 28 cases (36.8%) classified as definite, 20 (26.3%) as high confidence, 22 (28.9%) as moderate confidence, and 6 (7.9%) as low confidence diagnosis. MPE was identified in 71 cases (38.0%), with 62 cases (87.3%) classified as definite and 9 (12.7%) as low confidence.

For the purpose of the study, only TBE and MPE cases with at least moderate confidence in diagnosis were included, resulting in a total of 132 subjects analyzed. A detailed flowchart is provided in Figure 1.

Figure 1.

Figure 1

Flowchart of subject recruitment and classification of pleural effusion cases.

Baseline demographic characteristics, Pf, and serum investigations

Approximately two-thirds (62.9%) of the cohort were male, with a median age of 61 years. One-third (28.8%) of the subjects were smokers. Patients with TBE were significantly younger than those with MPE [median age, 53.5 (IQR, 32.5) vs. 66.6 (IQR, 14.5) years, P<0.001], demonstrating a bimodal age distribution at 20.1–30 and 60.1–70 years old age groups (Table S3).

There were no significant differences in comorbidities between the two groups. Blood investigations revealed lower mean serum albumin levels in the TBE group compared to the MPE group (30.33±6.49 vs. 34.45±5.49 g/L, P<0.001). Similarly, TBE group had higher urea and creatinine levels. However, there were no differences in hematological parameters, serum protein levels, or LDH between the groups.

There were no significant differences in Pf pH, protein, or glucose levels between the groups. However, MPE exhibited significantly higher mean Pf LDH levels compared to TBE (863.56±871.54 vs. 519.33±543.79 U/L, P=0.009). Conversely, TBE demonstrated significantly higher mean Pf ADA levels than the MPE group (50.29±22.42 vs. 20.71±26.72 U/L, P<0.001) (Table 1).

Table 1. Baseline characteristic of study subjects.

Variables Overall (n=132) TBE (n=70) MPE (n=62) P value
Baseline demographic characteristics
   Age (years) 61 [27] 53.5 [32.5] 66.6 [14.5] <0.001
   Gender 0.15
    Male 83 (62.9) 48 (69.0) 35 (56.0)
    Female 49 (37.1) 22 (31.0) 27 (44.0)
   Smoking 0.74
    Non-smoker 94 (71.2) 49 (70.0) 45 (73.0)
    Smoker 38 (28.8) 21 (30.0) 17 (27.0)
   Co-morbidities
    Diabetes mellitus 33 (25.0) 16 (23.0) 17 (27.0) 0.55
    Hypertension 56 (42.4) 24 (34.3) 32 (51.6) 0.053
    Heart failure 3 (2.3) 1 (1.4) 2 (3.2) 0.60
    Renal failure 13 (9.8) 9 (12.9) 4 (6.5) 0.25
Baseline laboratory parameters
   Serum hemoglobin (g/L) 11.97±1.99 11.70±1.86 12.26±2.10 0.11
   Serum total white cell (×109/L) 8.65±3.86 8.34±4.46 9.01±3.05 0.31
   Serum platelet (×109/L) 354.16±117.32 356.10±116.02 351.97±119.68 0.84
   Serum albumin (g/L) 32.27±6.37 30.33±6.49 34.45±5.49 <0.001
   Serum urea (mmol/L) 5.27±4.20 5.97±5.16 4.49±2.57 0.04
   Serum creatinine (μmol/L) 113.22±142.73 141.01±184.89 81.84±56.51 0.02
   Serum protein (g/L) 69.81±9.53 70.02±11.09 69.58±7.49 0.78
   Serum LDH (U/L; n=131) 301.50±221.15 267.01±151.53 341.08±276.74 0.07
Baseline Pf parameters
   Pf pH (n=104) 7.65±0.36 7.68±0.39 7.61±0.31 0.29
   Pf LDH (U/L; n=131) 682.25±735.43 519.33±543.79 863.56±871.54 0.009
   Pf protein (g/L) 49.95±12.02 51.14±11.32 48.60±12.73 0.23
   Pf glucose (mmol/L; n=122) 5.23±2.75 5.20±2.18 5.27±3.30 0.89
   Pf ADA (U/L; n=113) 36.68±28.52 50.29±22.42 20.71±26.72 <0.001
Baseline TUS characteristic
   Size of effusion 0.30
    <50% hemithorax 53 (40.2) 31 (44.3) 22 (35.5)
    ≥50% hemithorax 79 (59.8) 39 (55.7) 40 (64.5)
   Laterality 0.73
    Right 76 (57.6) 39 (55.7) 37 (59.7)
    Left 56 (42.4) 31 (44.3) 25 (40.3)
   Echogenicity 0.02
    Hyperechoic 56 (42.4) 23 (33.0) 33 (53.0)
    Non-hyperechoic 76 (57.6) 47 (67.0) 29 (47.0)
   Complexity 0.002
    Complex loculated 55 (41.7) 38 (52.8) 17 (27.4)
    Unilocular 77 (58.3) 32 (47.2) 45 (72.6)
   Lung 0.11
    Bulkily collapsed 40 (30.3) 17 (24.3) 23 (37.1)
    Simple collapsed 92 (69.7) 53 (75.7) 39 (62.9)
   Hemidiaphragm nodule 43 (32.6) 14 (20.0) 29 (47.0) 0.001
   Presence of pleural thickening 120 (90.1) 61 (87.1) 59 (95.2) 0.11
   Pleural thickening (mm) 11.82±14.56 8.85±11.75 15.17±16.66 0.01
   Fibrin 71 (53.8) 48 (68.6) 23 (37.1) <0.001

Data are presented as median [IQR], n (%), or mean ± SD. ADA, adenosine deaminase; IQR, interquartile range; LDH, lactate dehydrogenase; MPE, malignant pleural effusion; Pf, pleural fluid; SD, standard deviation; TBE, tuberculous pleural effusion.

Baseline imaging characteristic

On plain chest radiographs, 76 cases (57.6%) presented with right-sided pleural effusion, and nearly two-thirds (59.8%) showed effusions occupying at least half of the hemithorax, with no significant differences between the groups (Table 1).

On TUS, TBE appeared more commonly non-hyperechoic (67.0%), while MPE was more frequently hyperechoic with swirling sign (53.0%, P=0.02). Conversely, TBE was more often complex and loculated (52.8%), whereas MPE tended to be simple and non-loculated (72.6%, P=0.002). Hemidiaphragm nodules were more commonly visualized in MPE (47.0% vs. 20.0%, P=0.001), while fibrin was more frequently observed in TBE (68.6% vs. 37.1%, P<0.001). Although pleural thickening was observed in both conditions, MPE was associated with significantly greater thickening compared to TBE (15.17 vs. 8.85 mm, P=0.01) (Table 1).

Clinical variables for predicting TBE with and without Pf ADA

Several demographics, Pf, and TUS parameters of clinical relevance were analyzed using logistic regression. In the simple logistic regression, younger age [odds ratio (OR) =0.95; P<0.001] was found to be a significant predictor for distinguishing TBE from MPE. Other significant predictors included lower Pf LDH levels (OR =0.99; P=0.01) and higher Pf ADA levels (OR =1.08; P<0.001). Key TUS features associated with TBE included non-hyperechoic effusion, absence of hemidiaphragm nodules, presence of fibrin, and minimal pleural thickening.

In the multiple logistic regression, independent predictors for TBE included younger age [adjusted OR (aOR) =0.94; P=0.004], lower Pf LDH (aOR =0.996; P<0.001), and higher Pf ADA (aOR =1.10; P<0.001). Notably, even in the absence of Pf ADA, these parameters—together with the absence of hemidiaphragm nodules (aOR =0.33; P=0.02) and presence of fibrin (aOR =2.97; P=0.02)—remained significant for TBE. Collectively, these parameters achieved a classification accuracy of 87.9% with an area under the curve (AUC) of 0.949. Without Pf ADA, the accuracy reduced to 75.8% with an AUC of 0.851 (Table 2).

Table 2. Univariable and multiple variable analysis with and without Pf ADA.

Variables Simple logistic regression Multiple logistic regression (with Pf ADA) Multiple logistic regression (without Pf ADA)
OR (95% CI) P value aOR (95% CI) P value aOR (95% CI) P value
Age 0.95 (0.93, 0.97) <0.001 0.94 (0.90, 0.98) 0.004 0.95 (0.92, 0.98) 0.001
Male 1.68 (0.83, 3.46) 0.15 2.78 (0.80, 10.58) 0.12 1.86 (0.73, 4.89) 0.20
Pf protein 1.02 (0.99, 1.05) 0.23 0.97 (0.90, 1.03) 0.32 1.02 (0.98, 1.07) 0.25
Pf LDH 0.999 (0.998, 1.00) 0.01 0.996 (0.993, 0.998) <0.001 0.998 (0.997, 0.999) 0.004
Pf glucose 0.97 (0.85, 1.11) 0.69 1.00 (0.79, 1.23) 0.97 0.99 (0.83, 1.19) 0.91
Pf ADA 1.08 (1.05, 1.12) <0.001 1.10 (1.06, 1.14) <0.001 NA NA
Hyperechoic effusion 0.43 (0.21, 0.87) 0.02 1.42 (0.43, 5.03) 0.57 0.67 (0.27, 1.64) 0.38
Hemidiaphragm nodule 0.28 (0.13, 0.60) 0.001 0.37 (0.10, 1.26) 0.12 0.33 (0.13, 0.83) 0.02
Fibrin 3.70 (1.82, 7.73) <0.001 2.86 (0.86, 10.39) 0.09 2.97 (1.20, 7.56) 0.02
Degree of pleural thickening 0.97 (0.94, 0.99) 0.02 0.98 (0.94, 1.03) 0.51 0.97 (0.94, 1.01) 0.13

ADA, adenosine deaminase; aOR, adjusted odds ratio; CI, confidence interval; LDH, lactate dehydrogenase; NA, not available; OR, odds ratio; Pf, pleural fluid.

RF models for TBE prediction

The same variables used in the logistic regression were applied in RF models built with number of variables equal to p, where p is the number of variables, at each split and 500 trees. The RF model underwent 10-fold cross-validation to reduce the risk of overfitting. Feature importance rankings derived from RF models with cross-validation were included in Tables S4,S5 to enhance interpretability. In the presence of Pf ADA, this variable was strongly weighted in model prediction compared with other features. In contrast, when Pf ADA was excluded, age, Pf LDH, presence of fibrin, hemidiaphragm nodule, and pleural thickening emerged as important predictors.

When Pf ADA was included, the RF model achieved an AUC of 0.908 and a diagnostic accuracy of 92.6% for predicting TBE. Remarkably, even in the absence of Pf ADA, the model demonstrated robust performance with an AUC of 0.972 and an accuracy of 81.5% (Table 3). Representative cases were shown in Figure 2.

Table 3. Performance measures of multiple logistic regression and RF with 10-fold cross validation.

Performance measures Multiple logistic regression RF
With Pf ADA Without Pf ADA With Pf ADA Without Pf ADA
AUC 0.949 0.851 0.977 0.972
Diagnostic accuracy 0.879 0.758 0.926 0.815
Sensitivity 0.871 0.786 1.000 1.000
Specificity 0.887 0.726 0.875 0.688
Positive predictive value 0.897 0.764 0.846 0.688
Negative predictive value 0.859 0.750 1.000 1.000

ADA, adenosine deaminase; AUC, area under the curve; Pf, pleural fluid; RF, random forest.

Figure 2.

Figure 2

Representative cases. (A-C) Representative case 1: a 60-year-old gentleman presented with right-sided exudative pleural effusion with Pf protein of 52 g/L, LDH of 180 U/L, glucose of 5.65 mmol/L, and ADA of 15.80 U/L. Ultrasound demonstrated hyperechoic effusion with the absence of fibrin and hemidiaphragm nodule. The thickest pleural thickening measured 4.90 mm. RF prediction, with or without Pf ADA in the algorithm, indicated MPE. MT revealed blood-stained pleural effusion and scattered pleural masses. Biopsy confirmed metastatic adenocarcinoma of the lung. (D-F) Representative case 2: a 41-year-old gentleman presented with right-sided exudative pleural effusion with Pf protein of 58 g/L, LDH of 667 U/L, glucose of 5.00 mmol/L, and ADA of 68.40 U/L. Ultrasound demonstrated non-hyperechoic effusion with the presence of fibrin and no hemidiaphragm nodule. The thickest pleural thickening measured 6.00 mm. RF prediction, with or without Pf ADA in the algorithm, indicated TBE. MT revealed extensive bridging fibrin and minute parietal pleural nodules. Biopsy confirmed caseating granuloma, which cultured MTB. ADA, adenosine deaminase; LDH, lactate dehydrogenase; MPE, malignant pleural effusion; MT, medical thoracoscopy; MTB, Mycobacterium tuberculosis; Pf, pleural fluid; RF, random forest; TBE, tuberculous pleural effusion.

Discussion

TB remains a significant public health problem in Malaysia, with an incidence rate of 122 per 100,000 population, of which TBE comprises 18.6% of all extrapulmonary TB cases (21). Due to its paucibacillary nature, TBE diagnosis is often challenging due to poor culture and smear yields, mandating tissue biopsy (22). Locally, TBE is diagnosed in nearly half (40.6%) of patients undergoing medical thoracoscopic biopsy for cytology-negative exudative effusion, while global reports report prevalence rates of 23.5–82.4% in high TB burden countries and 2.1–5.9% in low TB burden countries (2,23). However, access to pleural biopsy services may not be easily accessible in this part of the world. Moreover, our study demonstrated a bimodal age distribution of TBE in TB-endemic regions, reflecting primary tuberculous infection in younger patients and reactivation in older patients. Thus, a clinical prediction model could potentially help clinicians detect primary pleural infection early and initiate treatment to reduce the risk of reactivation, overcoming delays caused by restricted pleural biopsy access.

Existing clinical prediction algorithms are generally centered around Pf ADA with other complementary variables such as temperature, gender, age, differential cell count, protein, and LDH (7-11,14,15). These algorithms reported high diagnostic accuracy of more than 90% in the prediction of TBE (5,8). However, Pf ADA may be inaccurate as its diagnostic accuracy depends on disease prevalence, thus acting optimally as a rule-in test in high TB prevalence settings and as a rule-out test in low prevalence scenarios (4). Moreover, the variation in Pf ADA testing methods (conventional colorimetric vs. automated reagent-based assays) also yield different cut-off values (24). Furthermore, Pf ADA may also be elevated in other pleural diseases such as parapneumonic pleural effusion and potentially in secondarily infected MPE (25). Although clinical prediction models without Pf ADA have shown promise, they are far from becoming standard practice and need further refinement (5,6). TUS has proven useful in recent years for differentiating transudates from exudates. In a large prospective cohort evaluating diaphragmatic nodularity, unilaterality, fluid echogenicity, pleural thickening, and septations, the presence of two or more of these features yielded a positive predictive value of 98.8% and a negative predictive value of 100%, with a notably lower misclassification rate compared with Light’s criteria (1% vs. 6.9%) (26). Moreover, the sonographic features of MPE, including pleural nodularity, pleural thickening greater than 1 cm, and diaphragmatic thickening greater than 7 mm, have been reported to be highly predictive of MPE (27). However, incorporating TUS into a clinical prediction model has yet to be described.

TBE and MPE differ in pathophysiology. TBE is predominantly driven by a type IV hypersensitivity reaction, whereas MPE results from a complex pathobiological process involving varying contributions from increased vascular permeability, lymphatic obstruction, and possibly enhanced anaerobic cancer metabolism (13). This difference in pathophysiology is reflected in the Pf biochemical profile, where higher levels of inflammatory markers (higher protein and ADA) are observed in TBE in our cohort, while higher levels of anaerobic metabolism markers (higher LDH and lactate and lower pH) are seen in MPE (28,29). Extrapolating these differences to TUS, we demonstrated that fibrin is an independent predictor of TBE. This finding is consistent with its pathophysiology, as fibrin formation in TBE is predominantly driven by an increased inflammatory reaction and reduced fibrinolytic activity compared to MPE (30,31). Several cohort studies have also reported higher prevalence of fibrin in TBE, ranging from 33.3% to 47.0% (12,13,32). Conversely, pleural thickening and the presence of hemidiaphragm nodules were significantly associated with an onco-metabolic environment in MPE within our cohort. This finding aligns with a previous study showing that significant pleural thickening, pleural nodularity, and diaphragmatic nodules were predictive of MPE (27). Overall, we demonstrated that inflammation-related TUS findings, such as complex and loculated effusion and fibrin, along with the absence of TUS findings which were commonly associated with MPE, such as hyperechoic fluid, pleural thickening, and hemidiaphragm nodules, were in favor of TBE.

We also demonstrated that a combination of TUS parameters with clinical and Pf parameters provided a robust clinical prediction, especially with machine learning based algorithm. The RF model demonstrated superior diagnostic accuracy (0.926) compared to conventional logistic regression (0.879) when Pf ADA was included; and remained comparable to conventional logistic regression with Pf ADA, even when Pf ADA was excluded in the RF model. Logistic regression model is a conventional statistical model used to model the log-odds of a binary event as a linear combination of multiple independent variables, while the RF model is an ensemble supervised machine learning model that combines the predictions of multiple decision trees to improve accuracy and stability of prediction, while avoiding issues such as overfitting and outliers. The use of machine learning models like RF to predict TBE has been reported in literature previously, with a high accuracy of 91.5% to 97% (14,15). However, these models did not incorporate TUS parameters as demonstrated in our study.

Our study has several limitations. First, we did not include all patients, as we excluded subjects with NSP from our final analysis, which may limit the generalizability of the model. As such, the predictor models may appear falsely high. An exploratory analysis including the entire dataset (n=187) showed that the diagnostic accuracy of our model was 0.769 and 0.743 with and without Pf ADA, respectively (Table S6). However, this is a proof-of-concept study, and future validation in a larger population is necessary. Second, no follow-up data were obtained; however, we believe our study remains relevant since it aimed to validate the TUS diagnostic capability in a cohort of TBE and MPE patients with robust diagnostic criteria, not focusing on the therapeutic progress and outcome. However, it is important to note that patients with NSP may later develop either TBE or MPE. Third, the imputation method used for missing data may introduce potential bias. Nonetheless, this reflects a real-world challenge, as not all biochemical variables are readily available, particularly Pf ADA, which was only accessible in 60.4% (113/187) of the overall recruited cohort. Therefore, simple and readily available variables, such as TUS findings, may be more relevant clinically. However, we acknowledge that TUS remains operator-dependent, and further consensus development, as well as the potential application of machine learning-assisted image analysis, may be worth exploring in the future. Fourth, several important Pf parameters, including quantitative differential cell counts and IGRA, were not routinely assessed in our region. Hence, the applicability of our prediction model may be limited in wider settings. Nevertheless, despite the absence of these variables, our model remained robust. Moreover, a meta-analysis reported that Pf IGRA demonstrated suboptimal diagnostic accuracy when used as a stand-alone test for TBE diagnosis (33). Finally, the Mycobacterium culture yield from pleural biopsy in our cohort was lower than that reported in the literature, where rates are typically around 80% (34). We postulate that this discrepancy may partly be attributable to the use of solid culture media in our study. Moreover, in endemic regions like ours, TBE usually reflects primary infection rather than post-primary reactivation. It is a T-cell-mediated hypersensitivity reaction in the pleural space, producing lymphocytic exudate and granulomatous inflammation with a low bacillary burden. Hence, culture yields are typically lower in younger, immunocompetent patients compared to those with pulmonary disease or immunosuppression (35,36). Lastly, our study lacked a validation cohort for the clinical prediction model due to a limited sample size, and future prospective validation studies will be crucial to verify the accuracy of the model. Once validated, this model may potentially assist in guiding the treatment of TBE without the need for biopsy, thereby expediting therapy initiation and reducing the risk of transmission.

Conclusions

In conclusion, TUS findings differ significantly between TBE and MPE, with the presence of fibrin and the absence of hemidiaphragm nodules being key predictors for TBE. A clinical prediction model incorporating TUS variables using the RF model achieved high diagnostic accuracy, even without Pf ADA. Future prospective validation cohorts are highly anticipated.

Supplementary

The article’s supplementary files as

jtd-18-04-378-rc.pdf (178KB, pdf)
DOI: 10.21037/jtd-2025-1524
jtd-18-04-378-coif.pdf (1.5MB, pdf)
DOI: 10.21037/jtd-2025-1524
DOI: 10.21037/jtd-2025-1524

Acknowledgments

We would like to thank the Director-General of Health Malaysia for his permission to publish this article.

Ethical Statement: The authors are accountable for all aspects of the work in ensuring that questions related to the accuracy or integrity of any part of the work are appropriately investigated and resolved. The study was conducted in accordance with the Declaration of Helsinki and its subsequent amendments. The study protocol was approved by the Medical Research & Ethics Committee, Ministry of Health Malaysia [NMRR ID-22-02920-7RL (IIR), dated 28 February 2023, ClinicalTrials.gov ID NCT05935696]. All participating hospitals were informed and agreed on the study. Written informed consent was obtained from each patient included in the study.

Footnotes

Reporting Checklist: The authors have completed the TRIPOD reporting checklist. Available at https://jtd.amegroups.com/article/view/10.21037/jtd-2025-1524/rc

Funding: None.

Conflicts of Interest: All authors have completed the ICMJE uniform disclosure form (available at https://jtd.amegroups.com/article/view/10.21037/jtd-2025-1524/coif). The authors have no conflicts of interest to declare.

Data Sharing Statement

Available at https://jtd.amegroups.com/article/view/10.21037/jtd-2025-1524/dss

jtd-18-04-378-dss.pdf (62.7KB, pdf)
DOI: 10.21037/jtd-2025-1524

References

  • 1.Liam CK, Lim KH, Wong CM. Causes of pleural exudates in a region with a high incidence of tuberculosis. Respirology 2000;5:33-8. 10.1046/j.1440-1843.2000.00223.x [DOI] [PubMed] [Google Scholar]
  • 2.Kho SS, Chan SK, Yong MC, et al. Diagnostic yield of medical thoracoscopy in exudative pleural effusions in a region with high tuberculosis burden. Med J Malaysia 2020;75:254-9. [PubMed] [Google Scholar]
  • 3.Huan NC, Kho SS, Nyanti LE, et al. Dry Medical Thoracoscopy with Artificial Pneumothorax Induction Using Veress Needle. Tuberc Respir Dis (Seoul) 2025;88:181-9. 10.4046/trd.2024.0029 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Shaw JA, Ahmed L, Koegelenberg CFN. Effusions related to TB. In: Maskell NA, Laursen CB, Lee YCG, et al. editors. Pleural Disease (ERS Monograph). Sheffield: European Respiratory Society; 2020:172-92. [Google Scholar]
  • 5.Valdés L, San José ME, Pose A, et al. Diagnosing tuberculous pleural effusion using clinical data and pleural fluid analysis A study of patients less than 40 years-old in an area with a high incidence of tuberculosis. Respir Med 2010;104:1211-7. 10.1016/j.rmed.2010.02.025 [DOI] [PubMed] [Google Scholar]
  • 6.Kaewwinud J, Pienchitlertkajorn S, Koomtanapat K, et al. Diagnostic scoring systems for tuberculous pleural effusion in patients with lymphocyte-predominant exudative pleural profile: A development study. Heliyon 2024;10:e23440. 10.1016/j.heliyon.2023.e23440 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Porcel JM, Alemán C, Bielsa S, et al. A decision tree for differentiating tuberculous from malignant pleural effusions. Respir Med 2008;102:1159-64. 10.1016/j.rmed.2008.03.001 [DOI] [PubMed] [Google Scholar]
  • 8.Wu S, Li S, Fang N, et al. A scoring model for diagnosis of tuberculous pleural effusion. BMC Pulm Med 2022;22:332. 10.1186/s12890-022-02131-7 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Liu Y, Liang Z, Yuan S, et al. Development and validation of a prediction model for tuberculous pleural effusion: a large cohort study and external validation. Respir Res 2022;23:134. 10.1186/s12931-022-02051-4 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Lei X, Wang J, Yang Z. Development and validation of a prediction model to assess the probability of tuberculous pleural effusion in patients with unexplained pleural effusion. Sci Rep 2023;13:10904. 10.1038/s41598-023-38048-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Neves DD, Dias RM, Cunha AJ. Predictive model for the diagnosis of tuberculous pleural effusion. Braz J Infect Dis 2007;11:83-8. 10.1590/s1413-86702007000100019 [DOI] [PubMed] [Google Scholar]
  • 12.Chen HJ, Hsu WH, Tu CY, et al. Sonographic septation in lymphocyte-rich exudative pleural effusions: a useful diagnostic predictor for tuberculosis. J Ultrasound Med 2006;25:857-63. 10.7863/jum.2006.25.7.857 [DOI] [PubMed] [Google Scholar]
  • 13.Kho SS, Chan SK, Tie ST. Echographic septation: A potentially useful indicator discriminating tuberculous from malignant pleural effusion. Respir Investig 2022;60:704-8. 10.1016/j.resinv.2022.04.009 [DOI] [PubMed] [Google Scholar]
  • 14.Ren Z, Hu Y, Xu L. Identifying tuberculous pleural effusion using artificial intelligence machine learning algorithms. Respir Res 2019;20:220. 10.1186/s12931-019-1197-5 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Garcia-Zamalloa A, Vicente D, Arnay R, et al. Diagnostic accuracy of adenosine deaminase for pleural tuberculosis in a low prevalence setting: A machine learning approach within a 7-year prospective multi-center study. PLoS One 2021;16:e0259203. 10.1371/journal.pone.0259203 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Hooper C, Lee YC, Maskell N, et al. Investigation of a unilateral pleural effusion in adults: British Thoracic Society Pleural Disease Guideline 2010. Thorax 2010;65 Suppl 2:ii4-17. 10.1136/thx.2010.136978 [DOI] [PubMed] [Google Scholar]
  • 17.Van Buuren S, Groothuis-Oudshoorn K. mice: Multivariate imputation by chained equations in R. J Stat Softw 2011;45:1-67. [Google Scholar]
  • 18.Kuhn M. Building predictive models in R using the caret package. J Stat Softw 2008;28:1-26.27774042 [Google Scholar]
  • 19.Robin X, Turck N, Hainard A, et al. pROC: an open-source package for R and S+ to analyze and compare ROC curves. BMC Bioinformatics 2011;12:77. 10.1186/1471-2105-12-77 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Liaw A, Wiener M. Classification and regression by randomForest. R News 2002;2:18-22. [Google Scholar]
  • 21.Khan AH, Sulaiman SAS, Laghari M, et al. Treatment outcomes and risk factors of extra-pulmonary tuberculosis in patients with co-morbidities. BMC Infect Dis 2019;19:691. 10.1186/s12879-019-4312-9 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.McNally E, Ross C, Gleeson LE. The tuberculous pleural effusion. Breathe (Sheff) 2023;19:230143. 10.1183/20734735.0143-2023 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Zhai K, Lu Y, Shi HZ. Tuberculous pleural effusion. J Thorac Dis 2016;8:E486-94. 10.21037/jtd.2016.05.87 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Feres MC, Martino MC, Maldijian S, et al. Laboratorial validation of an automated assay for the determination of adenosine deaminase activity in pleural fluid and cerebrospinal fluid. J Bras Pneumol 2008;34:1033-9. 10.1590/s1806-37132008001200008 [DOI] [PubMed] [Google Scholar]
  • 25.Nyanti LE, Rahim MAA, Huan NC. Diagnostic Accuracy of Lactate Dehydrogenase/Adenosine Deaminase Ratio in Differentiating Tuberculous and Parapneumonic Effusions: A Systematic Review. Tuberc Respir Dis (Seoul) 2024;87:91-9. 10.4046/trd.2023.0107 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Gardiner A, Ling R, Chan YH, et al. DUETS for Light's in separating exudate from transudate. Respirology 2024;29:976-84. 10.1111/resp.14780 [DOI] [PubMed] [Google Scholar]
  • 27.Qureshi NR, Rahman NM, Gleeson FV. Thoracic ultrasound in the diagnosis of malignant pleural effusion. Thorax 2009;64:139-43. 10.1136/thx.2008.100545 [DOI] [PubMed] [Google Scholar]
  • 28.Kho SS, Chan SK, Yong MC, et al. Pleural fluid lactate as a point-of-care adjunct diagnostic aid to distinguish tuberculous and complicated parapneumonic pleural effusions during initial thoracentesis: Potential use in a tuberculosis endemic setting. Respir Investig 2020;58:367-75. 10.1016/j.resinv.2020.01.004 [DOI] [PubMed] [Google Scholar]
  • 29.Ho CY, Tsai YH, Chang CC, et al. The role of pleural fluid lactate dehydrogenase-to-adenosine deaminase ratio in differentiating the etiology of pleural effusions. Chin J Physiol 2022;65:105-8. 10.4103/cjp.cjp_104_21 [DOI] [PubMed] [Google Scholar]
  • 30.Chung CL, Chen YC, Chang SC. Effect of repeated thoracenteses on fluid characteristics, cytokines, and fibrinolytic activity in malignant pleural effusion. Chest 2003;123:1188-95. 10.1378/chest.123.4.1188 [DOI] [PubMed] [Google Scholar]
  • 31.Hua CC, Chang LC, Chen YC, et al. Proinflammatory cytokines and fibrinolytic enzymes in tuberculous and malignant pleural effusions. Chest 1999;116:1292-6. 10.1378/chest.116.5.1292 [DOI] [PubMed] [Google Scholar]
  • 32.Akhan O, Demirkazik FB, Ozmen MN, et al. Tuberculous pleural effusions: ultrasonic diagnosis. J Clin Ultrasound 1992;20:461-5. 10.1002/jcu.1870200708 [DOI] [PubMed] [Google Scholar]
  • 33.Aggarwal AN, Agarwal R, Gupta D, et al. Interferon Gamma Release Assays for Diagnosis of Pleural Tuberculosis: a Systematic Review and Meta-Analysis. J Clin Microbiol 2015;53:2451-9. 10.1128/JCM.00823-15 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 34.Lee CS, Chiu LC, Chang CH, et al. The Clinical Experience of Mycobacterial Culture Yield of Pleural Tissue by Pleuroscopic Pleural Biopsy among Tuberculous Pleurisy Patients. Medicina (Kaunas) 2022;58:1280. 10.3390/medicina58091280 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Tovar M, Siedner MJ, Gilman RH, et al. Improved diagnosis of pleural tuberculosis using the microscopic- observation drug-susceptibility technique. Clin Infect Dis 2008;46:909-12. 10.1086/527447 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Porcel JM. Advances in the diagnosis of tuberculous pleuritis. Ann Transl Med 2016;4:282. 10.21037/atm.2016.07.23 [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Supplementary Materials

    The article’s supplementary files as

    jtd-18-04-378-rc.pdf (178KB, pdf)
    DOI: 10.21037/jtd-2025-1524
    jtd-18-04-378-coif.pdf (1.5MB, pdf)
    DOI: 10.21037/jtd-2025-1524
    DOI: 10.21037/jtd-2025-1524

    Data Availability Statement

    Available at https://jtd.amegroups.com/article/view/10.21037/jtd-2025-1524/dss

    jtd-18-04-378-dss.pdf (62.7KB, pdf)
    DOI: 10.21037/jtd-2025-1524

    Articles from Journal of Thoracic Disease are provided here courtesy of AME Publications

    RESOURCES