Abstract:
In order to achieve fast and accurate detection of macadamia nuts in natural environment, a macadamia detection algorithm based on SCG-YOLOv5n during the harvesting period is proposed, aiming at the problems of the similar color of macadamia nut peel and branch leaves during harvesting period, small size and difficult identification of mixed diseased fruit. The method uses data augmentation to improve model robustness, introduces SimAM attention mechanism in the backbone network of YOLOv5n to enhance the extraction of effective features, introduces CARAFE up sampling in the FPN structure to strengthen target perception, uses GSConv lightweight convolution to replace some convolutional layers to reduce the number of model parameters and achieve efficient feature fusion to improve detection speed and detection accuracy. The results show that the improved SCG-YOLOv5n macadamia detection algorithm has an average accuracy AP of 94.8% and 97.9% for the detection of green macadamia nuts and diseased macadamia nuts during the harvest period, respectively, and the average time of a single image is 5.33 ms, which is 2.1% and 1.3% higher than the YOLOv5n model, and the detection speed is improved by 15.8%. The algorithm can efficiently detect macadamia nuts and provide technical reference for subsequent automated harvesting.