One of the biggest causes of morbidity and death globally, especially in children and the elderly, is pneumonia, an infectious disease that affects the lungs. In order to improve treatment efficacy and lower the risk of serious consequences, early identification of pneumonia is essential. Convolutional Neural Networks (CNN), a type of artificial intelligence, are used to analyse chest X-ray pictures in order to diagnose pneumonia. The purpose of this work is to use a CNN architecture to divide chest X-ray pictures into two groups. Pneumonia and normal. The Chest X-ray (Pneumonia) dataset, which was acquired via Kaggle, was utilised in this investigation. Resizing the photos to 150 × 150 pixels, normalising pixel values, augmenting the data, and using class weights to correct class imbalance are all part of the preprocessing step. The CNN model consists of three convolutional layers followed by Batch Normalization, Max Pooling, Flatten, Dense, Dropout, and a Sigmoid output layer. This model was trained using the Stochastic Gradient Descent (SGD) optimizer with a learning rate of 0.0001, momentum of 0.9, and Binary Cross-Entropy as the loss function. The maximum number of training epochs was set to 50, with Early Stopping applied to prevent overfitting. The experimental results show that the proposed CNN model achieved an accuracy of 90% on the test dataset. Furthermore, the model achieved a precision of 90%, a recall of 90%, and an F1-score of 90%, indicating that it is capable of effectively distinguishing between normal chest X-ray images and those showing pneumonia. These findings suggest that the proposed CNN architecture can serve as an effective approach to aid in the early detection of pneumonia based on chest X-ray images.
Copyrights © 2026