Research on the rapid diagnosis of three common Gram-negative bacilli in bloodstream infections based on the CNN-Dinov2 hybrid model
10.3760/cma.j.cn112150-20250827-00829
- VernacularTitle:基于CNN-Dinov2混合模型快速诊断血流感染三种常见革兰氏阴性杆菌的研究
- Author:
Zhihong HUANG
1
;
Lisha LAI
;
Lu ZHANG
;
Wohe YIN
;
Rentang DENG
;
Wenjin FU
;
Wenfeng QIU
;
Wencai HUANG
Author Information
1. 东莞市厚街医院检验科 东莞市糖尿病肾病重点实验室,东莞 523945
- Publication Type:Journal Article
- Keywords:
Deep learning;
Bloodstream infection;
Image classification;
Confusion matrix
- From:
Chinese Journal of Preventive Medicine
2025;59(11):1989-1998
- CountryChina
- Language:Chinese
-
Abstract:
Objective:To develop CNN-Dinov2, a deep learning-based automatic classification model for Gram-stained images, enabling rapid diagnosis of three prevalent Gram-negative bacilli in bloodstream infections: Escherichia coli ( E.coli), Klebsiella pneumoniae ( K.pneumoniae), and Pseudomonas aeruginosa ( P.aeruginosa). Methods:This evaluation study analyzed 1 425 Gram-stained microscopic images from patients with bloodstream infections at Houjie Hospital, in Dongguan City, collected between January 2023 and January 2024. The images, all positive for blood culture and identified as target strains, were categorized into Escherichia coli (419 images), Klebsiella pneumoniae (411 images), Pseudomonas aeruginosa (413 images), and other Gram-negative bacilli (182 images). They were randomly split into a training set (1 141 images), a validation set (141 images), and a test set (143 images) in an 8∶1∶1 ratio. A hybrid CNN-Dinov2 model was developed by integrating ResNet′s local feature extraction with Dinov2′s global pre-trained features, followed by a fully connected layer. The model was optimized by inputting the preprocessed images and adjusting parameters through loss calculation and backpropagation. AlexNet, Dinov2, and ResNet18 served as control models. The models′ classification performance was assessed using accuracy, precision, weighted F1 score, and recall rate, derived from the confusion matrix. The PR curve and AP value further evaluated each model′s classification capability across the four image categories. Results:The CNN-Dinov2 model achieved a training accuracy of 99.74%, a validation accuracy of 98.12%, and a validation loss of 0.070 6, demonstrating robust generalization without overfitting. Validation metrics revealed superior performance with an accuracy of 98.60%, precision of 98.65%, a weighted F1 score of 98.60%, and a recall rate of 98.60%, outperforming other models. The confusion matrix confirmed its strong classification capability, with the highest sum of diagonal values for identifying four types of bacteria. The macro average precision (AP) values under the precision-recall (PR) curves were all 1, indicating excellent discrimination across all categories. Overall, the CNN-Dinov2 model exhibited the best performance among the four models evaluated.Conclusion:This study successfully developed CNN-Dinov2, an automated classification model for Gram staining images. It offers valuable support for the rapid diagnosis of bloodstream infections caused by Escherichia coli, Klebsiella pneumoniae, and Pseudomonas aeruginosa, demonstrating practical utility.