# PELM: A Deep Learning Model for Early Detection of Pneumonia in Chest Radiography
## 3 Materials and Methods
### Data Collection and Preprocessing
#### 3.1.1 Dataset
CheXpert Dataset: The CheXpert dataset contains 224,316 chest radiographs collected from 65,240 patients, each annotated with labels corresponding to 14 common chest radio graphic findings [19]. To improve the reliability of label extraction from free-text radiology reports, the dataset incorporates an uncertainty-aware labeling strategy, allowing the model to capture not only confirmed observations but also uncertain diagnostic information. This approach enhances the dataset's applicability in training models under both supervised and weakly supervised settings. Representative samples from the dataset are shown in Figure 2.  
The PadChest dataset is a comprehensive and clinically rich resource for medical imaging research, consisting of over 160,000 chest X-ray (CXR) images acquired from approximately 67,000 patients at San Juan Hospital in Alicante, Spain, between 2009 and 2017 [25]. These radiographs encompass a wide array of clinical presentations and imaging conditions, captured in six different positional views, thus offering substantial diversity for training and evaluating computer-aided diagnostic (CAD) systems. The dataset is further enhanced by extensive metadata, including details on image acquisition settings and patient demographics, supporting both clinical interpretation and algorithmic development. Each CXR image is paired with a corresponding radiology report authored by expert radiologists. These reports have been meticulously annotated with 174 distinct radiographic findings, 19 differential diagnoses, and 104 anatomical locations. Annotations are organized using a hierarchical structure and mapped to standardized medical ontologies, including  
Figure 2: CheXpert dataset samples (CheXpert) ((a) “Pneumonia”, (b) “Normal”, (c) “Enlarged Cardiomediastinum”, (d) “Lung Opacity”) [19]. the Unified Medical Language System (UMLS), ensuring interoperability and consistency with other clinical datasets. The annotation pipeline employed a hybrid strategy to balance accuracy and scalability. Approximately 27% of the reports were manually annotated by trained physicians to establish high-quality ground truth labels. The remaining reports were annotated automatically using a supervised deep learning pipeline that incorporates a recurrent neural network with attention mechanisms. This dual approach--combining expert insight with algorithmic efficiency--produced a robust, high-utility dataset that is particularly well-suited for the development and validation of deep learning models in thoracic imaging. Representative samples from the PadChest dataset are presented in Figure 3.  
Kaggle CXR Pneumonia Dataset: The Kaggle Chest X-ray Pneumonia dataset consists of 5863 anterior-posterior chest radiographs in JPEG format, organized into three distinct subsets: training, testing, and validation, each containing subfolders for the two image classes--Preumonia and Normal [26]. The images were retrospectively collected from pediatric patients aged one to five years at Guangzhou Women and Children's Medical Center in China, with all imaging conducted as part of routine clinical care. To ensure  
Figure 3: PadChest dataset samples ((**a**) “Increased density, Apical Pleural Thickening, Fibrotic Band, Pneumonia, Volume Loss, Bullas”, (**b**) “Normal”, (**c**) “Copd Signs, Pulmonary Mass, Soft Tissue Mass”, (**d**) “Fibrotic Band”) [25]. data quality, all scans underwent initial screening to exclude unreadable or low-quality images. Diagnostic labels were assigned by two experienced physicians, with an independent review conducted by a third expert to resolve any discrepancies and confirm final annotations. The dataset includes both bacterial and viral pneumonia cases, which present distinct radiographic patterns--bacterial pneumonia typically appears as focal lobar consolidation, whereas viral pneumonia presents a diffuse interstitial pattern affecting both lungs.