Methods, systems, equipment, media, and products for nonlinear estimation of underwater crab mass.
By improving the Dfe-Mask Transfiner model and the XGBoost model, the problems of accuracy and cost in underwater mitten crab quality estimation were solved, enabling accurate quality prediction and real-time monitoring, and improving aquaculture efficiency.
Patent Information
- Application Number
- CN202411874194.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-12-19
AI Technical Summary
Existing technologies are insufficient to accurately estimate the quality of underwater mitten crabs. Traditional methods are costly and have low accuracy, which affects crab growth and farming efficiency.
An improved Dfe-Mask Transfiner model was used for crab shell image segmentation, and an XGBoost model was used for nonlinear quality estimation. The length, width, perimeter and RGB color channel mean of the crab shell were obtained through image enhancement and feature extraction. A nonlinear regression model was then constructed for quality prediction.
It enables accurate estimation of underwater crab quality, improves prediction accuracy, reduces costs, and supports real-time monitoring and optimization of feeding strategies during the aquaculture process.
Smart Images

Figure CN119762464B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of aquaculture technology, and in particular to a method, system, equipment, medium and product for nonlinear estimation of the mass of underwater crabs. Background Technology
[0002] The Chinese mitten crab (Eriocheir sinensis), commonly known as the hairy crab, is highly valued for its rich nutrition and high economic worth. In recent years, with the continuous growth of market demand and the expansion of aquaculture scale, the area of crab farming has steadily increased year by year. However, crab farming still faces challenges such as low feeding efficiency and high feed input costs. Furthermore, traditional random feeding methods cannot ensure the even distribution of feed, seriously affecting the cost-effectiveness and work efficiency of farming. Crab quality is a key factor in determining the amount of feed, and regularly obtaining crab quality information is particularly important for optimizing daily feeding management. Therefore, continuous and accurate monitoring of the body size and weight of Chinese mitten crabs at different growth stages is crucial for precise feeding. By accurately estimating crab quality, farmers can adjust their feeding strategies in a timely manner, ensuring that crabs receive sufficient nutrition and a suitable growth environment during their growth period, thereby improving survival rates, accelerating growth rates, and ultimately increasing farming efficiency.
[0003] Currently, in the process of raising Chinese mitten crabs, farmers need to periodically collect small samples for measurement and weighing to determine the amount of feed and monitor their growth. However, this manual method is not only costly and inaccurate, but it can also cause stress in the Chinese mitten crabs, thus affecting their growth. Therefore, there is an urgent need for a low-cost, contactless, high-precision, and highly generalizable method to automate the measurement of Chinese mitten crabs, which is of great significance to the aquaculture industry. However, there is currently a lack of effective assessment research on the mass estimation of underwater crustaceans. The main methods for estimating crab mass are simple data fitting methods and machine learning methods. For example, watershed segmentation technology is used to obtain images of the head and carapace of swimming crabs, and then three features—projected area, carapace length, and carapace width—are extracted. A three-factor regression prediction model for swimming crab mass is established using a support vector machine algorithm optimized by a genetic algorithm to estimate the crab mass. The root mean square error of the model prediction is 5.80g, and the mean absolute percentage error is 2.23%. Although current methods for estimating crab mass can estimate the body mass, they cannot accurately estimate the mass of underwater Chinese mitten crabs. Summary of the Invention
[0004] The purpose of this application is to provide a method, system, device, medium, and product for nonlinear estimation of the mass of underwater crabs, which can accurately estimate the mass of underwater mitten crabs.
[0005] To achieve the above objectives, this application provides the following solution:
[0006] Firstly, this application provides a nonlinear estimation method for the mass of underwater crabs, the nonlinear estimation method for the mass of underwater crabs comprising:
[0007] Acquire the image to be processed; the image to be processed is an image of a single crab whose mass is to be estimated;
[0008] The image to be processed is color corrected to obtain a color-corrected image;
[0009] The image to be processed is subjected to low-light enhancement to obtain an enhanced image;
[0010] The enhanced illumination image and the color-corrected image are fused pixel by pixel to obtain a fused image;
[0011] The fused image is subjected to white balance and low-light enhancement to obtain the image to be segmented;
[0012] The Dfe-Mask Transfiner model is used to perform instance segmentation on the image to be segmented, resulting in a crab shell image. The Dfe-Mask Transfiner model is an improvement upon the Mask Transfiner model. The improvements to the Mask Transfiner model include: first, adding a deformable large kernel attention mechanism module to the backbone network of the Mask Transfiner model; second, modifying the input and output of the FPN in the FPN feature fusion process, fusing the P5 output features (downsampled by the FPN) with the P4 downsampled output features as the input features for P4 upsampling; fusing the P4 output features (downsampled by the FPN) with the P3 downsampled output features as the input features for P3 upsampling; and finally, adding an EMA attention mechanism to the downsampled P5 output layer of the FPN feature fusion layer and a deformable large kernel attention mechanism to the downsampled P6 output layer of the FPN feature fusion layer.
[0013] Crab features are obtained from the crab shell image; the crab features include the length of the crab shell, the width of the crab shell, the circumference of the crab shell, and the average value of the three RGB color channels of the RGB image of the crab shell.
[0014] The crab features are input into the trained XGBoost model to obtain the crab quality output by the trained XGBoost model; the trained XGBoost model is trained using multiple crab feature samples and the crab quality corresponding to each crab feature sample.
[0015] Optionally, before acquiring the image to be processed, the underwater crab mass nonlinear estimation method further includes:
[0016] Acquire underwater video of a crab's back, captured by an image acquisition device;
[0017] One image is extracted per second from the video of the underwater crab's back, resulting in multiple images of the underwater crab;
[0018] An image of each crab whose mass is to be estimated is obtained from multiple images of the underwater crabs described;
[0019] The image to be processed is obtained from the image of each crab whose mass is to be estimated.
[0020] Optionally, the image to be processed is subjected to low-light enhancement to obtain an enhanced image, specifically including:
[0021] The image to be processed is enhanced under low light conditions by using adaptive histogram equalization with limited contrast, resulting in an enhanced image.
[0022] Optionally, the fused image is subjected to white balance and low-light enhancement to obtain the image to be segmented, specifically including:
[0023] The fused image is subjected to white balance and low-light enhancement based on contrast-limited adaptive histogram equalization to obtain the image to be segmented.
[0024] Optionally, crab features are obtained from the crab shell image, specifically including:
[0025] The crab shell image is binarized to obtain a binary image of the crab shell;
[0026] The minimum circumscribed ellipse of the crab shell is obtained from the binary graph of the crab shell.
[0027] Based on the smallest circumscribed ellipse of the crab shell, using the pixel size as a reference, calculate the length of the crab shell using the major axis of the ellipse, calculate the width of the crab shell using the minor axis of the ellipse, and calculate the perimeter of the crab shell using the length of the pixels surrounding the crab shell.
[0028] The average values of the three RGB color channels of the RGB image of the crab shell are obtained from the crab shell image.
[0029] Optionally, the crab feature samples include the length, width, and circumference of the shell of a single crab of known mass, as well as the average of the three RGB color channels of the RGB image of the shell.
[0030] Secondly, this application provides an underwater crab mass nonlinear estimation system, the underwater crab mass nonlinear estimation system comprising:
[0031] The image acquisition module is used to acquire the image to be processed; the image to be processed is an image of a single crab whose mass is to be estimated.
[0032] The color correction module is used to perform color correction on the image to be processed to obtain a color-corrected image;
[0033] The low-light enhancement module is used to enhance the low-light performance of the image to be processed, thereby obtaining an enhanced image.
[0034] A pixel fusion module is used to fuse the illumination enhancement image and the color correction image at the pixel level to obtain a fused image.
[0035] A white balance and low-light enhancement module is used to perform white balance and low-light enhancement on the fused image to obtain the image to be segmented;
[0036] The instance segmentation module is used to perform instance segmentation on the image to be segmented using the Dfe-Mask Transfiner model to obtain a crab shell image. The Dfe-Mask Transfiner model is an improved version of the Mask Transfiner model. The improvements to the Mask Transfiner model include: first, adding a deformable large kernel attention mechanism module to the backbone network of the Mask Transfiner model; then, modifying the input and output of the FPN in the FPN feature fusion process, fusing the P5 output features (downsampled by the FPN) with the P4 output features (downsampled by the FPN) as the input features for P4 upsampling; fusing the P4 output features (downsampled by the FPN) with the P3 output features (downsampled by the FPN) as the input features for P3 upsampling; finally, adding an EMA attention mechanism to the downsampled P5 output layer of the FPN feature fusion layer, and adding a deformable large kernel attention mechanism to the downsampled P6 output layer of the FPN feature fusion layer.
[0037] The crab feature extraction module is used to obtain crab features based on the crab shell image; the crab features include the length of the crab shell, the width of the crab shell, the circumference of the crab shell, and the average value of the three RGB color channels of the RGB image of the crab shell.
[0038] The crab quality estimation module is used to input the crab features into a trained XGBoost model to obtain the crab quality output by the trained XGBoost model; the trained XGBoost model is trained using multiple crab feature samples and the crab quality corresponding to each crab feature sample.
[0039] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the underwater crab mass nonlinear estimation method described in any one of the above.
[0040] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the underwater crab mass nonlinear estimation method described above.
[0041] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the underwater crab mass nonlinear estimation method described above.
[0042] According to the specific embodiments provided in this application, this application has the following technical effects:
[0043] This application provides a nonlinear estimation method, system, device, medium, and product for underwater crab quality. By performing color correction and low-light enhancement on images of a single crab whose quality is to be estimated, and then fusing the enhanced and color-corrected images at their pixels, followed by white balance and low-light enhancement on the fused image, a clearer outline of the underwater crab can be obtained. The Mask Transfiner model is applied to crab segmentation for the first time, and an improved version, the Dfe-Mask Transfiner model, is obtained. This model enables fine-grained segmentation of the crab shell, and more accurate crab features (i.e., the length, width, and perimeter of the shell, and the average of the three RGB color channels in the RGB image) are obtained from the precisely segmented shell image. Furthermore, the XGBoost nonlinear model is applied to underwater crab quality estimation for the first time. The XGBoost model better captures and expresses the relationship between crab features and crab quality, improving the accuracy of quality prediction and ultimately achieving accurate estimation of the quality of underwater mitten crabs. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 A flowchart illustrating a nonlinear estimation method for the mass of an underwater crab provided in an embodiment of this application;
[0046] Figure 2 A flowchart illustrating a nonlinear quality estimation method for underwater crabs based on fine segmentation, provided as an embodiment of this application;
[0047] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0048] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0049] The purpose of this application is to provide a method, system, device, medium, and product for nonlinear estimation of the mass of underwater crabs, which can accurately estimate the mass of underwater mitten crabs.
[0050] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] like Figure 1 As shown, this application provides a nonlinear estimation method for the mass of underwater crabs, comprising:
[0052] Step 101: Obtain the image to be processed; the image to be processed is an image of a single crab whose mass needs to be estimated.
[0053] The preceding steps 101 also include:
[0054] Acquire underwater crab back view video captured by image acquisition equipment.
[0055] One image is extracted per second from the video of the underwater crab's back, resulting in multiple images of the underwater crab.
[0056] An image of each crab whose mass is to be estimated is obtained from multiple underwater crab images.
[0057] The image to be processed is obtained from the image of each crab whose mass is to be estimated.
[0058] Step 102: Perform color correction on the image to be processed to obtain a color-corrected image.
[0059] Step 103: Perform low-light enhancement on the image to be processed to obtain an enhanced image.
[0060] Step 103 specifically includes:
[0061] A low-light enhancement image is obtained by using adaptive histogram equalization with limited contrast to enhance the image under low light conditions.
[0062] Step 104: Blend the pixels of the illumination enhancement image and the color correction image to obtain a fused image.
[0063] Step 105: Perform white balance and low-light enhancement on the fused image to obtain the image to be segmented.
[0064] Step 105 specifically includes:
[0065] The image to be segmented is obtained by performing white balance and low-light enhancement based on contrast-limited adaptive histogram equalization on the fused image.
[0066] Step 106: Use the Dfe-Mask Transfiner model to perform instance segmentation on the image to be segmented to obtain the crab shell image. The Dfe-Mask Transfiner model is an improvement on the Mask Transfiner model. The improvements to the Mask Transfiner model include: First, adding a deformable large kernel attention mechanism module to the backbone network of the Mask Transfiner model. Then, in the FPN feature fusion, modifying the input and output of FPN, fusing the P5 output features downsampled by FPN with the output features downsampled by P4 and using them as the input features for P4 upsampling. Fusing the P4 output features downsampled by FPN with the output features downsampled by P3 and using them as the input features for P3 upsampling. Finally, adding an EMA attention mechanism to the downsampled P5 output layer of the FPN feature fusion layer and adding a deformable large kernel attention mechanism to the downsampled P6 output layer of the FPN feature fusion layer.
[0067] Step 107: Obtain crab features from the crab shell image; crab features include the length, width, circumference of the crab shell, and the average of the three RGB color channels of the RGB image of the crab shell.
[0068] Step 107 specifically includes:
[0069] Binarize the crab shell image to obtain a binary image of the crab shell.
[0070] The minimum circumscribed ellipse of the crab shell is obtained from the binary graph of the crab shell.
[0071] Based on the smallest circumscribed ellipse of the crab shell, using the pixel size as a reference, calculate the length of the crab shell using the major axis of the ellipse, calculate the width of the crab shell using the minor axis of the ellipse, and calculate the perimeter of the crab shell using the length of the pixels surrounding the crab shell.
[0072] The average values of the three RGB color channels of the crab shell's RGB image are obtained from the crab shell image.
[0073] Step 108: Input the crab features into the trained XGBoost model to obtain the crab quality output by the trained XGBoost model; the trained XGBoost model is trained using multiple crab feature samples and the crab quality corresponding to each crab feature sample.
[0074] In step 108, the crab feature samples include the length, width, and circumference of the shell of a single crab of known mass, as well as the mean values of the three RGB color channels of the RGB image of the shell.
[0075] The technical solution of this application is illustrated below with a specific embodiment:
[0076] This application provides a nonlinear estimation method for underwater crab mass based on fine segmentation (i.e., a nonlinear estimation method for underwater crab mass based on fine segmentation), such as... Figure 2 As shown, the underwater crab mass nonlinear estimation method provided in this application includes:
[0077] S1: Acquire underwater crab shell video frames to be processed.
[0078] Video images of underwater crabs can be acquired using image acquisition devices (e.g., cameras), but before video acquisition, the camera needs to be calibrated using a calibration board.
[0079] S2: Extract images from the video, one image per second (camera shooting speed is 30 frames per second).
[0080] S3: Perform color correction on the image to obtain a crab image with less color variation.
[0081] Color correction is used to fix problems such as color cast, color temperature, and contrast in underwater crab images, thereby improving the visual effect and color accuracy of underwater crab images.
[0082] S4: Perform low-light enhancement on the image to obtain an underwater image with less noise and stronger contrast.
[0083] In practical implementation, the CLAHE histogram equalization algorithm can be used for low-light enhancement to solve the global problem of image quality, background noise enhancement problem, improve contrast and suppress noise.
[0084] S5: The color-corrected image and the underwater enhanced image are fused to obtain a clear and color-corrected image.
[0085] In practical implementation, pixel-based image fusion can be used, which involves adding or subtracting corresponding image pixels to obtain a clearer image.
[0086] S6: Perform white balance and low-light enhancement on the fused image to obtain an enhanced image that is more favorable to the computer.
[0087] In practice, white balance and low-light enhancement can be used to eliminate or reduce color cast in underwater images so that the image colors are not distorted as much as possible and the colors are restored to normal.
[0088] S7: Perform fine segmentation on the enhanced image to obtain a more comprehensive image of crab shell features (i.e., crab features).
[0089] The precise segmentation model for the underwater crab specifically includes:
[0090] Crab quality estimation requires consideration of both the accuracy of external feature segmentation and the refinement of edge segmentation. The specific structure of the Dfe-Mask Transfiner crab refinement instance segmentation model is as follows:
[0091] The Dfe-Mask Transfiner refined instance segmentation model for crabs is an improvement upon the MaskTransfiner model. First, a Deformable LargeKernelAttention (D-LKANet) attention mechanism module is added to the Mask Transfiner backbone to facilitate preprocessing of the input image, achieving refined calculation of image contour features through pixel-level computation. Then, in the FPN feature fusion, the input and output of the FPN are modified. The P5 output features (i.e., the output of the FPN, improving the original feature fusion with the FPN) are fused again with the P4 downsampled output features, and used as the input features for P4 upsampling (i.e., the input for the first upsampling, i.e., the output layer of P4 performing the upsampling operation). The P4 output features (downsampled by the FPN) are then fused again with the P3 downsampled output features, and used as the input features for P3 upsampling (i.e., the input of the FPN), ultimately achieving more accurate feature pixel-level calculation. Finally, an EMA attention mechanism was added to the downsampling P5 output layer of the FPN feature fusion layer (i.e., the output layer P5 of the fourth downsampling) to capture pixel-level pairwise relationships, and a D-LKANet attention mechanism was added to the downsampling P6 output layer of the FPN feature fusion layer to improve the model's segmentation accuracy for irregularly shaped objects or features.
[0092] In the task of fine-grained segmentation of crabs, the accuracy of edge segmentation requires clearer pixel-level features. To enable the model to generate better pixel-level high-level feature maps after feature fusion, this application utilizes an efficient multi-scale attention module (EMA) that learns across spatial spaces (i.e., adding an EMA attention mechanism to the P5 output layer downsampled by the FPN feature fusion layer). The efficient multi-scale attention module (EMA) that learns across spatial spaces not only preserves information in each channel but also reduces the side effects of modeling across channels on the extraction of deep visual representations.
[0093] EMA reshapes some channels into batch dimensions and groups the channel dimensions into multiple sub-features, ensuring a uniform distribution of spatial semantic features within each feature group. Specifically, for any given input feature map, EMA divides the input feature (X) into G sub-feature groups, each learning a different semantic meaning. This grouping not only enhances feature learning in semantic regions but also compresses noise. EMA employs three parallel paths to extract attention weight descriptors for the grouped feature maps. Two paths are 1x1 branches, and the third is a 3x3 branch. The 1x1 branch uses one-dimensional global average pooling to encode channel information in two spatial directions. The 3x3 branch captures multi-scale feature representations through 3x3 convolutions. In this way, EMA can not only encode cross-channel information to adjust the importance of different channels but also preserve precise spatial structure information within the channels.
[0094] Because the features of a crab's carapace (shell) and claws are extremely similar in color, texture, or the texture, color, or surrounding area of an object, other features can affect the accuracy of carapace segmentation when only the carapace is segmented. Therefore, to accurately segment the complete carapace, this application adds D-LKA Net to the model's backbone and adds D-LKA Net to the downsampled P6 output layer after FPN feature fusion (i.e., adding D-LKA Net to the ResNet in the backbone and adding D-LKA Net after the downsampled P6 output layer after FPN feature fusion). D-LKA uses large convolutional kernels to fully utilize contextual information. This "complete contextual information" improves the model's ability to understand and interpret images by combining global and local information.
[0095] The D-LKA Attention model benefits from deformable convolutions, which flexibly deform the sampling grid, enabling the model to adapt to diverse data patterns and enhancing its ability to represent deformed segmentation targets. Furthermore, D-LKA enhances the model's adaptability to geometric changes by introducing learnable offsets, allowing the network to better handle irregularly shaped objects or features. Specifically, D-LKA uses two variants of MaxViT and deformable LKA layers, which effectively extract features and achieve finer, superior segmentation.
[0096] S8: Based on the segmented image, obtain the binary image of the crab shell, and then use the binary image to extract the features of the crab, mainly extracting the width, length, perimeter of the carapace, and the mean of the RGB color channels of the carapace.
[0097] S9: Construct feature values from information such as carapace width, carapace length, carapace circumference, and the mean of the RGB color channels of the carapace to obtain multi-feature information for crab quality estimation.
[0098] In the specific implementation, the length, width, and perimeter of the crab shell are calculated using the smallest circumscribed ellipse of the crab shell, with the pixel size as the label. The perimeter is the length of the pixels around the crab shell. Finally, the length, width, and perimeter of the crab shell are obtained. Based on the segmented image of the crab shell, the three means of the RGB color channels are extracted using Python programming to obtain color information. Finally, the mean information of the three RGB color channels is obtained and written to a TXT file to construct a nonlinear estimation file of crab features and crab mass (i.e., crab weight).
[0099] S10: Use multi-feature TXT files to train the XGBoost mass estimation model to achieve accurate mass estimation of underwater mitten crabs.
[0100] The underwater nonlinear mass estimation model specifically includes:
[0101] Different morphological and color features have varying correlations with quality; therefore, linear correlation cannot be directly used to predict crab quality when estimating the quality of different crabs. To address quality estimation under multi-feature conditions, this application utilizes eXtreme GradientBoosting (XGBoost) to construct a multi-feature quality estimation regression model. XGBoost is an improvement on Gradient Boosting Decision Trees (GBDT), achieving excellent data fitting results by combining basis functions and weights. Unlike traditional GBDT, XGBoost introduces a regularization term in the loss function, thereby enhancing the robustness of model training. By combining basis functions and weights, XGBoost can more accurately handle complex data relationships, thus improving the model's generalization ability and robustness, and contributing to multiple fields such as soil, hydrology, and atmosphere. Therefore, this application uses the XGBoost algorithm to predict crab quality, achieving multi-feature quality estimation for mitten crabs. The XGBoost algorithm quality prediction model is shown below:
[0102]
[0103] Where, y′ i x is the final predicted value of the model. i Let K be the input feature vector of the sample, K be the number of decision trees, and f be the input feature vector of the sample. k Let F be the k-fold training function, and let F be the set of all decision trees, i.e., F is f k The set of all decision trees; f k (x i y' is the predicted value of the k-th tree for sample i, where k∈[1,K]. The predicted value y' is the result of the t-th round model. i(t) Let y' be the predicted value of the model in round t-1. i(t-1) Add new tree f k (x i )get:
[0104] y′ i(t) =f k (x i )+y′ i(t-1) ;
[0105] To prevent overfitting, a regularization term is introduced into the XGBoost loss function to control model complexity and reduce model variance. This application ultimately uses the XGBoost mass estimation algorithm to accurately predict the weight (mass) of underwater crabs.
[0106] This application relates to the field of underwater crab image segmentation and nonlinear quality estimation models. It provides a nonlinear quality estimation method for underwater crabs based on fine segmentation, comprising: acquiring a top-view video of the underwater crab; obtaining clearer crab image data using a low-light enhancement algorithm; then using an improved fine segmentation algorithm (Dfe-MaskTransfiner) to accurately segment the crab's carapace; extracting the carapace size and color information based on the segmentation; constructing a multi-feature quality estimate using the length, width, perimeter, and RGB color mean of the carapace; and training a nonlinear XGBoost model based on these multi-features to achieve real-time estimation of the underwater crab's quality. This application, through low-light image enhancement, ensures the acquisition of clearer outlines of pond-dwelling underwater crabs; accurately extracts carapace information based on the fine segmentation model; and constructs the relationship between carapace features and quality using a nonlinear regression model. The nonlinear model can better capture and express these complex interactions, thereby improving prediction accuracy. This application allows farmers to monitor and understand changes in the quality of underwater crabs in real time, providing scientific guidance for optimizing daily feeding amounts, controlling stocking density, and ultimately determining the optimal harvest time.
[0107] In short, the nonlinear estimation method for underwater crab mass based on fine segmentation in this application includes:
[0108] A video image of an underwater crab shell is acquired, and the video image (i.e., the acquired video) is enhanced under low light conditions to obtain a clearer video image.
[0109] Color correction is performed on the video image to reduce the impact of low light on the color channels of the crab shell.
[0110] The illumination-enhanced image and the color-corrected image are fused pixel by pixel to obtain a first fused image.
[0111] The first fused image is subjected to white balance and CLAHE low-light enhancement to obtain an enhanced image with higher resolution and color correction.
[0112] Accurate segmentation of underwater crab shells is achieved using an improved segmentation network to enhance images (image segmentation is performed directly after white balance and CLAHE low-light enhancement).
[0113] The Dfe-MaskTransfiner algorithm is used to obtain a precise segmented image of the crab shell. The crab shell image is then binarized to obtain a binary image of the crab shell. The feature processing of the crab shell image is implemented using the Python programming language to extract the size and color information of the crab shell.
[0114] Based on the size and color information of the crab shell, the length and width are calculated using the smallest circumscribed ellipse of the crab shell, with the pixel size as the label, and the major and minor axes of the ellipse are used. The perimeter is the length of the pixels around the crab shell. Finally, the length, width, and perimeter information of the crab shell are obtained. Based on the segmented image of the crab shell, the three mean values of the RGB color channels are extracted using Python programming to obtain the color information. Finally, the mean values of the three RGB color channels are obtained.
[0115] Underwater nonlinear mass estimation is performed based on multi-information features.
[0116] This application utilizes low-light enhancement technology to acquire high-quality images of underwater crabs. Then, by incorporating an attention module and a novel Functional Partial Network (FPN) into the segmentation network, the segmentation accuracy of the crab carapace is improved, achieving refined carapace segmentation. The segmented carapace images are then used to obtain information on the length, width, perimeter, and RGB color channels of the crab carapace. Multi-information features are used to estimate the quality, and an XGBoost nonlinear regression model is employed to predict the crab's quality. This crab quality estimation method enables real-time, accurate quality estimation and monitoring of underwater crabs, providing effective technical support for real-time monitoring and scientific feeding in crab farming.
[0117] This application focuses on the shape features of crab shells, as quality estimation requires accurate crab shell feature segmentation. Due to the complex texture, similar colors, and strong reflectivity of crab shells, achieving high-precision segmentation is a challenge, especially in applications such as automated aquaculture, quality inspection, and biometric research. Traditional image processing methods, including edge detection, thresholding, and region growing, rely on low-level image features (such as color, texture, and edges) and use mathematical models for segmentation. However, for complex textures and shapes like crab shells, accuracy is low, and these methods are easily affected by factors such as lighting changes and background interference. In recent years, with the development of deep learning, especially the success of convolutional neural networks (CNNs) in image segmentation, many studies have begun to use deep learning methods for crab shell segmentation, such as coarse-to-fine segmentation of underwater crabs. Although this has achieved high accuracy in instance segmentation and good results, the mask remains relatively coarse. The problem of fine-grained and accurate segmentation of crab shells is a significant challenge in the fields of computer vision and image processing. Therefore, in order to obtain a segmented image of the crab shell and a clear crab shell instance mask from the segmented image (obtaining a clear crab shell instance mask requires using the segmented image, specifically by removing the background from the segmented image and the original image to obtain the instance segmentation mask image), this application is the first to apply Mask Transfiner to crab segmentation, proposing a Dfe-Mask Transfiner-based segmentation model. Simultaneously, it is the first to utilize a nonlinear model combined with multiple features for underwater crab quality estimation. This application uses an XGBoost regression model to fit the multi-feature data, establishing a nonlinear regression quality estimation model for live underwater crabs, achieving accurate quality estimation of underwater mitten crabs. This monitoring method is economical, remotely operable, contactless, and highly accurate, and it has become a trend for non-destructive testing of aquatic organism characteristics in aquaculture environments.
[0118] Based on the same inventive concept, this application also provides an underwater crab mass nonlinear estimation system for implementing the aforementioned underwater crab mass nonlinear estimation method. The solution provided by this system is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more underwater crab mass nonlinear estimation system embodiments provided below can be found in the limitations of the underwater crab mass nonlinear estimation method described above, and will not be repeated here.
[0119] In an exemplary embodiment, an underwater crab mass nonlinear estimation system is provided, which is an underwater crab mass nonlinear estimation system based on fine segmentation (i.e., an underwater crab nonlinear mass estimation system based on fine segmentation), comprising:
[0120] The image acquisition module is used to acquire the image to be processed; the image to be processed is an image of a single crab whose mass needs to be estimated.
[0121] The color correction module is used to perform color correction on the image to be processed, resulting in a color-corrected image.
[0122] The low-light enhancement module is used to enhance the low-light performance of the image to be processed, resulting in an enhanced image.
[0123] The pixel fusion module is used to fuse the pixels of the illumination-enhanced image and the color-corrected image to obtain a fused image.
[0124] The white balance and low-light enhancement module is used to perform white balance and low-light enhancement on the fused image to obtain the image to be segmented.
[0125] The instance segmentation module is used to segment the image to be segmented using the Dfe-Mask Transfiner model to obtain the crab shell image. The Dfe-Mask Transfiner model is an improvement on the Mask Transfiner model. The improvements to the Mask Transfiner model include: first, adding a deformable large kernel attention mechanism module to the backbone network of the Mask Transfiner model; then, in the FPN feature fusion, modifying the input and output of FPN, fusing the P5 output features downsampled by FPN with the output features downsampled by P4 and using them as the input features for P4 upsampling; and fusing the P4 output features downsampled by FPN with the output features downsampled by P3 and using them as the input features for P3 upsampling; finally, adding an EMA attention mechanism to the downsampled P5 output layer of the FPN feature fusion layer, and adding a deformable large kernel attention mechanism to the downsampled P6 output layer of the FPN feature fusion layer.
[0126] The crab feature extraction module is used to obtain crab features from the crab shell image. The crab features include the length, width, and circumference of the crab shell, as well as the average value of the three RGB color channels of the RGB image of the crab shell.
[0127] The crab quality estimation module is used to input crab features into the trained XGBoost model and obtain the crab quality output by the trained XGBoost model. The trained XGBoost model is trained using multiple crab feature samples and the crab quality corresponding to each crab feature sample.
[0128] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 3As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores non-linear estimation data of underwater crab mass. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When the computer program is executed by the processor, it implements a non-linear estimation method for underwater crab mass.
[0129] Those skilled in the art will understand that Figure 3 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0130] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0131] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0133] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0134] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0135] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A nonlinear estimation method for the mass of underwater crabs, characterized in that, The underwater crab mass nonlinear estimation method includes: Acquire the image to be processed; the image to be processed is an image of a single crab whose mass is to be estimated; The image to be processed is color corrected to obtain a color-corrected image; The image to be processed is subjected to low-light enhancement to obtain an enhanced image; The enhanced illumination image and the color-corrected image are fused pixel by pixel to obtain a fused image; The fused image is subjected to white balance and low-light enhancement to obtain the image to be segmented; The Dfe-Mask Transfiner model is used to perform instance segmentation on the image to be segmented, resulting in a crab shell image. The Dfe-Mask Transfiner model is an improvement upon the Mask Transfiner model. The improvements to the Mask Transfiner model include: first, adding a deformable large kernel attention mechanism module to the backbone network of the Mask Transfiner model; second, modifying the input and output of the FPN in the FPN feature fusion process, fusing the P5 output features (downsampled by the FPN) with the P4 downsampled output features as the input features for P4 upsampling; fusing the P4 output features (downsampled by the FPN) with the P3 downsampled output features as the input features for P3 upsampling; and finally, adding an EMA attention mechanism to the downsampled P5 output layer of the FPN feature fusion layer and a deformable large kernel attention mechanism to the downsampled P6 output layer of the FPN feature fusion layer. Crab features are obtained from the crab shell image; the crab features include the length of the crab shell, the width of the crab shell, the circumference of the crab shell, and the average value of the three RGB color channels of the RGB image of the crab shell. The crab features are input into the trained XGBoost model to obtain the crab quality output by the trained XGBoost model; the trained XGBoost model is trained using multiple crab feature samples and the crab quality corresponding to each crab feature sample.
2. The nonlinear estimation method for underwater crab mass according to claim 1, characterized in that, Before acquiring the image to be processed, the underwater crab mass nonlinear estimation method further includes: Acquire underwater video of a crab's back, captured by an image acquisition device; One image is extracted per second from the video of the underwater crab's back, resulting in multiple images of the underwater crab; An image of each crab whose mass is to be estimated is obtained from multiple images of the underwater crabs described; The image to be processed is obtained from the image of each crab whose mass is to be estimated.
3. The nonlinear estimation method for underwater crab mass according to claim 1, characterized in that, The image to be processed is subjected to low-light enhancement to obtain an enhanced image, specifically including: The image to be processed is enhanced under low light conditions by using adaptive histogram equalization with limited contrast, resulting in an enhanced image.
4. The nonlinear estimation method for underwater crab mass according to claim 1, characterized in that, The fused image is subjected to white balance and low-light enhancement to obtain the image to be segmented, specifically including: The fused image is subjected to white balance and low-light enhancement based on contrast-limited adaptive histogram equalization to obtain the image to be segmented.
5. The nonlinear estimation method for underwater crab mass according to claim 1, characterized in that, The crab features are obtained from the crab shell image, specifically including: The crab shell image is binarized to obtain a binary image of the crab shell; The minimum circumscribed ellipse of the crab shell is obtained from the binary graph of the crab shell. Based on the smallest circumscribed ellipse of the crab shell, using the pixel size as a reference, calculate the length of the crab shell using the major axis of the ellipse, calculate the width of the crab shell using the minor axis of the ellipse, and calculate the perimeter of the crab shell using the length of the pixels surrounding the crab shell. The average values of the three RGB color channels of the RGB image of the crab shell are obtained from the crab shell image.
6. The nonlinear estimation method for underwater crab mass according to claim 1, characterized in that, The crab feature samples include the length, width, and circumference of the shell of a single crab of known mass, as well as the average values of the three RGB color channels of the RGB image of the shell.
7. A nonlinear estimation system for the mass of underwater crabs, characterized in that, The underwater crab mass nonlinear estimation system includes: The image acquisition module is used to acquire the image to be processed; the image to be processed is an image of a single crab whose mass is to be estimated. The color correction module is used to perform color correction on the image to be processed to obtain a color-corrected image; The low-light enhancement module is used to enhance the low-light performance of the image to be processed, thereby obtaining an enhanced image. A pixel fusion module is used to fuse the illumination enhancement image and the color correction image at the pixel level to obtain a fused image; The white balance and low light enhancement module is used to perform white balance and low light enhancement on the fused image to obtain the image to be segmented; The instance segmentation module is used to perform instance segmentation on the image to be segmented using the Dfe-Mask Transfiner model to obtain a crab shell image. The Dfe-Mask Transfiner model is an improved version of the Mask Transfiner model. The improvements to the Mask Transfiner model include: first, adding a deformable large kernel attention mechanism module to the backbone network of the Mask Transfiner model; then, modifying the input and output of the FPN in the FPN feature fusion process, fusing the P5 output features (downsampled by the FPN) with the P4 output features (downsampled by the FPN) as the input features for P4 upsampling; fusing the P4 output features (downsampled by the FPN) with the P3 output features (downsampled by the FPN) as the input features for P3 upsampling; finally, adding an EMA attention mechanism to the downsampled P5 output layer of the FPN feature fusion layer, and adding a deformable large kernel attention mechanism to the downsampled P6 output layer of the FPN feature fusion layer. The crab feature extraction module is used to obtain crab features based on the crab shell image; the crab features include the length of the crab shell, the width of the crab shell, the circumference of the crab shell, and the average value of the three RGB color channels of the RGB image of the crab shell. The crab quality estimation module is used to input the crab features into a trained XGBoost model to obtain the crab quality output by the trained XGBoost model; the trained XGBoost model is trained using multiple crab feature samples and the crab quality corresponding to each crab feature sample.
8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the underwater crab mass nonlinear estimation method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the nonlinear estimation method for the mass of underwater crabs as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the nonlinear estimation method for the mass of underwater crabs as described in any one of claims 1-6.
Citation Information
Patent Citations
Eriocheir sinensis quality estimation method based on unmanned aerial vehicle image processing
CN112417378A
Image instance segmentation method based on enhanced one-time aggregation network
CN117422876A