Introduction

Community-acquired pneumonia (CAP) continues to exhibit high incidence and mortality rates, leading to frequent instances of misdiagnosis and inappropriate treatment [1]. The progression to severe community-acquired pneumonia (SCAP) is associated with a significant increase in mortality, which remains elevated despite intensive care unit (ICU) intervention [2]. SCAP is a grave infectious disease originating in the lungs, with the potential for rapid advancement to respiratory failure. Patients with SCAP necessitating mechanical ventilation as a result of septic shock may experience a mortality rate surpassing 35%, whereas individuals developing acute respiratory distress syndrome (ARDS) exhibit a mortality rate exceeding 30% [3]. Those who survive often endure long-term consequences, including impaired lung function, diminished neurological and cognitive capacities, and limited mobility [4]. Timely recognition of SCAP, facilitating prompt and appropriate intervention, has the potential to enhance patient prognoses and mitigate the development of these sequelae. Early identification of SCAP patients is imperative for prompt and precise treatment, as well as for preventing delays in critical care, ultimately leading to a reduction in mortality rates [5, 6].

Imaging techniques are essential in the field of medicine due to their non-invasive nature, which assists in clinical decision-making [7]. Chest CT scans are considered valuable tools for diagnosing pneumonia, assessing its severity, and evaluating the efficacy of treatment [8, 9]. The imaging features commonly associated with CAP consist of patchy infiltrates, air bronchograms, and interlobular septal thickening. Conversely, SCAP typically presents with widespread pulmonary consolidation and bilateral lung involvement [10, 11]. Nevertheless, these characteristics are not always distinct, and the shared imaging features of CAP and SCAP can complicate differentiation based solely on manual interpretation of computed tomography (CT) images. And the interpretation of clinical images is often hindered by the subjective nature of physicians’ analysis, which is heavily reliant on their experience. Simple visual inspection often falls short of the needs of precision medicine and individualized treatment. Therefore, decoding and quantitatively presenting macroscopic information from images is crucial for clinical decision-making, treatment planning, and prognostic assessment.

Radiomics, first proposed by Lambin et al. [12]. in 2012, is a novel approach to medical image analysis that involves the extraction of quantitative features from images in a high-throughput manner. By comparing radiomic features with clinical data, radiomics facilitates the diagnosis and prognosis of diseases [12, 13]. In recent years, there has been a growing utilization of radiomics for the assessment and detection of pneumonia lesions [14]. This trend has been particularly notable in light of the worldwide scarcity of medical professionals during the COVID-19 pandemic, leading to increased interest in the utilization of computer-based medical image processing technology for pneumonia diagnosis. The primary focus of radiomics in pneumonia diagnosis lies in the differentiation of COVID-19 and Viral Pneumonia, pneumonia-like lung cancer, and checkpoint inhibitor-related pneumonitis [15,16,17]. Radiomics is predominantly utilized in the diagnosis, staging, prognosis, and prediction of tumor responses in lung diseases. Recent research has shown the emerging potential of radiomics in diagnosing pneumonia, assessing its severity, and evaluating prognosis [15, 18,19,20,21]. These studies suggest that radiomics features have the potential to serve as imaging biomarkers for predicting clinical outcomes and prognoses.

The objective of this study is to create a prognostic model for the severity of CAP using CT radiomics analysis, which may facilitate early identification of severe cases and improve patient outcomes through prompt intervention. The results of this research show significant potential for the progression of precision medicine and the improvement of personalized treatment strategies.

Materials and methods

Patients

In this retrospective study, a total of 115 cases diagnosed with CAP and SCAP between January and December 2021 at Shunde Hospital of Southern Medical University were analyzed. The specific inclusion criteria included meeting the diagnostic criteria for CAP or SCAP [22,23,24], having clear lung CT images within three days of admission, and possessing comprehensive clinical baseline information. The specific exclusion criteria included lack of CT images within 3 days, hospital infections and unclear CT images. In this study, patients were randomly allocated into two cohorts, with a ratio of 7:3, identified as the training and testing cohorts. The patient enrollment process is illustrated in Fig. 1. Approval for this retrospective study was obtained from the Ethics Committee of Shunde Hospital of Southern Medical University. All procedures adhered to the Declaration of Helsinki and pertinent regulations in China.

Fig. 1
figure 1

The flow chart depicted in this study outlines the process of enrolling patients, including the selection and allocation of study subjects. A total of 115 patients were ultimately included, with 80 assigned to the training set and 35 to the validation set at a ratio of 7:3. The flow chart and main text provide comprehensive details regarding the specific criteria for inclusion and exclusion of patients

Imaging acquisition and segmentation

The imaging of all patients was conducted using a 128-detector row CT scanner (SIEMENS SOMATOM Definition Flash-CT scanner; Siemens, Erlangen, Germany) with specific parameters: reconstruction slice thickness of 0.6 mm, acquisition field of view (FOV) of 300 mm, beam pitch of 1.2, collimation width of 64 × 0.625 mm, matrix of 512 × 512, tube voltage of 120 kV, and tube current of 200 mA. Patients were instructed to hold their breath to minimize motion-related artifacts during imaging. The resulting images were captured using lung window settings with a width of 1600 HU and a level of -600 HU. Prior to segmenting lung lobes and lesions, the images underwent normalization by adjusting grayscale values with a scale factor of 1000 and were resampled to an isotropic voxel size of 3 × 3 × 3 mm³ using nearest neighbor interpolation. Additionally, an additional padding distance of 10 mm was implemented to address large sigma values in the Laplacian of Gaussian (LoG) filtering process. The intensity values were discretized using a fixed bin width of 5 Hounsfield Units (HU).

CT images were obtained from the Picture Archiving and Communication System (PACS) for the purpose of analyzing diffuse lung lesions in SCAP cases. The entire lung tissue was delineated for examination. Subsequently, two radiologists, each with 5 and 10 years of experience, respectively, utilized ITK-SNAP software (version 3.8.0) for the manual delineation of central lesion areas within three-dimensional Regions of Interest (ROI). These ROI were then carefully reviewed by a third radiologist with 15 years of experience in the field.

Radiomics workflow

Figure 2 delineates the radiomics workflow, comprising five essential stages: (1) delineation of ROI, (2) extraction of radiomics features, (3) selection of radiomics features, (4) construction of the prediction model using a training dataset, and (5) evaluation of the prediction model’s efficacy. This sequential process elucidates a methodical framework for the examination of radiographic images, beginning with initial segmentation and culminating in the assessment of model performance. Each stage plays a pivotal role in guaranteeing the precision and dependability of the radiomics analysis.

Fig. 2
figure 2

Workflow of radiomic analysis in this study. Nodules were segmented by radiologists, and features were extracted and selected by LASSO based on which the prediction model, DCA, Decision curve analysis, confusion matrices and sample prediction waterfall charts

Radiomics feature extraction and selection

The radiomic features were extracted utilizing Pyradonis’s proprietary feature analysis program (http://pyradiomics.readthedocs.io). The extraction process encompassed a variety of radiomics features, including first-order statistics, the Grey Level Co-occurrence Matrix (GLCM), the Gray Level Dependence Matrix (GLDM), the Grey Level Run-Length Matrix (GLRLM), the Gray Level Size Zone Matrix (GLSZM), the neighborhood gray-tone difference matrix (NGTDM), and shape features.

In order to enhance the efficiency of our analysis, we implemented two techniques to systematically eliminate redundant features. The selection of intra- and inter-class correlation coefficients (ICC) was utilized to evaluate and preserve highly reproducible characteristics, thereby ensuring consistency across various imaging conditions. The LASSO method was employed for its capacity to conduct variable selection and regularization concurrently, thereby reducing dimensionality while retaining the most predictive features [25]. This approach guarantees the inclusion of solely statistically significant and pertinent features in our model. The patient radiomic features were initially standardized using z-score normalization. ICC was calculated for each radiomic feature, with those exceeding 0.9 selected for further analysis. LASSO model was then employed to further reduce the dimensionality of the feature set and identify the most important features. The optimal lambda value for the LASSO model was determined through a tenfold cross-validation process within the training set.

Radiomics model construction and validation

This study involved the development of radiomics-based models utilizing four classifiers: KNN, SVM, LR, and RF. These models were created by combining selected radiomics features with the aforementioned classifiers. The performance of the models was evaluated using the area under the curve (AUC) from ROC analysis, and a 95% confidence interval (CI) was provided for the results. DCA was performed to assess the clinical utility of the model by determining the net benefit across various threshold probabilities for both the training and test datasets. The Confusion Matrix outlined the true and false positives/negatives, yielding metrics such as accuracy and sensitivity. Sample Prediction Histograms visually depicted the model’s prediction confidence, highlighting potential biases. Collectively, these analyses evaluated the model’s diagnostic efficacy in identifying SCAP and informed strategies for enhancing its reliability.

Statistical analysis and experimental parameters

Statistical analysis was performed utilizing Python and SPSS 25.0. Categorical variables were presented as frequencies and percentages. The normality of continuous variables was evaluated through Kolmogorov-Smirnov or Shapiro-Wilk tests. Quantitative data were presented as mean ± standard deviation or median (interquartile range). Disparities between subgroups were examined using t-tests or Mann-Whitney U tests for continuous variables, and Chi-square tests for categorical variables. Statistical significance was established at p < 0.05 (two-tailed). In this research, the hyperparameters employed for the machine learning models were as follows: A Random Forest model was utilized with 10 trees, minimum samples split of 2, and a random state of 0. The Support Vector Machine was configured to provide probability estimates with a random state of 0. The K-Nearest Neighbors algorithm utilized the “kd tree” method. The Logistic Regression model had a random state of 0.

The experiments were carried out utilizing a system equipped with a 13th Generation Intel(R) Core (TM) i5-13500 H processor running at 2.60 GHz, 32 GB of RAM, Intel(R) Iris(R) Xe Graphics, and a 954 GB SSD. Image processing and radiomics feature extraction were executed using Python (version 3.8) along with various libraries such as Pydicom, SimpleITK, PyRadiomics, Matplotlib, Seaborn, Pandas, Scikit-learn, among others.

Results

Patients characteristics

This research, which included 115 patients diagnosed with CAP and SCAP who met the designated inclusion and exclusion criteria, was carried out between January and December of 2021. Following a randomization ratio of 7:3, the patients were divided into a training set (n = 80) and a validation set (n = 35). Analysis within the training set revealed no significant differences between the two diseases in terms of age, gender, smoking status, sputum production, chest pain, fatigue, diabetes and kidney disease. Significant associations were observed between fever, cough and hypertension with the type of disease (p < 0.05). In the validation set, factors including age, gender, smoking, fever, cough, sputum, chest pain, fatigue, hypertension, diabetes and kidney disease did not show significant differences between CAP and SCAP. A detailed description of the baseline characteristics of the patients can be found in Table 1.

Table 1 Comparison of severity and clinical characteristics in both training and validation cohort

Radiomics feature extraction and selection

In our study, a total of 115 ROI were analyzed. Utilizing the Pyradiomics package, 107 radiomic features were extracted, encompassing 18 first-order features, 24 Gy Level Coherence Matrix (GLCM) features, 14 Gy Level Dependence Matrix (GLDM) features, 16 Gy Level Run Length Matrix (GLRLM) features, 16 Gy Level Size Zone Matrix (GLSZM) features, 5 Neighboring Gray Tone Difference Matrix (NGTDM) features, and 14 shape features. The selection of radiomics features involved calculating intra-class and ICC for each extracted feature. Features with an ICC exceeding 0.9 were deemed highly correlated, resulting in the retention of only one feature and a reduction of the significant image features to 38. Following this, relevant features were identified through the application of the LASSO regression model and a forward selection approach, as illustrated in Fig. 3a. The optimal performance of the LASSO regression, characterized by a penalty parameter of 0.0339, led to the attainment of the smallest mean squared error. Based on the LASSO regression analysis depicted in Fig. 3b, the optimized hyperparameter λ was determined to be 0.0339, leading to the preservation of six radiomic features. These features consist of original firstorder 10 Percentile, original glcm Imc2, original glcm MCC, original glszm Large Area High Gray Level Emphasis, original glszm Large Area Low Gray Level Emphasis, and original_ngtdm_Strength. Consequently, six radiomic features along with their corresponding feature weights were identified (Fig. 3c).

Fig. 3
figure 3

Radiomic feature selection based on LASSO algorithm. a, b Ten-fold cross-validated coefficients and 10-fold cross-validated MSE. c The histogram of the Rad score based on the selected features

Model establishment and evaluation

ROC analysis was employed to evaluate the predictive performance of radiomic-based models (Fig. 4). Within the training set, the AUC values for the KNN, SVM, LR, and RF models were 0.957, 0.954, 0.943, and 0.975, respectively. In the validation set, the overall AUC values for KNN, SVM, LR, and RF were 0.909, 0.956, 0.969, and 0.888, respectively. Furthermore, the study found promising results in terms of accuracy, sensitivity, and specificity for the KNN, SVM, LR, and RF classifiers, as outlined in Table 2. Out of the four classifier models examined, the RF classifier demonstrated superior precision and accuracy. In particular, the RF classifier exhibited an accuracy of 0.977 on the training set and 0.833 on the validation set, as well as precision scores of 0.925 for the training set and 0.857 for the validation set. These performance metrics outperformed those of the other classifier models. DCA was employed to assess the clinical utility of the RF classifier. The findings of the analysis indicate that the RF classifier yielded a favorable net benefit within the specified threshold intervals of 0.1 to 0.8 for the training set and 0.2 to 0.7 for the validation set, underscoring its efficacy in informing clinical decision-making (Fig. 5a and b). Additionally, confusion matrices and sample prediction waterfall charts were utilized to showcase the predictive capabilities of the models, as depicted in Fig. 6a, b, c, and d. The model’s performance in distinguishing between patients with CAP and SCAP was assessed through the utilization of a confusion matrix. Additionally, sample waterfall prediction charts were utilized to illustrate the model’s confidence levels in predicting individual samples, with notable instances of high confidence observed in certain predictions. These analyses collectively demonstrate the efficacy of our radiomics model in accurately identifying SCAP patients at an early stage.

Fig. 4
figure 4

Comparison of Receiver Operating Characteristic (ROC) curves for the four classifiers on both the training (a) and testing cohorts (b)

Table 2 Diagnostic efficiency of different models in the training cohort and testing cohort
Fig. 5
figure 5

Decision curves of the training (a) and testing cohorts (b)

Fig. 6
figure 6

Confusion matrices and sample prediction waterfall charts of the training (a, c) and testing cohorts (b, d)

Discussion

Due to the swift advancement and elevated fatality rate associated with CAP, the timely evaluation of disease progression is imperative. The early detection of patients afflicted with SCAP has the potential to greatly enhance treatment approaches and patient prognoses [26,27,28]. In this research, we showcased the effectiveness of CT imaging attributes by constructing radiomic models utilizing quantitative imaging characteristics across four classifier methodologies. The efficacy of the models was confirmed through the utilization of ROC curves, DCA, confusion matrices, and sample prediction waterfall charts. The findings indicate that the model is capable of accurately distinguishing between CAP and SCAP in the initial stages, underscoring the significant predictive utility of radiomic features extracted from CT images for timely detection of SCAP.

Numerous assessment tools exist for evaluating the severity of pneumonia, with the Pneumonia Severity Index (PSI) and the CURB-65 score emerging as prevalent metrics [29, 30]. While the PSI is renowned for its robust prognostic capabilities in predicting mortality, its intricate nature presents obstacles to routine implementation in clinical practice [31]. CURB-65 exhibits comparatively lower sensitivity, particularly in the prediction of admissions to the Intensive Care Unit (ICU) [32]. Both the Pneumonia Severity Index (PSI) and CURB-65 rely on clinical symptoms, standard laboratory indices, and radiological findings. However, the initial phases of the disease may manifest with nonspecific symptoms, ambiguous laboratory indicators, and subjective evaluations of radiological findings by radiologists, posing challenges in the timely and accurate diagnosis of SCAP [31]. As a result, there remains a persistent demand for improved assessment techniques in clinical settings. The diagnosis of CAP requires the presence of an infiltrate, as visualized on imaging modalities such as chest X-ray, chest CT scan, or lung ultrasonography, in individuals exhibiting symptoms consistent with the disease [33]. CT scans are particularly valuable due to their high sensitivity in detecting CAP early and identifying complications in certain patient populations [34]. They play a crucial role in offering detailed insights into the location, severity, and features of pneumonia. Therefore, radiological examinations play a crucial role in evaluating the severity of CAP. The etiology of CAP is diverse, including bacterial, viral, and mycoplasma infections, all of which can contribute to the onset of CAP. Various pathogens may present with different radiological features, with SCAP often exhibiting diffuse pulmonary lesions [35]. This article presents a radiomic model for the early detection of SCAP using CT based on specific premises. The model is designed to identify SCAP by segmenting the entire lung volume and extracting 6 radiomic features. The study’s methodology uses quantitative imaging feature analysis to eliminate the subjectivity of manual CT image interpretation.

Radiomics, a quantitative imaging analysis technique, is commonly utilized in clinical research for the purposes of early detection, prognosis, and predicting treatment response [36, 37]. This method involves extracting quantitative data from images to identify phenotypic differences and correlating them with clinical information [38, 39]. The radiomics process consists of four stages: image acquisition, image segmentation, feature extraction, and informatics analysis. Radiomics features are classified according to shape and size, texture derived from filtered images, fractal properties, image intensity histograms, and the interrelationships among image voxels [40, 41]. Subsequent to feature extraction, dimensionality reduction methods such as ICC and LASSO regression are employed to identify significant features. Subsequently, Machine Learning (ML) classifiers are utilized for disease classification and prediction [41]. In this research, the entire volume of both lungs was contoured, and the ROI for each patient was manually segmented by a physician with expertise in lung CT imaging. Through the use of radiological features’ ICC and LASSO regression, the study reduced 107 imaging features to 6. Following this, four classifiers, namely KNN, SVM, LR, and RF, were employed to construct radiomics-based models for the detection of SCAP. The findings of this study suggest that the four models evaluated exhibited strong predictive capabilities in feature classification methods, with accuracy exceeding 0.80 and AUC exceeding 0.85. This research highlights the potential of radiomics as a computer-assisted tool for extracting important biomedical data from CT images, which could aid in the early detection and treatment of SCAP. These results provide novel insights into the utilization of established radiomics and machine learning methodologies for improving pneumonia diagnosis.

Recently, radiomics has shown promise in the detection, severity assessment, and prognostic evaluation of pneumonia. Li et al. [18]. utilized radiomic features extracted from chest CT scans to develop a multivariable logistic regression model that incorporates both radiomic and clinical data, successfully distinguishing between mycoplasma pneumonia and bacterial pneumonia. In the evaluation of pneumonia severity, it has been suggested that radiomic models utilizing CT features may serve as a valuable tool for prognosticating the severity of COVID-19 pneumonia, thereby potentially facilitating timely intervention strategies and mitigating mortality rates among COVID-19 patients [19]. Homayounieh et al. [42]. employed a comprehensive approach incorporating whole-lung radiomics, radiologist interpretations, and clinical variables to forecast pneumonia in individuals with COVID-19. Their findings indicate that radiomics holds greater significance compared to alternative diagnostic modalities. Radiomics features have shown a discriminative ability between outpatient and inpatient chest CTs, achieving an AUC of 0.84. Recent research, characterized by high accuracy and AUC values, suggests that radiomics analysis of whole-lung segmentation can effectively distinguish between confirmed cases of COVID-19 and suspected individuals [43,44,45,46]. The application of radiomics, a noninvasive, efficient, and cost-effective technique, has been expanded to assess the severity of CAP, resulting in a decrease in unnecessary interventions and alleviation of patient distress, especially in settings with limited resources. Once the model is developed, it can be smoothly incorporated into the CT interpretation software, streamlining the workflow for radiologists who need only delineate the entire lung volume, after which the system produces an objective outcome for their review. Existing literature indicates a dearth of research on the utilization of radiomics for evaluating the severity of CAP. This research develops a prognostic model for the severity of CAP using CT radiomics analysis, introducing an innovative method for the timely identification of SCAP. These findings have substantial implications for the progression of precision medicine and the enhancement of individualized and efficient treatment strategies.

Our research is constrained by several limitations. This retrospective study is subject to selection bias, and the manual delineation of Regions of Interest may introduce variability due to lesion irregularities. Moreover, it is important to note that this study was conducted at a single center with a sample size of 115 patients, which may limit the generalizability of the findings. The absence of an a priori power analysis underscores the necessity for future research to address this limitation. Moving forward, we recommend expanding sample sizes and incorporating data from multiple centers to improve the robustness and applicability of our model. Longitudinal follow-up studies are essential for validating the predictive efficacy of radiomics features in SCAP patients over time. Enhancing feature extraction and selection methods using advanced algorithms and machine learning techniques will enhance the predictive accuracy and interpretability of the model.

Conclusion

In this study, the radiomics model based on CT imaging have good performance in early identification of SCAP. The implications of our findings in the clinical setting are significant, as timely and precise identification of SCAP has the potential to enhance patient outcomes and streamline resource allocation within healthcare facilities. Implementation of this model in clinical practice can empower healthcare professionals to make evidence-based decisions, ultimately enhancing patient care and treatment. At the same time, it will provide new ideas for the research, diagnosis, and treatment of other types of pneumonia.