Comparative Analysis of Lightweight Vision Transformers and CNNs for Efficient Bacterial Species Classification
Abstract
Food safety requires rapid and accurate bacterial identification to prevent disease and economic losses. This study compares three lightweight deep learning models—Tiny-ViT, ShuffleNetV2, and EfficientNet-Lite—for classifying 33 bacterial species from a combined public dataset. Models were trained using transfer learning with original and augmented data and evaluated using 5-fold cross-validation. Tiny-ViT achieved the highest performance with 99.66% accuracy and 99.70% precision, setting a new state-of-the-art for the DIBaS dataset. EfficientNet-Lite reached 99.32% accuracy with superior efficiency—threefold lower FLOPs (397.49M), fewer parameters (3.41M), and faster inference (0.90 ms/image). Comparison of per-class error rates across four models—Tiny-ViT Original, Tiny-ViT Augmented, EfficientNet-Lite Augmented, and EfficientNet-Lite Original—showed consistent stability, where each bacterial class exhibited low mean error and narrow 95% confidence intervals (CI95%), reflecting statistical reliability. These findings highlight a trade-off: Tiny-ViT offers maximum accuracy, while EfficientNet-Lite provides optimal accuracy–efficiency balance for edge-based bacterial diagnostics.
Keywords
Supporting Institution
Project Number
Ethical Statement
Thanks
References
- J. Zhang, C. Li, Y. Yin, J. Zhang, and M. Grzegorzek, “Applications of artificial neural networks in microorganism image analysis: A comprehensive review from conventional multilayer perceptron to popular convolutional neural network and potential visual transformer,” Artif. Intell. Rev., vol. 56, no. 2, pp. 1013–1070, Feb. 2023. doi: 10.1007/s10462-022-10192-7
- X. Dong, A. Huang, L. He, C. Cai, and T. You, “Recent advances in foodborne pathogen detection using photoelectrochemical biosensors: From photoactive material to sensing strategy,” Front. Sustain. Food Syst., vol. 8, p. 1432555, Aug. 2024. doi: 10.3389/fsufs.2024.1432555
- A. H. Havelaar et al., “World health organization global estimates and regional comparisons of the burden of foodborne disease in 2010,” PLoS Med., vol. 12, no. 12, p. e1001923, Dec. 2015. doi: 10.1371/journal.pmed.1001923
- P. S. Hiremath, and P. Bannigidad, “Automatic classification of bacterial cells in digital microscopic images,” in Proc. 2nd Int. Conf. Digit. Image Process. Singapore, Singapore, Feb. 2010, p. 754613. doi: 10.1117/12.853303
- S. Visitsattaponge, M. Bunkum, C. Pintavirooj, and M. P. Paing, “A deep learning model for bacterial classification using big transfer (BiT),” IEEE Access, vol. 12, pp. 15609–15621, 2024. doi: 10.1109/ACCESS.2024.3358671
- B. Zieliński, A. Plichta, K. Misztal, P. Spurek, M. Brzychczy-Włoch, and D. Ochońska, “Deep learning approach to bacterial colony classification,” PLoS ONE, vol. 12, no. 9, pp. 1–14, Sep. 2017. doi: 10.1371/journal.pone.0184554
- Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, May 2015. doi: 10.1038/nature14539
- A. Dosovitskiy et al., “An image is worth 16x16 words: Transformers for image recognition at scale,” arXiv, 2020. doi: 10.48550/ARXIV.2010.11929
Details
Primary Language
English
Subjects
Computing Applications in Life Sciences
Journal Section
Research Article
Authors
M. Amirul Ghiffari
0000-0002-4441-661X
Indonesia
Febri Dolis Herdiani
0000-0003-2203-1943
Indonesia
Ishak Ariawan
*
0000-0002-7378-7540
Indonesia
Dea Aisyah Rusmawati
0009-0005-3734-6368
Indonesia
Early Pub Date
March 15, 2026
Publication Date
March 15, 2026
Submission Date
September 4, 2025
Acceptance Date
November 15, 2025
Published in Issue
Year 2026 Volume: 9 Number: 1
