AI-powered parasite detection tool for Petri dish analysis.
Biologists spend hours visually scanning Petri dishes with fish/sea urchin samples to detect trematode parasites (metacercariae). This is tedious, time-consuming, and leads to eye fatigue and missed detections.
Trematode Scanner is a web application that uses computer vision (OpenCV + YOLOv8) to automatically detect suspicious circular objects in Petri dish images. It highlights potential parasites with green bounding boxes, significantly reducing manual screening time.
- 📸 Upload photos of Petri dishes (drag & drop support)
- 🧠 AI-powered detection of circular parasitic objects
- 🟩 Visual highlighting with bounding boxes
- 📊 Real-time detection count
- 🔄 Clean and intuitive user interface
- 🚀 FastAPI backend with async processing
- FastAPI — Modern Python web framework
- OpenCV — Image processing and contour detection
- Ultralytics YOLOv8 — Object detection (ready for custom training)
- Python 3.12
- HTML5 / CSS3 — Clean, responsive interface
- Vanilla JavaScript — No frameworks needed
- REST API — Communication with backend
- Python 3.12 or higher
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/yourusername/trematode-scanner.git
cd trematode-scanner- Create and activate virtual environment:
cd backend
python -m venv venv
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run the backend server:
uvicorn app:app --reload --host 0.0.0.0 --port 8000- Run the frontend (in a new terminal):
cd ../frontend
python -m http.server 5500- Open your browser at
http://localhost:5500
- Upload: Biologist uploads a photo of a Petri dish
- Detection: Backend processes the image using:
- Adaptive thresholding to find dark regions
- Contour detection to identify circular objects
- Circularity filtering (0.7 < circularity < 1.3)
- Size filtering (50 < area < 2000 pixels)
- Visualization: Results are returned with green bounding boxes
- Reporting: Detection count is displayed instantly
| Input | Output |
|---|---|
- Train YOLOv8 on real trematode datasets
- Add SQLite database for analysis history
- Export results to CSV/Excel
- Support for microscope image formats (.tiff, .czi)
- Batch processing for multiple images
- User authentication and result sharing
This is a proof-of-concept project. Contributions are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built for researchers working on trematode detection
- Inspired by real-world needs in parasitology labs
Project Link: https://github.com/bat801/trematode-scanner