# Rapid and Accurate Crayfish Sorting by Size and Maturity Based on Improved YOLOv5
## 1 Introduction
These fac-tors have made deep learning an important tool in the fields of aquaculture and aquatic product detection. [PERSON] [18] used binocular stereo vision technology to obtain three-dimensional information and performed fish detection and fine segmentation using the Mask-RCNN network. Finally, three-dimensional point cloud data of the fish surface were generated, and the external dimensions of multiple fish under free movement were calculated. [PERSON] [19] addressed the issue of limited generalization ability in existing multi-object fish detection methods that mostly focus on controlled environments. They proposed a transfer learning approach based on DRN for feature extraction from raw images, combined with RPN to generate candidate detection boxes. Using Faster-RCNN, they created a fish detection model capable of detecting multiple objects in complex backgrounds. By testing in complex backgrounds, the model was found to achieve an average detection accuracy of 89.5% for goldfish. To tackle challenges posed by blurriness and the multi-degree-of-freedom motion of objects in water, [PERSON] [20] proposed a YOLO-V3 algorithm-based model for object recognition. The model successfully tracked objects with a multi-degree-of-freedom motion in water, achieving an average accuracy of 75.1% when the confidence level was set at 0.5. [PERSON] [21] proposed a cost-effective and easy-to-operate monitoring method based on YOLO for effectively detecting and counting fish in water using image enhancement and object detection algorithms, and extracting trajectory features to enhance the tracking and detection capabilities of fish ponds in aquaculture. For the specific features of sea urchin spines, [PERSON] [22] developed a feature-enhanced sea urchin detection algorithm that used a multi-directional edge detection algorithm for feature enhancement, utilized ResNet 50 as the basic framework, and employed a feature-level fusion technique to improve feature extraction capability and semantic representation. Experimental results showed that the proposed algorithm achieved a 7.6% improvement in AP value over the SSD algorithm and improved the confidence score for small targets. To address the problems of underwater image blur and difficulty in capturing small targets,Hu [23] proposed an approach that utilizes an optimized YOLO-V4 to detect uneaten feed particles in aquaculture. The proposed method enhanced the network performance and model accuracy by modifying the way the feature pyramid network and path aggregation network are connected, as well as the residual connection mode. The experiments showed an average precision improvement of 27.21%. To track crayfish from capture to consumers, [PERSON] [24] proposed an image-based individual recognition solution using convolutional neural networks. This approach employed a combination of the Siamese model and a contrastive loss function to distinguish individual crayfish by analyzing their exoskeleton images, providing a more secure and reliable approach for crayfish recognition and tracking. The convolutional neural network-based methods mentioned above usually incorporate attention mechanisms or increase the network depth to enhance detection accuracy. However, the model's parameters increase with this approach, leading to slower processing speeds that fail to satisfy the requirement for detecting in real time. This method faces challenges such as difficulty in live crayfish sorting, insufficient accuracy, and low efficiency. Therefore, a balance between improving accuracy and maintaining high-speed processing is necessary. The proposed method, which utilizes an improved YOLOv5, was evaluated on a crayfish dataset through experiments, for the fast sorting of crayfish maturity and size. Therefore, to achieve automated, contactless, fast, and accurate sorting of live crayfish, we propose the following methods to address this objective:  
1.