Animal weight estimation method and system based on quality-aware dual-branch network

By using a quality-aware dual-branch network to filter high-quality frames and perform feature fusion, the problem of unstable frame image quality in livestock weight estimation is solved, and efficient and accurate weight prediction is achieved.

CN121095985BActive Publication Date: 2026-02-27HUAZHONG AGRI UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511639257.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-02-27
Estimated Expiration
2045-11-11

AI Technical Summary

Technical Problem

Existing technologies for livestock weight estimation suffer from instability and computational redundancy due to variations in lighting, occlusion interference, and differences in body posture. In particular, it is difficult to efficiently select the best observation frame and extract stable features from video data.

Method used

A quality-aware dual-branch network is adopted. Animal back images are obtained through the Mask RCNN segmentation model. The ResNet-34 network and the quality-aware dual-branch network are combined to learn weight and image quality features. The quality-guided feature fusion module and the weighted fusion module are used to score frame image quality and predict weight.

Benefits of technology

It significantly improves the accuracy and robustness of animal weight prediction, reduces computational requirements, and improves weight estimation efficiency and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121095985B_ABST
    Figure CN121095985B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of animal weight estimation method and system based on quality perception double-branch network.The method first extracts animal back area image by segmentation model, then generates the convolution feature map of body length and body width, and predicts its value, then calculates image quality score by regression coefficient method in combination with label data.Subsequently, back image is converted into convolution feature map, input into quality perception double-branch network, and the features of body weight and quality score are learned respectively.The feature maps output by two branches are merged into single-frame fusion feature map by quality-guided feature fusion module, then the body weight and quality score are predicted by passing through fully connected layer, and are constrained using L1 loss function.Finally, the final weight estimation value is output by integrating multiple frame prediction results through weighted fusion module.The present application can automatically filter high-quality video frames and extract stable morphological features, while ensuring computational efficiency, significantly improving the accuracy and stability of animal weight estimation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computer vision, and relates to an animal weight estimation method, system and device, in particular to an animal weight estimation method, system and device based on a quality-aware dual-branch network. BACKGROUND

[0002] In modern large-scale livestock production, accurate measurement of livestock weight is a key link for evaluating growth performance, optimizing feeding management and making breeding decisions. Although the traditional manual contact type weighing method has high precision, it often accompanies operations such as driving and scale operation, which can easily cause stress reaction of livestock, and has high labor intensity and low efficiency in large-scale farms. In order to reduce labor costs and reduce disturbance to livestock, researchers gradually introduce computer vision technology to extract body length, body width, body height and other geometric features by collecting single or multiple static images, and establish a regression model or machine learning algorithm with the above features as input to realize non-contact weight estimation. However, the weight estimation method based on static images is often limited by light changes, shielding interference and livestock body posture differences in actual application, resulting in insufficient stability and generalization ability of the weight estimation result.

[0003] Compared with a static view, a video sequence can continuously record multiple images of livestock during the running process in the channel, which provides a natural advantage for capturing the best observation angle and eliminating incidental noise. However, directly using all video frames for weight estimation not only has large amount of calculation, but also has low-quality frames such as motion blur, background interference and incomplete target in the video. If these frames are not distinguished and involved in feature extraction, the final prediction accuracy will be seriously reduced. In addition, how to efficiently and automatically filter out the most representative observation frames from the massive frame data and extract stable and reliable morphological features on this basis has become a core problem for realizing real-time and high-precision livestock weight estimation.

[0004] Therefore, there is an urgent need for a livestock weight estimation scheme that can intelligently evaluate and filter out poor-quality frames, select the best observation frames in the video stream through a multi-index fusion method, then perform fine target segmentation and geometric feature extraction on these high-quality frames, and finally obtain a stable weight prediction value through multi-frame result fusion. This not only can improve the weight estimation accuracy while reducing the calculation redundancy, but also can provide reliable support for dynamic monitoring and big data management of farms, and improve the overall efficiency of the intelligent breeding system. SUMMARY

[0005] In order to solve the above technical problems, the present application provides an animal weight estimation method, system and device based on a quality-aware dual-branch network model.

[0006] The technical scheme adopted by the method of the present application is: an animal weight estimation method based on a quality-aware dual-branch network, characterized by comprising the following steps:

[0007] Step 1: using the pre-trained Mask RCNN segmentation model to segment the animal back region, and obtaining the back image without background;

[0008] Step 2: using the feature extraction network to convert the back image without background into a convolution feature map, and inputting the convolution feature map into the quality-aware double-branch network to learn the features of the body weight and image quality score respectively, and obtaining the body weight feature map and image quality score feature map;

[0009] Step 3: inputting the body weight feature map and image quality score feature map in step 2 into the quality-guided feature fusion module to obtain a single-frame fusion feature map;

[0010] Step 4: processing the single-frame fusion feature map in step 3 through two fully connected layers to obtain the predicted body weight and quality score, and inputting the predicted body weight and quality score into the weighted fusion module to obtain the weighted body weight prediction value.

[0011] As a preferred, in step 2, the feature extraction network is a network obtained by removing the average pooling layer and the fully connected layer from the ResNet-34 network.

[0012] As a preferred, in step 2, the quality-aware double-branch network is composed of a body weight feature extraction module, a body weight feature weighted fusion module, a plurality of quality-aware spatial attention modules and quality-aware channel attention modules.

[0013] The body weight feature extraction module performs Softmax processing on the convolution feature map obtained through the feature extraction network along the horizontal direction and the vertical direction respectively to obtain two coordinate normalized coordinate feature maps, and after the convolution feature map and the two coordinate normalized coordinate feature maps are spliced along the channel dimension, a spatial position information fusion feature map is obtained through a coordinate convolution block composed of F3N64, BatchNorm and PReLU, and after the spatial position information fusion feature map is processed through F3N64P1, F3N64P2, F3N64P4 and F3N64P8 respectively, it is spliced in the channel dimension and fused into a context enhancement feature map through F1N64.

[0014] The body weight feature weighted fusion module performs global average pooling and global maximum pooling on the context enhancement feature map in the spatial dimension respectively, splices them in the channel dimension, inputs them into F1N512 to obtain a weight score feature map, and then multiplies the weight score feature map with the context enhancement feature map obtained by the body weight feature extraction module channel by channel to obtain the body weight feature map.

[0015] The quality-aware spatial attention module will obtain the convolution feature map through the feature extraction network, extract horizontal and vertical gradients through F5N64 and F7N64 respectively to obtain horizontal feature map and vertical feature map, accumulate in the channel dimension to form a single-channel feature map, then sequentially process the single-channel feature map through F3N256, F3N1, and generate spatial attention weights through Sigmoid activation, and obtain the quality-aware spatial attention weight map by element-wise multiplication of the convolution feature map and the spatial attention weight map.

[0016] The quality-aware channel attention module will extract features through a F3N64G3 DW convolution and ReLU on the quality-aware spatial attention weight map, then mix the channel information through a F1N64 PW convolution layer, then perform global average pooling, then sequentially process through F1N256, F1N512, and then normalize along the channel dimension through Softmax, and then multiply the image quality score feature map by the quality-aware spatial attention weight map channel by channel.

[0017] As a preferred, in step 3, the quality-guided feature fusion module, the input image quality score feature map and the body weight feature map are spliced in the channel dimension through a splicing layer, then sequentially processed through F3N256, F5N1024, F3N2048, and then obtained a single-frame fusion feature map through a batch normalization layer and a ReLu activation function layer.

[0018] As a preferred, in step 4, the weighted fusion module, the input several single-frame fusion feature maps are processed through global average pooling, and then the predicted body weight value and the quality score are obtained through two fully connected layers, respectively. Several quality scores are processed through a Softmax activation function to obtain normalized weight scores, and then the weighted body weight prediction value is obtained by multiplying the predicted body weight value and the corresponding normalized weight score and then accumulating.

[0019] As a preferred, the feature extraction network and the quality-aware double-branch network are trained networks;

[0020] The training process includes the following sub-steps:

[0021] (1) Prepare the training data set;

[0022] Obtain several animal back region images, and obtain animal body length and body width data labels through manual measurement; use a pre-trained Mask RCNN segmentation model to segment the animal back region to obtain back images without background;

[0023] (2) Convert the back image without background into a body length convolution feature map and a body width convolution feature map, and process the predicted body length and body width values through a fully connected layer, respectively;

[0024] (3) The predicted body length and body width values are matched with the corresponding artificial measured body length and body width data labels to obtain image quality score labels by a regression coefficient method;

[0025] (4) The back images without background are converted into convolution feature maps by a feature extraction network, and the convolution feature maps are input into a quality-aware double-branch network to learn the features of body weight and image quality score respectively, thereby obtaining a body weight feature map and an image quality score feature map;

[0026] (5) The body weight feature map and the image quality score feature map are input into a quality-guided feature fusion module to obtain a single-frame fusion feature map;

[0027] (6) The single-frame fusion feature map is processed through two fully connected layers to obtain a predicted body weight and a quality score, and after the image quality score label and the artificial measured body weight data label are constrained by an L1 loss function, the predicted body weight and the quality score are input into a weighted fusion module to obtain a weighted body weight prediction value;

[0028] (7) The training is completed when a preset condition is met, and a trained feature extraction network and a quality-aware double-branch network are obtained.

[0029] Preferably, the back images are converted into body length convolution feature maps and body width convolution feature maps by an improved Xception network; the improved Xception network is a network obtained by removing the average pooling and the fully connected layer in the Xception network.

[0030] Preferably, the regression coefficient method has a calculation formula as follows:

[0031] Score

[0032] wherein, Score represents the score label of the image, is a real body width data label, is a body width prediction value; is a real body length data label, is a body length prediction value; and respectively represent weight factors of the body length and the body width; k is a score penalty coefficient.

[0033] Preferably, the loss function L used in the training process is as follows:

[0034]

[0035] wherein, N represents the total number of samples, is a real body weight data label, is a body weight prediction value. a real image quality score label, an image quality score prediction value; and weight factors representing weight loss and mass loss, respectively.

[0036] The technical scheme adopted by the system of the present application is: an animal weight estimation system based on a quality-aware dual-branch network, comprising:

[0037] one or more processors;

[0038] a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the animal weight estimation method based on the quality-aware dual-branch network.

[0039] Compared with existing animal weight estimation methods, the present application has the following advantages and positive effects:

[0040] (1) The present application takes video as the original data input, scores the quality of each frame image, automatically locates the frame image with the best quality for model inference prediction, thereby significantly reducing the requirement for device computing power and improving system running efficiency;

[0041] (2) The present application is based on a joint feature learning mechanism of body length and body weight, improves the stability of predicted image quality on the basis of frame image positioning, and significantly improves the accuracy and robustness of animal weight prediction.

[0042] The present application realizes automatic selection of high-quality frames from video and extraction of stable morphological features, and through intelligent screening and multi-frame result weighted fusion, can significantly improve the accuracy and stability of animal weight estimation while ensuring computing efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0043] The technical scheme of the present application is further illustrated below using examples and specific embodiments. In addition, some drawings are also used in the process of explaining the technical scheme. For those skilled in the art, other drawings and the intention of the present application can also be obtained from these drawings without creative labor.

[0044] Figure 1 : a method flowchart of an embodiment of the present application;

[0045] Figure 2 : a body weight feature extraction module and a body weight feature weighted fusion module in an embodiment of the present application;

[0046] Figure 3 : a quality-aware spatial attention module and a quality-aware channel attention module in an embodiment of the present application;

[0047] Figure 4 : the quality guided feature fusion network in the embodiment of the present application;

[0048] Figure 5 : the weighted fusion network in the embodiment of the present application;

[0049] Figure 6 : the flow chart for acquiring the image quality score in the process of training the feature extraction network and the quality-aware dual-branch network in the embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to facilitate those skilled in the art to understand and implement the present application, the present application will be further described in detail below in combination with the drawings and implementation examples. It should be understood that the implementation examples described herein are only used to illustrate and explain the present application, and are not used to limit the present application.

[0051] See Figure 1 The animal weight estimation method based on the quality-aware dual-branch network provided in the embodiment includes the following steps:

[0052] Step 1: using the pre-trained Mask RCNN segmentation model to segment the animal back region to obtain the back image without background;

[0053] Step 2: using the feature extraction network to convert the back image without background into a convolution feature map, inputting the convolution feature map into the quality-aware dual-branch network to learn the features of the body weight and the image quality score respectively, and obtaining the body weight feature map and the image quality score feature map;

[0054] In an implementation, the feature extraction network is a network obtained by removing the average pooling layer and the fully connected layer from the ResNet-34 network.

[0055] In an implementation, see Figure 2 and Figure 3 The quality-aware dual-branch network is composed of a body weight feature extraction module, a body weight feature weighted fusion module, a plurality of quality-aware spatial attention modules, and a quality-aware channel attention module.

[0056] In an embodiment, the weight feature extraction module will obtain the convolution feature map through the feature extraction network, and simultaneously perform Softmax processing along the horizontal and vertical directions respectively to obtain two coordinate normalized coordinate feature maps. After the convolution feature map and the two coordinate normalized coordinate feature maps are spliced along the channel dimension, a spatial position information fusion feature map is obtained through a coordinate convolution block composed of F3N64, BatchNorm and PReLU. The spatial position information fusion feature map is processed through F3N64P1, F3N64P2, F3N64P4 and F3N64P8 respectively, spliced in the channel dimension, and then fused into a context enhancement feature map through F1N64. Wherein, F3N64 represents a convolution layer with a convolution kernel of 3x3 and an output channel of 64; F3N64P1 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 1; F3N64P2 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 2; F3N64P4 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 4; F3N64P8 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 8.

[0057] In an embodiment, the weight feature extraction module will obtain the convolution feature map through the feature extraction network, and simultaneously perform Softmax processing along the horizontal and vertical directions respectively to obtain two coordinate normalized coordinate feature maps. After the convolution feature map and the two coordinate normalized coordinate feature maps are spliced along the channel dimension, a spatial position information fusion feature map is obtained through a coordinate convolution block composed of F3N64, BatchNorm and PReLU. The spatial position information fusion feature map is processed through F3N64P1, F3N64P2, F3N64P4 and F3N64P8 respectively, spliced in the channel dimension, and then fused into a context enhancement feature map through F1N64. Wherein, F3N64 represents a convolution layer with a convolution kernel of 3x3 and an output channel of 64; F3N64P1 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 1; F3N64P2 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 2; F3N64P4 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 4; F3N64P8 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 8.

[0058] In an embodiment, the weight feature extraction module will obtain the convolution feature map through the feature extraction network, and simultaneously perform Softmax processing along the horizontal and vertical directions respectively to obtain two coordinate normalized coordinate feature maps. After the convolution feature map and the two coordinate normalized coordinate feature maps are spliced along the channel dimension, a spatial position information fusion feature map is obtained through a coordinate convolution block composed of F3N64, BatchNorm and PReLU. The spatial position information fusion feature map is processed through F3N64P1, F3N64P2, F3N64P4 and F3N64P8 respectively, spliced in the channel dimension, and then fused into a context enhancement feature map through F1N64. Wherein, F3N64 represents a convolution layer with a convolution kernel of 3x3 and an output channel of 64; F3N64P1 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 1; F3N64P2 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 2; F3N64P4 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 4; F3N64P8 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 8.

[0059] In an embodiment, the weight feature extraction module will obtain the convolution feature map through the feature extraction network, and simultaneously perform Softmax processing along the horizontal and vertical directions respectively to obtain two coordinate normalized coordinate feature maps. After the convolution feature map and the two coordinate normalized coordinate feature maps are spliced along the channel dimension, a spatial position information fusion feature map is obtained through a coordinate convolution block composed of F3N64, BatchNorm and PReLU. The spatial position information fusion feature map is processed through F3N64P1, F3N64P2, F3N64P4 and F3N64P8 respectively, spliced in the channel dimension, and then fused into a context enhancement feature map through F1N64. Wherein, F3N64 represents a convolution layer with a convolution kernel of 3x3 and an output channel of 64; F3N64P1 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 1; F3N64P2 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 2; F3N64P4 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 4; F3N64P8 represents a group convolution layer with a convolution kernel of 3x3, an output channel of 64, and a group number of 8.

[0060] Step 3: input the body weight feature map and the image quality score feature map in step 2 into the quality-guided feature fusion module to obtain a single-frame fusion feature map;

[0061] In an embodiment, please see Figure 4 , the image quality score feature map and the body weight feature map are spliced in the channel dimension through a splicing layer, then processed through F3N256, F5N1024 and F3N2048 in turn, and a single-frame fusion feature map is obtained through a batch normalization layer and a ReLu activation function layer.

[0062] Step 4: process the single-frame fusion feature map in step 3 through two fully connected layers to obtain a predicted body weight and a quality score, and input the predicted body weight and the quality score into a weighted fusion module to obtain a weighted body weight prediction value.

[0063] In an embodiment, please see Figure 5 The weighted fusion module is composed of several fully connected layers and a Softmax layer; the plurality of single-frame fusion feature maps in this embodiment are processed through global average pooling, and then the predicted body weight values and the quality scores are obtained through two fully connected layers respectively, the plurality of quality scores are processed through a Softmax activation function to obtain normalized weight scores, and then the weighted body weight prediction value is obtained by multiplying the predicted body weight values with the corresponding normalized weight scores and then accumulating.

[0064] In an embodiment, the feature extraction network and the quality perception double-branch network are trained networks;

[0065] The training process includes the following sub-steps:

[0066] (1) prepare a training data set;

[0067] Obtain a plurality of animal back region images, and obtain animal body length and body width data labels by manual measurement; use a pre-trained Mask RCNN segmentation model to segment the animal back region to obtain back images without background;

[0068] (2) convert the back images without background into body length convolution feature maps and body width convolution feature maps, and process the body length and body width values through fully connected layers respectively;

[0069] In an embodiment, the back images are converted into body length convolution feature maps and body width convolution feature maps through an improved Xception network; the improved Xception network is a network obtained by removing the average pooling and the fully connected layer in the Xception network.

[0070] (3) The predicted body length and body width values are combined with the corresponding manually measured body length and body width data labels to obtain image quality score labels by a regression coefficient method;

[0071] See Figure 6 In an embodiment, the regression coefficient method has a calculation formula as follows:

[0072] Score

[0073] wherein Score represents the score label of the image, is a true body width data label, is a body width prediction value; is a true body length data label, is a body length prediction value; and respectively represent weight factors of the body length and the body width; k is a score penalty coefficient.

[0074] (4) The back image without background is converted into a convolution feature map by a feature extraction network, and the convolution feature map is input into a quality-aware double-branch network to learn features of the body weight and the image quality score respectively, so as to obtain a body weight feature map and an image quality score feature map;

[0075] (5) The body weight feature map and the image quality score feature map are input into a quality-guided feature fusion module to obtain a single-frame fusion feature map;

[0076] (6) The single-frame fusion feature map is processed through two fully connected layers to obtain a predicted body weight and a quality score, and after the image quality score label and the manually measured body weight data label are constrained by an L1 loss function, the predicted body weight and the quality score are input into a weighted fusion module to obtain a weighted body weight prediction value;

[0077] In an embodiment, a loss function L used in the training process is as follows:

[0078]

[0079] wherein N represents a total number of samples, is a true body weight data label, is a body weight prediction value; is a true image quality score label, is an image quality score prediction value; and respectively represent weight factors of the body weight loss and the quality score loss.

[0080] (7) The training is completed when a preset condition is met, and a trained feature extraction network and a quality-aware double-branch network are obtained.

[0081] The application is further described below through specific experiments.

[0082] In the experiment, the pigs were weighed, and each frame of the video was scored, and the experimental results are shown in Table 1 below.

[0083] Table 1

[0084]

[0085] It can be seen from the experimental results that the network proposed in the application has obvious advantages in predicting images greater than the set threshold: as the score threshold increases, the prediction errors (MAE and MRE) of body length, body width and body weight all decrease significantly, while the model fitting goodness (R2) steadily increases, indicating that the model performance continuously improves with the increase of the threshold.

[0086] Compared with static images, the application provides more perspectives and continuous frame data through video sequences, which helps to filter the best observation frames, but also faces the interference of low-quality frames such as motion blur and occlusion. The application can automatically filter high-quality frames from the video and extract stable morphological features, and through intelligent filtering and weighted fusion of multiple frame results, the accuracy and stability of pig weight estimation can be significantly improved while ensuring the calculation efficiency.

[0087] It should be understood that the above-described embodiments are part of the embodiments of the application, rather than all the embodiments. In addition, the technical features of each embodiment or single embodiment provided by the application can be combined with each other to form a feasible technical solution, and such combination is not restricted by the order of steps and / or structure composition mode, but must be based on the realization by the ordinary skilled in the art, when the combination of technical solutions appears contradictory or unfeasible, it should be considered that such combination of technical solutions does not exist, nor within the protection scope of the application claimed.

[0088] It should be understood that the above description of the preferred embodiments is more detailed, and therefore should not be considered as a limitation on the scope of patent protection of the application. The ordinary skilled in the art can make substitutions or modifications without departing from the scope of the claims, which fall within the scope of protection of the application. The scope of protection of the application should be subject to the appended claims.​

Claims

1. A method for animal weight estimation based on quality-aware dual-branch network, characterized in that, The method comprises the following steps: Step 1: segmenting the back region of the animal using a pre-trained Mask RCNN segmentation model to obtain a back image without background; Step 2: converting the back image without background into a convolution feature map using a feature extraction network, inputting the convolution feature map into a quality-aware double-branch network to learn the features of the weight and the image quality score respectively, and obtaining a weight feature map and an image quality score feature map; The quality-aware double-branch network is composed of a weight feature extraction module, a weight feature weighted fusion module, a plurality of quality-aware spatial attention modules and quality-aware channel attention modules; The weight feature extraction module simultaneously performs Softmax processing along the horizontal direction and the vertical direction on the convolution feature map obtained through the feature extraction network to obtain two coordinate normalized coordinate feature maps, the convolution feature map and the two coordinate normalized coordinate feature maps are spliced along the channel dimension, and a spatial position information fusion feature map is obtained through a coordinate convolution block composed of F3N64, BatchNorm and PReLU, the spatial position information fusion feature map is processed through F3N64P1, F3N64P2, F3N64P4 and F3N64P8 respectively, spliced in the channel dimension, and fused into a context enhancement feature map through F1N64; The weight feature weighted fusion module inputs the context enhancement feature map after global average pooling and global maximum pooling in the spatial dimension into F1N512 in the channel dimension to obtain a weight score feature map, and then multiplies the weight score feature map with the context enhancement feature map obtained by the weight feature extraction module channel by channel to obtain a weight feature map; The quality-aware spatial attention module extracts horizontal and vertical gradients from the convolution feature map obtained through the feature extraction network through F5N64 and F7N64 respectively to obtain a horizontal feature map and a vertical feature map, accumulates the horizontal feature map and the vertical feature map in the channel dimension to form a single-channel feature map, then processes the single-channel feature map through F3N256 and F3N1 in turn, and generates spatial attention weights with Sigmoid activation, and obtains a quality-aware spatial attention weight map by multiplying the convolution feature map and the spatial attention weights element by element; The quality-aware channel attention module extracts features from the quality-aware spatial attention weight map through a F3N64G3 DW convolution and ReLU, then mixes the channel information through a F1N64 PW convolution layer, then performs global average pooling, and then processes through F1N256 and F1N512 in turn, and then multiplies the quality-aware spatial attention weight map along the channel dimension to obtain an image quality score feature map; Step 3: inputting the weight feature map and the image quality score feature map in step 2 into a quality-guided feature fusion module to obtain a single-frame fusion feature map; Step 4: processing the single-frame fusion feature map in step 3 through two fully connected layers to obtain a predicted weight and a quality score, and inputting the predicted weight and the quality score into a weighted fusion module to obtain a weighted weight prediction value.

2. The method of claim 1, wherein the method comprises: In step 2, the feature extraction network is a network obtained by removing the average pooling layer and the fully connected layer from the ResNet-34 network.

3. The method of claim 1, wherein the method comprises: In step 3, the quality-guided feature fusion module is obtained by sequentially processing the image quality score feature map and the weight feature map through a concatenation layer in the channel dimension, F3N256, F5N1024, and F3N2048, and a batch normalization layer and a ReLu activation function layer to obtain a single-frame fusion feature map.

4. The method of claim 1, wherein the method comprises: In step 4, the weighted fusion module is obtained by processing several single-frame fusion feature maps through global average pooling, two fully connected layers to obtain predicted weight values and quality scores, processing several quality scores through a Softmax activation function to obtain normalized weight scores, and then multiplying the predicted weight values and the corresponding normalized weight scores to obtain a weighted weight prediction value.

5. The method of claim 1-4, wherein: The feature extraction network and the quality-aware dual-branch network are trained networks. The training process includes the following sub-steps: (1) Prepare the training data set; Obtain several animal back region images, and manually measure the animal length and width data labels; use a pre-trained Mask RCNN segmentation model to segment the animal back region to obtain back images without background; (2) Convert the back images without background into length convolution feature maps and width convolution feature maps, and process the predicted length and width values through fully connected layers; (3) Obtain image quality score labels by regression coefficient method using the predicted length and width values and the corresponding manually measured length and width data labels; (4) Convert the back images without background into convolution feature maps using the feature extraction network, and input the convolution feature maps into the quality-aware dual-branch network to learn the features of weight and image quality score, respectively, to obtain weight feature maps and image quality score feature maps; (5) Input the weight feature maps and the image quality score feature maps into the quality-guided feature fusion module to obtain single-frame fusion feature maps; (6) Process the single-frame fusion feature maps through two fully connected layers to obtain predicted weight and quality scores, and then input the predicted weight and quality scores into the weighted fusion module to obtain a weighted weight prediction value after using the image quality score labels and the manually measured weight data labels to constrain through an L1 loss function; (7) Complete the training when the preset condition is met to obtain the trained feature extraction network and quality-aware dual-branch network.

6. The method of claim 5, wherein: The improved Xception network is used to convert the back images into length convolution feature maps and width convolution feature maps.

7. The method of claim 5, wherein the method comprises: The calculation formula of the regression coefficient method is: Score where Score denotes the score label of the image, is the true body width data label, is the body width prediction value; is the true body length data label, is the body length prediction value; and denote the weight factors for body length and body width, respectively; k is the score penalty coefficient.

8. The method of claim 5, wherein the method further comprises: The loss function L used in the training process is: where N denotes the total number of samples, is the true weight data label, is the weight prediction value; is the true image quality score label, is the image quality score prediction value; and are weight factors for weight loss and quality score loss, respectively.

9. An animal weight estimation system based on quality-aware dual-branch network, characterized in that, It includes: One or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the animal weight estimation method based on the quality-aware dual-branch network as claimed in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Fetal age and weight prediction method based on double-model fusion

    CN115349889A

  • Cow weight estimation method and system based on cow back image and height and body length data

    CN118898854A