Identification of 2D colloidal assemblies in images: a threshold processing method versus machine learning
L. T. Khusainova, K. S. Kolegov
TL;DR
The study addresses identifying 2D colloidal assemblies in monolayer coatings by comparing a threshold-based OpenCV pipeline with a YOLOv8-Seg machine-learning pipeline trained on a polygon-annotated dataset of four assembly classes. The threshold approach uses $R_{cut} = R + eps$ and $L = sqrt((x2 - x1)^2 + (y2 - y1)^2)$ to form particle neighborhoods, applies DFS for topology classification, and refines contours with Watershed after Otsu binarization, with circularity $circularity = 4 pi A / P^2$ guiding threshold choice. The ML approach builds a ~6000-image dataset with four polygon-based labels and trains YOLOv8-Seg (pretrained on COCO) to perform polygon-based instance segmentation, achieving high accuracy measured by $mAP$, $Precision$, and $Recall$. Results show thresholding attains about 68% accuracy while YOLOv8-Seg reaches around 97% accuracy with good generalization; thresholding requires extensive preprocessing and suffers from contour artifacts, whereas ML provides a scalable, robust solution suitable for large datasets and automated analysis in materials science, with the software integrated into ISANM and data/models available on request.
Abstract
This paper is devoted to the problem of identification of colloidal assemblies using the example of two-dimensional coatings (monolayer assemblies). Colloidal systems are used in various fields of science and technology, for example, in applications for photonics and functional coatings. The physical properties depend on the morphology of the structure of the colloidal assemblies. Therefore, effective identification of particle assemblies is of interest. The following classification is considered here: isolated particles, dimers, chains and clusters. We have studied and compared two identification methods: image threshold analysis using the OpenCV library and machine learning using the YOLOv8 model as an example. The features and current results of training a neural network model on a dataset specially prepared for this work are described. A comparative characteristic of both methods is given. The best result was shown by the machine learning method (97% accuracy). The threshold processing method showed an accuracy of about 68%. The developed algorithms and software modules may be useful to scientists and engineers working in the field of materials science in the future.
