Spaces:
Sleeping
Sleeping
| title: Bacteria Detection System | |
| emoji: 🦠 | |
| colorFrom: blue | |
| colorTo: purple | |
| sdk: gradio | |
| sdk_version: 5.49.1 | |
| app_file: app.py | |
| pinned: false | |
| license: mit | |
| short_description: Classifies bacteria images into Gram+/- cocci and bacilli wi | |
| # 🦠 Bacteria Detection System | |
| A deep learning application for detecting and classifying bacteria in microscope images using YOLOv8. | |
| ## 🎯 Overview | |
| This application automatically detects and classifies bacteria based on: | |
| - **Gram staining:** Gram-positive (G+) vs Gram-negative (G-) | |
| - **Shape:** Cocci (spherical) vs Bacilli (rod-shaped) | |
| ## 🔬 Features | |
| - **Real-time Detection:** Upload microscope images and get instant results | |
| - **4 Classes:** | |
| - G- Cocci (Gram-negative cocci) | |
| - G+ Cocci (Gram-positive cocci) | |
| - G- Bacilli (Gram-negative bacilli) | |
| - G+ Bacilli (Gram-positive bacilli) | |
| - **Visual Results:** Color-coded bounding boxes with confidence scores | |
| - **Detailed Statistics:** Class distribution and detection counts | |
| ## 🚀 How to Use | |
| 1. **Upload Image:** Click the upload area or drag & drop a microscope image | |
| 2. **Detect:** Click the "🔬 Detect Bacteria" button | |
| 3. **View Results:** See detected bacteria with bounding boxes and classification | |
| ## 🧬 Model Details | |
| - **Architecture:** YOLOv8 Nano | |
| - **Training Dataset:** Clinical Bacteria Detection Dataset (6,005 images) | |
| - **Performance:** | |
| - Precision: ~87% | |
| - Recall: ~82% | |
| - mAP50: ~87% | |
| - mAP50-95: ~64% | |
| - **Confidence Threshold:** 25% | |
| - **IoU Threshold:** 45% | |
| ## 📊 Classes | |
| | Class | Description | Gram Stain | Shape | | |
| | ---------- | --------------------- | ---------------------- | ---------- | | |
| | G- Cocci | Gram-negative cocci | Negative (Pink/Red) | Spherical | | |
| | G+ Cocci | Gram-positive cocci | Positive (Purple/Blue) | Spherical | | |
| | G- Bacilli | Gram-negative bacilli | Negative (Pink/Red) | Rod-shaped | | |
| | G+ Bacilli | Gram-positive bacilli | Positive (Purple/Blue) | Rod-shaped | | |
| ## 🛠️ Technology Stack | |
| - **Model:** YOLOv8 (Ultralytics) | |
| - **Framework:** Gradio | |
| - **Backend:** PyTorch | |
| - **Image Processing:** OpenCV | |
| ## 📖 Clinical Relevance | |
| Gram staining and bacterial shape identification are crucial for: | |
| - Initial antibiotic selection | |
| - Infection diagnosis | |
| - Treatment planning | |
| - Laboratory screening | |
| **Note:** This is a research tool and should not replace professional medical diagnosis. | |
| ## 🔗 Links | |
| - [Dataset Paper](https://www.nature.com/articles/s41597-024-03370-5) | |
| - [YOLOv8 Documentation](https://docs.ultralytics.com/) | |
| - [Gradio Documentation](https://gradio.app/) | |
| ## 📝 License | |
| MIT License | |
| ## 🙏 Acknowledgments | |
| - Dataset: Clinical Bacteria Detection Dataset (Nature Scientific Data) | |
| - Model: YOLOv8 by Ultralytics | |
| - Interface: Gradio by Hugging Face | |
| --- | |
| **Made with ❤️ for medical research and education** |