Welcome to the lung xray classification repository! This Jupyter Notebook focuses on classifying lung xrays of patients either having pneumonia, covid or healthy lungs. The dataset is organized into 3 folders (covid, pneumonia, normal), each containing chest X-ray posteroanterior (PA) images. In total, 6939 samples were used in the experiment, with 2313 samples for each case.
The repository contains a history.csv file which contains all the training data per epoch of the model.
The .ipynb file contains all the model training and evaluation.
Before running the notebook, ensure you have the following dependencies installed:
pip install -r requirements.txt- Clone this repository to your local machine:
git clone https://github.com/Harbringe/lung-xray-classification/- Navigate to the project directory:
cd lung-xray-classification-
Download the dataset using the provided link and place it in the project directory.
-
Open and run the "lung_Xray_classification.ipynb" notebook using Jupyter Notebook or Jupyter Lab:
jupyter notebook lung_Xray_classification.ipynbFollow the instructions in the notebook to execute each cell.
The model showed exceptional results and has done very well at classifying the X-rays with 95% accuracy.
- Click on the link model.keras to download the Keras model file.
- Ensure you have the required dependencies installed. You can install them using
pip install -r requirements.txt. - Load the model in your Python environment using TensorFlow or Keras:
from tensorflow.keras.models import load_model model = load_model('path/to/model.keras')
- Once loaded, you can use the model to make predictions on new X-ray images:
# Assuming 'image' contains your input image data prediction = model.predict(image)
- Interpret the prediction results as needed for your application.
Link to dataset: COVID19 Pneumonia Normal Chest Xray PA Database
Feel free to explore the notebook to understand the modeling process and results. Happy classifying!