Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drkenreid/cnn-tutorial---x-ray-image-classifier
This Google Colab script implements a Convolutional Neural Network to classify chest X-ray images for pneumonia detection, featuring data preparation, model training, performance evaluation, and result visualization.
https://github.com/drkenreid/cnn-tutorial---x-ray-image-classifier
cnn convolutional-neural-networks image-processing x-ray x-ray-images x-ray-imaging
Last synced: 3 days ago
JSON representation
This Google Colab script implements a Convolutional Neural Network to classify chest X-ray images for pneumonia detection, featuring data preparation, model training, performance evaluation, and result visualization.
- Host: GitHub
- URL: https://github.com/drkenreid/cnn-tutorial---x-ray-image-classifier
- Owner: DrKenReid
- License: mit
- Created: 2024-08-21T14:36:42.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-21T20:21:23.000Z (4 months ago)
- Last Synced: 2024-11-08T10:50:25.598Z (about 2 months ago)
- Topics: cnn, convolutional-neural-networks, image-processing, x-ray, x-ray-images, x-ray-imaging
- Language: Jupyter Notebook
- Homepage:
- Size: 3.56 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🫁 CNN X-ray Image Classifier for Pneumonia Detection
## 🔍 Overview
This Python script, designed to run in Google Colab, implements a Convolutional Neural Network (CNN) for classifying chest X-ray images as either normal or indicating pneumonia. It's particularly useful for medical professionals and researchers in the field of radiology and pulmonary diseases who want to explore automated diagnosis assistance tools.## ✨ Features
- **📊 Data Preparation**: Automatically downloads and prepares the pneumonia X-ray dataset from Kaggle.
- **🖼️ Image Preprocessing**: Implements image resizing, normalization, and data augmentation techniques.
- **🧠 CNN Model Architecture**: Designs and implements a CNN structure suitable for X-ray image analysis.
- **🏋️♀️ Model Training**: Utilizes TensorFlow and Keras for efficient model training with callbacks for early stopping and learning rate adjustment.
- **📈 Performance Evaluation**: Assesses the model's performance using accuracy, precision, recall, and F1-score metrics.
- **📊 Visualization**: Provides visualizations of sample X-rays, training progress, and confusion matrices.
- **☁️ Google Drive Integration**: Automatically saves results and model to Google Drive for easy access and persistence.## 🛠️ Requirements
- Google Colab environment
- Google account for Google Drive integration
- Kaggle account and API credentials for dataset access
- Required libraries (automatically installed in the notebook):
- TensorFlow
- Keras
- NumPy
- Pandas
- Matplotlib
- Seaborn
- Scikit-learn## 🚀 Usage
1. Open the script in Google Colab.
2. Ensure you have a Kaggle account and API token (instructions provided in the notebook).
3. Run the cells in order, following the instructions in the notebook.
4. The script will guide you through:
- Setting up the Kaggle API and downloading the dataset
- Preparing and preprocessing the X-ray images
- Building and training the CNN model
- Evaluating the model's performance
- Visualizing results and predictions## ⚙️ Configuration
You can modify the following parameters in the notebook:
- `batch_size`: Number of images processed in each training iteration
- `img_height` and `img_width`: Dimensions of input images
- CNN architecture: Number of layers, filters, and neurons in dense layers
- Training parameters: Number of epochs, learning rate, etc.## 📤 Output
The script generates several outputs:
1. Trained CNN model saved to Google Drive
2. Training history and performance metrics
3. Visualizations of sample X-rays and model predictions
4. Confusion matrix and classification report## ⚠️ Limitations
- Designed to run in Google Colab; modifications may be needed for local execution
- Performance depends on the quality and diversity of the training dataset
- Intended for research and educational purposes; not for clinical use without proper validation## 🤝 Contributing
Contributions, issues, and feature requests are welcome. Feel free to check [issues page] if you want to contribute.## 📄 License
This project is open-source and available under the MIT License.## ⚖️ Disclaimer
This tool is for research and educational purposes only. It should not be used for clinical diagnosis without proper medical validation and approval.