Abstract:Objective To achieve rapid and non-destructive online detection of the appearance quality of crayfish during primary processing and to improve detection accuracy and real-time performance in complex scenarios.Methods A dataset for crayfish appearance quality is constructed for complex scenarios on primary-processing production lines, and a crayfish appearance quality detection algorithm YOLO-CQ based on YOLOv11n is proposed. DualConv is introduced to improve the C3k2 module, enhancing the model's feature extraction capability while optimizing the allocation of computational resources. Deformable attention (DAT) is integrated into the C2PSA module, enabling the model to adaptively focus on key regions. In addition, an IoU-based dynamically weighted SlideLoss is adopted to optimize the classification loss, thereby balancing the gradient contributions of samples with different difficulty levels during training.Results YOLO-CQ achieves the precision of 86.6%, the recall of 84.3%, and the mAP@0.5 of 91.3%, which represent improvements of 2.5%, 2.3%, and 3.4% over those of YOLOv11n, respectively. YOLO-CQ reaches an inference speed of 211.5 FPS.Conclusion YOLO-CQ significantly improves the detection accuracy of crayfish appearance quality while maintaining model lightness and real-time performance, meeting the requirements of online grading on primary-processing production lines.