Pneumonia remains a leading cause of global mortality, accounting for nearly 15% of deaths among children under five worldwide, thus requiring early and accurate detection. This research examines three YOLOv8 variants: YOLOv8n, YOLOv8s, and YOLOv8m to determine their effectiveness in classifying Chest X-Ray (CXR) images into normal, bacterial pneumonia, and viral pneumonia categories. The dataset was divided into training 80%, validation 10%, and testing 10%, with each image resized to 640 × 640 pixels. The models were checked using three measures: Precision, Recall, and mAP@50. The experimental evaluation revealed that all models produced high accuracy, each achieving mAP@50 scores above 0.90. Among the tested variants, YOLOv8s delivered the most optimal results, obtaining mAP@50 of 0.917, precision of 0.873, and recall of 0.889. YOLOv8m showed consistent performance and strong detection capability for normal lung images, while YOLOv8n achieved the highest recall value (0.894) with efficient computational demands. The superior outcome of YOLOv8s is attributed to its well-balanced architectural design, enabling enhanced detection while minimizing overfitting. Overall, the findings indicate that the moderately complex YOLOv8s model provides the most effective combination of speed, a
Copyrights © 2026