🧫 High-Speed Microparticle Detection and Tracking using YOLOv5

Author: Martin Badrous
Affiliation: ViBOT Master’s Program, Bourgogne University
Year: 2021
License: MIT


🧠 Abstract

This repository hosts the deep learning model developed for the master’s thesis
β€œHigh-Speed Microparticle Detection and Tracking” (2021),
conducted under the ViBOT Master’s Program, Bourgogne University.

The model implements a YOLOv5-based object detection pipeline for identifying and counting PMMA microplastic particles in high-speed microscopy imagery.
It represents the second and deep learning phase of the research, following an earlier classical image processing approach.


πŸ“š Research Context

Microparticle detection is a key task in studying particulate contamination and flow behavior under a microscope.
Traditional methods based on thresholding and contour detection struggle with illumination, blur, and focus variations.
To overcome these limitations, this work explores a deep learning detector (YOLOv5) trained to recognize two microplastic classes under 20Γ— magnification.

Target Classes

  • PMMA10
  • PMMA20

Model Architecture

  • Model: YOLOv5s (PyTorch)
  • Input Resolution: 640 Γ— 640
  • IoU Threshold: 0.5
  • Confidence Threshold: 0.5
  • Min Detection Area: 500 px
  • Scale: 0.30 Β΅mΒ²/pixel
  • Epochs: 50
  • Batch Size: 16

πŸ§ͺ Dataset and Training

  • Dataset Split: 70% train / 20% validation / 10% test
  • Data Source: Custom microscope videos at 20Γ— magnification
  • Augmentations: Gaussian noise, blur, brightness, contrast, and saturation (rotation disabled)
  • Optimization: SGD with cosine learning rate decay
  • Framework: PyTorch (YOLOv5 Ultralytics)

Evaluation Results

Metric PMMA10 PMMA20 Mean
Precision 0.80 0.79 0.795
Recall 0.88 0.91 0.895
mAP@0.5 0.97 0.97 0.97

🧩 Post-Processing and Analysis

After detection, each particle undergoes morphological analysis via three computed features:

Feature Description
Otsu Binarized Area (px) Measures the segmented particle area
Laplacian Variance Quantifies image focus/sharpness
Chi-Square Histogram Distance Measures similarity to a reference β€œideal” particle histogram

These features are visualized in a 3D scatter space to assess detection focus, size distribution, and classification consistency.


🧭 Model Structure

Microparticle-Detection-YOLOv5-HF/
β”œβ”€β”€ README.md          # Academic model card (this file)
β”œβ”€β”€ config.yaml        # Metadata (architecture and params)
β”œβ”€β”€ model_card.json    # Structured metadata for Hugging Face Hub
└── best.pt            # YOLOv5 trained weights

🧩 How to Use

import torch

# Load custom YOLOv5 model
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt')
results = model('microscope_sample.jpg')
results.show()

πŸ“˜ Citation

Badrous, M. (2021). High-Speed Microparticle Detection and Tracking.
ViBOT Master’s Program, Bourgogne University.


πŸ§‘β€πŸ’» Author

Martin Badrous
ViBOT Master’s Program, Bourgogne University (2021)


πŸͺΆ License

This model is released under the MIT License.


🧭 Future Work

  • Integrate motion tracking and particle trajectory reconstruction
  • Extend dataset to diverse microplastic materials and shapes
  • Deploy as an interactive Hugging Face Space (Streamlit demo)
  • Explore YOLOv8 or RT-DETR for real-time microscopy inference

Downloads last month
2
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Evaluation results

  • precision on Custom PMMA Microplastic Microscopy Dataset
    self-reported
    0.795
  • recall on Custom PMMA Microplastic Microscopy Dataset
    self-reported
    0.895
  • mAP@0.5 on Custom PMMA Microplastic Microscopy Dataset
    self-reported
    0.970