Pneumonia is an inflammatory condition of the lungs affecting the small air sacs known as alveoli. Symptoms typically include cough, chest pain, fever, and difficulty breathing. The severity varies, and the condition is often diagnosed using chest X-rays, blood tests, and sputum cultures.
This project utilizes deep learning techniques to classify chest X-ray images as either normal or pneumonia-affected using Convolutional Neural Networks (CNNs).
The dataset consists of chest X-ray images categorized into two classes:
- โ Normal: X-ray images of healthy individuals
- โ Pneumonia: X-ray images showing pneumonia infection
The dataset is preprocessed using image augmentation techniques to improve model generalization.
To run this project, install the required dependencies:
pip install numpy pandas matplotlib seaborn keras tensorflow scikit-learnThe deep learning model used is a CNN built using Keras with TensorFlow as the backend. The architecture consists of:
- ๐งฉ Convolutional layers with ReLU activation
- ๐ Max-pooling layers
- โ๏ธ Batch normalization
- ๐ Fully connected dense layers
- ๐ Dropout for regularization
The model is trained using:
- Loss Function: Categorical Crossentropy
- Optimizer: Adam
- Evaluation Metrics: Accuracy and loss
The dataset is split into training, validation, and testing sets. Image augmentation is applied to improve performance.
The model is evaluated using:
- ๐ Accuracy
- ๐ Precision
- ๐ฏ Recall
- ๐ F1 Score
- ๐งฎ Confusion Matrix
To run the model, execute the Jupyter Notebook file:
jupyter notebook pneumonia_detection.ipynbEnsure the dataset is correctly placed in the directory specified in the notebook.
The notebook includes:
- ๐ Model training and validation accuracy plots
- ๐ Confusion matrix visualization
- ๐ Sample predictions with actual vs. predicted labels
This project was inspired by medical imaging research and Kaggle datasets. Contributions from deep learning enthusiasts and healthcare professionals helped refine the model.