π§« 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
PMMA10PMMA20
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
Evaluation results
- precision on Custom PMMA Microplastic Microscopy Datasetself-reported0.795
- recall on Custom PMMA Microplastic Microscopy Datasetself-reported0.895
- mAP@0.5 on Custom PMMA Microplastic Microscopy Datasetself-reported0.970