Open Access Article
This Open Access Article is licensed under a Creative Commons Attribution-Non Commercial 3.0 Unported Licence

Deep-learning enabled rapid and low-cost detection of microplastics in consumer products following on-site extraction and image processing

Md. Zayed Bin Zahir Arjua, Nafisa Amin Hridia, Lamiya Dewana, Suhailab, Md. Nurul Aminc, Taslim Ur Rashidc, Abul Kalam Azada, Sejuti Rahmand, Mainul Hossain*a and Ahsan Habib*a
aDepartment of Electrical and Electronic Engineering, University of Dhaka, Dhaka-1000, Bangladesh. E-mail: mainul.eee@du.ac.bd; mahabib@du.ac.bd
bDepartment of Computer Science and Engineering, Independent University, Bangladesh, Dhaka-1229, Bangladesh
cDepartment of Applied Chemistry and Chemical Engineering, University of Dhaka, Dhaka-1000, Bangladesh
dDepartment of Robotics and Mechatronics Engineering, University of Dhaka, Dhaka-1000, Bangladesh

Received 10th November 2024 , Accepted 21st March 2025

First published on 4th April 2025


Abstract

Microplastic (MP) contamination has become a major concern in recent times, posing a significant threat to the environment and human health. Existing techniques for MP detection require access to expensive and specialized microscopy setups and often demand long turnaround time and extensive labor. Herein, we propose a simple platform for MP detection, where MPs are extracted from salt, sugar, teabag, toothpaste and toothpowder samples, and imaged using a low-cost mobile phone-based microscopy setup. The extraction process involves the isolation of MPs from their matrices using the well-established density separation technique with ZnCl2 solution (1.7 g cm−3) and hydrogen peroxide (H2O2) to oxidize organic matter. A commercially available miniaturized microscopy attachment (TinyScope, $10) is fixed on top of an ordinary cell phone camera and is used to capture about 2490 images of MPs obtained from five different product categories. The YOLOv5 deep learning model was used to detect microplastics in images. It was trained on a dataset of 1990 images, validated with 250 images, and tested on a separate set of 250 images. The presence of plastic content in the detected samples was confirmed by performing attenuated total reflectance-Fourier transform infrared (ATR-FTIR) spectroscopy and the morphologies of the MPs were determined using the field-emission scanning electron microscopy (FE-SEM). Results show that the deep-learning enabled image processing approach can identify MPs with an accuracy of 98%. Overall, the fast, accurate, and affordable detection of MPs in low-resource settings can lead to the monitoring of MP content in consumer products on a more frequent basis.


Introduction

The widespread use of plastic products and the release of plastic into the environment has become a global concern, with annual plastic emissions expected to reach 53 million metric tons per year in 2030.1 Plastic parts, less than 5 mm in diameter, are termed as microplastics (MPs). More specifically, particles and fibers ranging in size from 1 μm to 1 mm are labeled as nanoplastics and MPs, respectively, with 1–5 mm fragments being classified as large MPs.2 MPs originate from the degradation of bulk plastic wastes comprising of polymers such as polyethylene (PE), polystyrene (PS), polypropylene (PP), nylon, polyvinyl chloride (PVC), polyamide (PA) etc., that are commonly used in plastic production. MPs have been widely detected in air, soil, marine and freshwater ecosystems, drinking water, food items and consumer goods, threatening human health and contributing to environmental pollution.3–5 Fast, accurate, low-cost detection and quantification of MPs is therefore essential to fully comprehend the ecological and health impacts and take necessary preventive measures to mitigate contamination risks. Recent articles have discussed several approaches that focused on the sample preparation, extraction, isolation and quantitative detection and characterization of MPs in food and marine systems as well as in waste water and fresh water.2,6–10 Following successful extraction and isolation, a single analytical method is often difficult to identify MPs as they appear in various sizes, shapes and compositions within complex matrices. The methodology for detecting MPs includes physical characterization with microscopy followed by chemical analysis using various spectroscopic techniques for both identification and quantification. Visual inspection of extracted samples using microscopes provides detailed information on MP's size, shape surface texture and morphology. Common microscopy techniques include simple conventional light and fluorescence microscopy as well as advanced scanning electron microscopy (SEM), transmission electron microscopy (TEM), and atomic force microscopy (AFM) techniques. Conventional optical microscopes are low-cost and readily available but suffer from poor accuracy and are unable to identify MPs which are less than 100 μm in diameter. Scanning electron microscopes (SEMs) have significantly higher resolution, allowing MPs as small as 1 nm to be identified. However, SEMs are expensive and cannot provide any information on the color and chemical composition of the particles. Other optical methods like fluorescent microscopy and confocal laser scanning microscopy rely on expensive lasers with specific wavelengths that are needed to excite light emission.6 Fourier-transform infrared spectroscopy (FTIR) is widely used to discriminate MPs from other types of organic and inorganic particles. FTIR can identify the polymer material in the MPs, since the spectra produced is unique to the bond composition of the polymer. Other spectroscopy methods involved in MP detection include near infrared (NIR), vibrational, thermal and Raman spectroscopy.1,8,11 Other alternative approaches involve the use of hyperspectral imaging and photothermal effects for accurate detection and analysis of MPs.12 Despite the merits, the combination of existing microscopy and spectroscopy techniques is highly resource intensive, lack portability, has long turnaround times, require expensive laboratory settings and trained operators and are often subject to uncertainties resulting from adsorbed contaminants and the operator's skill. In this work, we describe a simple, deep learning enabled, fast and accurate image processing approach that can mitigate some of these challenges.

Our proposed method is built upon recent studies that have reported the use of image or spectra processing through advanced machine learning (ML) and deep learning (DL) algorithms to automate the detection and recognition of MPs.13 Typically, images of MPs obtained through various microscopy techniques are used to train ML models for quick, highly-precise and automated classification and identification of MPs. Lately, Yang et al. applied ML model on spectra obtained from optical photothermal infrared (O-PTIR) spectroscopy. The ML model uses support vector machine (SVM) classifiers that correspond to specific wavenumbers, enabling quick separation of nylon MPs from other MPs, with high-precision.14 Using a dataset containing 3000 images, obtained from optical cameras, Han et al. trained a mask R-CNN deep learning algorithm to localize, classify and segregate different types of marine MPs, achieving more than 93% precision against a white background.15 Focal plane array (FPA) micro-Fourier transform infrared spectroscopy (micro-FT-IR) imaging can collect multiple spectra from a MP surface and is a reliable method for MP detection in environmental samples. Zhu et al. trained a deep learning convolutional neural network (CNN) architecture with over 8000 FPA micro-FT-IR spectra to classify 11 types of common plastics, with over 95% accuracy.16 Another study by Choi et al., utilized a dataset of 5413 FTIR spectra to train a one-dimensional CNN that can classify 16 polymer types with an accuracy of 98.5%.17 Although, these approaches achieve high precision and accuracy, they still need to rely on expensive and sophisticated laboratory equipment, which lack portability and point-of-care detection capability. A recent work by Leonard et al. also reported the use of images, obtained from a smartphone-based fluorescence microscope, for the detection of MPs.18 The field-deployable prototype used an algorithm that was able to count MPs as small as 10 μm, within in 1 hour, enabling rapid quantification of MPs in environmental samples. However, despite being the merits, the custom-made setup costs nearly $500, limiting its widespread use.

With the aim of developing a MP detection platform that is fast, accurate, simple, portable and affordable, we used a low-cost (<$10) microscope attachment that contains a standard objective lens which is seamlessly interfaced with a standard mobile phone camera. Similar microscopy-enabled mobile phone setups have been used in the past for disease diagnosis and water quality monitoring.19–21 ESI Fig. S1 shows the schematic representation of our workflow. Using our proposed setup, 2000+ images of MPs were captured from salt, sugar, toothpaste and toothpowder samples, following a rigorous extraction process as described in Section 2 (Methodology). The images were then used to train YOLOv5 deep learning model for MP detection. Furthermore, the presence of the MPs was confirmed using a combination of attenuated total reflectance-Fourier transform infrared (ATR-FTIR) spectroscopy and scanning electron microscopy (SEM). A detailed analysis of the sample data and the accuracy of the proposed method has been presented in Section 3 (Results and discussion).

Methodology

Microplastics extraction

We transfer 1 g each of salt, sugar, toothpaste, and toothpowder into 100 mL glass containers using a stainless steel spoon. For teabags, we cut open the packets with stainless steel scissors and discarded the tea foliage. We rinsed the empty bags three times with deionized water and transferred them to 100 mL glass containers. The samples were sonicated for 10 minutes at 80 °C. Subsequently, 10 mL of nanopure water was added to maintain a 10[thin space (1/6-em)]:[thin space (1/6-em)]1 solvent-to-solute ratio. This procedure was repeated for all unextracted specimens. Throughout the process, aluminum foil covered the specimens to prevent contamination. We used smaller quantities to expedite extraction, identification, and detection.5,22,23 We incorporated a vortex mixer with effective reagents for density separation and chemical digestion to aid the rapid extraction process. Preprocessed samples were transferred into 25 mm × 150 mm glass test tubes. Using a micropipette, we added 1 mL of dense ZnCl2 solution (density 1.7 g cm−3) and 100 μL of 35.5% H2O2. ZnCl2 (1.7 g mL−1) was selected for density separation due to its ability to maximize flotation and efficiently extract a wide range of plastic types.24,25 Our protocol enables microplastic extraction in under an hour, making it significantly faster than conventional methods. To enhance organic material removal within this short timeframe, we used industry-grade 35.5% H2O2.26,27 The samples were then covered with aluminum foil and sealed with rubber bands to avoid plastic contamination. After vortexing at 50 Hz for 5 minutes, the test tubes were left at room temperature for 15 minutes. Since the vortex mixer lacks temperature control, we used an ultrasonic bath at 80 °C for 10 minutes during preprocessing. This ensured that the samples remained warm throughout the vortexing process, which facilitated effective extraction.22 The organic compounds settled at the bottom. This left a clear liquid supernatant layer that was approximately 2–3 mL. We extracted 1 mL of this supernatant for FTIR analysis and drop-cast the remaining supernatant samples onto an 11 μm mesh Whatman cellulose filter paper.

Preparation of image dataset

We used a ‘TinyScope’ microscope attachment to capture images of the plastics. The images were obtained after positioning the lens, attached to a cellphone, over the filter paper, which had been subjected to drop-casting of the remaining extracted samples onto cellulose filter paper. Since the extraction process was designed to retain only microplastics on the filter paper, the captured images exclusively contain microplastic particles. The captured images, referred to as ‘raw images’ in our research, are inherently RGB images containing microplastics. These raw images were then processed using ImageJ (ESI Text 1). The images were scrutinized, and threshold values were fine-tuned to create binary mask images. These masked images, shown in ESI Fig. S2, have a white background with dark entities identified as microplastics.28 We acquired 2490 thresholded images for preprocessing. The images were manually screened and labeled as ‘Microplastic’ using Label Studio software,29 which resulted in 9113 annotations across 2490 images. The images were saved with their corresponding text files. Coordinates of microplastic presence and class labels were contained in the text file (ESI Fig. S3). The dataset was divided into training, validation, and test sets in an 80[thin space (1/6-em)]:[thin space (1/6-em)]10[thin space (1/6-em)]:[thin space (1/6-em)]10 ratio. This resulted in 1990 images (7503 annotations) for training, 250 images (1071 annotations) for validation, and 250 images (539 annotations) for testing.

Deep learning object detection algorithm YOLOv5

This study employs YOLOv5, a real-time object detection model, to identify microplastics in binary (black-and-white) images. The model follows a structured pipeline that includes feature extraction, bounding box prediction, and classification to ensure accurate and efficient detection. The basic architecture of YOLOv5 consists of three main components: the backbone (CSPDarknet) extracts hierarchical features using the Cross Stage Partial (CSP) architecture, enhancing gradient flow and reducing computation time; the neck (FPN + PAN) improves multi-scale detection by integrating the Feature Pyramid Network (FPN) and Path Aggregation Network (PAN) for better feature fusion; and the output detection heads process feature maps to predict bounding boxes, class probabilities, and confidence scores.30 Input images are resized to 640 × 640 pixels, normalized, and augmented. Bounding box predictions are refined using Non-Maximum Suppression (NMS) to eliminate redundant detections. For our microplastic detection, the dataset consists of thresholded binary images, where white represents the background and black denotes microplastic regions. YOLOv5 is trained to identify these regions based on contrast, texture, and edges rather than only color, making it well-suited for this task. The CSPDarknet backbone extracts key features, and the detection heads predict bounding boxes around microplastic regions.31 The use of an appropriate confidence threshold ensures reliable identification, and NMS refines the results by removing overlapping detections. YOLOv5's efficient architecture and feature extraction capabilities allow it to accurately detect microplastics in images when the training annotations are well-defined. In this study, all images in the training set were resized to 640 × 640 pixels. Data augmentation techniques such as random flipping, geometric transformations, cutout, and mix-up were applied. The testing images were also standardized to 640 × 640 pixels. The model was implemented using the PyTorch framework on Google Colab, utilizing transfer learning with pre-existing weights from YOLOv5s.pt, originally trained on the COCO dataset. A Tesla T4 GPU (15[thin space (1/6-em)]102 MiB memory) was used for model training.

Since our dataset consists of simple black-and-white images with a clear distinction between microplastics (black) and the background (white), the default YOLOv5 hyperparameters were appropriate. Studies suggest that default hyperparameters can yield effective results in straightforward datasets with minimal noise, as seen in applications like weapon identification32 and breast cancer detection,33 where default settings resulted in high precision and recall rates. Additionally, using pre-trained YOLOv5 weights through transfer learning allows for faster training convergence while reducing the need for extensive hyperparameter tuning. While we did not conduct exhaustive hyperparameter optimization experiments, we ensured model robustness by selecting hyperparameters based on Aydin et al. (2023).34 The chosen hyperparameters consisted of a learning rate (lr) set to 0.01, momentum at 0.937, and a weight decay of 0.0005, optimized using Stochastic Gradient Descent (SGD). Additional augmentations such as Blur (p = 0.01), MedianBlur (p = 0.01), ToGray (p = 0.01), and CLAHE (p = 0.01, clip_limit = (1, 4.0), tile_grid_size = (8, 8)) were applied to improve model robustness, following best practices referenced by Aydin.34 The number of classes was reduced from 80 to a single class (microplastic). Training was conducted in batches of 3 for 50 epochs. To visualize and evaluate the model's detection ability, we conducted microplastic extraction on three new sets of teabag samples, fully following our proposed protocol. We then gathered image data and recorded videos of each sample to capture the detection process in real time.

ATR-FTIR analysis and FE-SEM imaging

For FTIR analysis, the extracted 1 mL supernatant samples, as mentioned earlier in the Microplastics extraction subsection, were divided into two portions. One portion of the supernatant was placed on an ATR-FTIR spectrophotometer (Shimadzu IR Prestige-21), and spectra were obtained within the 700–4000 cm−1 range, with an average of five scans per sample. For FE-SEM imaging, the other portion was drop-cast onto a glass Petri dish and dried in an oven at 37 °C. After drying, the microplastics were collected using carbon tape (Electron Microscopy Science) attached to an aluminum holder. To improve conductivity, the samples were coated with gold using a BALTEC SDC 050 Sputter Coater and examined using a ZEISS Sigma 300 VP FE-SEM, operated at 2 kV.

Results and discussion

Microplastics extraction and COD analysis

The effective extraction of microplastics (MPs) from consumer products is crucial for accurate detection and quantification. Fig. 1 shows the microplastics extraction process. It starts with selecting five categories of consumer goods: salt, teabags, sugar, toothpaste and toothpowder (Fig. 1(i)). These items are obtained from supermarkets across Bangladesh. These items are mixed with 10 mL of nano-pure water in a beaker (Fig. 1(ii)) and sonicated at 80 °C for 10 minutes to achieve uniformity (Fig. 1(iii)). The sonicated samples are then transferred to test tubes containing 1 mL of ZnCl2 and 100 μL of H2O2 (Fig. 1(iv)). This approach includes two steps. The first step is the density separation, where MPs are isolated from their matrix by using density differences between the extraction solution and the MP polymers. We select a saline solution (ZnCl2) with a density of 1.7 g mL−1 to balance recovery and minimize interference from unwanted particulates.35 Most common plastics have densities below this value, such as PET (1.32–1.41 g mL−1), PVC (1.14–1.46 g mL−1), and PP (0.85–0.92 g mL−1), allowing denser materials to settle out by sedimentation.36 The second is the oxidation of organic matter that floats to the surface with the separated MPs.36 We use 35.5% hydrogen peroxide (H2O2) as an oxidizing agent to efficiently remove biogenic organic matter without degrading the microplastics.37 Then it's agitated in a vortex mixer at 50 Hz for 5 minutes (Fig. 1(v)). High-frequency vortexing reduces the processing time for microplastics extraction. It accelerates the separation of organic and inorganic compounds from the solution. To verify this, we perform Chemical Oxygen Demand (COD) analysis using the titrimetric KMnO4 oxidation technique.38 Based on the COD analysis results, the required amount of KMnO4 decreases as the vortex frequency increases. At 0 Hz, 5.1 mL of KMnO4 is needed, while at 50 Hz, only 4.1 mL is required (Fig. 2a and b, ESI Text 2). This indicates that higher agitation frequencies enable better digestion of organic matters, which reduces the amount of oxidizing agent required later. After vortexing, we allow the solutions to settle for 15 minutes (Fig. 1(vi)). The top layer is then carefully placed onto an 11 μm mesh cellulose filter paper (Fig. 1(vii)). Finally, MPs are imaged using a microscope attached to a cellphone for visual analysis (Fig. 1(viii)).
image file: d4ra07991d-f1.tif
Fig. 1 Rapid extraction of microplastics from various consumer products using nanopure water, sonication, and vortex mixing. Chemical treatment with ZnCl2 and H2O2 aids in separation, followed by filtration onto a cellulose membrane. Extracted microplastics are imaged using a cellphone-attached microscope.

image file: d4ra07991d-f2.tif
Fig. 2 (a) Table showing agitation frequency, required KMnO4 solution, and corresponding COD values. (b) Decreasing trend in COD (mg L−1) as agitation frequency increases from 0 Hz (0 rpm) to 50 Hz (3000 rpm).

ATR-FTIR analysis and FE-SEM imaging

Our ATR-FTIR analysis reveals significant variations of microplastics in different consumer goods. Such results demonstrate that the extraction process significantly increases the number of particles detected in the supernatant of the extracted samples. Then, we cross-referenced the ATR-FTIR signatures of each sample with relevant literature on plastic identification.5,22,39–44 Our findings confirm the presence of plastics in the samples. ATR-FTIR spectra of salt samples (Fig. 3d) have peaks that correspond to C–O stretching, CH2 rocking and bending, NH bending, C–N stretching, C[double bond, length as m-dash]O stretching etc., which signifies the presence of components such as PP, nylon, EVA, and PET. These findings are consistent with the results of Kim43 and Peixoto.44 Sugar samples (Fig. 3c) have peaks corresponding to CH bending, aromatic ring stretching and bending, NH bending, C–N stretching, indicating the presence of PP, PVC, nylon, and ABS. The results align with Afrin's findings.39 ATR-FTIR analysis of Teabags (Fig. 3b) shows peaks for aromatic ring stretching, CF2 stretching, CH2 and CH3 bending and more, thus indicating the presence of PC, PTFE, PVC, nylon, EVA, and CA, which is also consistent with Hernandez and Afrin's study.5,22 Toothpaste samples have (Fig. 3f) CH2 and CH3 rocking, C–C, C–O, C[double bond, length as m-dash]O stretching peaks, signifying the presence of PP, nylon, PMMA, and PVC, which are in line with the findings of Ustabasi40 and Madhumitha.42 Finally, toothpowder samples (Fig. 3e), being the powdered form of toothpaste, matched the findings of toothpaste and have peaks that refer to the presence of PP, nylon, PMMA, and PVC. Our FE-SEM images provide insights into the shape and surface morphology of the microplastics. The images show that the microplastics in all samples are mostly fibers and fragments (Fig. 4). Additionally, since majority SEM images exhibited similar shape characteristics, we have selected the sharpest and most distinct images for representation from three distinct product categories. The remaining SEM images from the other two product categories have been included in ESI Fig. S4.
image file: d4ra07991d-f3.tif
Fig. 3 ATR-FTIR signatures of the collected supernatant samples with corresponding physical images captured using the mobile phone-based microscope. These images depict the extracted microplastics from the same supernatant samples analyzed via ATR-FTIR, providing both spectral and visual confirmation of microplastic presence. (a) Overview of the sample categories; (b–f) ATR-FTIR profiles of the teabag, sugar, salt, toothpowder, and toothpaste samples, respectively. The individual spectra display characteristic plastic peak values, allowing for the identification of microplastic components. Peaks corresponding to polymers such as PP, PE, nylon, EVA, PET, PVC, ABS, PMMA, PC, PTFE, and CA are compared with existing literature data.

image file: d4ra07991d-f4.tif
Fig. 4 Field-emission scanning electron microscopy (FE-SEM) images of the extracted samples from salt, sugar, and toothpowder. The images reveal detailed morphological characteristics of the microplastics. The samples are mainly fiber-type microplastics, as shown in images (a), (e), (b), (d), and (f), and fragment-type microplastics, as seen in images (c), (b), and (d). The scale bar in each image represents 50 μm.

Dataset preparation and processing

Any deep learning model requires a robust dataset with sufficient sample data to ensure that the model generalizes well. To construct such a dataset, we use a ‘TinyScope’ mobile phone microscope attachment to capture images of the extracted microplastics. Some of the images of the extracted samples are shown in Fig. 5. Fig. 5a and b show plastic particles extracted from the salt samples. Fig. 5c and d show plastic particles from the sugar samples. The plastic particles extracted from the teabag samples appear in Fig. 5e and f, while that from the toothpaste samples are shown in Fig. 5g and h. And finally, Fig. 5i and j display plastic particles from the toothpowder samples. In Fig. 5, the imaged microplastics predominantly appear as fibers and fragments, which is consistent with the findings from FE-SEM imaging. Then, we threshold the images to separate foreground microplastics from the background by using a cut-off value that represents the pixel's brightness or intensity.45 The thresholding process involves two user-defined parameters: lower threshold and upper threshold. In our case, the lower threshold level is kept at 126 whereas upper threshold level is kept at 255. The pixels within the specified range will turn into white pixels and those out of range will turn into black pixels, therefore converting the microscopy images into binary images consisting solely of black and white elements (ESI Text 1 and Fig. S2).
image file: d4ra07991d-f5.tif
Fig. 5 Resulting images after microplastics extraction of samples: (a and b) salt, (c and d) sugar, (e and f) teabag, (g and h) toothpaste, and (i and j) toothpowder. The images found are mainly fiber-type (a, e, g and j) or fragment-type microplastics (b–d, f, h and i).

Construction of the YOLOv5 model

YOLOv5 is utilized on our image dataset by combining them (ESI Fig. S3) to construct an automatic microplastics counting model. YOLOv5 predicts bounding box locations and class probabilities in a single evaluation. We train the YOLOv5 model to detect and count various plastic particles using our microplastics image dataset. The goal is to accurately fit the ground truth box and minimize the loss function as much as possible.46 Post training, we find model evaluation results to be satisfactory. Fig. 6a depicts training box loss (blue) and validation box loss (orange) over 50 epochs, where training box loss gradually decreases to 0.03 ratio after 50 epochs whereas the validation box loss decreases to 0.025 ratio after 50 epochs. The curves of decreasing box loss indicate improved localization accuracy for microplastics,47 as calculated by the Complete IoU (CIoU) loss function, which quantifies the error in predicting bounding boxes during training; lower values in higher epochs indicate more accurate predictions as the training goes on. The consistently lower validation box loss is likely due to the smaller validation set, which consists of 250 images compared to the 1990 images used for training. Additionally, training dynamics, such as the chosen batch size and learning rate, can lead to a relatively higher training loss. To address these discrepancies and improve model generalization, implementing k-fold cross-validation could be beneficial, as it allows for assessment across different data subsets. We use confusion matrix for evaluating model in terms of precision, recall. ESI Fig. S5a illustrates the object loss for both training (blue) and validation (orange), showing a steady decrease over 50 epochs. This trend indicates that the model improves in accurately detecting the presence of objects in the images as training progresses. Fig. 6b shows that recall score increases with epochs and becomes approximately 0.9 after 50 epochs. Recall measures the ability of the model to identify relevant objects from all actual objects. It shows how well the model can detect microplastics. As recall improves over the epochs, our model becomes more accurate at predicting positive instances of microplastics. Fig. 6c shows a precision score of approximately 0.85 after 50 epochs. This indicates a relatively low rate of false positives. In other words, our model can accurately predict positive instances. ESI Fig. S5b presents the mean average precision at an IoU threshold of 0.5 (mAP@50), which measures how well the predicted bounding boxes overlap with the ground truth by at least 50%. Our model achieves a high mAP@50 value of 0.935 after 50 epochs. Fig. 6d shows the confusion matrix specific to the YOLOv5 model. The model exhibits good accuracy (98%) in identifying ‘Microplastic’. That means, out of 250 validation images containing around 1071 annotated microplastics (objects), our model successfully predicted 1054 (True Positive, TP), missing only 17 (False Negative, FN). The True Negative (TN) value is zero because our model detects only ‘Microplastic’. Anything that is not microplastic is considered ‘Background’. However, there are no ground truth labels for the background. Without background labels, the model cannot register predictions as true negatives, even if it correctly identifies a region as background. This is normal in single-class object detection and is supported by previous literature.48,49 Our model shows 431 false positives (FP), meaning it predicted extra microplastic objects that were not part of our annotations or ground truth. These objects were not labeled as microplastics. Our annotations only included objects visible to the human eye, which have a higher chance of being microplastics due to their size. However, YOLOv5, being a highly sensitive OpenCV-based algorithm, may detect tiny black pixels against the white background. These pixels may or may not be plastics, making it difficult to confirm their nature even with magnification, leading to the extra predictions. Predicted images of the YOLOv5 model output are shown in Fig. 6e. Their initial images are taken at different locations on the filter paper after microplastic extraction from teabag samples, following the exact procedure described in the methodology. The extracted samples were imaged and fed into the trained model for detection. The YOLOv5 model successfully identified and localized microplastics on the filter paper, reinforcing its effectiveness in detecting unseen samples. Additionally, we have provided live video detection of the process, available in ESI Videos S1–S3, demonstrating real-time microplastic detection after extraction from three different teabag samples. The YOLOv5 model precisely locates the microplastics on the filter paper.
image file: d4ra07991d-f6.tif
Fig. 6 Evaluation of the YOLOv5 model trained for microplastic detection. (a) The plot shows training box loss (blue) and validation box loss (orange) across 50 epochs, both decreasing and indicating improved localization of microplastics using the Complete IoU (CIoU) loss function described in the equation. The lower validation loss may result from the smaller, less varied validation set (250 images vs. 1990 for training). Training dynamics, including batch size and learning rate, also contribute to higher training loss. Implementing k-fold cross-validation could improve the model's generalization by assessing its performance across various data subsets. (b) Recall curve, which reflects the model's ability to identify true positive instances of microplastics, improves steadily over time, approaching 0.9 after 50 epochs. (c) Precision curve, indicating the model's accuracy in predicting true positives versus false positives, stabilizes at approximately 0.85 after 50 epochs. (d) Confusion matrix illustrating the performance of the model, with 98% of microplastics correctly identified. (e) Example images showing the predicted locations of microplastic particles on filter paper with confidence scores indicated in green. Scale bars represent 40 μm.

Quantitative analysis of microplastic contamination in consumer goods

To further investigate and quantify microplastic contamination across various consumer goods, we extract three independent samples from each of the following categories: salt, sugar, teabags, toothpaste, and toothpowder, as outlined in the Methodology section. These samples are specifically prepared for quantitative analysis using our proposed extraction methodology. High-resolution image data are collected from each sample, subjected to a masking procedure to isolate potential microplastic regions, and subsequently analyzed using the model. Each sample comprised approximately 19–20 images, providing a comprehensive representation of the entire sample. Upon getting results, microplastic particles were detected across all five product categories. Teabags have the highest average microplastic count, with 44.33 ± 7.0 items. The count ranges from 38 to 52 microplastic counts across this category's three different samples. Salt follows with an average of 36.67 ± 7.0 microplastic items, ranging from 32 to 45 items across samples. Sugar has a slightly lower average of 28.33 ± 9.9 items. However, sugar shows the greatest variability, with a range from 17 to 34 items across all of it's respective samples. Toothpowder shows more consistent detection, with an average of 29.33 ± 3.5 microplastic items, which range from 26 to 33 counts across it’s samples. This suggests more uniformity in microplastic counts across toothpowder samples. In contrast, toothpaste has the lowest microplastic count, averaging 20.00 ± 6.4 items, with a range of 15 to 27 counts of microplastics across samples. One-way ANOVA analysis shows that there is a statistically significant difference in microplastic abundance between the sample types (F-value: 5.06, p-value: 0.0171). The boxplot and swarm plot (Fig. 7) provide a detail visualization of the distribution of microplastic counts across the samples. The teabag samples showed the highest concentration, with values clustering near the upper end of the range. In contrast, the toothpaste samples displayed the lowest counts. The sugar samples show the widest distribution. This highlights a broader spread of microplastic contamination. Meanwhile, toothpowder appeared more uniform, with a narrower range of detected microplastics. These findings indicate that the nature of the product might influence both the concentration and variability of microplastic contamination.
image file: d4ra07991d-f7.tif
Fig. 7 Box plot showing the detected microplastic counts for five sample types: salt, sugar, teabag, toothpaste, and toothpowder. Each box represents the distribution of microplastic counts for three samples from each category. The black dots indicate individual sample points, and the black horizontal line within each box represents the median. The whiskers represent the range of the data. The average microplastic count and range are displayed for each category: salt (36.67 counts, range 32 to 45 items), sugar (28.33 counts, range 17 to 34 items), teabag (44.33 counts, range 38 to 52 items), toothpaste (20.00 counts, range 15 to 27 items), and toothpowder (29.33 counts, range 26 to 33 items). ANOVA analysis yielded an F-value of 5.06 and a p-value of 0.0171, indicating statistically significant differences in microplastic counts among the sample types.

Conclusion

In conclusion, we have successfully demonstrated a simple, accurate, field-deployable, fast, and affordable MP detection platform that integrates sample extraction, image capture, and image processing through deep learning. Following standard operating procedures based on density separation and organic component oxidation, a wide range of MPs were extracted from various consumer product samples. The presence of MPs in the extracted samples was validated through ATR-FTIR spectroscopy and FE-SEM analysis. The extracted MPs were imaged using a small microscopy attachment adaptable to a typical mobile phone camera. Approximately 2500 captured images were used to train YOLOv5 deep learning models through binary masking and thresholding, enabling rapid MP detection with 98% accuracy. Further improvements in MP identification and classification could be achieved by implementing global automatic thresholding algorithms, along with shape and size measurement classes for a broader range of plastic products. Additionally, hyperspectral imaging could enhance detection by providing detailed spectral and spatial information for each pixel, allowing the differentiation of MPs from organic matter without traditional digestion and separation methods. Beyond laboratory settings, the proposed method has significant potential for environmental monitoring and regulatory applications, offering a rapid and cost-effective tool for assessing MP contamination in various ecosystems. Since all experimental parameters remain the same, a solid understanding can be obtained by comparing the microplastic count in different samples. Thus, a comparative picture can be drawn for microplastics present in samples collected from various consumer brands, geographical locations, and other sources. The ability to deploy this approach in the field could facilitate large-scale surveillance of plastic pollution, aiding policymakers and environmental agencies in tracking contamination trends and enforcing regulations. By providing an accessible and scalable solution, this technique could contribute to global efforts in mitigating the impact of microplastics on ecosystems and human health.

Data availability

Data for this article, including images used for training and validation, are available here – https://github.com/zayedarju/microplastic-detection.

Conflicts of interest

The authors declare no conflicts of interest.

Acknowledgements

Mainul Hossain acknowledges the funding provided by the Collaborative Research Grant from the Faculty of Engineering and Technology at the University of Dhaka. The authors extend their sincere thanks for the logistics facilities provided by the Semiconductor Technology Research Centre (STRC). Gratitude is also due to the National Institute of Textile Engineering and Research (NITER) for FT-IR analysis support, and to the Department of Biomedical Engineering at Bangladesh University of Engineering and Technology (BUET) for facilitating the FE-SEM studies. We would like to acknowledge ChatGPT from OpenAI for providing assistance in creating readable, clear, and grammatically correct English throughout this paper. Lastly, the authors would like to express their sincere appreciation to Professor Mosabber Uddin Ahmed, Atique B. Zakir, and Asif Rahman Dipto for their consultation and contribution in optimizing the YOLOv5 script for this study.

References

  1. R. Myszka, M. Enfrin and F. Giustozzi, Microplastics in road dust: A practical guide for identification and characterisation, Chemosphere, 2023, 315, 137757 CAS.
  2. N. P. Ivleva, Chemical Analysis of Microplastics and Nanoplastics: Challenges, Advanced Methods, and Perspectives, Chem. Rev., 2021, 121, 11886–11936 CAS.
  3. S. Huang, X. Huang, R. Bi, Q. Guo, X. Yu, Q. Zeng, Z. Huang, T. Liu, H. Wu, Y. Chen, J. Xu, Y. Wu and P. Guo, Detection and Analysis of Microplastics in Human Sputum, Environ. Sci. Technol., 2022, 56, 2476–2486 CAS.
  4. T. Islam, Y. Li, M. M. Rob and H. Cheng, Microplastic pollution in Bangladesh: Research and management needs, Environ. Pollut., 2022, 308, 119697 CrossRef CAS.
  5. L. M. Hernandez, E. G. Xu, H. C. Larsson, R. Tahara, V. B. Maisuria and N. Tufenkji, Plastic teabags release billions of microparticles and nanoparticles into tea, Environ. Sci. Technol., 2019, 53, 12300–12310 CrossRef CAS.
  6. Z. Huang, B. Hu and H. Wang, Analytical methods for microplastics in the environment: a review, Environ. Chem. Lett., 2022, 21, 383–401 CrossRef PubMed.
  7. C. Vitali, R. J. Peters, H.-G. Janssen, M. W. Nielen and F. S. Ruggeri, Microplastics and nanoplastics in food, water, and beverages, part II. Methods, TrAC, Trends Anal. Chem., 2022, 157, 116819 CrossRef CAS.
  8. B. Singh and A. Kumar, Advances in microplastics detection: A comprehensive review of methodologies and their effectiveness, TrAC, Trends Anal. Chem., 2024, 170, 117440 CrossRef CAS.
  9. D. Elkhatib and V. Oyanedel-Craver, A Critical Review of Extraction and Identification Methods of Microplastics in Wastewater and Drinking Water, Environ. Sci. Technol., 2020, 54, 7037–7049 CrossRef CAS PubMed.
  10. A. Sridhar, D. Kannan, A. Kapoor and S. Prabhakar, Extraction and detection methods of microplastics in food and marine systems: A critical review, Chemosphere, 2022, 286, 131653 CrossRef CAS PubMed.
  11. W. J. Shim, S. H. Hong and S. E. Eo, Identification methods in microplastic analysis: a review, Anal. Methods, 2017, 9, 1384–1391 RSC.
  12. J. Lukose, M. Sunil, E. K. Westhead, S. Chidangil and S. Kumar, Gaining traction of optical modalities in the detection of microplastics, Curr. Opin. Chem. Eng., 2025, 47, 101086 CrossRef.
  13. J. Su, F. Zhang, C. Yu, Y. Zhang, J. Wang, C. Wang, H. Wang and H. Jiang, Machine learning: Next promising trend for microplastics study, J. Environ. Manage., 2023, 344, 118756 CrossRef CAS PubMed.
  14. C. Yang, J. Xie, A. Gowen and J.-L. Xu, Machine learning driven methodology for enhanced nylon microplastic detection and characterization, Sci. Rep., 2024, 14, 3464 CAS.
  15. X.-L. Han, N.-J. Jiang, T. Hata, J. Choi, Y.-J. Du and Y.-J. Wang, Deep learning based approach for automated characterization of large marine microplastic particles, Mar. Environ. Res., 2023, 183, 105829 CrossRef CAS.
  16. Z. Zhu, W. Parker and A. Wong, Leveraging deep learning for automatic recognition of microplastics (MPs) via focal plane array (FPA) micro-FT-IR imaging, Environ. Pollut., 2023, 337, 122548 CrossRef CAS PubMed.
  17. E. Choi, Y. Choi, H. Lee, J. Kim and H. B. Oh, Development of a machine-learning model for microplastic analysis in an FT-IR microscopy image, Bull. Korean Chem. Soc., 2024, 45, 472–481 CrossRef CAS.
  18. J. Leonard, H. C. Koydemir, V. S. Koutnik, D. Tseng, A. Ozcan and S. K. Mohanty, Smartphone-enabled rapid quantification of microplastics, J. Hazard. Mater. Lett., 2022, 3, 100052 CAS.
  19. A. Orth, E. R. Wilson, J. G. Thompson and B. C. Gibson, A dual-mode mobile phone microscope using the onboard camera flash and ambient light, Sci. Rep., 2018, 8, 3298 CAS.
  20. C. W. Pirnstill and G. L. Coté, Malaria Diagnosis Using a Mobile Phone Polarized Microscope, Sci. Rep., 2015, 5, 13368 CAS.
  21. S. A. Lee and C. Yang, A smartphone-based chip-scale microscope using ambient illumination, Lab Chip, 2014, 14, 3056–3063 RSC.
  22. S. Afrin, M. M. Rahman, M. A. Akbor, M. A. B. Siddique, M. K. Uddin and G. Malafaia, Is there tea complemented with the appealing flavor of microplastics? A pioneering study on plastic pollution in commercially available tea bags in Bangladesh, Sci. Total Environ., 2022, 837, 155833 Search PubMed.
  23. A. Karami, A. Golieskardi, C. Keong Choo, V. Larat, T. S. Galloway and B. Salamatinia, The presence of microplastics in commercial salts from different countries, Sci. Rep., 2017, 7, 46173 CrossRef CAS PubMed.
  24. B. Schütze, D. Thomas, M. Kraft, J. Brunotte and R. Kreuzig, Comparison of different salt solutions for density separation of conventional and biodegradable microplastic from solid sample matrices, Environ. Sci. Pollut. Res., 2022, 29, 81452–81467 Search PubMed.
  25. Y. Liu, F. Gao, Z. Li, H. Ding, D. Zhang, L. Feng and X. Li, An optimized procedure for extraction and identification of microplastics in marine sediment, Mar. Pollut. Bull., 2021, 165, 112130 CAS.
  26. F. Radford, L. M. Zapata-Restrepo, A. A. Horton, M. D. Hudson, P. J. Shaw and I. D. Williams, Developing a systematic method for extraction of microplastics in soils, Anal. Methods, 2021, 13, 1695–1705 Search PubMed.
  27. O. Güven, K. Gökdağ, B. Jovanović and A. E. Kıdeyş, Microplastic litter composition of the Turkish territorial waters of the Mediterranean Sea, and its occurrence in the gastrointestinal tract of fish, Environ. Pollut., 2017, 223, 286–294 CrossRef PubMed.
  28. H.-m. Park, S. Park, M. K. de Guzman, J. Y. Baek, T. Cirkovic Velickovic, A. Van Messem and W. De Neve, MP-Net: Deep learning-based segmentation for fluorescence microscopy images of microplastics isolated from clams, PLoS One, 2022, 17, e0269449 CrossRef CAS PubMed.
  29. M. Tkachenko, M. Malyuk, A. Holmanyuk and N. Liubimov, Label Studio: Data Labeling Software, 2020–2022, https://github.com/heartexlabs/label-studio Search PubMed.
  30. R. Khanam and M. Hussain, What is YOLOv5: A deep look into the internal features of the popular object detector, arXiv, 2024, preprint, arXiv:2407.20892,  DOI:10.48550/arXiv.2407.20892.
  31. A. M. Qureshi, A. H. Butt, A. Alazeb, N. A. Mudawi, M. Alonazi, N. A. Almujally, A. Jalal and H. Liu, Semantic Segmentation and YOLO Detector over Aerial Vehicle Images, Comput. Mater. Continua, 2024, 80(2), 3315–3332 CrossRef.
  32. G. N. Sree, Weapon Identification using YOLO V5 Algorithm, Int. J. Sci. Res., 2022, 12, 11 Search PubMed.
  33. A. Intasam, Y. Promworn, A. Juhong, S. Thanasitthichai, S. Khwayotha, T. Jiranantanakorn, S. Thawornwanchai and W. Piyawattanametha, Optimizing the hyperparameter tuning of YOLOv5 for breast cancer detection, 2023 9th International Conference on Engineering, Applied Sciences, and Technology (ICEAST), 2023, pp 184–187 Search PubMed.
  34. B. Aydin and S. Singha, Drone Detection Using YOLOv5, Eng, 2023, 4, 416–433 CrossRef.
  35. T. Maes, R. Jessop, N. Wellner, K. Haupt and A. G. Mayes, A rapid-screening approach to detect and quantify microplastics based on fluorescent tagging with Nile Red, Sci. Rep., 2017, 7, 44501 CrossRef CAS.
  36. M. Rani, S. Ducoli, L. E. Depero, M. Prica, A. Tubić, Z. Ademovic, L. Morrison and S. Federici, A complete guide to extraction methods of microplastics from complex environmental matrices, Molecules, 2023, 28, 5710 CrossRef CAS.
  37. Q. Zhou, J. Chen, D. Zhang and X. Pan, Evaluation of organic matter removal by H2O2 from microplastic surface by nano-physicochemical methods, Green Anal. Chem., 2022, 3, 100035 CrossRef.
  38. C.-P. Goh and P.-E. Lim, Potassium permanganate as oxidant in the COD test for saline water samples, ASEAN J. Sci. Technol. Dev., 2017, 25, 383–393 CrossRef.
  39. S. Afrin, M. M. Rahman, M. N. Hossain, M. K. Uddin and G. Malafaia, Are There Plastic Particles in My Sugar? A Pioneering Study on the Identification/Characterization of Microplastics in Commercial Sugars and Risk Assessment, Sci. Total Environ., 2022, 837, 155849 CrossRef CAS PubMed.
  40. G. S. Ustabasi and A. Baysal, Occurrence and risk assessment of microplastics from various toothpastes, Environ. Monit. Assess., 2019, 191, 438 CrossRef PubMed.
  41. S. Veerasingam, M. Ranjani, R. Venkatachalapathy, A. Bagaev, V. Mukhanov, D. Litvinyuk, M. Mugilarasan, K. Gurumoorthi, L. Guganathan and V. Aboobacker, others Contributions of Fourier transform infrared spectroscopy in microplastic pollution research: A review, Crit. Rev. Environ. Sci. Technol., 2021, 51, 2681–2743 CrossRef.
  42. C. T. Madhumitha, N. Karmegam, M. Biruntha, A. Arun, A. A. Al Kheraif, W. Kim and P. Kumar, Extraction, identification, and environmental risk assessment of microplastics in commercial toothpaste, Chemosphere, 2022, 296, 133976 CrossRef CAS PubMed.
  43. J.-S. Kim, H.-J. Lee, S.-K. Kim and H.-J. Kim, Global pattern of microplastics (MPs) in commercial food-grade salts: sea salt as an indicator of seawater MP pollution, Environ. Sci. Technol., 2018, 52, 12819–12828 CrossRef CAS PubMed.
  44. D. Peixoto, C. Pinheiro, J. Amorim, L. Oliva-Teles, L. Guilhermino and M. N. Vieira, Microplastic pollution in commercial salt for human consumption: A review, Estuarine, Coastal Shelf Sci., 2019, 219, 161–168 CrossRef CAS.
  45. W. Cowger, A. Gray, S. H. Christiansen, H. DeFrond, A. D. Deshpande, L. Hemabessiere, E. Lee, L. Mill, K. Munno, B. E. Ossmann, M. Pittroff, C. Rochman, G. Sarau, S. Tarby and S. Primpke, Critical Review of Processing and Classification Techniques for Images and Spectra in Microplastic Research, Appl. Spectrosc., 2020, 74, 989–1010 CrossRef CAS PubMed.
  46. H. Chen, S. Xu, H. Liu, C. Liu, H. Liu, J. Chen, H. Huang, H. Gong, J. Wu, H. Tang, J. Luo, B. Wen, J. Zhou and Y. Qiao, Nanomesh-YOLO: Intelligent Colorimetry E-Skin Based on Nanomesh and Deep Learning Object Detection Algorithm, Adv. Funct. Mater., 2023, 34, 2309798 CrossRef.
  47. L. Yu and S. Liu, A Single-Stage Deep Learning-based Approach for Real-Time License Plate Recognition in Smart Parking System, Int. J. Adv. Comput. Sci. Appl., 2023, 14, 9 Search PubMed.
  48. H.-C. Nguyen, T.-H. Nguyen, R. Scherer and V.-H. Le, YOLO Series for Human Hand Action Detection and Classification from Egocentric Videos, Sensors, 2023, 23, 3255 Search PubMed.
  49. B. Aldughayfiq, F. Ashfaq, N. Z. Jhanjhi and M. Humayun, YOLOv5-FPN: A Robust Framework for Multi-Sized Cell Counting in Fluorescence Images, Diagnostics, 2023, 13, 2280 Search PubMed.

Footnote

Electronic supplementary information (ESI) available: Supplementary Text 1: Preparation of image dataset. Supplementary Text 2: COD analysis. Supplementary Fig. S1: Schematic representation of the workflow. Supplementary Fig. S2: Image thresholding. Supplementary Fig. S3: Image data processing and training. Supplementary Fig. S4: FE-SEM images of remaining two categories. Supplementary Fig. S5: Model evaluation with object loss and mAP@50. Supplementary Videos S1–S3: Detection of microplastics in teabag samples. See DOI: https://doi.org/10.1039/d4ra07991d

This journal is © The Royal Society of Chemistry 2025
Click here to see how this site uses Cookies. View our privacy policy here.