The invention discloses a
small target detection method and
system for pepper flowers based on YOLOv8n lightweight improvement, and the method comprises the steps: loading target detection image data through a corresponding
database, converting the target detection image data into a VOC format
data set trained by YOLO (You Only Look Once), and dividing a
training set and a
test set; the method comprises the following steps: by adding an EMA lightweight attention mechanism, introducing a GSConv (GSConv) lightweight
convolution module and a WIoU (Light Intersection over Union)
loss function to respectively replace a C2F
convolution module in a
trunk and an original CIoU (Complete Intersection over Union)
loss function, and constructing a lightweight capsicum flower
small target detection model based on improved YOLOv8n; training the
small target detection model based on the
training set to obtain an optimal small target detection model; inputting the
test set into the optimal small target detection model, and outputting to obtain a small target detection result; by optimizing the YOLOv8n
algorithm, the detection average precision mean value of the small-target pepper flowers is improved, the parameter quantity of the
algorithm is reduced, the lightweight of the
algorithm is realized, and the method is suitable for the requirements of mobile terminal deployment in the agricultural field.