基于改进YOLOv7算法的自然环境下柑橘缺陷检测

打开文本图片集
中图分类号:S225;TP391.41 文献标志码:A 文章编号:1001-411X(2026)01-0094-12
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 inteligent 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 eficiency; integrating the atentio free transformer (AFT) to strengthen target feature recognition; 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 achievedallweather detection ofcitrus 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.
Key words: Machine vision; Object detection; Citrus defect; YOLOv7; Defect detection
柑橘是我国第一大水果,在年产量和种植面积上,均为各类水果中的第一名。(剩余19673字)