This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Open AccessArticle
Swarm-Optimized Explainable Attention–Transformer Networks for Bacterial Colony Segmentation and Quantification
by
Najla Sassi
Najla Sassi 1,*
and
Moulay Ibrahim El-Khalil Ghembaza
Moulay Ibrahim El-Khalil Ghembaza 2
1
Department of Management Information Systems, School of Business, King Faisal University, Al Ahsa 31982, Saudi Arabia
2
Department of Computer Science, College of Engineering and Information Technology, Onaizah Colleges, Qassim 56447, Saudi Arabia
*
Author to whom correspondence should be addressed.
Mathematics 2026, 14(12), 2104; https://doi.org/10.3390/math14122104 (registering DOI)
Submission received: 8 May 2026
/
Revised: 1 June 2026
/
Accepted: 6 June 2026
/
Published: 12 June 2026
Abstract
For microbiological diagnostics, accurately counting and segmenting microbial colonies is extremely important. However, manual methods are labor-intensive and yield inconsistent results. We develop a hybrid model using swarm intelligence, combining a convolutional transformer with nested skip connections and global context with channel and spatial attention. Parameter tuning is supported by a variety of swarm optimization algorithms (e.g., Particle Swarm Optimization, Quantum-behaved Particle Swarm Optimization, and Differential Evolution Particle Swarm Optimization). Morphological refinement, including a further watershed transform, an attention graph, and post-processing, enhances colony boundaries by separating them. Grad-CAM++, Integrated Gradients, and temperature scaling provide a transparent and trustworthy model through explainability and post hoc calibration. The proposed model was extensively tested on the Microbial Colony Recognition and Circular Bacterial Colony Datasets, achieving a Dice score of 94.2%, an Intersection over the Union of 88.6%, and a mean absolute counting error of 2.7 colonies. These results significantly outperform several baseline models, including U-Net (88.1%), U-Net++ (89.7%), Attention U-Net (90.6%), and Swin-Unet (91.4%). Statistically significant improvements were confirmed (p < 0.01). A cross-dataset analysis demonstrates the framework’s robustness and cross-domain applicability, and positions it as a trustworthy, explainable automated model for assessing microbial colonies in laboratory and clinical settings.
Share and Cite
MDPI and ACS Style
Sassi, N.; Ghembaza, M.I.E.-K.
Swarm-Optimized Explainable Attention–Transformer Networks for Bacterial Colony Segmentation and Quantification. Mathematics 2026, 14, 2104.
https://doi.org/10.3390/math14122104
AMA Style
Sassi N, Ghembaza MIE-K.
Swarm-Optimized Explainable Attention–Transformer Networks for Bacterial Colony Segmentation and Quantification. Mathematics. 2026; 14(12):2104.
https://doi.org/10.3390/math14122104
Chicago/Turabian Style
Sassi, Najla, and Moulay Ibrahim El-Khalil Ghembaza.
2026. "Swarm-Optimized Explainable Attention–Transformer Networks for Bacterial Colony Segmentation and Quantification" Mathematics 14, no. 12: 2104.
https://doi.org/10.3390/math14122104
APA Style
Sassi, N., & Ghembaza, M. I. E.-K.
(2026). Swarm-Optimized Explainable Attention–Transformer Networks for Bacterial Colony Segmentation and Quantification. Mathematics, 14(12), 2104.
https://doi.org/10.3390/math14122104
Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details
here.
Article Metrics
Article Access Statistics
For more information on the journal statistics, click
here.
Multiple requests from the same IP address are counted as one view.