Sorting defective cocoons is a critical procedure in the silk reeling industry to ensure the quality of raw silk products. Currently, this process relies heavily on manual inspection, which is labor-intensive, subjective, and inefficient. While automated sorting based on machine vision offers a promising alternative, existing object detection algorithms struggle to balance accuracy and computational complexity, particularly when detecting tiny surface defects or distinguishing morphologically similar cocoons in dense scenarios. To address these challenges, this paper proposes an efficient silkworm cocoon defect detection model named LMD-YOLO, based on the YOLOv10 architecture. In this model, we introduce three key improvements to enhance feature extraction and multi-scale perception. First, we integrate a Large Separable Kernel Attention (LSKA) module into the C2f structure (C2f-LSKA) of the backbone. This design decomposes large kernels to capture global shape features with minimal computational cost, effectively distinguishing double cocoons from normal ones. Second, we replace standard upsampling with a DySample module in the neck, which utilizes dynamic point sampling to recover fine-grained texture details of tiny defects like surface stains. Third, a Multi-Scale Dilated Attention (MSDA) mechanism is embedded before the detection heads to aggregate semantic information across different scales, improving robustness against background interference. YOLOv10 was selected as the baseline due to its NMS-free characteristic, which mitigates the latency caused by post-processing in high-speed sorting tasks. Evaluations on a self-constructed multi-category dataset indicate that LMD-YOLO surpasses established detectors, including YOLOv8n and Faster R-CNN. Relative to the YOLOv10n baseline, our method improves mAP@0.5 by 3.11%, achieving 94.46%. Notably, Precision and Recall are increased by 3.50% and 2.97%, reaching 89.98% and 93.61%, respectively. With a compact size of 2.68 M parameters and an inference speed of 115 FPS, the proposed model offers a practical trade-off between accuracy and latency for real-time cocoon defect detection.
Zhu et al. (Thu,) studied this question.