Machine learning to diagnose community-acquired pneumonia based on routine clinical and laboratory data

Community-acquired pneumonia is currently diagnosed based on clinical information, laboratory test results, and radiography findings. However, chest radiography is frequently inaccessible in primary care settings, and this leads to variable clinical diagnoses. The literature has so far not revealed alternative approaches to chest radiography. This study aimed to develop a machine-learning (ML) model to diagnose community-acquired pneumonia (CAP) using clinical and laboratory data. We included 10,707 adult patients who presented with fever or respiratory symptoms at the outpatient clinic or emergency room of a tertiary care center between January 2005 and July 2019. Patients were assigned to training set ( n = 7,515) and a year-based holdout test set ( n = 3,192), with patients admitted in 2016 comprising the holdout test set. A temporal validation cohort comprised 1,364 patients from the same institution between August 2019 and December 2020. Models learned from the training data, and the algorithm with the best performance on the test data was selected. An optimized model was then evaluated in the temporal validation cohort. Among the algorithms tested, eXtreme Gradient Boosting (XGBoost) achieved the highest area (AUC) under the receiver operating characteristic (ROC) curve (0.9364; confidence interval [CI], 0.9241–0.9471), followed by gradient boosting (0.9310) and random forest (0.9257) models in the test set. The most significant independent predictors for diagnosing pneumonia were cough, crackled lung sounds, and elevated C-reactive protein (CRP) values. The AUC for XGBoost in the temporal validation cohort was 0.9092 (CI, 0.8848–0.9323), with sensitivity, specificity, and accuracy of 82.30%,88.92%, and 87.90%, respectively. Our study is limited by its single-center, retrospective design. Nevertheless, the model showed promising diagnostic performance using routinely available clinical and laboratory information. The ML model showed good discriminatory performance for identifying CAP using clinical and laboratory data and may be relevant in settings where immediate chest imaging is not readily available, including primary care. Prospective validation in primary-care populations is required before routine clinical implementation.

Authors

Institutions

Publication Details

Journal
BMC Pulmonary Medicine
Published
2026-11-30
DOI
https://doi.org/10.1186/s12890-026-05067-4
Primary Topic
Pneumonia and Respiratory Infections
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Machine learning to diagnose community-acquired pneumonia based on routine clinical and laboratory data

J. Lee, Myung Jin Song, Sooyoung Yoo, Ho Young Lee et al.
BMC Pulmonary Medicine
Pneumonia and Respiratory Infections
article

Machine learning to diagnose community-acquired pneumonia based on routine clinical and laboratory data

J. Lee, Myung Jin Song, Sooyoung Yoo, Ho Young Lee, Sejin Nam, Sung Yoon Lim, Taehun Kim, 이재연, Eu Suk Kim, Hyunju Lee, Seyoung Jung, Kyul Kim, Jihoon Cho, Miyoung Kim
article en

Abstract

Community-acquired pneumonia is currently diagnosed based on clinical information, laboratory test results, and radiography findings. However, chest radiography is frequently inaccessible in primary care settings, and this leads to variable clinical diagnoses. The literature has so far not revealed alternative approaches to chest radiography. This study aimed to develop a machine-learning (ML) model to diagnose community-acquired pneumonia (CAP) using clinical and laboratory data. We included 10,707 adult patients who presented with fever or respiratory symptoms at the outpatient clinic or emergency room of a tertiary care center between January 2005 and July 2019. Patients were assigned to training set ( n = 7,515) and a year-based holdout test set ( n = 3,192), with patients admitted in 2016 comprising the holdout test set. A temporal validation cohort comprised 1,364 patients from the same institution between August 2019 and December 2020. Models learned from the training data, and the algorithm with the best performance on the test data was selected. An optimized model was then evaluated in the temporal validation cohort. Among the algorithms tested, eXtreme Gradient Boosting (XGBoost) achieved the highest area (AUC) under the receiver operating characteristic (ROC) curve (0.9364; confidence interval [CI], 0.9241–0.9471), followed by gradient boosting (0.9310) and random forest (0.9257) models in the test set. The most significant independent predictors for diagnosing pneumonia were cough, crackled lung sounds, and elevated C-reactive protein (CRP) values. The AUC for XGBoost in the temporal validation cohort was 0.9092 (CI, 0.8848–0.9323), with sensitivity, specificity, and accuracy of 82.30%,88.92%, and 87.90%, respectively. Our study is limited by its single-center, retrospective design. Nevertheless, the model showed promising diagnostic performance using routinely available clinical and laboratory information. The ML model showed good discriminatory performance for identifying CAP using clinical and laboratory data and may be relevant in settings where immediate chest imaging is not readily available, including primary care. Prospective validation in primary-care populations is required before routine clinical implementation.

BMC Pulmonary Medicine
Seoul National University (KR), Seoul National University Bundang Hospital (KR), Keimyung University Dongsan Medical Center (KR), Keimyung University Dongsan Hospital (KR), Keimyung University (KR)
Pneumonia and Respiratory Infections
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
Machine learning to diagnose community-acquired pneumonia based on routine clinical and laboratory data — J. Lee, Myung Jin Song, et al. · BMC Pulmonary Medicine (2026) | TGRS Research Map | TGRS