The invention discloses a street garbage detection method based on improved YOLOv8s. The street garbage detection method comprises the following steps: making a street garbage
data set and preprocessing the
data set; on the basis of a C2f module in the YOLOv8s model, a FocudLearAttention self-attention mechanism is fused to form a C2f-FLA module, and the
feature fusion effect of the model and the expression ability of the model to global context information are improved; an AIFI module of RT-DETR is introduced into a check layer in YOLOv8s, the AIFI module enhances the feature representation capability through a multi-head self-attention mechanism and a feedforward
network layer, global context information and detail features can be captured more effectively, and the detection precision of a
small target is improved; a CIoU
loss function used in YOLOv8s is improved into a Focal-EIoU
loss function, so that the problem of inaccurate positioning of street garbage detection is solved. The improved YOLOv8s model
algorithm enhances the expression capability of the model for global context information, so that shallow information and deep information in the image are fully fused, and the image information can be processed more effectively. According to the method, the problem of low detection precision in a street garbage detection scene with complex background and multiple small targets can be well solved, and a relatively high detection speed is kept at the same time.