Light Weight Detection Algorithm for Apple Surface Defect Based on Improved YOLOv7
Aiming at how to improve the detection speed and accuracy of apple surface defects and solve the problem of large model memory ratio,a lightweight detection algorithm for apple surface defects based on improved YOLOv7 was proposed.Firstly,GhostNetV2 was introduced as the backbone of YOLOv7 network,which effectively reduced the model complexity and improved the detection speed.SimAM attention-free mechanism was introduced to enhance the feature information of different depth.The bidirectional weighted feature pyramid BiFPN was used for weighted feature fusion to further improve the detection accuracy of apple surface defects.Finally,the ECIOU loss function was used to calculate the boundary frame loss,which further improved the convergence speed and the overall performance of the model.Experimental results showed that compared with the original YOLOv7 network,the improved model improved the apple surface defect detection mAP@0.5 by 2 percentage points,the accuracy rate and recall rate by 1.7 and 3.9 percentage points respectively.The model decreased by 20.8 MB and the speed increased by 36.43 FPS.Its comprehensive performance was also better than SSD,CenterNet and other mainstream algorithms,which can realize the rapid and accurate diagnosis of apple surface defects.
Apple surface defectYOLOv7GhostNetV2Attention mechanismBiFPNECIOU