A deep learning application demonstrating pneumonia detection in chest X-ray images using TensorFlow and Streamlit.
This computer vision project showcases a complete CNN implementation for medical image classification. It includes a training pipeline, model evaluation, and an interactive web interface for image upload and prediction.
- Deep Learning Model: CNN architecture for binary image classification
- Training Pipeline: Complete model training with evaluation metrics
- Web Interface: Streamlit app for image upload and prediction
- Model Persistence: Save and load trained models
- Error Handling: Robust error handling throughout the pipeline
- Deep Learning: TensorFlow, Keras
- Computer Vision: OpenCV, Pillow
- Web Framework: Streamlit
- Data Science: NumPy, Pandas, Matplotlib
- Model Evaluation: scikit-learn
medical-image-classifier/
├── data/
│ ├── train/ # Training images folder
│ ├── test/ # Test images folder
│ └── val/ # Validation images folder
├── models/ # Model storage
├── src/
│ └── model_training.py # CNN training script
├── streamlit_app.py # Web interface
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Clone the repository:
git clone https://github.com/sunnynguyen-ai/medical-image-classifier.git
cd medical-image-classifier
- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
python src/model_training.py
streamlit run streamlit_app.py
Visit http://localhost:8501
to access the interface.
- Architecture: CNN with convolutional blocks and global average pooling
- Training: Uses sample data for demonstration purposes
- Evaluation: Provides accuracy, precision, recall, and F1-score metrics
- Web Interface: Allows image upload with real-time predictions
- Convolutional layers with ReLU activation
- Batch normalization for stable training
- Dropout layers for regularization
- Binary classification output with sigmoid activation
- Early stopping to prevent overfitting
- Model checkpointing for best weights
- Comprehensive evaluation metrics
- Training history visualization
This project currently uses synthetic sample data to demonstrate the complete ML pipeline. The architecture and training process are designed to work with real medical imaging datasets when integrated.
This tool is for educational and demonstration purposes only. It should not be used for actual medical diagnosis. Always consult qualified healthcare professionals for medical decisions.
- Integration with real medical imaging datasets
- Docker containerization for deployment
- Additional preprocessing techniques
- Model performance optimization
- Extended evaluation metrics
- Fork the repository
- Create feature branch (
git checkout -b feature/improvement
) - Commit changes (
git commit -am 'Add new feature'
) - Push to branch (
git push origin feature/improvement
) - Create Pull Request
Sunny Nguyen
- GitHub: @sunnynguyen-ai
- Email: sunny.nguyen@onimail.com
- Website: sunnyinspires.com