This invention discloses a method for identifying
Gram-stained
blood culture samples using microscopic images, belonging to the field of
image processing technology. The invention acquires
Gram-stained
blood culture smear images under an
optical microscope and annotates
pathogenic bacteria using rectangular bounding boxes. Subsequently, the annotated image undergoes
color space conversion to obtain an L-channel image and calculates the
gradient magnitude of each pixel. After dividing the L-channel image into blocks, a dynamic shearing threshold is calculated based on the average
gradient magnitude of each sub-block. The
grayscale histogram of each sub-block is then sheared to obtain
histogram-equalized sub-blocks. Next, the
block effect of each equalized sub-block is eliminated, and it is concatenated with the A-channel and B-channel images and converted back to the
RGB color space to obtain a contrast-enhanced image. Finally, the contrast-enhanced image is scaled and input into an enhanced YOLOv11 target detection network, ultimately achieving accurate identification of
pathogenic bacteria categories. This invention effectively improves the identification accuracy of
pathogenic bacteria in
Gram-stained
blood culture samples.