An Explainable Attention-Gated CNN–Transformer Framework for Automated Microplastic Recognition in Freshwater Microscopy Images
Abstract Microplastic pollution requires rapid and reproducible monitoring methods that can complement labor-intensive visual and spectroscopic analyses. This study develops a morphology-aware artificial-intelligence framework for automated classification of field-collected microplastic particles and diatom algae in optical microscopy images. A public freshwater dataset containing 1,140 images from four classes (algae, filament, fragment, and pellet) was analyzed. After image-quality auditing, 1,137 unique images were retained for morphology–texture analysis, while deep-learning experiments used the original image collection under a fixed train/validation/test protocol. Handcrafted morphology and texture descriptors were evaluated with Random Forest, Extra Trees, radial-basis-function Support Vector Machine, and Histogram Gradient Boosting. Histogram Gradient Boosting achieved a cross-validation macro-F1 of 0.9341 ± 0.0255 and a held-out test accuracy of 0.9342. Deep-learning experiments compared ResNet50, Swin Transformer, and a CNN–Transformer fusion model combining ResNet50 and Swin representations. The fusion model achieved an accuracy of 0.9240, macro-F1 of 0.9222, and macro-AUC of 0.9954 on the 171-image test subset. Class-wise AUCs were 1.0000, 0.9950, 0.9886, and 0.9982 for algae, filament, fragment, and pellet, respectively. The results show that morphology-aware machine learning and complementary CNN–Transformer representations can support automated freshwater microplastic screening and provide a reproducible basis for environmental monitoring workflows.
Authors
- Majid Hajibarati
Institutions
- Islamic Azad University, Tehran (IR)
Publication Details
- Journal
- Research Square
- Published
- 2026-11-16
- DOI
- https://doi.org/10.21203/rs.3.rs-11105292/v1
- Primary Topic
- Microplastics and Plastic Pollution
- Type
- preprint