Background

Pneumocystis jirovecii pneumonia (PCP) is an opportunistic lung infection caused by P. Jirovecii that usually affects immunocompromised patients with or without human immunodeficiency virus (HIV) infection [1, 2]. In recent years, the incidence of PCP has been increasing in non-HIV, with a significantly higher mortality rate (17.2-52.9%) than in HIV patients (mortality rate: 6.7%) [3, 4]. PCP is initially suspected on the basis of symptoms (fever, cough, dyspnea), computed tomography (CT) findings (e.g., ground glass opacities) and high risk factors (an underlying immunodeficiency) [5, 6]. The diagnosis is confirmed by identification of cysts or trophozoites from bronchoalveolar lavage (BAL) or biopsy by direct immunofluorescence (IF) or conventional staining [7]. Real-time quantitative polymerase chain reaction (qPCR) testing on specimens is another method recommended by guidelines but should be used in combination with IF staining to improve its specificity [8]. Unfortunately, diagnosis is challenging, as bronchoscopy or biopsy can lead to complications such as fever, worsening hypoxemia or the need for tracheal intubation and mechanical ventilation [9, 10]. Meanwhile, these diagnostic methods are time-consuming and cannot provide early indication of PCP infection risk. Non-invasive methods, such as qPCR and/or IF staining on induced sputum, oral washings, nasopharyngeal aspirate are not recommended due to unsatisfactory diagnostic accuracy [8, 11]. Serum β-D-glucan detection is also considered as a supplementary means as it requires a high pretest probability [8, 11, 12]. Therefore, there is an urgent need to explore new technologies that can detect the risk of PCP infection early, accurately, and non-invasively to guide clinical interventions.

Radiomics is a new method of image processing that has emerged in the last decade. By transforming images into massive amounts of data, extensive features invisible to the naked eye can be extracted and analysed for diagnosis, severity assessment and prognosis of diseases [13, 14]. In recent years, the application of radiomics has gradually expanded from oncology research to others [15, 16]. In particular, radiomics models based on computed tomography (CT) have demonstrated great performance in the diagnosis and prognosis of COVID-19 pneumonia [17, 18]. However, there are few studies focusing on the radiomic features of PCP, especially in non-HIV patients [19]. In the present study, we aim to investigate the radiomics features of PCP and develop a radiomics-based model to provide an early indication of the risk of PCP infection in non-HIV patients.

Methods

Study population

This study was approved by the Ethics Committee of Chinese PLA General Hospital (NO. S2023-006-01) and was conducted in accordance with the Declaration of Helsinki (as revised in 2013). The study was registered in ClinialTrials.gov (27/01/2023, NCT05701631). Individual informed consent for this retrospective analysis was waived by the Ethics Committee of Chinese PLA General Hospital. From January 2010 to December 2022, patients admitted to our institute with clinical suspected PCP were screened for inclusion. The inclusion criteria were as follows: (I) aged over eighteen years; (II) presence of underlying immunodeficiency reported to be associated with PCP, including autoimmune diseases, hematological malignancies, solid cancers, transplantation, corticosteroid use, immunosuppressants use and chemotherapeutic agents use [5, 20]; (III) symptoms of lower respiratory tract infection, such as fever, cough or dyspnea; (IV) signs of lung infection on high resolution CT at the on-set of the disease, including ground glass opacity, consolidation, honeycombing, interlobular septal thickening and pleural effusion [14]; (V) received BAL examination within three days after CT scans; (VI) underwent qPCR and IF staining tests on the BAL fluid sample. Patients with HIV infection, those taking trimethoprim-sulfamethoxazole for prophylaxis, or those undiagnosed by qPCR and IF staining tests were excluded. In total, 322 patients were evaluated, and 140 patients were included in this study who were then randomized at a 7:3 radio into training (N = 97) and a validation set (N = 43) (Fig. 1).

Fig. 1
figure 1

Flow chart of the study. PCP, Pneumocystis jirovecii pneumonia; CT, computed tomography; qPCR, quantitative polymerase chain reaction; IF, immunofluorescent; HIV, human immunodeficiency virus; TMP/SMZ, trimethoprim-sulfamethoxazole

Clinico-demographic data collection

The clinical, laboratory and CT image data were retrospectively gathered through our institute’s medical record system. The collected clinical features included age, sex, smoking history, underlying diseases, medication use including corticosteroid, immunosuppressant or chemotherapeutic agents use, clinical symptoms including fever, cough, dyspnea; laboratory findings including PaO2/FiO2 ratio measured on arterial blood, white blood cell, serum c-reaction protein, serum lactate dehydrogenase (LDH), and serum β-D-glucan.

CT scanning protocols

Chest CT scans were carried out in a CT scanner (SOMATOM Definition AS+, Siemens Healthcare, Forchheim, Germany). Scanning parameters were as follows: tube voltage of 120 kV, automatic exposure control, tube rotational speed of 0.5 s/rot, collimation of 0.6 × 64 mm, pitch of 0.984, matrix size of 512 × 512 mm, reconstructed slice thickness of 1-1.25 mm and reconstructed kernel of B70f. All the images used for analysis were unenhanced.

Segmentation and radiomic features extraction

Image segmentation was performed by -a Food and Drug Administration (FDA) approved imaging software of FACT medical imaging system (Version 1.5, Dexin Medical Imaging Technology Company). Firstly, the pneumonia regions of the CT data were identified and segmented automatically by using a previously reported deep learning algorithm [21, 22]. The average density of the lung parenchyma was used to compute a threshold (the lowest density) to detect CT abnormalities including ground glass opacity, consolidation, honeycombing and interlobular septal thickening. The detected abnormalities of the whole lung were masked as the region of interest (ROI) in the automatic processing mode of “Pneumonia” (Fig. 2). Then, an independent senior respiratory physician (WZ with fifteen years of experience in lung CT imaging) reviewed the segmentation results in a fixed lung window (level: -500HU; width: 1500HU) and made modifications if necessary. An expert in chest radiology (WY) confirmed the results. Then, the region of interest was resampled at 1 mm × 1 mm × 1 mm and 1316 radiomic features were extracted using the “Radiomics” module and normalized through Z-Score method. The features included: (I) shape; (II) first order features, (III) texture features, (IV) features extracted from filtered images, i.e., wavelet and Laplacian of Gaussian (LoG) features. In total, 37 ROIs of 12 patients (9%) were manually modified, including 13 unidentified and 24 inaccurate pneumonia regions. The modification time for one patient was approximately 30 to 65 min. For patients whose ROIs need no manual modification, each CT DICOM file was processed in 6–10 min.

Fig. 2
figure 2

The segmentation of infected areas (i.e., the region of interest, ROI) on the FACT Medical Imaging System. A 59-year-old female with anti-synthetase syndrome and a long history of corticosteroid use was admitted to hospital with fever and cough for 7 days. A Sagittal HRCT images showed ground-glass opacity and thickening interlobular septal predominantly in both lower lungs. B Three-dimensional (3D) volume rendering image of the lobes (purple: right upper lobe; yellow: right middle lobe; blue: right lower lobe, brown: left upper lobe; green: left lower lobe). C and D Sagittal CT and 3D images of automatically identified infected areas. Different colors indicated that the infection was in different lobes (blue: right upper lobe; red: right middle lobe; green: right lower lobe; cyan: left upper lobe; yellow: left lower lobe). The ROIs are integrated as one and radiomic features were extracted from it

Radiomics model construction

First, Student’s t-test and Mann-Whitney U-test were used to identify the significant features in the training cohort. The Least Absolute Shrinkage and Selection Operator (LASSO) were then used and features with non-zero coefficients were identified at the optimal regularization parameter (λ) by tenfold cross-validation. After that, a radiomics model were constructed using logistic regression. The area under the curve (AUC) of the receiver operating characteristic (ROC) curves were calculated and used to evaluate the diagnostic performance of the model. In addition, the radiomic score (Radscore) was calculated, and calibration curves and a waterfall plot of the Radscore were plotted to show the diagnostic accuracy of the model.

Traditional risk factors model construction

The CT images were viewed and evaluated at a fixed lung window (level: -500 HU; width: 1500 HU) by two independent respiratory physicians (QZ, ZL) with eight and twenty years of experience in lung CT image reading. An expert chest radiologist (WY) confirmed the results. The CT abnormalities included ground-glass opacity, interlobular septal thickening, cyst, consolidation, honeycombing, mediastinal lymphadenopathy, and pleural effusion. All CT signs are identified according to the definitions in the glossary of terms published by the Fleischner Society in 2008 [23]. Semantic CT features and clinical characteristics significantly associated with the diagnosis of PCP were screened by univariate analysis and used for multivariate logistic regression analysis. The independent factors identified by multivariate logistic regression were then used to construct a traditional model. The AUC was calculated in both training and validation cohorts and compared with the radiomics model by the Delong test.

Clinical utility of the models

The clinical utility of the radiomics model and the traditional model were assessed with decision curve analysis by calculating the net benefit at different threshold probabilities.

Diagnostic performance comparison with serum β-D-glucan and LDH

Previous-reported risk factors for PCP infection, including serum β-D-glucan > 200 pg/mL or LDH > 300 IU/mL as PCP positive, and β-D-glucan < 80 pg/mL as PCP negative, were also evaluated for diagnostic performance among all patients [1, 12, 24, 25]. Accuracy, sensitivity, specificity, positive predictive value (PPV) and negative predictive value (NPV) were calculated and compared with the radiomics model.

Standard of reference

Real-time qPCR and IF staining tests were performed on BAL fluid samples to detect P. Jirovecii. QPCR > 0 pathogens/mL was considered as qPCR (+). IF staining was considered positive when P. Jirovecii cysts or trophozoites were found. PCP diagnosis was made based on the results of qPCR and IF staining tests according to the criteria developed by the European Conference on Infection in Leukaemia (ECIL) guidelines 2016 [8].

Statistical analysis

The R software (version 4.2.2, The Free Software Foundation, USA) and the SPSS for Windows, version 26.0 (IBM Corp., Armonk, N.Y., USA) were used for randomization, model construction and statistical analysis. The “glmnet”, “e1071”, and “adabag” packages were used for model construction by LASSO regression, support vector machine and adaboost. The “pROC”, “ggplot2”and “rmda” packages were used to plot ROC and decision curves. The “rms”, “Hmisc”, “Survival”, “Lattice”, “Formula” and “waterfalls” package were used to draw calibration curve and waterfall plots. Depending on the type and distribution of the data, Student’s t-test, Mann-Whitney U-test or Pearson’s x2 test were applied to test for the significance of between-group differences in clinical characteristics and semantic CT features. The Delong test was used to compare the differences between AUCs of ROC curves of different models. P-values less than 0.05 were considered statistically significant.

Results

Patient characteristics

A total of 140 patients were included in this study (Fig. 1; Table 1). Sixty-one patients were diagnosed with PCP (as the PCP group) and 79 with other types of pneumonia (as the non-PCP group). The other types of pneumonia included: bacterial pneumonia (n = 43), viral pneumonia (n = 14), fungal pneumonia (n = 5), radiation pneumonia (n = 2), and interstitial pneumonia associated with connective tissue disease (n = 15). In the PCP group, the proportion of ex-smokers was higher (36.1%, P = 0.038), and more patients used corticosteroids (73.8%, P < 0.001) or immunosuppressants (54.1%, P < 0.001. Meanwhile, the PCP patients had significant lower PaO2/FiO2 ratio (P = 0.004) but higher serum C-reaction protein (P = 0.004), LDH (P < 0.001) and β-D-glucan (P < 0.001). For semantic CT features, there are more ground glass opacity (100%, P = 0.002) and cyst (31.1%, P = 0.041) in the PCP group. In the non-PCP group, more patients used chemotherapeutic agents (46.8%, P = 0.004), and the proportion of patients with a CT sign of pleural effusion was higher (27.8%, P = 0.038).

Table 1 Comparison of clinical characteristics and semantic CT features in Pneumocystis jirovecii pneumonia (PCP) and other types of pneumonia (non-PCP) group

All patients were randomized into a training cohort (N = 97) and a validation cohort (N = 43) (Table 2). In the training cohort, significant differences were found between the PCP and non-PCP group in terms of medication use, laboratory findings (c-reaction protein, LDH, β-D-glucan) and CT features (ground glass opacity). Multivariate logistic regression revealed that the serum β-D-glucan was the only independent factor associated with the diagnosis of PCP (Odds ratio: 1.010; 95% CI: 1.006–1.015; P < 0.001). The AUCs of the serum β-D-glucan (as a traditional model) were 0.859 (95% CI: 0.774–0.944) and 0.752 (95% CI: 0.597–0.908) in the training and validation cohorts, respectively.

Table 2 Comparison of clinical characteristics and semantic CT features in patients in the training and validation set

Performance of the radiomics model

Univariate analysis showed that 648 of the 1316 radiomics features differed significantly between the PCP and non-PCP groups of the training cohort. LASSO regression was then performed, and the model had the lowest error when λ = 0.069 and log λ = -1.161 (Figure S1 in Additional file 1), and nine non-zero features were identified to construct the radiomics model (Table S1 in Additional file 1). The radiomics model constructed by the logistic regression was found to perform best in both the training (AUC = 0.950, 95% CI: 0.908–0.992) and validation cohorts (AUC = 0.954, 95% CI: 0.898-1.000) (Figure S2 in Additional file 1). The Radscore of the PCP group were significantly higher than those of the non-PCP group in both the training (2.5 ± 2.4 vs. -3.1 ± 2.7, P < 0.001) and validation (2.0 ± 2.8 vs. -4.3 ± 3.0, P < 0.001) cohorts. The Radscore was calculated as follows:

$$\text{R}\text{a}\text{d}\text{s}\text{c}\text{o}\text{r}\text{e}=74.172-60.024\times {X}_{1}-10.643\times {X}_{2}+6.850\times {X}_{3}+1.613\times {X}_{4}+1.378\times {X}_{5}-2.394\times {X}_{6}-10.677\times {X}_{7}-2.241\times {X}_{8}+1.276\times {X}_{9}$$

The radiomics model showed a more efficient diagnosis performance than the traditional model with a higher AUC in the training (0.950 vs. 0.859, P = 0.049) and validation cohorts (0.954 vs. 0.752, P = 0.011) (Fig. 3). The calibration curves showed good consistency between predictions and observations (corrected C-index: 0.948) (Fig. 4). The waterfall plot of the Radscore also showed that radiomics model could distinguish most PCP patients from non-PCP ones (Figure S3 in Additional file 1).

Fig. 3
figure 3

The receiver operating characteristic (ROC) curves of the radiomics model and traditional clinical-imaging model in (A) training and (B) validation cohorts. The radiomics model exhibited better performance than the traditional clinical-imaging model in both training (P = 0.049) and validation cohort (P = 0.011). The 95% confidence interval of AUC was shown as the data in the parentheses

Fig. 4
figure 4

The calibration curves of the radiomics model. A The curve showed a good agreement between prediction and observation by 1000 groups bootstrap-resampling. B Logistic regression estimated observed probability with 95% confidence interval vs. radiomics model-predicted probability (red line) based on the calculated radiomic score for the diagnosis of Pneumocystis jirovecii pneumonia

Clinical utility of the radiomics model

The decision curve analysis indicated that the use of radiomics model added more net benefit than traditional model in differentiating PCP from non-PCP over a threshold probability range of 0–95% (Fig. 5).

Fig. 5
figure 5

Decision curve analysis of the radiomic model and the traditional clinical-imaging model. The curve showed that using the radiomics model added more net benefit than the traditional model in differentiating Pneumocystis jirovecii pneumonia from other types of pneumonia over a threshold probability range of 0–95%

Performance comparison with serum β-D-glucan and LDH

In all patients, the diagnostic performance of the radiomics model and serum β-D-glucan/LDH previously used for diagnosis were calculated (Table 3), the radiomics model had the highest diagnostic accuracy (90.0%).

Table 3 Diagnostic performance of the radiomics model compared with -D-glucan and LDH for the diagnosis of Pneumocystis jirovecii pneumonia

Combining strategy for PCP diagnosis

Table 4. showed the diagnostic performance of the radiomics model in patients with different serum β-D-glucan levels. In patients with serum β-D-glucan > 200 pg/mL, the PPV of the radiomics model was 91.9% and in patients with serum β-D-glucan < 80 pg/mL, the NPV was 96.6%. In addition, among patients with serum β-D-glucan of 80–200 pg/mL, the PPV and NPV of the radiomics model were 100.0% and 90.9%, respectively. Therefore, we developed a new diagnostic strategy for PCP by combining radiomics model and serum β-D-glucan levels (Fig. 6). In our study, 118 of 140 patients (84.3%) could be diagnosed by this method, with a diagnostic accuracy of 95.8% for PCP (sensitivity: 93.8%, specialty: 97.1%, PPV: 95.7%, NPV: 95.8%).

Table 4 Diagnostic performance of the radiomics model in different serum -D-glucan levels for the diagnosis of Pneumocystis jirovecii pneumonia
Fig. 6
figure 6

A diagnostic strategy combining radiomics model and serum BDG for the diagnosis of Pneumocystis jirovecii pneumonia. HIV, human immunodeficiency virus; PCP, Pneumocystis jirovecii pneumonia; BDG, β-D-glucan; BAL, bronchoalveolar lavage; qPCR, quantitative polymerase chain reaction; IF: immunofluorescent

Discussion

In this study, we constructed a CT-based radiomics model to identify the risk of PCP infection in non-HIV patients with CT manifestations of pneumonia. The established radiomics model demonstrated better diagnostic efficiency than traditional risk factors in clinical characteristics and CT findings. We also developed a diagnostic strategy based on the radiomics model and serum β-D-glucan levels, which may identify the risk of PCP infection in non-HIV patients accurately and non-invasively.

The CT manifestations of PCP are commonly considered to be non-specific [5, 14]. Nevertheless, some investigators believed that CT features might be of some value in diagnostic decision-making. A nested case-control study involving 72 PCP patients and 288 non-PCP patients showed that ‘increased interstitial markings’ and ‘ground glass opacity’ were independently associated with the diagnosis of PCP, whereas ‘pleural effusion’ and ‘nodular findings’ were independently negatively associated [14]. They developed a nomogram to predict the post-CT probability of PCP and to assist clinical practice (i.e., non-invasive testing in low risk patients and more invasive testing in high risk patients). In our study, the PCP group had more ground glass opacity, more cysts and fewer pleural effusion, but none of these were independent risk factors for diagnosis by multivariate logistic regression analysis.

In this study, serum β-D-glucan was the only independent traditional risk factor for the diagnosis of PCP. Morjaria et al. suggested that β-D-glucan > 200 pg/mL had 100% sensitivity and 100% PPV for PCP diagnosis in cancer patients [24]. A meta-analysis by Del Corpo et al. showed a pooled sensitivity of 86% for β-D-glucan in the non-HIV patients, and an NPV of 95% for β-D-glucan at < 80 pg/mL even at a prevalence rate of 50% [12]. The diagnostic accuracy of β-D-glucan seemed to be not enough for diagnosis. In our study, the serum β-D-glucan also exhibited unsatisfied stability and moderate performance in the validation cohort (AUC = 0.752). Therefore, clinical characteristics and CT semantic features may be not enough for PCP diagnosis due to insufficient diagnostic efficacy.

Radiomic analysis has been wildly used in cancer research [15, 26,27,28] and in the diagnosis of COVID-19 pneumonia [29,30,31]. For the diagnosis of PCP, we identified only one study conducted by Kloth et al. that was relevant to the radiomic features of PCP [19]. They explored CT-textures of one or two local regions with typical disease manifestations in 21 patients with PCP (including non-HIV patients). Eleven first- and second-order texture features were analyzed but no specific features were found for diagnostic purposes. Differently, the radiomics model constructed in our study performed well. There are three possible reasons for the difference in results between Kloth’s study and ours. First, the different sample sizes of the studies (21 versus 140) affected the accuracy of the diagnoses. Second, the ROIs in Kloth’s study were obtained from localized squares drawn by a senior reader in the “diseased area”. In our study, we obtained the whole pneumonia regions in the lungs. Third, we analyzed more radiomics features, including wavelet features and LOG features, which were interestingly all the features selected and incorporated into our radiomic model. These features were obtained by filtering the original image to enhance some special features such as edge regions [32]. The decision curve analysis showed a good clinical value of the radiomics model, meaning that radiomics could be used as a tool to assist clinicians in the diagnosis of PCP.

In addition, we calculated the diagnostic performance of serum β-D-glucan and LDH mentioned in previous studies for the diagnosis of PCP [1, 12, 24]. Compared to these previously used clinical indicators, the radiomics model performed best. Furthermore, we assessed the diagnostic efficacy of radiomics at different β-D-glucan levels. Based on the results, we established a strategy for non-invasive diagnosis of PCP, which could identify the risk of PCP infection in non-HIV patients with a diagnostic accuracy of 95.8%.

Nowadays, qPCR and IF staining tests of BAL fluid samples are the primary tests recommended by the guidelines to confirm the diagnosis of PCP in non-HIV patients, with serum β-D-glucan testing as an adjunctive laboratory diagnostic tool [8]. Although well-tolerated, it is not uncommon for patients to develop fever and worsening hypoxemia after the bronchoscopy [33]. The implementation of BAL techniques also requires specialist technicians, specialized equipment and rooms, and is difficult to carry out in resource-limited areas and medical centers. Other non-invasive methods, such as qPCR and IF staining of upper respiratory specimens (i.e., induced sputum [34, 35], oral washings [36, 37], nasopharyngeal aspirate [38, 39]) and/or blood samples [38, 40] are not diagnostically satisfactory, with the diagnostic specificity ranged from 54 to 100%, and the diagnostic sensitivity from 50 to 77%. The new strategy in our study, if its general validity is confirmed in future studies, has the potential to provide an accurate and non-invasive way to identify the risk of PCP infection in non-HIV patients.

This study had several limitations. First, the sample size of the population included in this study was not large. Second, this single-center retrospective study did not include external validation, which may have led to bias in model performance. Third, six patients with qPCR (-) and IF (+) were excluded to ensure confirmation of pathological results (as the results were technically inconsistent), which could have led to a small selection bias. Fourth, PPV and NPV were calculated in the existing population (PCP prevalence of 43.6%) and may be altered due to changes in PCP prevalence. Therefore, a large multicenter study is needed to validate these findings.

Conclusions

Radiomics showed good diagnostic performance in differentiating PCP from other types of pneumonia in non-HIV patients. A combined diagnostic method including radiomics and serum β-D-glucan has the potential to provide an accurate and non-invasive way to identify the risk of PCP infection in non-HIV patients with CT manifestation of pneumonia.