# Pneumonia Disease Detection Using Chest X-Rays and Machine Learning
## 4 Discussion  
With regards to comparing the CNN models and ResNet-50 models test results, an overall better accuracy of 0.79 achieved by the CNN model with and without the use of augmentation on the original dataset compared to the ResNet-50 model with augmentation of 0.74, shows a fairly good performance of the models at identifying pneumonia disease, suggesting that it could be effective for pneumonia detection. However, existing studies have performed better. Ref. [23], for instance, used customized CNNs to detect pneumonia and achieved an accuracy of 92%. Refs. [24, 25] built a simple CNN architecture for the classification of pneumonia chest X-ray images and achieved 90.68% and 93.73%, respectively [20]. The CNN model with augmentation was compared to the ResNet 50 model with augmentation. The CNN model achieved 0.79 accuracy while the ResNet50 model achieved 0.74, the CNN model achieved a precision of 0.76 compared to ResNet50's 0.73, and the CNN model achieved a recall value of 0.73 compared to ResNet50's 0.63. The CNN model had an F1 score of 0.74 compared to ResNet50's 0.63. CNN achieved an AUC OF 0.84. Although the results show that the CNN model developed from scratch is more effective across all performance metrics compared to the pretrained ResNet50 in training and test set results, the results may have been due to over-fitting. Though a higher result was achieved by [26], they used chest X-ray images to detect the presence of pneumonia with ResNet50, Inception v3, and InceptionResNetV2 and later compared the result with the CNN built from scratch, and then proposed a ResNet50 model from the result. They achieve an accuracy of 93.06%, an 88.87% precision rate, a 96.78% recall rate, and an F1 score of 92.71%. The CNN model accuracy, using the original data with and without augmentation, remained the same. However, the AUC decreased from 0.85 to 0.82, showing a slight reduction in discriminate ability, even though the accuracy is consistent. The result of the CNN model trained on a reduced dataset the accuracy dropped to 0.75 and the AUC was 0.78. This suggests that the effect of the augmentation could be less effective with respect to data size. The AUC figure of 0.79, on the other hand, shows that augmentation helps but could be less effective with pretrained models. Though [27] developed the CheXNet algorithm using chest X-rays and applied augmentations to the images. They achieve a score of 0.4 35 higher than the average of 0.387 for radiologists. Also, ref. [28], in a classification task, trained on changed images, through different steps of pre-processing, and successfully classified chest infection in chest X-ray, achieving an overall accuracy of 98.46% [29, 30]. The CNN original dataset achieved 0.79 with and without augmentation. The CNN reduced dataset accuracy to 75 with augmentation and 0.77 without augmentation. AUC for the original dataset was 0.82-0.85, while for the reduced dataset, it was 0.78-0.80. One would imply that data size has a notable impact on model performance, suggesting that having a larger dataset size generally for better generalization and detection accuracy. The performance drops in the reduced dataset highlight the importance of a considerable quantity of data in training effective deep learning models for image analyses. Due to computational constraints during the training and time limitations, only the CNN model from scratch was trained using different data sizes and no augmentation. Using exactly the same training parameters for the ResNet 50 model would provide more room for comparison and not limit the ability to fully evaluate the pretrained model's potential and adaptability to various scenarios. Clinical Implications of the Visual Quality Improvements  
In this study, the enhanced resolution and pre-processing methods have vital clinical implications.