Inspiration

The growing threat of microplastic pollution in our ecosystems inspired this project. Traditional detection methods are time-consuming and require specialized expertise. I wanted to create an accessible AI solution that could automate microplastic identification in environmental samples, empowering researchers and conservationists to analyze pollution faster and at scale.

What it does

This system detects and localizes microplastic particles in microscope images using computer vision. It draws precise bounding boxes around detected particles and provides confidence scores. A Flask web interface allows users to upload images and instantly visualize results, making it practical for real-world environmental analysis.

How we built it

  1. Dataset Preparation:
    • Converted CSV annotations to YOLO format using Python
    • Organized 1,200+ images into train/val splits (74%/26%)
  2. Model Development:
    • Implemented YOLOv5s architecture via Ultralytics framework
    • Trained on Google Colab (Tesla T4 GPU) for 50 epochs
    • Configured custom microplastics.yaml for dataset specs
  3. Deployment:
    • Built Flask backend with OpenCV image processing
    • Designed minimal web interface for user uploads/results

Challenges we ran into

  • Annotation Conversion: CSV-to-YOLO coordinate translation required precise math to handle normalized bounding boxes
  • Small Particle Detection: Microplastics under 20px often missed in early training phases
  • Resource Constraints: Colab GPU timeouts forced optimization of batch sizes and early stopping
  • Edge Cases: Handling blurry/low-contrast images reduced false positives

Accomplishments that we're proud of

Delivered a working prototype with 68.8% mAP50 accuracy
Created an intuitive web interface for non-technical users
Solved critical CSV-to-YOLO conversion challenges programmatically
Achieved 79.5% precision despite small particle sizes

What we learned

  • Technical: YOLOv5 configuration, dataset versioning, and Flask deployment
  • Problem-Solving: Balancing model accuracy vs. computational efficiency
  • Environmental Science: Gained insights into microplastic morphology and imaging techniques
  • Iterative Development: The value of continuous validation during training

What's next for Microplastic Detection using YOLOv5

  • Model Improvements: Experiment with YOLOv8 and attention mechanisms
  • Video Analysis: Process microscope video streams for dynamic samples
  • Cloud Deployment: Dockerize and host on AWS/Azure for public access
  • Collaboration: Partner with marine biology labs for real-world validation
  • Quantification Tools: Add particle size measurement and concentration estimates

Built With

Share this project:

Updates