Abstract:
Objective Citrus defect recognition is a key link in realizing automatic citrus fruit picking and controlling fruit quality. This study aims to improve the accuracy of citrus defect recognition in natural environments and achieve all-weather operation of intelligent picking.
Method By optimizing key modules, an improved YOLOv7 algorithm was proposed. The specific improvements included: Introducing the complete intersection over union (CIoU) loss function to improve bounding box regression accuracy; adopting the HardSwish activation function to enhance network learning and computational efficiency; integrating the attention free transformer (AFT) to strengthen target feature recognition; and combining the residual multilayer perceptron (ResMLP) and dynamic convolution (DC) technologies to improve model’s adaptability and stability under complex lighting conditions.
Result Using a dual light source system, this algorithm achieved all-weather detection of citrus fruits and their defects in natural environments. It detected defects such as black spots and cracks under natural light or white light, while at night, violet light served as a complementary means to detect defects that were not obvious under white light or natural light based on fluorescent responses. The experimental results showed that the improved YOLOv7 algorithm achieved 97.9% recognition accuracy for citrus fruits and 92.8% for defects during daytime, which were 3.8 and 13.4 percentage points higher than those of the original YOLOv7 algorithm, respectively; The defect recognition accuracy at night reached 82.4%.
Conclusion The citrus defect recognition method proposed in this paper has high accuracy and a wide applicable time range, providing new insights for the intelligent harvesting in the citrus industry.