A Deep Learning-Based Weight Estimation Method
By employing a deep learning-based weight estimation method, utilizing the LiteHRNet backbone network and class activation mapping technology, the problems of low efficiency and harm in traditional sheep weight acquisition are solved, achieving efficient and contactless sheep weight estimation, and improving automation and model interpretability.
Patent Information
- Application Number
- CN202211564150.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-07
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2042-12-07
AI Technical Summary
Traditional methods for obtaining sheep weight are inefficient, lack automation, may harm the sheep, and consume a lot of manpower and time.
We employ a deep learning-based weight estimation method, constructing a weight estimation model using the LiteHRNet backbone network and class activation mapping technology. We then use sheep detection and semantic segmentation models for preprocessing to select a pre-trained model with high accuracy and attention focused on the sheep region, thus achieving contactless weight estimation.
It achieves efficient and harmless acquisition of sheep weight, improves automation, saves time and costs, and enhances the interpretability and accuracy of pre-trained models.
Smart Images

Figure CN115984554B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and more specifically to a weight estimation method based on deep learning. Background Technology
[0002] Animal husbandry is an important branch of agriculture in developing countries. Developing modern animal husbandry is one of the important measures for eliminating absolute poverty in my country, and it is also key to improving the rural economy and agricultural living standards in Northwest my country.
[0003] Obtaining sheep weight is a routine task in animal husbandry. Improving the efficiency of sheep weight acquisition is a crucial means of promoting smart animal husbandry. Timely acquisition of sheep weight information allows for monitoring of sheep's growth and development. Sheep weight is one of the reference indicators for sheep farms to select high-quality breeding sheep. Obtaining sheep weight allows for accurate judgment of the sheep's growth and development, as well as the rationality of feeding and management, serving as a basis for reasonable breeding and selection.
[0004] Traditional methods for obtaining sheep weight include weighing with a scale, estimation based on body size, and image processing estimation based on binocular vision. Weighing with a scale requires people to drive the sheep through the scale, which may cause varying degrees of harm to the sheep. Weight estimation based on body size requires obtaining the sheep's body size data in advance, which is also a labor-intensive and time-consuming task. Weight estimation based on binocular vision requires equipment deployment and calibration, and subsequent processing requires manual interaction, thus limiting the application of the method.
[0005] Traditional methods for obtaining sheep weight reduce the automation level of sheep weight acquisition, and their efficiency cannot meet the needs of modern smart farming. Therefore, a deep learning-based weight estimation method is proposed to address these issues. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a deep learning-based weight estimation method, which solves the problems existing in the prior art.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] A deep learning-based weight estimation method includes the following steps:
[0009] Collect side-view depth image data of a single sheep, detect sheep from the collected data, and crop images of the detected sheep;
[0010] The extracted sheep images are subjected to sheep semantic segmentation processing to obtain segmented sheep depth image data.
[0011] A LiteHRNet backbone network is constructed, and a weight estimation network head is built by utilizing the point convolutional layers, ReLU layers, Dropout layers, adaptive average pooling layers and linear layers of the LiteHRNet backbone network.
[0012] By combining different weight estimation network heads, a LiteHRNet deep neural network model is constructed. The LiteHRNet deep neural network model is trained using data obtained after sheep detection and sheep semantic segmentation to obtain different weight estimation pre-trained models.
[0013] The prediction layer of different pre-trained models for weight estimation was analyzed using the class activation mapping method. The pre-trained model with high accuracy and attention focused on the sheep region was selected as the final sheep weight estimation model.
[0014] The processed sheep targets are input into the final pre-trained model to obtain the corresponding sheep weight estimation results.
[0015] Furthermore, a depth camera was placed on the side of the single sheep passage, about 0.8 meters away from the passage and 0.5 meters high, to collect depth image data of the sheep from the side.
[0016] Furthermore, a sheep detection model is used to detect sheep in the collected depth image data and extract the corresponding sheep region images.
[0017] Furthermore, a sheep semantic segmentation model is used to perform semantic segmentation processing on the extracted sheep images.
[0018] Furthermore, the mean squared error loss function is used to train the neural network to obtain different pre-trained models for weight estimation.
[0019] Furthermore, the average error of the weight estimation of the pre-trained model is used as an indicator of the model's accuracy.
[0020] Furthermore, the degree of concentration of sheep regions in the image based on the attention visualization results of the pre-trained model is used as a visual screening metric for the model.
[0021] This invention provides a deep learning-based weight estimation method, which has the following beneficial effects:
[0022] (1) Compared with traditional methods, the method in this paper selects a deep learning method that is "contactless, high-yield, and high-efficiency", which is more efficient than traditional sheep weight estimation methods.
[0023] (2) In this invention, the sheep detection and segmentation model is used to preprocess the collected depth image data, which can obtain reliable and rich sheep object data, reduce the influence of irrelevant objects on the estimation model, and improve the model's ability to extract sheep object features.
[0024] (3) This invention uses multiple weight estimation network heads to train the collected data, which can explore the influence of different structures in the network head on weight estimation. The backbone network is trained from scratch using LiteHRNet, which can efficiently extract rich features related to sheep weight.
[0025] (4) This invention uses class activation mapping technology to visualize the image regions that the pre-trained model focuses on in the weight estimation task, which increases the interpretability of the pre-trained model. At the same time, it also optimizes and selects different weight estimation network heads.
[0026] (5) This invention provides a new solution for efficient sheep weight estimation, which can greatly save the time cost of obtaining sheep weight in farms, while avoiding the possible harm to sheep caused by traditional methods, increasing sheep welfare, and providing ideas for weight estimation methods of related poultry and livestock, which is worth promoting. Attached Figure Description
[0027] Figure 1 This is a flowchart of the deep learning-based method for estimating sheep weight according to the present invention.
[0028] Figure 2 This is a diagram showing the layout of the data acquisition device for this invention.
[0029] Figure 3 The experimental results are shown in the embodiments of the present invention. Detailed Implementation
[0030] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0031] like Figure 1-3 As shown, the present invention provides a deep learning-based method for estimating sheep weight, comprising the following steps:
[0032] Collect side-view depth image data of a single sheep, detect sheep from the collected data, and crop images of the detected sheep;
[0033] The extracted sheep images are subjected to sheep semantic segmentation processing to obtain segmented sheep depth image data.
[0034] A LiteHRNet backbone network is constructed, and a weight estimation network head is built by utilizing the point convolutional layers, ReLU layers, Dropout layers, adaptive average pooling layers and linear layers of the LiteHRNet backbone network.
[0035] By combining different weight estimation network heads, a LiteHRNet deep neural network model is constructed. The LiteHRNet deep neural network model is trained using data obtained after sheep detection and sheep semantic segmentation to obtain different weight estimation pre-trained models.
[0036] The prediction layer of different pre-trained models for weight estimation was analyzed using the class activation mapping method. The pre-trained model with high accuracy and attention focused on the sheep region was selected as the final sheep weight estimation model.
[0037] The cropped sheep target image is input into the final pre-trained model to obtain the corresponding sheep weight estimation result.
[0038] Step 1: To obtain more complete side-view images of sheep at different growth stages and sizes, a passageway is set up that allows only one sheep to pass through. A depth camera is placed on one side of the passageway, approximately 0.8 meters away and 0.5 meters above it, ensuring that depth image data of the sheep's side view is captured. To reduce environmental and lighting noise, the acquisition scene and passageway are deployed in a location without direct sunlight, and the passageway is designed for only one sheep to pass through, ensuring that the depth camera captures data from only one sheep. The sheep side-view data acquisition in Step 1 ensures that sheep of different sizes and movement states can be captured, maximizing the capture rate of sheep data and obtaining the deep image data of the sheep.
[0039] Step 2: To reduce interference from other backgrounds and objects during information acquisition and maximize the proportion of sheep in the overall image, this method first transcodes the video stream data captured by the depth camera into color images and corresponding depth image data. Then, using a sheep detection model, the sheep portion is extracted from the color and depth images. Next, a sheep semantic segmentation model is used to perform semantic segmentation on the extracted sheep images and augment the sheep depth image data. The sheep side view data preprocessing in Step 2 involves using an intelligent sheep detection model to obtain sheep objects, removing other objects besides the sheep to reduce the influence of irrelevant objects on the model, and enhancing the sheep instance segmentation model to utilize sheep features.
[0040] Step 3: Sheep weight estimation requires semantic information at different levels in the image. To improve the efficiency of sheep estimation, LiteHRNet was selected as the backbone network of the deep neural network model. It extracts semantic information at different levels through branch structures with different resolutions, and features computationally efficient internal modules, a small number of parameters, and high computational efficiency. A LiteHRNet deep neural network model combining different weight estimation network heads was constructed. The LiteHRNet deep neural network model was trained using data obtained from sheep detection and segmentation, as well as the corresponding sheep's actual weight data. Mean squared error was used as the loss function to obtain different pre-trained weight estimation models. A LiteHRNet backbone network is constructed to extract features from sheep depth image data with different numbers of channels. A weight estimation network head is constructed to receive the image data features extracted by the backbone network and output the estimated weight of the sheep. This network head consists of point convolutional layers, ReLU layers, Dropout layers, adaptive average pooling layers, and linear layers. Using the data obtained from sheep detection and segmentation, the LiteHRNet deep neural network model combined with the weight estimation network head is trained to obtain different pre-trained weight estimation models. The training of the sheep preprocessing data in step 3 uses a lightweight network for de novo training to fully learn the features of sheep weight in the data.
[0041] Step 4: To evaluate the weight estimation models of different network heads and explore the decision-making process of different pre-trained models, the attention region in the weight estimation image of the deep neural network pre-trained model obtained in Step 3 is visualized using class activation mapping. The average error of the weight estimation of the pre-trained model is used as the accuracy index of the model, and the degree of concentration of the attention visualization results of the pre-trained model in the sheep region of the image is used as the visual screening index of the model. The pre-trained model with high accuracy and concentrated attention in the sheep region is selected as the final sheep weight estimation model. The design and optimization of the sheep weight estimation head in Step 4 uses the class activation mapping method to select the pre-trained model, and selects the weight estimation model with strong interpretability and small prediction error.
[0042] Step 5: Deploy the final model obtained in Step 4. For the target sheep whose weight needs to be estimated, collect its depth image data as in Step 1. To maximize the proportion of sheep in the entire image, use a sheep detection model to detect sheep in the collected depth image data and extract the corresponding sheep regions. Then, input the extracted depth image data into the final weight estimation model to obtain the weight estimation result of the corresponding sheep. The sheep weight estimation model in Step 5 uses a pre-trained model to estimate the weight of the sheep, which can obtain an estimation result with good interpretability and small error.
[0043] Compared to traditional methods, this invention employs a deep learning approach that is "contactless, harmless, highly beneficial, and efficient," achieving superior efficiency compared to traditional sheep weight estimation methods. This invention not only enables rapid acquisition of sheep weight but also provides a direction for estimating the weight of related poultry and livestock, while saving time for relevant personnel and improving animal welfare. It is worthy of widespread adoption.
[0044] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A weight estimation method based on deep learning, characterized in that, Includes the following steps: Collect side-view depth image data of a single sheep, detect sheep from the collected data, and crop images of the detected sheep; The extracted sheep images are subjected to sheep semantic segmentation processing to obtain segmented sheep depth image data. A deep neural network model with LiteHRNet as the backbone network is constructed, and a weight estimation network head is connected after the backbone network. The weight estimation network head includes a point convolutional layer, a ReLU layer, a Dropout layer, an adaptive average pooling layer, and a linear layer connected in sequence. The backbone network is used to extract the depth image data features of sheep with different numbers of channels, and the weight estimation network head is used to receive the image data features extracted by the backbone network and output the estimated weight of the sheep. Using multiple sets of sheep images and segmented sheep depth image data, as well as the corresponding sheep's actual weight data, multiple deep neural network models with different weight estimation network head structures are trained to obtain multiple different weight estimation pre-trained models. The prediction layers of several different pre-trained models for weight estimation were analyzed using the class activation mapping method. The pre-trained model with high accuracy and attention focused on the sheep region was selected as the final sheep weight estimation model. The cropped sheep images are input into the final pre-trained model to obtain the corresponding sheep weight estimates.
2. The weight estimation method based on deep learning according to claim 1, characterized in that, A depth camera was placed on the side of the single sheep passage, 0.8 meters away from the passage and 0.5 meters above it, to collect depth image data of the sheep from the side.
3. The weight estimation method based on deep learning according to claim 1, characterized in that, A sheep detection model is used to detect sheep in the collected depth image data and extract the corresponding sheep images.
4. The weight estimation method based on deep learning according to claim 1, characterized in that, A sheep semantic segmentation model is used to perform semantic segmentation on the extracted sheep images.
5. The weight estimation method based on deep learning according to claim 1, characterized in that, It also includes using the mean squared error loss function to train deep neural network models, resulting in multiple different pre-trained models for weight estimation.
6. The weight estimation method based on deep learning according to claim 1, characterized in that, The average error of the weight estimation from the pre-trained model is used as an indicator of the model's accuracy.
7. The weight estimation method based on deep learning according to claim 1, characterized in that, The degree of concentration of sheep regions in an image is used as a visual selection metric for the model based on the attention visualization results of the pre-trained model.