Abstract:Addressing the challenges of apricot mushroom grading, which relies heavily on manual labor, is inefficient, and prone to subjectivity. An automated grading and detection method for apricot mushrooms named FCML-YOLO v8 was proposed. Building upon the improved YOLO v8n-seg, the network sequentially integrated the feature-focused diffusion pyramid network (FDPN), characteristic attention fusion module (CAFM), and multi-level channel attention (MLCA) mechanism. By combining the FCML-YOLO v8 model with subordinate judgment, mask merging, and center screening methods, accurate assessments of apricot mushroom size and disease spot conditions was achieved. Additionally, through image refinement and curve-fitting techniques, it effectively quantified the curvature of apricot mushrooms. Furthermore, by leveraging CIE XYZ color space values, the color characteristics of apricot mushrooms were precisely analyzed. By integrating these four indicators, the automated grading and detection of apricot mushrooms were successfully implemented. Experimental results demonstrated that the FCML-YOLO v8 model achieved a precision of 94.41%, a recall rate of 88.48%, and an mAP@0.5 of 92.04% in bounding box prediction. In mask detection, it achieved a precision of 90.52%, a recall rate of 84.14%, and an mAP@0.5 of 86.79%. Compared with the original YOLO v8n-seg model, the mAP@0.5 of FCML-YOLO v8 was improved by 6.39 and 4.79 percentage points, respectively, in bounding box prediction and mask detection. In the constructed apricot mushroom grading and detection experimental setup, the FCML-YOLO v8 model achieved an mAP@0.5 of 92.98%, fully meeting the requirements of industrial-grade applications.