1. Introduction
Plastics, while versatile in applications ranging from industry to food preservation, pose a significant environmental threat when they decompose into smaller fragments known as microplastics. Microplastics are an environmental issue that severely impacts aquatic ecosystems. It is estimated that between 4.7 and 12.8 million metric tons of plastic entered the ocean in 2010, and without proper management, the accumulated amount of plastic waste that could enter the ocean from land is projected to increase by an order of magnitude by 2025 [
1]. These plastics fragment due to UV radiation and wave action into increasingly smaller pieces, transforming into microplastics. Microplastics are deposited on shores, carried by sea currents, and in highly exposed areas, concentrations on beaches can reach values of more than 300 g of microplastics per square meter [
2].
Coastal plastic pollution has escalated into a systemic environmental crisis. Quantitatively, it is estimated that between 11 and 14 million metric tons of plastic waste leak into marine ecosystems annually, contributing to a total oceanic accumulation that may exceed 199 million tons by 2025 [
3]. This pollution is not merely an aesthetic issue; qualitatively, it results in the physical smothering of coral reefs and mangroves, and the chemical contamination of the food chain through microplastic ingestion. In [
4], a study on the Macaronesia islands showed the presence of plastic marine litter on all the beaches studied, with an average concentration of 1760 items/m
2 and 15.30 g/m
2 for microplastics, reaching in some beaches more than 3000 items/m
2 and almost 33 g/m
2.
In addition to the harm they may cause to marine organisms that ingest them, microplastics also cause aesthetic and landscape damage. This is a growing concern for citizens, local authorities in coastal areas, as well as for administrations at all levels and research funding programs. This issue became evident following the accident of the “Toconao” ship off the Portuguese coast in December 2023. The ship was carrying containers filled with pellets, the raw material used to manufacture plastics, which are about 5 mm in diameter. This type of spill generates significant environmental damage due to the impossibility of removing these pellets from the sea because of their small size and the large number of pellets each container holds. Once they reach the shores, cleaning and removing them from the beaches is very difficult, which caused great public alarm.
Furthermore, the toxicity of these pellets depends on the additives they carry, which could pose a problem for marine organisms and marine seabirds. This accident highlighted the need for monitoring and alert systems to detect the arrival of unusually high quantities of pellets or any other type of microplastic that could pose a threat to ecosystems or cause significant landscape damage on beaches. Various studies have demonstrated the significant variability in the reaching of microplastics on beaches, which depends on wind, wave action, and currents [
2]. This results in a substantial difference in concentration even between consecutive days of sampling, making it very difficult to monitor coastal arrival due to the considerable sampling effort and enormous expense in human resources.
In Europe, the objective of the Marine Strategy Framework Directive (MSFD, 2008/56/EC) [
5] is to assess trends in good environmental status, for which it is necessary to implement monitoring programs, in this case, for Descriptor 10 related to marine litter. As noted by Galgani et al. [
6], the unequal spatial and temporal distribution of marine debris presents a challenge when designing a statistically robust monitoring program. Therefore, one of the major challenges in this field of study is finding a way to automate both the quantification and classification of microplastics, saving time and sampling effort.
Thanks to Artificial Intelligence, several studies are attempting to develop technologies with this goal in mind. Additionally, citizens who visit beaches daily could help by collecting samples or images that would allow automated quantification and classification, generating data that would inform authorities of possible spills or unusually high microplastic arrivals, enabling them to make decisions such as increasing cleaning services. Currently, apps Marine Litter Watch [
7] or MARNOBA [
8] have been developed for use with smartphones to monitor macro-litter, but to date, mesoplastics (5–25 mm) and microplastics (1–5 mm) have not been included.
The analysis of debris on the coast, especially plastic debris, is of significant interest to the scientific community. In some cases, this analysis is performed manually by experts who analyze aerial images, as demonstrated by the study conducted by Moy et al. [
9], which analyzed almost 76 km of coastline across the main Hawaiian Islands of Niihau, Kauai, Oahu, Molokai, Lanai, Maui, Kahoolawe, and Hawaii. A similar study is that of Deidun et al. [
10], where aerial images of the Maltese Islands were used to categorize different types of debris, including plastics. In another example of visual analysis, Kako et al. [
11] monitored Newport Beach in Oregon over the course of one year to observe whether debris from the Great Tohoku Earthquake and the massive tsunami of 11 March 2011, reached the west coast of the United States. Photographs were taken and analyzed to count the amount of debris present on the beach. Visual analysis of images is time-consuming, so the introduction of automatic techniques from the field of computer vision can alleviate the task and enable the monitoring of wider areas. Gonçalvez et al. [
12] analyzed the presence of plastics on Cabedelo Beach (Portugal) using aerial images captured by a drone. Those authors focused on meso-litter items (sizes between 2.5 cm and 50 cm) due to the resolution of the images taken from an altitude of 20 m. Meso-litter items were classified at the pixel level using color as an input feature to a Random Forest classifier [
13]. The images were divided into 320 × 320-sized patches, which were then rescaled to 64 × 64. Results were reported in terms of the F1-score, as the task was approached as a classification problem, yielding scores of 76% and 57% for plastics located on the beach and in the dunes, respectively. F1-score is the harmonic mean of precision and recall, where precision is the proportion of samples predicted as positive by the classifier that are actually true positives, and recall (also known as sensivity) is the proportion of actual positive samples that are correctly identified as positive by the classifier.
Pinto et al. [
14] made use of a neural network on Leirosa Beach (Portugal), achieving an average F1-score of 49% across the different types of litter considered. In a more recent study, Ross Winans [
15] utilized the annotated images from Moy et al. [
9] to train various deep learning methods for litter detection, with the best F1-score of 50.7% achieved using Single Shot MultiBox Detector (SSD) [
16] with MobileNetV2 [
17] which is a is a lightweight convolutional neural network architecture
Previous works that aim to automatically detect plastic items on beaches using methods from the computer vision field primarily focus on object detection that do not delineate them at the pixel level in images. To achieve the latter, segmentation methods have been proposed, receiving significant attention in the computer vision field over the decades. In recent years, with the rise of deep learning approaches, numerous methods have been proposed. One of the first proposed methods was the Fully Convolutional Network (FCN) [
18], which modifies traditional Convolutional Neural Networks (CNNs) for pixel-wise prediction tasks. This is achieved by replacing fully connected layers with convolutional layers. Other models obtained as an improvement of a detection models are Mask Region-based Convolutional Neural Network (R-CNN) [
19] and YOLO [
20]. Thus, Mask R-CNN is an extension of Faster R-CNN [
21], integrates instance segmentation capabilities by adding a branch that predicts segmentation masks for each Region of Interest (RoI). Similarly, YOLO, originally designed for object detection, has evolved to include segmentation capabilities. Its latest versions provide instance segmentation by predicting masks for detected objects. Another widely used model is U-Net [
22], featuring an encoder-decoder architecture with skip connections. These connections enable precise localization while preserving contextual information. Similarly, LinkNet [
23] employs an encoder–decoder architecture with skip connections, achieving competitive performance while using significantly fewer parameters. The Pyramid Attention Network (PAN) [
24] leverages a spatial pyramid attention mechanism to enhance feature extraction for semantic segmentation. By incorporating attention mechanisms, PAN effectively captures global context and improves pixel-level classification accuracy. These methods will be discussed in more detail in
Section 2.2.
The present study represents an effort in the development of software for the automatic quantification of microplastics on beaches, which could be incorporated into any of the currently existing apps for marine litter monitoring. In this context, our work focuses on benchmarking optimal neural network architectures for microplastic segmentation in coastal environments. The objective of this study is to contribute to a scalable and efficient monitoring solution for coastal microplastic accumulation. Unlike laboratory-intensive methodologies, such as those involving chemical digestion and FTIR spectroscopy, which offer high-fidelity classification but are constrained by high costs and time demands, this work focuses on a rapid screening approach. By utilizing deep learning-based semantic segmentation, we aim to build a bridge between automated detection and environmental monitoring. This system is designed to facilitate long-term, extensive spatial assessments, providing a critical tool for local authorities to monitor plastic arrival trends and respond to environmental incidents with minimal human resource intervention.
3. Results
To evaluate the performance of the segmentation models described in
Section 2.2, we will use both the Intersection over Union (
IoU) and the
Dice coefficient (
Dice) metrics. The
IoU is a widely used metric for evaluating segmentation methods, as it measures the percentage of overlapping pixels between the ground truth and the predicted segmentation relative to their total union. The
IoU is defined as:
where
A represents the ground truth (i.e., the labeled image), and
B denotes the predicted regions of the segmentation method. Here,
is the number of overlapping pixels between the ground truth and predictions, while
corresponds to the total number of pixels covered by either the ground truth or the predictions.
However, the
Dice coefficient is particularly useful due to its sensitivity to small overlaps, making it well suited to detect fine-grained objects such as microplastic particles, which are small relative to the total area of the image (see
Figure 2 and
Figure 3). Additionally, the
Dice coefficient balances the union and intersection by normalizing against the combined size of the predicted and ground truth regions, improving interpretability for imbalanced tasks like ours. The
Dice coefficient is defined as:
where
is the number of overlapping pixels, and
and
represent the total number of pixels in the ground truth and predictions, respectively. Unlike the
IoU, the
Dice coefficient’s denominator accounts for the sum of pixels in both regions, effectively giving double weight to the overlapping area.
To evaluate the segmentation models, the initial dataset described in
Section 2 was partitioned into three disjoint subsets: training (483 samples), validation (60 samples), and test (61 samples). To enhance training data diversity, we applied an augmentation pipeline to the training images, which included vertical and horizontal flips (each with a probability of 0.5), color adjustments to simulate varying illumination conditions modifying brightness (0–0.1), hue (0–0.05), and saturation (0–0.1), rotations to simulate different camera orientations (0–10 degrees), and perspective transformations to simulate changes in camera position with a distortion scale between 0 and 0.2.
This process expanded the training subset to 1449 images. The validation subset was used to optimize model hyperparameters, while the test subset, never exposed during training or validation, provided the final performance evaluation. This strict separation ensures that the generalizability of the model is assessed without bias.
Table 1 presents the results for the evaluated models. The results for all evaluation metrics are normalized and expressed as percentages (%), with a scale ranging from 0% to 100%. Higher values indicate superior model performance in segmenting microplastic particles. Two models achieved an
IoU above 70% in the test set, which is considered a strong result. Regarding the
Dice coefficient, eleven models surpassed 70%, LinkNet reaching 80%, a notable performance given that the
Dice coefficient is a more stringent metric than the
IoU. The lowest
IoU and
Dice coefficient are obtained with the ResUNet architecture. With respect to YOLOv11 models, they exhibit a low performance except the medium size model (YOLOv11m) that achieves the third best results in
Dice coefficient and fourth best result with
IoU metric. This fact can be explained by the resolution of the images being better suited for the medium model than for the rest.
Table 2 reports the segmentation results at the pixel level, in contrast to
Table 1, which focuses on region-based overlap metrics. The total number of pixels labeled as microplastic particles in the 61 images of the test subset is 150,371. The column True Positive corresponds to the number of pixels correctly classified as microplastics by the model, False Positive represents the number of pixels incorrectly classified as microplastics (i.e., pixels belonging to sand or other types of debris), and False Negative denotes the number of microplastic pixels that were not correctly detected by the models. The two rightmost columns correspond to accuracy, defined as the proportion of correctly classified pixels, and the F1-score, which is the harmonic mean of precision and recall, as introduced in
Section 1.
Analyzing the results by model family, clear performance trends emerge. The specific semantic segmentation architectures (U-Net, ResUNet, LinkNet, and PAN) consistently outperform the YOLO-based segmentation models in terms of F1-score. This behavior indicates a superior ability to balance precision and recall at the pixel level, which is critical for accurately delineating small and irregular microplastic particles. It is important to note that pixel-wise accuracy is not a reliable performance metric in this context due to the highly imbalanced nature of the problem, where the vast majority of pixels do not correspond to microplastics particles. In such scenarios, a model can achieve high accuracy by correctly classifying background pixels while still missing a large fraction of microplastic particles. For this reason, the F1-score provides a more informative and robust measure of performance, as it jointly accounts for false positives and false negatives and better reflects the model’s effectiveness in detecting microplastic pixels.
Apart from the quantitative results measured by
IoU and
Dice metrics, qualitative evaluation is essential in computer vision applications, including this microplastics segmentation task, to analyze model behavior across diverse scenarios.
Figure 5 displays the original images, ground truth masks, and LinkNet’s segmentation results for two test set images. These images contain not only microplastics but also debris. The model successfully segments only the microplastics particles, with one exception: a black particle adjacent to the blue one in the lower row, which is misclassified due to its visual similarity to unlabeled small rocks. In the upper image, non-microplastics objects (e.g., small rocks and a bird feather) are correctly ignored.
Figure 6 highlights the performance gap between LinkNet (the top-performing model) and PSPNet. While LinkNet correctly segments almost all microplastic particles, missing only a few very small ones on the right side of the image, PSPNet fails to detect many particles and produces low-resolution predictions. This is evident on the right side of its output, where multiple particles are grouped into a single, larger detection.
4. Discussion
The segmentation of microplastics on sandy beaches remains a particularly challenging computer vision problem due to the small size of the targets, their wide variability in color and shape, and the strong visual similarity between microplastics and naturally occurring materials such as small rocks, shell fragments, organic debris, and dark mineral grains. Illumination variability, cast shadows, and heterogeneous sand textures further increase intra-class variance and reduce the contrast between foreground and background. These factors jointly explain why microplastic segmentation represents a more demanding task than macro- or meso-litter detection, which has been the focus of most previous vision-based coastal monitoring studies.
A key consideration in the automated detection of coastal debris is the discrimination between microplastics and natural elements (e.g., shell fragments, small rocks, or organic matter). In this study, the semantic segmentation models were trained specifically to isolate microplastics, leveraging the expert-labeled ground truth. While visual-based RGB analysis cannot provide the chemical certainty of Fourier-Transform Infrared (FTIR) spectroscopy, the results indicate that the deep learning architectures, particularly those with high spatial resolution preservation like LinkNet, effectively distinguish the geometric and textural signatures of plastic polymers from those of surrounding natural debris. Nonetheless, the lack of spectral data remains a limitation; visual ’mimicry’ by certain minerals or bleached organic matter may lead to false positives.
Among the evaluated models, LinkNet and PAN achieved the most robust and consistent performance. LinkNet’s advantage appears to stem from its efficient encoder–decoder design with residual skip connections based on element-wise addition. This design preserves spatial detail while avoiding the parameter inflation associated with concatenation-based skip connections, as used in U-Net. In a data-constrained scenario such as the one considered here, this architectural efficiency likely contributes to better generalization on the test set. PAN also achieved competitive results, which can be attributed to its attention mechanisms that explicitly model multi-scale contextual information. However, this comes at the cost of increased computational complexity, which may limit its applicability in resource-constrained or edge-computing scenarios.
The comparatively lower performance of ResUNet and some YOLOv11 variants highlights an important trade-off between architectural complexity, input resolution, and dataset size. While residual connections are generally beneficial in deep networks, in this case they did not translate into improved segmentation accuracy, possibly due to overfitting or insufficient representation of fine-grained microplastic structures in deeper layers. Similarly, YOLO-based segmentation models, originally optimized for instance-level object detection, may be less suited to capturing the subtle boundaries and thin structures typical of microplastics, especially when operating on relatively small image patches.
A key strength of the proposed approach lies in the use of semantic segmentation rather than object detection. Pixel-level delineation enables more informative measurements than bounding-box-based methods, particularly for irregular particles such as fragments. Although the current setup does not allow for precise physical area estimation due to the lack of camera calibration and scale normalization, the relative area covered by microplastics can still be used as an approximate indicator to analyze spatial and temporal trends. This represents a substantial practical advantage over traditional manual counting and weighing procedures, which are time-consuming, labor-intensive, and difficult to scale.
Despite the encouraging results, several limitations must be acknowledged. First, although the dataset includes a range of sand colors and microplastic appearances representative of many sandy beaches, it was collected from a single geographical location. Although the robustness of the proposed approach is supported by the inclusion of varied sand backgrounds in the training set, ranging from light yellow to dark gray (
Figure 2 and
Figure 3), extending the dataset to beaches with different sediment compositions, lighting conditions, and pollution profiles will be essential to fully assess the generalizability of the models. Second, fiber-shaped microplastics are underrepresented, reflecting both their lower persistence on beaches and the difficulty of manual annotation. Since fibers are environmentally relevant, future datasets should aim to include them more systematically, potentially supported by semi-automatic labeling tools.
Annotation quality is another factor that may influence performance. Pixel-level labeling of millimeter-scale objects is inherently prone to uncertainty, particularly along object boundaries. Small discrepancies between annotations and predictions can disproportionately affect quantitative metrics such as IoU and Dice. From this perspective, the reported results should be interpreted as conservative estimates of model performance. Exploring boundary-tolerant metrics or uncertainty-aware evaluation protocols could provide additional insight into real-world effectiveness.
The comparison with foundation models such as Meta’s Segment Anything Model (SAM) further underscores the importance of task-specific training. While SAM demonstrates impressive zero-shot capabilities, its performance on microplastic segmentation remains inferior to that of a model explicitly trained on domain-specific data (
Figure 7). This suggests that, for fine-grained environmental monitoring tasks, specialized datasets and targeted training still play a crucial role, even in the era of large-scale foundation models.
Finally, from an application standpoint, the results indicate that an automated, image-based microplastic monitoring system is feasible using off-the-shelf cameras or smartphones. Such a system could support daily or near-real-time monitoring, enabling early detection of anomalous microplastic accumulation events and facilitating rapid response by local authorities. When combined with citizen science initiatives and existing marine litter monitoring platforms, this approach has the potential to significantly enhance spatial coverage and temporal resolution in coastal pollution assessment. Furthermore, while the current study focuses on sandy beaches, the robustness of the specific semantic segmentation models used suggests they could be adapted for freshwater or marine pond environments through future transfer learning applications on diverse substrates.
5. Conclusions
This study demonstrates the viability of using deep learning-based segmentation models to detect microplastics in coastal environments with a high degree of precision, addressing a critical gap in automated environmental monitoring. Among the 12 tested approaches, LinkNet consistently outperformed others, achieving the highest performance (Dice: 80.0%, IoU: 72.6% in the test set), demonstrating its efficacy in identifying small microplastics amidst complex backgrounds like sand and organic debris. PAN also performed competitively, leveraging attention mechanisms to enhance localization, albeit with higher resource demands.
Our results show that segmentation-based approaches offer significant advantages over traditional object detection techniques, particularly in their ability to deliver pixel-level delineation of microplastic particles. This not only enables more accurate quantification of contamination but also provides a scalable solution for environmental monitoring. While foundation models like SAM offer some zero-shot segmentation capabilities, our results suggest that task-specific models, fine-tuned on domain-specific data, remain more reliable for fine-grained environmental monitoring tasks such as microplastic detection.
Furthermore, the dataset compiled for this study which includes diverse sand backgrounds and microplastic types strengthens the generalizability of segmentation-based approaches to other beach environments. The deployment of these models in embedded systems for edge computing applications opens a promising avenue for real-time, in situ monitoring of microplastic pollution, potentially reducing the need for labor-intensive manual surveys.
Future work will focus on expanding the dataset, integrating the models into mobile and low-power devices, and exploring calibration techniques to enable reliable area estimation. These advances could play a crucial role in supporting regulatory frameworks and cleanup efforts by providing timely and accurate information on microplastic distribution in coastal zones.