To solve the concern regarding low precision in detecting apple maturity, a refined apple target detection method built upon YOLOv8 is put forward. Firstly, CBAM attention mechanism is integrated into the architecture of the neural network. architecture to make the model focus on the specific region of interest in the image, reduce the background interference, and improve the feature representation ability. Then the SPPF structure is improved. Additionally, a pooling layer has been incorporated to expand the SPPF architecture to include a maximum pooling operation at the fourth layer. Simultaneously, through pooling activities conducted at various spatial levels, the SPPF can retain a certain level of variability, enhancing the model’s capacity to detect changes in target shape and orientation. The pooling operations applied to subregions transform eigenvectors of variable lengths into fixed-length feature representations and makes an improvement on the computational efficiency related to the model. The results from the experimental analysis on the data set show that, compared with the original model, in this method, the recognition time of a single image is only increased by 3ms, the recognition frame number is reduced by 5.59 fps, the mAP is increased by 1.97%, and the target recognition rate of low maturity apples and medium maturity apples is increased by 3.44% and 3.17% respectively. The target recall rates of low maturity apples, medium maturity apples and mature apples were increased by 7.59%, 7.81% and 3.31% respectively compared with the original model.
|