A gender and body size dual-dimension detection and automatic sorting system for eriocheir sinensis based on yolov1

The automated sorting system based on YOLO11 enables the individual transport and dual-dimensional detection of sex and body size of Chinese mitten crabs, solving the problem of accurate sorting in the pea crab stage, improving sorting efficiency and accuracy, and adapting to the automation needs of different growth stages.

CN122477968APending Publication Date: 2026-07-31FRESHWATER FISHERIES RES CENT OF CHINESE ACAD OF FISHERY SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FRESHWATER FISHERIES RES CENT OF CHINESE ACAD OF FISHERY SCI
Filing Date
2026-07-01
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies are insufficient to achieve single-animal transport of Chinese mitten crabs, simultaneous imaging of the upper carapace and lower abdomen, accurate detection of sex and body size in both dimensions during the pea crab stage, and coordinated operation of identification and sorting mechanisms. This results in low efficiency, large errors, and difficulty in adapting to large-scale automated sorting in traditional manual sorting.

Method used

A YOLO11-based dual-dimensional detection and automated sorting system for Chinese mitten crabs based on sex and body size was adopted. Through the collaborative work of a batch delivery and buffering module, a multi-specification card slot guidance and alignment module, a single-crab beat-limiting conveying module, a carapace and abdominal image acquisition module, a YOLO11 recognition and body size measurement module, a size and grade determination module, and an execution sorting module, accurate detection and automated sorting of sex and body size were achieved.

Benefits of technology

It enables the individual transport of Chinese mitten crabs, reduces the impact of stacking and occlusion on the identification results, improves detection efficiency and sorting accuracy, reduces manual measurement errors, and realizes real-time linkage between visual detection results and sorting mechanism, adapting to automated sorting at different growth stages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122477968A_ABST
    Figure CN122477968A_ABST
Patent Text Reader

Abstract

This invention discloses a YOLOv11-based dual-dimensional sex-body size detection and automated sorting system for Chinese mitten crabs, relating to the field of aquaculture equipment. The system includes: a batch delivery and buffering module, a multi-specification card slot guiding and alignment module, a single-crab beat-limiting conveying module, a carapace image acquisition module, an abdominal image acquisition module, a YOLOv11 recognition and body size measurement module, a size and grade determination module, a sorting execution module, and a classification collection and data output module. The YOLOv11 recognition and body size measurement module identifies sex and calculates body size data based on carapace and abdominal images; the size and grade determination module generates sorting instructions based on grading parameters and confidence thresholds, driving a lever-type or gate-type diversion mechanism to complete online sorting. This invention has advantages in grading consistency, processing speed, data traceability, and labor cost control, and is suitable for deployment at the edge of seedling breeding bases, factory farming workshops, and aquatic product processing lines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of aquaculture equipment technology, and more specifically to a YOLO11-based dual-dimensional detection and automated sorting system for the sex and body size of the Chinese mitten crab. Background Technology

[0002] The commercial grading of Chinese mitten crabs is primarily based on weight, sex, and body condition. The national product standard GB / T19783-2005 "Chinese Mitten Crab" and some group standards classify crabs by weight and require the identification of male and female information. The carapace length (CL) is also used in the calculation of body condition (e.g., CF=BW / CL³, where BW represents weight and CL represents carapace length). Traditionally, sex determination relies on manually examining the abdominal navel; male crabs have a triangular "pointed navel," while female crabs have a round or oval "round navel."

[0003] However, during the pea crab stage (i.e., juvenile crabs that have undergone their first 4 to 7 molts, and are only the size of a bean), the reliability of traditional manual visual sex determination is significantly reduced due to their tiny size, uniform body color, and indistinct abdominal navel features. Furthermore, this method is unsuitable for large-scale automated sorting. Traditionally, body size measurements are done manually using calipers to measure the length and width of the carapace, followed by sorting based on experience. This method suffers from high labor intensity, high subjective error, slow processing speed, significant stress on the crabs, and difficulty in generating continuous data records. Stable individual identification and grading during the pea crab stage has significant engineering application value. An imbalance in the sex ratio in the early stages of seedling rearing directly affects stocking density management and differentiated feeding strategies, leading to inconsistent market size of adult crabs and reduced overall economic benefits. Existing automated sorting equipment often uses weight or external dimensions as a single sorting criterion, making it difficult to simultaneously meet the combined needs of sex identification and body size determination. In recent years, deep learning object detection models have been used for image recognition of aquatic animals. However, in the automated sorting scenario of Chinese mitten crabs, the following shortcomings still exist: First, after batch release, multiple individuals are prone to stacking and entering the recognition area side by side, resulting in the camera recognizing multiple individuals at once or causing severe occlusion. Second, carapace images are suitable for measuring the length and width of the carapace, but cannot directly and reliably determine sex. Third, abdominal images are suitable for sex recognition, but require a dedicated lower imaging window, supplementary lighting structure, and anti-fouling structure. Fourth, there is a lack of time-delayed synchronous control between the visual recognition results and the end-effector mechanical sorting mechanism, which can easily lead to inconsistencies between the identified individuals and the sorted individuals.

[0004] Therefore, how to achieve single-animal transport of Chinese mitten crabs, simultaneous imaging of the upper carapace and lower abdomen, accurate detection of sex and body size in two dimensions, and coordinated linkage of identification and sorting mechanisms are problems that urgently need to be solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the present invention provides a dual-dimensional detection and automated sorting system for sex and body size of Chinese mitten crab based on YOLO11, which aims to solve the problems of unstable visual recognition caused by individual overlap and parallel passage of Chinese mitten crabs after a batch is put in, the low efficiency of manually checking the abdomen to determine the sex, the large error and slow speed of manual measurement of carapace length and width, and the difficulty in linking visual detection results with the sorting exit in real time.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: This invention discloses a YOLO11-based dual-dimensional detection and automated sorting system for the sex and body size of the Chinese mitten crab, comprising: The batch delivery and buffering module buffers and accommodates batches of Chinese mitten crabs before sending them into the multi-size card slots for guidance and alignment. The multi-specification slot guiding and aligning module oriented and aligns Chinese mitten crabs of different sizes, eliminating the stacking and side-by-side obstruction of crab bodies, and then feeds them into the single-crab beat-limiting conveying module. The single-beat limiting and conveying module controls the Chinese mitten crab to enter the carapace image acquisition module and the abdominal image acquisition module in a single, fixed-beat manner. The carapace image acquisition module and the abdomen image acquisition module acquire carapace and abdomen images of the Chinese mitten crab, respectively, and send them to the YOLO11 recognition and body size measurement module. The YOLO11 recognition and body size measurement module, based on the carapace and abdominal images, uses a pre-trained YOLO11 model to identify the sex of the Chinese mitten crab and calculate its body size data. The specification grade determination module determines the classification label of the Chinese mitten crab based on a preset grading threshold and in combination with the body size data and the sex. The sorting module, based on the classification label and in conjunction with the motion data from the single-beat limiting conveying module, sends the Chinese mitten crab into the corresponding collection channel of the classification collection and data output module. The classification, collection, and data output module classifies and collects Chinese mitten crabs of different sizes and sexes, and records the entire process of testing data.

[0007] Furthermore, the multi-specification card slot guiding and aligning module includes: a vibration aligning platform, card slots, guide baffles, and elastic width limiting strips; The slots are replaceable or adjustable in width, and there are at least two slots; the cross-section of the slots is V-shaped, U-shaped or shallow arc-shaped, and the bottom of the slot forms a continuous guide structure with the conveying direction, so that the crab bodies are arranged along the slot direction under the vibration action of the vibration sorting platform and the restriction of the guide baffle. The guide baffle is disposed between the end of each slot and the converging tapered opening; The elastic width-limiting barrier is set above or on both sides of the slot to prevent two crabs from entering the same slot side by side.

[0008] Furthermore, the single-crab beat-limiting conveyor module includes a transparent conveyor belt, an adjustable lateral limiting plate, a front beat gate, a rear isolation gate, a detection stop, and a photoelectric sensor. When the inlet photoelectric sensor detects a Chinese mitten crab entering, the front beat gate opens, allowing one crab to enter the beat zone. After confirming that there is only one target in the beat zone, the rear isolation gate closes to block subsequent individuals. When the target reaches the detection position, a trigger signal is output to control the carapace image acquisition module and the abdominal image acquisition module to take pictures. After the target finishes being photographed, the detection stop opens, and the conveyor belt transports the Chinese mitten crab to the output sorting area. Subsequently, the rear isolation gate and the front beat gate reset, and the detection cycle for the next crab begins.

[0009] Furthermore, the carapace image acquisition module is located above the detection cavity and includes an upper camera, a lens, a ring light, and a light-shielding shell. The upper camera is used to acquire images of the crab's carapace. The abdominal image acquisition module is arranged below the transparent conveyor belt and includes a lower camera, a lower imaging window, a supplementary light source, and a waterproof and stain-proof transparent plate. The lower camera is used to acquire images of the crab's abdomen.

[0010] The upper camera and the lower camera are triggered synchronously by the same trigger sensor, or triggered separately according to the encoder position signal; The detection cavity employs a light-shielding structure.

[0011] Furthermore, the YOLO11 recognition and body size measurement module incorporates an improved YOLO11 model trained on images of Chinese mitten crabs at the pea crab, juvenile crab, and adult crab stages. Based on the carapace image, the model outputs the crab body target box, carapace key points, and carapace contour. Combining calibration rulers or camera calibration parameters, the pixel distance is converted into millimeter distance to obtain the cephalothorax length CL and cephalothorax width CW. Based on the abdominal image, the model outputs the abdominal navel region target box and classification results, determining whether the individual is a female crab (F), a male crab (M), or undetermined (U), and simultaneously outputs the corresponding confidence level.

[0012] Furthermore, the improvements to the improved YOLO11 model include: A channel-space dual attention mechanism is introduced, and CBAM modules are inserted into the outputs of the last two C2f modules of the backbone network of the standard YOLO11 model. A high-resolution detection branch for small targets has been added, with a new 160×160 resolution detection branch added to the original three detection heads of the standard YOLO11 model. A decoupled detection head design was adopted, which split the detection head into independent classification and regression branches, and the two branches were optimized independently to decouple the gradients. The keypoint regression loss function is improved by replacing the L2 loss of the standard YOLO11 model with the OKS-weighted WingLoss function.

[0013] Furthermore, the specification grade determination module determines the body size specification based on the growth stage, sorting threshold, and confidence threshold set by the user; the specification determination result is integrated with the gender recognition result to form four classification labels: large female crab, small female crab, large male crab, and small male crab; when the gender output is undetermined (U), the recognition confidence is low, or the image is abnormal, an abnormal verification label is formed.

[0014] Furthermore, the sorting execution module is located at the output end and includes a solenoid valve group, pneumatic fork, swing arm, flap, or sorting gate connected to the controller. The controller, based on the results output by the classification label determination module and combined with the conveyor belt speed, encoder pulse, and the current position of the crab, controls the corresponding sorting gate to open when the target individual arrives, guiding it to the corresponding outlet. The fork, gate, or guide that contacts the crab can be provided with a flexible covering layer, and the action force is limited to below a preset safety threshold.

[0015] Furthermore, the classification collection and data output module includes four classification collection channels, corresponding to large-sized female crabs, small-sized female crabs, large-sized male crabs, and small-sized male crabs, respectively; an anomaly verification outlet is also provided for manual verification of individuals that are undetermined, have low confidence, are obscured, have turned over, or have incomplete images. The data terminal displays the current batch quantity, male-female ratio, large-size ratio, small-size ratio, number of abnormal reviews, and model confidence statistics.

[0016] As can be seen from the above technical solution, compared with the prior art, the present invention provides a YOLO11-based dual-dimensional detection and automated sorting system for sex and body size of the Chinese mitten crab, which has the following beneficial effects: (1) The present invention uses multi-specification card slots at the input end, vibration alignment and single-beat gate to send the batch of Chinese mitten crabs into the detection area one by one, reducing the impact of stacking, obstruction and side-by-side passage on the identification results.

[0017] (2) The present invention uses an upper camera to collect images of the carapace and a lower camera to collect images of the abdomen, which correspond to body size measurement and sex identification, respectively, thus solving the problem that it is difficult to complete sex identification and body size measurement at the same time from a single perspective.

[0018] (3) The present invention outputs information on gender, cephalothorax length and cephalothorax width through the YOLO11 model and converts the pixel measurement results into actual size, which can reduce the measurement error of manual calipers and improve the detection efficiency.

[0019] (4) The present invention links the identification results with the end sorting gate and combines the conveyor belt speed and encoder pulse for delay control, which can directly output four types of products: large-sized female crabs, small-sized female crabs, large-sized male crabs, and small-sized male crabs, thereby improving the automation level of aquaculture production and commodity grading.

[0020] (5) This invention can be adapted to different stages of crabs, juvenile crabs and adult crabs, and can achieve multi-stage application by changing the card slot plate, adjusting the channel width and setting the specification threshold.

[0021] (6) This invention can save the image, sex, carapace length, carapace width, size grade, confidence level and timestamp of each Chinese mitten crab, providing a data foundation for growth monitoring, breeding screening and batch traceability.

[0022] (7) The present invention sets up an undetermined output and an abnormal review channel, which can remove individuals with low confidence, occlusion, overturning or unclear early gender characteristics from the automatic sorting results, thereby reducing the risk of forced misclassification. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0024] Figure 1 This is a schematic diagram of the overall system architecture provided by the present invention.

[0025] Figure 2 This is a top view of the multi-specification card slot alignment mechanism for the input end provided by the present invention.

[0026] Figure 3 This is a schematic diagram of a single-cycle limiting conveyor mechanism provided by the present invention.

[0027] Figure 4 This is a side view of the dual-camera imaging detection cavity provided by the present invention.

[0028] Figure 5 This is a schematic diagram illustrating the measurement of the length and width of the cephalothorax in the carapace image provided by the present invention.

[0029] Figure 6 This is a schematic diagram illustrating the sex identification of abdominal images provided by the present invention.

[0030] Figure 7 This is a schematic diagram of the connection / data of the YOLO11 identification and sorting control unit provided by the present invention.

[0031] Figure 8 Top view of the four types of automated sorting output terminals provided by the present invention. Detailed Implementation

[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] This invention discloses a YOLOv11-based dual-dimensional detection and automated sorting system for the sex and body size of the Chinese mitten crab, such as... Figure 1 As shown, it includes: A batch delivery and buffering module is set at the system input end to buffer and accommodate batches of Chinese mitten crabs and send them into the multi-size card slot guide and alignment module. The multi-specification card slot guide and alignment module can oriented and align Chinese mitten crabs of different sizes, eliminate the stacking and side-by-side obstruction of crabs, and send them into the single-crab beat-limiting conveyor module. The single-beat limiting conveyor module controls the Chinese mitten crab to enter the carapace image acquisition module and the abdominal image acquisition module in a single, fixed-beat manner. The carapace image acquisition module and the abdomen image acquisition module acquire carapace and abdomen images of the Chinese mitten crab, respectively, and send them to the YOLO11 recognition and body size measurement module. The YOLO11 recognition and body size measurement module, based on carapace and abdominal images, uses a pre-trained YOLO11 model to identify the sex of the Chinese mitten crab and measure its body size data. The specification and grade determination module determines the classification label of Chinese mitten crab based on preset grading thresholds and in combination with body size data and sex. The sorting module executes the sorting module, which, based on the classification labels and the motion data from the single-beat limit conveying module, sends the Chinese mitten crab into the corresponding collection channel of the classification collection and data output module. The classification collection and data output module classifies and stores Chinese mitten crabs of different sizes and sexes, and records the entire process of testing data.

[0034] In a specific embodiment, such as Figure 2 As shown, the multi-size card slot guiding and aligning module includes: a vibration sorting platform, card slots, guide baffles and elastic width limiting bars, so that individuals of different sizes can enter the corresponding card slots and be arranged along the card slot direction, reducing stacking, lateral side-by-side arrangement and mutual obstruction; The slots are replaceable or adjustable in width, with at least two slots in total, including slots for pea crabs, slots for juvenile crabs, and slots for adult crabs. They adopt a replaceable slot plate or screw-adjustable width structure to accommodate the size differences of different batches of river crabs. The cross-section of the slots is V-shaped, U-shaped, or shallow arc-shaped, and the bottom of the slot forms a continuous guide structure with the conveying direction, so that the crabs are arranged along the slot direction under the vibration of the vibrating sorting platform and the restriction of the guide baffle. Guide baffles are set between the end of each slot and the confluence narrowing opening to restrict the lateral movement of the crab and guide the crab to enter the confluence narrowing opening in a predetermined direction; the exit width of the confluence narrowing opening is less than the width of two crabs of the same stage side by side, thus providing pre-separation conditions for subsequent single-crab passages.

[0035] Flexible width-limiting barriers are installed above or on both sides of the slot to prevent two crabs from entering the same slot side by side.

[0036] In a specific embodiment, such as Figure 3 As shown, the single-crab beat-limiting conveyor module includes a transparent conveyor belt, an adjustable lateral limiting plate, a front beat gate, a rear isolation gate, a detection position stop, and multiple photoelectric sensors. This allows crabs to pass through the imaging detection chamber (between the rear isolation gate and the detection position stop) one by one, preventing subsequent individuals from accidentally entering the detection field of view. Specifically, after the entrance photoelectric sensor detects the entry of a Chinese mitten crab, the front beat gate opens, allowing one crab to enter the beat zone. Once the single-crab confirmation sensor confirms that there is only one target in the beat zone, the rear isolation gate closes to block subsequent individuals. The trigger sensor outputs a trigger signal when the target reaches the detection position, controlling the carapace image acquisition module and the abdominal image acquisition module to capture images. After the target has finished being photographed, the detection position stop opens, and the conveyor belt transports the Chinese mitten crab to the output sorting area. Subsequently, the rear isolation gate and the front beat gate reset, and the detection cycle for the next crab begins. This structure avoids two or more crabs simultaneously being within the imaging field of view, improving the accuracy of YOLO11 model recognition and measurement.

[0037] In a specific embodiment, such as Figure 4 As shown, the carapace image acquisition module is located above the detection chamber and includes an upper camera, lens, ring light, and light-shielding shell. The upper camera is used to acquire images of the crab's carapace. The abdominal image acquisition module is located below the transparent conveyor belt and includes a lower camera, lower imaging window, light source, and waterproof and stain-proof transparent plate. The lower camera is used to acquire images of the crab's abdomen.

[0038] The upper and lower cameras are triggered synchronously by the same trigger sensor, or triggered separately by the encoder position signal; the transparent window can be equipped with a removable protective sheet or a cleaning structure to reduce the impact of water stains and mud on abdominal imaging.

[0039] The detection chamber employs a light-shielding structure to reduce the impact of external light on image acquisition. A transparent conveyor belt or transparent carrier plate is located in the middle of the detection chamber, with the crab passing through belly-down. A ring of supplementary lights is installed around the upper camera to enhance the imaging effect of key points such as the carapace edge, carapace length, and carapace width. Backlighting or oblique supplementary lighting is installed around the lower camera to highlight the outline of the abdominal umbilicus area.

[0040] In a specific embodiment, such as Figure 5-7 As shown, the YOLO11 recognition and body size measurement module incorporates an improved YOLO11 model trained on images of Chinese mitten crabs at the pea crab, juvenile crab, and adult crab stages. Based on the carapace image, the model outputs the crab body target box, carapace key points, and carapace contour. Combining calibration rulers or camera calibration parameters, the pixel distance is converted into millimeter distance to obtain the carapace length CL and carapace width CW. Based on the abdominal image, the model outputs the abdominal navel region target box and classification results, determining whether the individual is a female crab (F), a male crab (M), or undetermined (U), and simultaneously outputs the corresponding confidence level.

[0041] In one specific embodiment, the improvements to the YOLO11 model include: A dual channel-space attention mechanism is introduced, with CBAM (Convolutional Block Attention Module) modules inserted into the outputs of the last two C2f modules of the standard YOLO11 model backbone network. CBAM sequentially performs channel attention weighting and spatial attention weighting, enabling the network to prioritize the carapace contour texture and ventral umbilicus morphology region during the feature extraction stage, while suppressing the response intensity of irrelevant background information such as conveyor belt texture, water stain reflection, and foam filling, thereby improving the signal-to-noise ratio of effective features.

[0042] To address the issue of high false negative rates for small targets such as pea crabs (body length less than 3cm) using the standard three-scale detection head (80×80, 40×40, 20×20 feature maps), this invention adds a 160×160 high-resolution detection branch to the existing three detection heads of the standard YOLO11 model. This branch directly uses the shallow high-resolution feature map of the Backbone, performs channel compression through 1×1 convolution, and then connects to the detection head, improving the small target detection recall rate by more than 20%.

[0043] A decoupled detection head design is adopted. The standard YOLO11 uses a coupled detection head, where the same convolutional branch simultaneously predicts the classification score and bounding box coordinates / keypoint positions, causing mutual interference between the gradients of the two tasks. This invention splits the detection head into independent classification branches (2-layer convolution + sigmoid activation) and regression branches (2-layer convolution + keypoint regression head), and optimizes the two branches independently, decoupling the gradients; thus improving the localization accuracy of keypoints on the carapace edge.

[0044] The keypoint regression loss function is improved. The standard L2 loss has a very small gradient for small deviations (distance less than 1 pixel), which is not conducive to sub-pixel-level accurate localization of keypoints. This invention uses an OKS (ObjectKeypointSimilarity) weighted WingLoss function to replace the L2 loss of the standard YOLO11 model. When the prediction error δ is less than the threshold ω (ω=5 pixels in this embodiment), a logarithmic function is used to amplify the gradient, encouraging the model to further refine approximately correct predictions; when δ≥ω, it degenerates into a linear function to prevent gradient explosion for large error samples. The OKS weights of each keypoint are calibrated according to their contribution to the final CL / CW measurement accuracy, with the weight of the longitudinal axis endpoints of the carapace set to 1.5 and the weight of the lateral edge extreme points set to 1.0.

[0045] In one specific embodiment, the body size measurement method based on YOLO11 specifically includes: After the carapace image is captured by the upper camera, the system performs the following image preprocessing steps before sending it to the YOLO11 model: (1) Size normalization: The original acquired image is scaled to 640×640 pixels by bilinear interpolation, and the pixel value is normalized from the integer range [0,255] to the floating-point range [0,1] to adapt to the input layer size requirements of the YOLO11 network, while reducing the model generalization problem caused by the difference in the resolution of the acquisition device.

[0046] (2) Adaptive Contrast Enhancement (CLAHE): The CLAHE (Contrast Limited Adaptive Histogram Equalization) algorithm is applied to the luminance channel of the normalized image, with the block size set to 8×8 pixels and the contrast limit threshold set to 2.0. This step can effectively improve local overexposed / underexposed areas caused by water reflection, wet crab shells, or uneven light source distribution, and enhance the recognizability of the carapace contour texture.

[0047] (3) Foreground saliency prediction: In the high-speed operation mode of the production line, the system first extracts the average saturation value of the HSV color space of the scaled image. If it is lower than the preset empty frame threshold, it is determined that there is no crab body in the current frame, and the empty detection result is directly output and YOLO11 inference is skipped to reduce the consumption of computing resources.

[0048] (4) Online data augmentation during training: During model training, online augmentation operations such as horizontal flipping (probability 0.5), random rotation (±15°), random brightness / contrast perturbation (factor range [0.7,1.3]), Mosaic four-image stitching (probability 0.5), and Copy-Paste instance copying and pasting (probability 0.3, used to increase the proportion of small crab samples) are applied to each input sample to improve the robustness of the model under different lighting and pose conditions.

[0049] like Figure 5 As shown, after the carapace image is acquired, the YOLO11 model detects the crab body in the image and outputs the target bounding box of the carapace region, the carapace contour, or key points. The cephalothorax length CL is defined as the maximum distance from the anterior edge to the posterior edge of the carapace along the longitudinal axis of the crab body; the cephalothorax width CW is defined as the maximum distance between the left and right lateral edges of the carapace along the transverse axis.

[0050] YOLO11 employs a multi-scale feature pyramid network (FPN+PAN structure) to perform parallel detection of crabs of different sizes in the input image. The network outputs feature maps at four scales (160×160, 80×80, 40×40, and 20×20), corresponding to detection branches for extremely small targets such as pea crabs to large targets such as adult crabs. The decoupled regression head of each detection branch outputs the carapace bounding box (center coordinates cx, cy, width and height w, h) at each anchor point, the detection confidence score, and the coordinates of 8 carapace keypoints (each point contains three values: x, y, and visibility confidence score v).

[0051] The candidate boxes from multiple detection branches are merged into the final detection result through the following post-processing steps: Step 1, Confidence Threshold Filtering: Retain candidate boxes with a target confidence score greater than a preset threshold (default 0.5) and filter out background noise and low-confidence predictions.

[0052] Step 2, cross-scale NMS processing: Non-maximum suppression (NMS) is performed on candidate boxes from different detection branches. The IoU suppression threshold is set to 0.45. The highest confidence target box corresponding to each crab body is retained to eliminate overlapping and redundant detections.

[0053] Step 3, Carapace ROI cropping and alignment: Based on the target bounding box preserved by NMS, the corresponding area in the original resolution image is cropped after expanding the margin by 10% to obtain an ROI sub-image containing the complete carapace, and scaled to a fixed size (256×256 pixels) for use in keypoint fine regression.

[0054] Step 4, Posture Legality Verification: Calculate the aspect ratio (w / h) of the target box. If it exceeds the preset reasonable range (set to [0.6, 2.5] in this embodiment), the crab's posture is determined to be seriously abnormal (such as lying on its side or standing upright). The target is marked as abnormal and sent to the review exit, and will not participate in the subsequent body size calculation.

[0055] The system pre-calibrates the camera using a calibration ruler or checkerboard pattern to obtain the conversion relationship between pixel distance and actual millimeter distance. During continuous production, a fixed calibration ruler or standard mark can be set at the edge of the detection field of view as a basis for online verification calibration. For each crab, the YOLO11 recognition and body size measurement module calculates the pixel length CLp and pixel width CWp based on the target bounding box or key point coordinates, and converts them into the actual carapace length CL and carapace width CW. If the target in the image is severely occluded, the crab's tilt angle exceeds the set range, the calibration deviation exceeds the allowable range, or the key point confidence is lower than the threshold, the individual can be marked as abnormal and sent to the verification exit.

[0056] Within the carapace ROI region, the YOLO11 keypoint regression head regresses eight predefined keypoints. The meanings of each keypoint are as follows: KP1 and KP2 are the left and right endpoints of the front edge of the carapace; KP3 and KP4 are the left and right endpoints of the posterior edge of the carapace; KP5 is the foremost vertex of the longitudinal axis of the carapace; KP6 is the last vertex of the longitudinal axis of the carapace; and KP7 and KP8 are the maximum outward protrusions of the left and right lateral edges (used to assist in width correction).

[0057] (1) Sub-pixel refinement: Apply a local heatmap refinement algorithm to the key point coordinates obtained from regression, calculate the mean of Gaussian weights in a 9×9 neighborhood centered on the predicted coordinates, and improve the positioning accuracy from pixel level to sub-pixel level (±0.3 pixel error).

[0058] (2) Visibility filtering of key points: Key points with a visibility confidence score v below 0.4 are marked as invisible and interpolated with symmetrical key point coordinates in subsequent calculations to ensure that a complete geometric description of the carapace can still be obtained in the case of partial occlusion.

[0059] (3) Calculation of carapace length CL: Take the Euclidean distance CLp (pixels) between KP5 and KP6 as the pixel estimate of the carapace length, and then multiply it by the calibration coefficient k (unit mm / px) to obtain the actual carapace length CL=k×CLp.

[0060] (4) Calculation of carapace width CW: Take max (Euclidean distance between KP1 and KP2, Euclidean distance between KP3 and KP4) as the pixel estimate of the carapace width CWp, and multiply it by the calibration coefficient k to get CW=k×CWp, and then verify it by KP7 and KP8.

[0061] (5) Minimum bounding rectangle auxiliary verification: The minimum bounding rectangle is fitted using 8 effective key points. The major axis and minor axis of the rectangle are used as auxiliary estimates of CL and CW. The weighted average of the results calculated directly with the key points is taken (the key point calculation result has a weight of 0.7, and the rectangle fitting result has a weight of 0.3) to reduce the measurement error of the single method when the crab body edge is incomplete.

[0062] In one specific embodiment, the YOLO11-based sex identification method specifically includes: like Figure 6 As shown, after the lower camera captures images of the abdomen, the YOLO11 model detects the abdominal navel region and classifies them as male or female. The abdominal navel region of female crabs is relatively wide, with a nearly circular or semi-circular outline; the abdominal navel region of male crabs is relatively narrow, with a triangular or elongated outline. The model can use either the "abdominal ROI detection + sex classification" method or the "abdominal navel key point detection + rule-based judgment" method, outputting sex as F, M, or undetermined U and the corresponding confidence score.

[0063] In the abdominal umbilicus region detection, the system uses an independently trained abdominal YOLO11 detection head to output the target bounding box of the abdominal umbilicus contour region and four key feature points of the abdominal umbilicus (umbilicus apex, abdominal umbilicus bottom, left edge point, and right edge point) from the abdominal image captured by the lower camera.

[0064] (1) Regression of key points of the abdomen and navel: After subpixel refinement of the coordinates of the four key points of the abdomen and navel, the aspect ratio (width of abdomen and navel / length of abdomen and navel) of the bounding rectangle of the abdomen and navel region is calculated as the morphological feature value R. The R value of female crabs is usually greater than 0.75 (the outline is nearly circular or wide ellipse), while the R value of male crabs is usually less than 0.55 (the outline is triangular or narrow and long).

[0065] (2) Abdominal umbilicus compactness index: Based on the aspect ratio, the outline compactness index C = 4π × area / perimeter² is further calculated using the four key points. The C value for female crabs is usually greater than 0.62, and the C value for male crabs is usually less than 0.52. The interval [0.52, 0.62] is marked as insufficient confidence, and an undetermined U is output and sent to the manual review outlet.

[0066] (3) Dual feature fusion decision: The aspect ratio R and the compactness index C are weighted and fused. The final sex discrimination score is output by using the optimal weights of each stage in the training data (the bean crab option is biased towards the C value, and the adult crab option is biased towards the R value). Combined with the confidence threshold, the results of the three categories F, M or U and the corresponding confidence are output.

[0067] To accommodate different stages of growth in juvenile crabs, adult crabs, and juvenile crabs, the training dataset should include abdominal images under various growth stages, body colors, postures, water content, and background conditions. For samples with low confidence, abdominal occlusion by the foot, unclear abdominal umbilicus boundaries, unclear early sex characteristics, or abnormal individual flipping, the control system outputs an undetermined U or anomaly label and imports it into the anomaly verification output.

[0068] In a specific embodiment, the size classification module determines the body size based on user-defined growth stage, sorting threshold, and confidence threshold. The threshold can be a single threshold, such as a carapace width (CW) greater than or equal to a set value indicating a large size; it can also be a combination of thresholds, such as both carapace length (CL) and carapace width (CW) reaching set values ​​indicating a large size; or it can be a comprehensive index, such as S = aCL + bCW, where a and b are weighting coefficients. Different stages can correspond to different threshold groups, such as a pea crab threshold group, a juvenile crab threshold group, and an adult crab threshold group. For example, in pea crab, juvenile crab, or adult crab modes, a carapace length threshold, a carapace width threshold, or a comprehensive body size index threshold can be set respectively. When CL and / or CW reach the corresponding threshold, it is determined to be a large size; otherwise, it is determined to be a small size. The size classification result is integrated with the sex identification result to form four classification labels: large size for female crabs, small size for female crabs, large size for male crabs, and small size for male crabs. When the sex output is undetermined (U), the recognition confidence is low, or the image is abnormal, an anomaly verification label is formed.

[0069] In one specific embodiment, the sorting module is located at the output end and includes a solenoid valve group, pneumatic fork, swing arm, flap, or sorting gate connected to the controller. The controller determines the output of the sorting label module based on the results, and combines the conveyor belt speed, encoder pulse, and the current position of the crab to control the corresponding sorting gate to open when the target individual arrives and guide it to the corresponding outlet. The fork, gate, or guide that comes into contact with the crab can be provided with a flexible covering layer and the force of action can be limited to below a preset safety threshold.

[0070] The sorting gate is controlled by merging labels based on gender and size. For example... Figure 8 As shown, when the output label is FL, sorting gate A opens, allowing the individual to enter the large-sized female crab exit; when the output label is FS, sorting gate B opens, allowing the individual to enter the small-sized female crab exit; when the output label is ML, sorting gate C opens, allowing the individual to enter the large-sized male crab exit; and when the output label is MS, sorting gate D opens, allowing the individual to enter the small-sized male crab exit. Individuals that fail to be identified, are undetermined (U), have low confidence, or exhibit image abnormalities enter the abnormality verification exit. The sorting gate actions are triggered by the controller based on encoder pulses with a delay to ensure a one-to-one correspondence between the identified and sorted individuals.

[0071] In one specific embodiment, the classification collection and data output module includes four classification collection channels, corresponding to large-sized female crabs, small-sized female crabs, large-sized male crabs, and small-sized male crabs, respectively; and an anomaly verification outlet is provided for manual verification of individuals that are undetermined, have low confidence, are obscured, have turned over, or have incomplete images. The control system receives signals from the upper and lower cameras, photoelectric sensors, and encoders. Each crab is assigned a temporary number at the detection position, and the system records its detection time, carapace image, abdominal image, sex result, carapace length, carapace width, size grade, confidence level, and target sorting exit. Based on the conveyor belt speed and encoder pulses, the controller calculates the time it takes for the individual to reach the corresponding sorting gate and drives the solenoid valve or motor in advance to perform the sorting action; when the sensor detects insufficient spacing between consecutive individuals, the previous cycle gate can be paused or the target for that cycle can be redirected to the verification exit.

[0072] The data terminal displays the current batch quantity, sex ratio, proportion of large-sized animals, proportion of small-sized animals, number of anomaly verifications, and model confidence statistics. This data can be exported as a table for use in aquaculture batch management, breeding selection, and commodity grading and traceability.

[0073] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0074] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A YOLOv11-based dual-dimensional detection and automated sorting system for the sex and body size of the Chinese mitten crab, characterized in that, include: The batch delivery and buffering module buffers and accommodates batches of Chinese mitten crabs before sending them into the multi-size card slots for guidance and alignment. The multi-specification slot guiding and aligning module oriented and aligns Chinese mitten crabs of different sizes, eliminating the stacking and side-by-side obstruction of crab bodies, and then feeds them into the single-crab beat-limiting conveying module. The single-beat limiting and conveying module controls the Chinese mitten crab to enter the carapace image acquisition module and the abdominal image acquisition module in a single, fixed-beat manner. The carapace image acquisition module and the abdomen image acquisition module acquire carapace and abdomen images of the Chinese mitten crab, respectively, and send them to the YOLO11 recognition and body size measurement module. The YOLO11 recognition and body size measurement module, based on the carapace and abdominal images, uses a pre-trained YOLO11 model to identify the sex of the Chinese mitten crab and calculate its body size data. The specification grade determination module determines the classification label of the Chinese mitten crab based on a preset grading threshold and in combination with the body size data and the sex. The sorting module, based on the classification label and in conjunction with the motion data from the single-beat limiting conveying module, sends the Chinese mitten crab into the corresponding collection channel of the classification collection and data output module. The classification, collection, and data output module classifies and collects Chinese mitten crabs of different sizes and sexes, and records the entire process of testing data.

2. The YOLOv11-based dual-dimensional detection and automated sorting system for sex and body size of the Chinese mitten crab as described in claim 1, characterized in that, The multi-specification card slot guiding and alignment module includes: a vibration sorting platform, card slots, guide baffles, and elastic width limiting bars; The slots are replaceable or adjustable in width, and there are at least two slots; the cross-section of the slots is V-shaped, U-shaped or shallow arc-shaped, and the bottom of the slot forms a continuous guide structure with the conveying direction, so that the crab bodies are arranged along the slot direction under the vibration action of the vibration sorting platform and the restriction of the guide baffle. The guide baffle is disposed between the end of each slot and the converging tapered opening; The elastic width-limiting barrier is set above or on both sides of the slot to prevent two crabs from entering the same slot side by side.

3. The YOLOv11-based dual-dimensional detection and automated sorting system for sex and body size of the Chinese mitten crab as described in claim 1, characterized in that, The single-crab beat-limiting conveyor module includes a transparent conveyor belt, an adjustable lateral limiting plate, a front beat gate, a rear isolation gate, a detection stop, and a photoelectric sensor. When the inlet photoelectric sensor detects a Chinese mitten crab entering, the front beat gate opens, allowing one crab to enter the beat zone. Once it is confirmed that there is only one target in the beat zone, the rear isolation gate closes to prevent subsequent individuals from entering. When the target reaches the detection position, a trigger signal is output to control the carapace image acquisition module and the abdominal image acquisition module to take pictures. After the target has finished being photographed, the detection stop opens, and the conveyor belt transports the Chinese mitten crab to the output sorting area. Subsequently, the rear isolation gate and the front beat gate reset, and the detection cycle for the next crab begins.

4. The YOLOv11-based dual-dimensional detection and automated sorting system for sex and body size of the Chinese mitten crab as described in claim 1, characterized in that, The carapace image acquisition module is located above the detection cavity and includes an upper camera, a lens, a ring light, and a light-shielding shell. The upper camera is used to acquire images of the crab's carapace. The abdominal image acquisition module is located below the transparent conveyor belt and includes a lower camera, a lower imaging window, a light source, and a waterproof and stain-proof transparent plate. The lower camera is used to acquire images of the crab's abdomen. The upper camera and the lower camera are triggered synchronously by the same trigger sensor, or triggered separately according to the encoder position signal; The detection cavity employs a light-shielding structure.

5. The YOLOv11-based dual-dimensional detection and automated sorting system for sex and body size of the Chinese mitten crab as described in claim 1, characterized in that, The YOLO11 recognition and body size measurement module incorporates an improved YOLO11 model trained on images of Chinese mitten crabs at the pea crab, juvenile crab, and adult crab stages. Based on the carapace image, the model outputs the crab body target bounding box, carapace key points, and carapace contour. Combining calibration rulers or camera calibration parameters, it converts pixel distances into millimeter distances to obtain the carapace length CL and carapace width CW. Based on the abdominal image, the model outputs the abdominal navel region target bounding box and classification results, determining whether the individual is a female crab (F), a male crab (M), or undetermined (U), and simultaneously outputs the corresponding confidence level.

6. The YOLOv11-based dual-dimensional detection and automated sorting system for sex and body size of the Chinese mitten crab as described in claim 5, is characterized in that... The improvements to the improved YOLO11 model include: A channel-space dual attention mechanism is introduced, and CBAM modules are inserted into the outputs of the last two C2f modules of the backbone network of the standard YOLO11 model. A high-resolution detection branch for small targets has been added, with a new 160×160 resolution detection branch added to the original three detection heads of the standard YOLO11 model. A decoupled detection head design was adopted, which split the detection head into independent classification and regression branches, and the two branches were optimized independently to decouple the gradients. The keypoint regression loss function is improved by replacing the L2 loss of the standard YOLO11 model with the OKS-weighted WingLoss function.

7. The YOLOv11-based dual-dimensional detection and automated sorting system for sex and body size of the Chinese mitten crab as described in claim 1, characterized in that, The specification grade determination module determines the body size specification based on the growth stage, sorting threshold, and confidence threshold set by the user. The specification determination result is integrated with the gender recognition result to form four classification labels: large female crab, small female crab, large male crab, and small male crab. When the gender output is undetermined (U), the recognition confidence is low, or the image is abnormal, an abnormal verification label is formed.

8. The YOLOv11-based dual-dimensional detection and automated sorting system for sex and body size of the Chinese mitten crab as described in claim 1, characterized in that, The sorting module is located at the output end and includes a solenoid valve group, pneumatic fork, swing arm, flap, or sorting gate connected to the controller. The controller determines the sorting gate based on the results output by the classification label module and, in conjunction with the conveyor belt speed, encoder pulse, and the current position of the crab, controls the corresponding sorting gate to open when the target individual arrives, guiding it to the corresponding outlet. The fork, gate, or guide that contacts the crab can be provided with a flexible covering layer, and the force of action is limited to below a preset safety threshold.

9. The YOLOv11-based dual-dimensional detection and automated sorting system for sex and body size of the Chinese mitten crab as described in claim 1, characterized in that, The classification collection and data output module includes four classification collection channels, corresponding to large-sized female crabs, small-sized female crabs, large-sized male crabs, and small-sized male crabs, respectively; and an anomaly verification outlet is set up for manual verification of individuals that are undetermined, have low confidence, are obscured, have turned over, or have incomplete images. The data terminal displays the current batch quantity, male-female ratio, large-size ratio, small-size ratio, number of abnormal reviews, and model confidence statistics.