In response to the issues of high-intensity labor, low efficiency, and potential damage to crayfish associated with traditional manual sorting methods, an automated and non-contact sorting approach based on an improved YOLOv5 algorithm is proposed for the rapid sorting of crayfish maturity and size. To address the difficulty in focusing on small crayfish, the Backbone is augmented with Coordinate Attention to boost its capability to extract features. Additionally, to address the difficulty in achieving high overall algorithm efficiency and reducing feature redundancy, the Bottleneck Transformer is integrated into both the Backbone and Neck, which improves the accuracy, generalization performance, and the model’s computational proficiency. The dataset of 3464 images of crayfish collected from a crayfish breeding farm is used for the experiments. The dataset is partitioned randomly, with 80% of the data used for training and the remaining 20% used for testing. The results indicate that the proposed algorithm achieves an mAP of 98.8%. Finally, the model is deployed using TensorRT, and the processing time for an image is reduced to just 2 ms, which greatly improves the processing speed of the model. In conclusion, this approach provides an accurate, efficient, fast, and automated solution for crayfish sorting.