# PneumoNet: Artificial Intelligence Assistance for Pneumonia Detection on X-Rays
## 3 Pneumonet Framework
### Pneumonia Classification Module
As mentioned, the adapted AlexNet is trained using Adam (learning rate 10\({}^{-4}\), minibatch size 128, 10 epochs), with shuffling per epoch and validation every 50 iterations, stopping after four stagnant cycles. The augmented training set refines the convolutional stack and a two-class output layer, minimising cross-entropy loss. To prevent data leakage, each dataset [8; 9; 10] was independently split using stratified randomisation (via MATLAB R2024a's splitEachLabel function), ensuring no overlap between training, validation, and test sets while maintaining class balance. For individual dataset experiments, splits were isolated, with Dataset #2 [9] leveraging distinct patient IDs to avoid patient-level leakage. In ensemble training, datasets were pooled, followed by a new stratified split to ensure no image appeared across training and test sets. Data augmentation was applied solely to training data, and a separate validation set was used for early stopping to prevent test set influence. These measures, combined with randomised splitting and predefined folder structures (e.g., Dataset #3's [10] train/test/validation folders), minimised leakage risks. To address potential biases arising from dataset labelling quality and missing data, the PneumNet framework implemented several targeted strategies to ensure robust and reliable annotations across the three datasets. For Dataset #2 [9], which explicitly used clinical diagnoses with distinct patient identifiers, annotation consistency was verified by cross-referencing a subset of labels with radiological reports, reducing the risk of inter-observer variability. For Datasets #1 [8] and #3 [10], a manual audit of 10% of the images was conducted, comparing labels against standard radiological criteria for pneumonia (e.g., presence of consolidations or opacities). Additionally, stratified splitting and data augmentation (e.g., \(\pm 5^{\circ}\) rotations, reflections) were employed to enhance model robustness against potential demographic biases. These measures, combined with the use of multiple diverse datasets, minimised labelling inconsistencies and biases, ensuring reliable model performance, though future work could incorporate automated annotation validation tools for further rigour. The labelling standards for X-ray images in Datasets #1 [8], #2 [9] and #3 [10] relied on clinical and radiological criteria to ensure consistency and accuracy. For Dataset #2 [9], labels were derived from clinical diagnoses linked to distinct patient identifiers, adhering to radiological standards for pneumonia, such as the presence of consolidations, ground-glass opacities, or infiltrates. Datasets #1 [8] and #3 [10] used folder-based labelling (\"Pneumonia\" vs. \"Normal\"), with Dataset #3 [10] specifically sourced from paediatric patients at Guangzhou Women and Children's Medical Centre, where anterior-posterior chest X-rays were annotated based on routine clinical evaluations. To ensure label reliability, a manual audit of 10% of images in Datasets #1 [8] and #3 [10] was conducted, cross-referencing labels against radiological criteria (e.g., opacities for pneumonia), as described in the article (the code implemented in MATLAB further supported label integrity by using imageDatasore with 'LabelSource', 'foldernames' to automatically assign labels based on dataset folder structures, minimising manual labelling errors during data loading). Additionally, the manual audit process identified and corrected mislabelling in approximately 2% of audited images in Datasets #1 [8], ensuring high label fidelity. These combined strategies--clinical-standard labelling, automated label assignment, stratified splitting, and manual verification--minimised mislabelling risks, enhancing the reliability of PneumoNet's training and evaluation across diverse X-ray datasets. It is also important to stress that PCM was not tested separately for paediatric versus adult groups, as training and evaluation occurred across each dataset individually and as an ensemble using a unified pipeline.