Livestock weight measurement method, device, system and computer equipment

By obtaining dynamic weight data of livestock on the floor scale, using classification network models to identify behavior types and process data, the problem of time-consuming, labor-intensive and error-free weight measurement in the prior art is solved, and high-precision weight prediction and health monitoring are achieved.

CN117281061BActive Publication Date: 2025-08-22SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311072245.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-23
Publication Date
2025-08-22
Estimated Expiration
2043-08-23

AI Technical Summary

Technical Problem

In the prior art, the livestock weight measurement method has the problem of manual measurement of time-consuming and laborious and large errors, especially the method based on mean calculation is easily affected by outliers and data imbalance, resulting in inaccurate prediction results.

Method used

By obtaining the dynamic weight data of livestock when passing through the floor pound, a weight change curve chart is drawn, and a classification network model (such as ResNet18) is used to identify behavior types, and corresponding prediction strategies are adopted for combining different behavior types, dynamic weight data are screened and processed, and the weight regression equation is used to predict the weight of livestock.

Benefits of technology

It effectively reduces weight prediction errors, improves prediction accuracy, realizes dynamic weighing, and supports health and disease monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117281061B_ABST
    Figure CN117281061B_ABST
Patent Text Reader

Abstract

The present invention discloses a livestock weight measurement method, device, system, and computer equipment, comprising: obtaining dynamic weight data recorded when the livestock passes through a weighing scale; obtaining a weight change curve of the livestock based on the dynamic weight data; inputting the weight change curve into a preset classification network model to obtain the livestock's behavior type; the behavior type being one of normal passing, fast passing, slow passing, lame passing, uncooperative passing, and non-livestock behavior; applying a prediction strategy corresponding to the behavior type to the dynamic weight data, obtaining a weight regression equation for the dynamic weight data, and predicting the livestock's weight based on the weight regression equation. The present invention can adopt different prediction strategies for dynamic weight data based on different behavior types to perform weight prediction, thereby achieving dynamic weighing, effectively reducing weight prediction errors, and improving prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of livestock information technology, and in particular to a livestock weight measurement method, device, system and computer equipment. Background Art

[0002] The weight of livestock needs to be tracked and measured during production stages such as weaning, nursery, breeding, fattening, and daily health monitoring. The growth status, nutritional level, and health level of individual livestock can be distinguished based on the measurement results at different times, and the grades of livestock can be assessed and distinguished. Different feeding plans and breeding standards can then be formulated for livestock of different grades to improve livestock production levels.

[0003] At present, many farms still use manual measurement and monitoring methods for weight indicators. Direct contact with livestock for measurement not only causes stress reactions in livestock and poses certain safety risks, but is also time-consuming and labor-intensive.

[0004] With the development of artificial intelligence and the Internet of Things (IoT), methods for obtaining livestock weight data using sensors are emerging. Some of these methods calculate livestock weight based on averages. However, these methods are susceptible to outliers and data imbalance, resulting in larger errors and inaccurate predictions. Summary of the Invention

[0005] In order to overcome the problems existing in the related art, the present invention provides a method for measuring livestock weight, the method comprising:

[0006] obtaining dynamic weight data recorded when the livestock passes through the weighbridge;

[0007] Obtaining a weight change curve graph of the livestock according to the dynamic weight data;

[0008] Inputting the weight change curve graph into a preset classification network model to obtain the behavior type of the livestock; the behavior type is one of normal passing, fast passing, slow passing, lame passing, uncooperative passing, and non-livestock behavior;

[0009] A prediction strategy corresponding to the behavior type is adopted for the dynamic weight data to obtain a weight regression equation of the dynamic weight data, and the weight of the livestock is predicted based on the weight regression equation.

[0010] Preferably, the classification network model is a ResNet18 network model, which is specifically used to extract features of the weight change curve graph, integrate features through maximum pooling, and determine the behavior type of the livestock based on the features.

[0011] Preferably, the method of adopting a prediction strategy corresponding to the behavior type for the dynamic weight data, obtaining a weight regression equation for the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation specifically includes:

[0012] Obtaining a preset first screening coefficient α1 and a second screening coefficient α2, and a maximum value w0_max in the dynamic weight data;

[0013] Using w0_max*α1 as a first screening value, filter out data whose dynamic weight data is smaller than the first screening value to obtain a first weight data set W1;

[0014] Calculate the average value mean_maximum of the maximum value and the average value mean_minimum of the minimum value of the dynamic weight data, and calculate the extreme value mean_crest of the dynamic weight data based on mean_maximum and mean_minimum; wherein,

[0015]

[0016] Using mean_crest*α2 as the second screening value, remove the data in W1 that are smaller than the second screening value to obtain the second weight data set W2;

[0017] According to the second weight data set W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation of the dynamic weight data, and the weight of the livestock is predicted based on the weight regression equation.

[0018] Preferably, the step of adopting a prediction strategy corresponding to the behavior type based on the second weight data set W2 to obtain a weight regression equation of the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation includes:

[0019] If the behavior type is slow passing, the average value w2_mean of W2 is used as the predicted weight value of the livestock.

[0020] Preferably, the step of adopting a prediction strategy corresponding to the behavior type based on the second weight data set W2 to obtain a weight regression equation of the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation includes:

[0021] If the behavior type is one of normal passing, fast passing and uncooperative passing, the data in W2 is input into a pre-trained weight regression equation corresponding to the behavior type to calculate the predicted weight value of the livestock.

[0022] Preferably, the step of adopting a prediction strategy corresponding to the behavior type based on the second weight data set W2 to obtain a weight regression equation of the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation includes:

[0023] If the behavior type is lame passing, obtain the peak band data in W1, and filter out the data with a value smaller than mean_crest in each peak band data to obtain several peak segments;

[0024] Comparing the durations of the respective peak segments, and forming a third weight data set W3 based on the data of the peak segment with the longest duration;

[0025] The data in W3 is input into a pre-trained weight regression equation corresponding to the behavior type to calculate the predicted weight value of the livestock.

[0026] Preferably, the independent variables of the weight regression equation are one or more of the maximum value, average value, extreme value mean, median and mode of the dynamic weight data.

[0027] According to a second aspect of the present invention, there is provided a livestock weight measuring device, the device comprising:

[0028] A data acquisition module, used for acquiring dynamic weight data recorded when the livestock passes through the weighbridge;

[0029] A curve drawing module, used for obtaining a weight change curve of the livestock according to the dynamic weight data;

[0030] a behavior classification module, configured to input the weight change curve graph into a preset classification network model to obtain a behavior type of the livestock; the behavior type being one of normal passing, fast passing, slow passing, lame passing, uncooperative passing, and non-livestock behavior;

[0031] The weight prediction module is used to adopt a prediction strategy corresponding to the behavior type for the dynamic weight data, obtain a weight regression equation of the dynamic weight data, and predict the weight of the livestock based on the weight regression equation.

[0032] According to a third aspect of the present invention, there is provided a livestock weight measurement system, the system comprising a floor scale and the livestock weight measurement device according to any embodiment of the present invention.

[0033] According to a fourth aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the livestock weight measurement method according to any embodiment of the present invention is implemented.

[0034] The present invention discloses a livestock weight measurement method, device, system and computer equipment. The method uses dynamic weight data originally recorded by a floor scale to draw a weight change curve diagram, then uses a classification network model to classify livestock behavior and obtain livestock behavior types. Finally, different prediction strategies are adopted for the dynamic weight data according to different behavior types to predict weight, thereby realizing dynamic weighing, effectively reducing weight prediction errors and improving prediction accuracy.

[0035] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 The figure is a flow chart of a livestock weight measurement method according to one embodiment of the present invention.

[0037] Figure 2 It is a schematic diagram of a weight change curve diagram of livestock obtained by plotting dynamic weight data under different behavior types according to an embodiment of the present invention.

[0038] Figure 3 4 is a schematic diagram illustrating changes from dynamic weight data to a second weight data set under different behavior types according to an embodiment of the present invention.

[0039] Figure 4 3 is a schematic diagram showing a comparison between predicted weight values ​​and actual weight values ​​obtained under different behavior types according to an embodiment of the present invention.

[0040] Figure 5 The figure is a schematic structural diagram of a livestock weight measuring device according to one embodiment of the present invention.

[0041] Figure 6 The figure is a schematic structural diagram of a livestock weight measurement system according to one embodiment of the present invention.

[0042] Figure 7 The figure is a schematic diagram showing the structure of a computing device hardware according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent like or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.

[0044] The terms used in this invention are for the purpose of describing specific embodiments only and are not intended to limit the invention. The singular forms "a," "the," and "the" used in this invention and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0045] It should be understood that although the terms "first," "second," "third," etc. may be used in the present invention to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. Depending on the context, the term "if" as used herein may be interpreted as "when," "when," or "in response to determining."

[0046] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0047] like Figure 1 As shown, Figure 1 FIG1 is a flow chart of a livestock weight measurement method according to an embodiment of the present invention, comprising the following steps:

[0048] Step S101, obtaining dynamic weight data recorded when livestock passes through a weighbridge;

[0049] Step S102, obtaining a weight change curve of the livestock based on the dynamic weight data;

[0050] Step S103: Inputting the weight change curve graph into a preset classification network model to obtain the behavior type of the livestock; the behavior type is one of normal passing, fast passing, slow passing, lame passing, uncooperative passing, and non-livestock behavior;

[0051] Step S104 , adopting a prediction strategy corresponding to the behavior type for the dynamic weight data, obtaining a weight regression equation for the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation.

[0052] In the present invention, the livestock may be any large or medium-sized livestock such as cattle, pigs, horses, sheep, etc., and the present invention is not limited thereto.

[0053] In step S101, the weighbridge is arranged on a specified position, and after livestock walks onto the weighbridge, the weighbridge can obtain the weight of the object on the weighbridge by means of a load cell etc., and output the weight information to devices such as a connected display, a computer or a printer in the form of a digital signal. During the time period when livestock are driven through the weighbridge, the weighbridge can continuously record weight information, and due to the difference in posture and strength etc. during the livestock's walking, the weight information recorded by the weighbridge at each time also produces certain floating. Therefore, during the whole process in which livestock passes through the weighbridge, the weighbridge can record the weight data of livestock multiple times, i.e., dynamic weight data of the present invention. Due to the deviation in the measuring process, any single data in the dynamic weight data recorded when livestock passes through the weighbridge all cannot accurately represent the weight of livestock, and according to these dynamic weight data, analyzing, then a comparatively accurate weight value of livestock can be predicted.

[0054] In some embodiments, the weight data may be recorded every 200 ms when the livestock passes through the weighbridge. The weight data recorded each time may be different, and these weight data together constitute the dynamic weight data of the livestock. In some embodiments, the weight data may be recorded at other time intervals to form the dynamic weight data of the livestock, depending on the prediction accuracy and the type of livestock. The present invention is not limited to this.

[0055] In the present invention, the behavior of livestock when passing through the weighing scale is greatly affected by the consciousness of the livestock itself, and different behavior types will cause the dynamic weight data recorded by the weighing scale to change in different states. For example, the dynamic weight data recorded by livestock passing through the weighing scale normally will fluctuate around a certain peak value, and the fluctuation amplitude is generally small, while the dynamic weight data recorded by less cooperative livestock when passing through the weighing scale will have greater fluctuations.

[0056] In the present invention, the behavior types of livestock passing through the weighing scale can be divided into five different categories, including normal passing, fast passing, slow passing, lame passing, and uncooperative passing. Among them, normal passing refers to the behavior of the livestock to be weighed passing the weighing scale at the normal walking speed of the livestock type; fast passing refers to the behavior of the livestock to be weighed passing the weighing scale at a speed faster than the normal walking speed of the livestock type; slow passing refers to the behavior of the livestock to be weighed passing the weighing scale at a speed slower than the normal walking speed of the livestock type; lame passing refers to the behavior of the livestock to be weighed passing the weighing scale in a lame posture. In a lame posture, the livestock's steps are often one foot deep and one foot shallow, resulting in large changes in the weight data measured by the weighing scale; uncooperative passing refers to the behavior of the livestock to be weighed passing the weighing scale in an uncooperative manner. The forms of uncooperative livestock include moving back and forth or jumping on the weighing scale. The uncooperative behavior of livestock will cause the weight data measured by the weighing scale to change more and be more unstable, and the value fluctuations are also relatively large. In addition, since the weight data detected by the scale may be affected by external interference factors such as people or other static objects, the dynamic weight data obtained by the scale may also include non-livestock behaviors.

[0057] In step S102, the dynamic weight data obtained in step S101 can be plotted to obtain a weight change curve of the livestock. When the behavior type of the livestock is different, the weight change curve obtained by plotting the dynamic weight data is also different. Figure 2 As shown, Figure 2: This is a schematic diagram of a weight change curve of livestock obtained by drawing according to dynamic weight data under different behavior types according to an embodiment of the present invention. Among them, Figure (2a) is a weight change curve obtained when the behavior type is normal passing, wherein the middle section of the curve is relatively stable, and fluctuates up and down with a small degree around a certain peak value; Figure (2b) is a weight change curve obtained when the behavior type is fast passing, similarly, the middle section of the curve is relatively stable, and fluctuates up and down with a small degree around a certain peak value, but compared with the weight change curve of normal passing, the stable section of the weight change curve of fast passing is shorter; Figure (2c) is a weight change curve obtained when the behavior type is slow passing, similarly, the middle section of the curve is relatively stable, and fluctuates up and down with a small degree around a certain peak value, but compared with the weight change curve of normal passing, the stable section of the weight change curve of slow passing is longer; Figure (2d) is a weight change curve obtained when the behavior type is lame passing, the curve fluctuates greatly as a whole, but the middle section of the curve is higher than the two sides, and only the middle section of the curve maintains around the highest peak value; Figure (2e) is the weight change curve obtained when the behavior type is non-cooperative passing. The overall fluctuation of this curve is larger, and there is more than one curve that maintains around the highest peak value. It may include a curve with a rising peak after a curve with a decreasing peak; Figure (2f) is the weight change curve obtained when the behavior type is non-livestock behavior. This weight change curve is similar to the weight change curve of normal passing, but due to the irregular behavior of livestock when getting on and off the scale, there may be repeated weight increases and decreases, while the weight change process of people or static objects will be smoother. Therefore, it is possible to distinguish whether it is non-livestock behavior based on the curve segments of weight increase and decrease in the weight change curve. If the increase or decrease curve segment has a step-change shape, it indicates that the weight change curve corresponds to livestock behavior. If there is no step-change shape, the increase and decrease curve segments are all smoothly changing curve segments, which indicates that the weight change curve corresponds to non-livestock behavior.

[0058] from Figure 2 It can be seen that different behavior types will obtain different weight change curves. Therefore, by analyzing the image features of the weight change curve, the behavior type of livestock can also be inferred.

[0059] In step S103, the weight change curve obtained in step S102 can be input into a preset classification network model to obtain the behavior type of the livestock. In the present invention, the preset classification network is a neural network model trained based on the weight change curve of the livestock to classify the behavior type of the livestock.

[0060] Specifically, in some embodiments, the classification network model can be a ResNet18 network model, which can be used to extract features of the weight change curve graph, integrate features through maximum pooling, and determine the behavior type of livestock based on the features. Specifically, the ResNet18 network model includes multiple fully connected layers and maximum pooling layers, wherein the fully connected layer is used to perform high-dimensional spatial mapping of the weight change curve graph, and then perform dimensionality reduction and extract local features and global features, while the maximum pooling layer is used to perform feature integration to classify the weight change curve graph and determine whether the weight change curve graph belongs to one of normal passing, fast passing, slow passing, lame passing, uncooperative passing, and non-livestock behavior.

[0061] In some embodiments, when training the classification network model, the data set formed by a series of weight change curves obtained in advance can be divided into six categories: normal passing, fast passing, slow passing, lame passing, uncooperative passing, and non-livestock behavior through manual screening and marked, and then the ResNet18 network is used as its classification network model for training to obtain a trained classification network model.

[0062] Since different behavior types will affect the livestock weighing process, the dynamic weight data of livestock will have different changing trends with different behavior types. Therefore, different prediction strategies can be adopted to predict the weight of livestock for different behavior types to obtain more accurate weight data.

[0063] In step S104, after the behavior type of the livestock is determined by the classification network model, a prediction strategy corresponding to the behavior type can be adopted to obtain a weight regression equation of the dynamic weight data, and the weight of the livestock can be predicted based on the weight regression equation.

[0064] Since there is a lot of interference data in the dynamic weight data originally obtained by the scale, such as incomplete weight data measured by the scale when the livestock gets on and off the scale, before predicting the weight of the livestock based on the weight regression equation, the dynamic weight data can be preprocessed to filter out the interference data in the dynamic weight data to form a new weight data set, and then the weight of the livestock can be predicted based on the new weight data set to improve the accuracy of the predicted weight value.

[0065] Specifically, in some embodiments, a prediction strategy corresponding to the behavior type is adopted for the dynamic weight data to obtain a weight regression equation for the dynamic weight data, and the weight of the livestock is predicted based on the weight regression equation. Specific methods may include:

[0066] Obtaining a preset first screening coefficient α1 and a second screening coefficient α2, as well as a maximum value w0_max in the dynamic weight data;

[0067] Using w0_max*α1 as the first screening value, filter out data whose dynamic weight data are smaller than the first screening value to obtain the first weight data set W1;

[0068] Calculate the mean value mean_maximum of the maximum value of dynamic weight data and the mean value mean_minimum of the minimum value, and calculate the extreme value mean_crest of dynamic weight data based on mean_maximum and mean_minimum;

[0069]

[0070] Using mean_crest*α2 as the second screening value, remove the data in W1 that are smaller than the second screening value to obtain the second weight data set W2;

[0071] According to the second weight data set W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation of the dynamic weight data, and the weight of the livestock is predicted based on the weight regression equation.

[0072] Specifically, the first screening coefficient α1 and the second screening coefficient α2 can be set first, wherein the first screening coefficient α1 and the second screening coefficient α2 can be set according to needs, for example, the value can be between 0.6 and 0.7. Then, the maximum value w0_max in the original dynamic weight data W0 can be obtained first, and the dynamic weight data W0 can be filtered based on α1*w0_max, and the data with a weight less than α1*w0_max is removed to obtain the first weight data set W1. At the same time, n maximum values ​​and m minimum values ​​in the dynamic weight data W0 are obtained and the average value mean_maximum of the maximum value and the average value mean_minimum of the minimum value of the dynamic weight data W0 are calculated, wherein n and m are the number of maximum values ​​and the number of minimum values ​​in the dynamic weight data W0, respectively. Specifically, the calculation method of the average value mean_maximum of the maximum value and the average value mean_minimum of the minimum value of the dynamic weight data W0 is:

[0073] maximum={ma1,…,ma n}

[0074] minimum={mm1,…,mm m}

[0075]

[0076] Then, the extreme mean value mean_crest of the dynamic weight data W0 is calculated using the following formula:

[0077]

[0078] Then, the first data set W1 is filtered based on α2*mean_crest, and data with weight less than α2*mean_crest are removed to obtain the second weight data set W2.

[0079] Specifically, if Figure 3 As shown, Figure 3 3 is a schematic diagram of the change from dynamic weight data to the second weight data set under different behavior types according to an embodiment of the present invention. Among them, Figure (3a) is a schematic diagram of the change from dynamic weight data to the second weight data set under the behavior type of normal passing; Figure (3b) is a schematic diagram of the change from dynamic weight data to the second weight data set under the behavior type of fast passing; Figure (3c) is a schematic diagram of the change from dynamic weight data to the second weight data set under the behavior type of slow passing; Figure (3d) is a schematic diagram of the change from dynamic weight data to the second weight data set under the behavior type of lame passing; Figure (3e) is a schematic diagram of the change from dynamic weight data to the second weight data set under the behavior type of uncooperative passing; Figure (3f) is a schematic diagram of the change from dynamic weight data to the second weight data set under the behavior type of non-livestock behavior.

[0080] After obtaining the second weight data set W2, based on the second weight data set W2, different prediction strategies are used for each behavior type to predict the weight of the livestock.

[0081] Specifically, in some embodiments, based on the second weight data set W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation of the dynamic weight data, and based on the weight regression equation, a specific method of predicting the weight of the livestock may include: if the behavior type is slow passing, then the average value w2_mean of W2 is used as the predicted weight value of the livestock.

[0082] Specifically, in some embodiments, based on the second weight data set W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation for the dynamic weight data. A specific method for predicting the weight of the livestock based on the weight regression equation may also include: if the behavior type is one of normal passage, rapid passage, uncooperative passage, or non-livestock behavior, then the data in W2 is input into a pre-trained weight regression equation corresponding to the behavior type to calculate a predicted value for the livestock weight. Specifically, for the normal passage, rapid passage, and uncooperative passage categories, the data in W2 is input into a weight regression equation formed by combining weight coefficients and bias terms pre-trained using a linear regression model to perform predictions. The resulting target variable value is the predicted weight result for the livestock.

[0083] Specifically, in some embodiments, based on the second weight dataset W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation for the dynamic weight data. Predicting the livestock's weight based on the weight regression equation may further include: if the behavior type is lameness, obtaining peak band data from W1 and filtering out data with values ​​less than mean_crest from each peak band data to obtain a plurality of peak segments; then comparing the durations of each peak segment and forming a third weight dataset W3 based on the data of the peak segment with the longest duration; then inputting the data in W3 into a pre-trained weight regression equation corresponding to the behavior type to calculate a predicted livestock weight value. Specifically, for the lameness category, the peak band data is first obtained, then values ​​above the previously calculated extreme mean mean_crest are obtained as a dividing line, and the peak segment with the longest duration is obtained to obtain the third weight dataset W3. This is then input into a weight regression equation formed by combining weight coefficients and bias terms pre-trained using a linear regression model for prediction. The resulting target variable value is the predicted weight result for the livestock.

[0084] In addition, in some embodiments, based on the second weight data set W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation for the dynamic weight data, and based on the weight regression equation, a specific method for predicting the weight of livestock may also include: if the behavior type is non-livestock behavior, the weight of non-livestock targets on the scale, such as people or static objects, can also be predicted. Specifically, it can use the data in W2 to input a weight regression equation formed by combining weight coefficients and bias terms obtained by pre-training a linear regression model to perform prediction, and the obtained target variable value is the weight prediction result for the target.

[0085] In the present invention, the linear regression model mentioned above is to find a best-fit straight line that minimizes the error between the predicted value and the true value. The error here refers to the difference between the predicted weight value and the true weight value, which is usually measured using the least squares method. The least squares method determines the slope and intercept of the best-fit straight line by minimizing the sum of the squares of the errors. The model estimates the slope by calculating the covariance between the independent variable X and the dependent variable Y and the variance of the independent variable X, and estimates the intercept by calculating the mean and slope of the dependent variable. During the training process, the linear regression model will fit the optimal straight line parameters based on the provided training data, which can then be used to predict new data points.

[0086] In some embodiments, when training to obtain the weight regression equation corresponding to each behavior type, a series of dynamic weight data recorded for the livestock under each behavior type can be first obtained, and the actual weight data of the livestock can be obtained by other means, such as using a floor scale to measure the weight of the livestock in a static state. Then, the second weight data set W2 (corresponding to normal passing, fast passing, uncooperative passing, and non-livestock behavior) or the third weight data set W3 (corresponding to lame passing) calculated based on the dynamic weight data is used as the independent variable X, and the actual weight data is used as the dependent variable Y. The linear regression model is continuously fitted and trained to obtain the weight coefficients w1, ..., wn and the bias term b of the weight regression equation corresponding to the behavior type, thereby forming the weight regression equation y = X*w+b corresponding to each behavior type.

[0087] When predicting, simply substitute the data from the corresponding dataset into the weight regression equation y = X*w + b to calculate the predicted weight value y. This predicted weight value y is close to the actual weight of the livestock and can be recorded as the actual weight data of the livestock.

[0088] Specifically, if Figure 4 As shown, Figure 4 4 is a schematic diagram showing the comparison between the predicted weight value and the actual weight value obtained under different behavior types according to an embodiment of the present invention. Among them, Figure (4a) is a schematic diagram showing the comparison between the predicted weight value and the actual weight value obtained under the behavior type of normal passing; Figure (4b) is a schematic diagram showing the comparison between the predicted weight value and the actual weight value obtained under the behavior type of fast passing; Figure (4c) is a schematic diagram showing the comparison between the predicted weight value and the actual weight value obtained under the behavior type of slow passing; Figure (4d) is a schematic diagram showing the comparison between the predicted weight value and the actual weight value obtained under the behavior type of lame passing; Figure (4e) is a schematic diagram showing the comparison between the predicted weight value and the actual weight value obtained under the behavior type of uncooperative passing; Figure (4f) is a schematic diagram showing the comparison between the predicted weight value and the actual weight value obtained under the behavior type of non-livestock behavior.

[0089] Specifically, in some embodiments, the independent variables of the weight regression equation can also be one or more of the maximum value, average value, extreme value mean, median, and mode of the dynamic weight data. When training the weight regression model, one or more of the maximum value, average value, extreme value mean, median, or mode of the second or third data set is first obtained, and then the weight regression equation is trained using these data as the independent variable X. When predicting weight, after obtaining the second or third data set, one or more of the maximum value, average value, extreme value mean, median, or mode of the second or third data set is further obtained. The specific data is determined based on the data used in the trained weight regression equation, and then these data are input into the corresponding weight regression equation to calculate the predicted weight of the livestock.

[0090] This method uses raw dynamic weight data to plot weight change curves, then uses a classification network model to classify livestock behavior types. Finally, different prediction strategies are applied to the dynamic weight data based on the different behavior types, enabling dynamic weighing. This effectively reduces weight prediction errors and improves prediction accuracy. Furthermore, the present invention can also be used in health and disease monitoring equipment to monitor livestock health and provide early warning of diseases.

[0091] Corresponding to the livestock weight measurement method embodiment described above, the present invention also provides a livestock weight measurement device.

[0092] like Figure 5 As shown, Figure 5 FIG1 is a schematic structural diagram of a livestock weight measuring device according to an embodiment of the present invention, comprising the following modules:

[0093] The data acquisition module 510 is used to obtain dynamic weight data recorded when livestock pass through the weighbridge;

[0094] The curve drawing module 520 is used to obtain a weight change curve of the livestock based on the dynamic weight data;

[0095] The behavior classification module 530 is used to input the weight change curve graph into a preset classification network model to obtain the behavior type of the livestock; the behavior type is one of normal passing, fast passing, slow passing, lame passing, uncooperative passing, and non-livestock behavior;

[0096] The weight prediction module 540 is used to adopt a prediction strategy corresponding to the behavior type for the dynamic weight data, obtain a weight regression equation for the dynamic weight data, and predict the weight of the livestock based on the weight regression equation.

[0097] Preferably, the classification network model can be a ResNet18 network model, which is specifically used to extract features of the weight change curve graph, integrate features through maximum pooling, and determine the behavior type of livestock based on the features.

[0098] Preferably, a prediction strategy corresponding to the behavior type is adopted for the dynamic weight data to obtain a weight regression equation of the dynamic weight data, and the weight of the livestock is predicted based on the weight regression equation, specifically including:

[0099] Obtaining a preset first screening coefficient α1 and a second screening coefficient α2, as well as a maximum value w0_max in the dynamic weight data;

[0100] Using w0_max*α1 as a first screening value, filter out data whose dynamic weight data is smaller than the first screening value to obtain a first weight data set W1;

[0101] Calculate the average value mean_maximum of the maximum value and the average value mean_minimum of the minimum value of the dynamic weight data, and calculate the extreme value mean_crest of the dynamic weight data based on mean_maximum and mean_minimum; wherein,

[0102]

[0103] Using mean_crest*α2 as the second screening value, remove the data in W1 that are smaller than the second screening value to obtain the second weight data set W2;

[0104] According to the second weight data set W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation of the dynamic weight data, and the weight of the livestock is predicted based on the weight regression equation.

[0105] Preferably, based on the second weight data set W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation of the dynamic weight data, and the weight of the livestock is predicted based on the weight regression equation, including:

[0106] If the behavior type is slow passing, the average value w2_mean of W2 is used as the predicted value of the livestock's weight.

[0107] Preferably, based on the second weight data set W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation of the dynamic weight data, and the weight of the livestock is predicted based on the weight regression equation, including:

[0108] If the behavior type is one of normal passing, fast passing and uncooperative passing, the data in W2 is input into the pre-trained weight regression equation corresponding to the behavior type to calculate the predicted weight value of the livestock.

[0109] Preferably, based on the second weight data set W2, a prediction strategy corresponding to the behavior type is adopted to obtain a weight regression equation of the dynamic weight data, and the weight of the livestock is predicted based on the weight regression equation, including:

[0110] If the behavior type is lame pass, obtain the peak band data in W1, and filter out the data smaller than mean_crest in each peak band data to obtain several peak segments;

[0111] Comparing the durations of the various peak segments, and forming a third weight data set W3 based on the data of the peak segment with the longest duration;

[0112] The data in W3 are input into the pre-trained weight regression equation corresponding to the behavior type to calculate the predicted weight value of the livestock.

[0113] Preferably, the independent variable of the weight regression equation may be one or more of the maximum value, average value, extreme value mean, median and mode of the dynamic weight data.

[0114] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0115] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present invention. Those of ordinary skill in the art can understand and implement it without paying any creative work.

[0116] Corresponding to the above-mentioned livestock weight measurement device embodiment, the present invention also provides a livestock weight measurement system.

[0117] like Figure 6 As shown, Figure 6 1 is a schematic diagram illustrating the structure of a livestock weight measurement system according to one embodiment of the present invention. The livestock weight measurement system includes a weighbridge 610 and a livestock weight measurement device 620. The data acquisition module 510 in the livestock weight measurement device 620 is in communication with the weighbridge 610 to obtain data collected by the weighbridge 610 when livestock passes through the weighbridge 610. Specifically, the livestock weight measurement device 620 can be any of the livestock weight measurement devices described in the aforementioned embodiments of the present invention, and the present invention is not limited thereto.

[0118] The implementation process of the functions and effects of each module in the livestock weight measurement device 620 is detailed in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0119] The present invention also provides a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the aforementioned embodiments is implemented.

[0120] Figure 7 7 shows a more specific hardware structure diagram of a computing device provided by the present invention. The device may include: a processor 701, a memory 702, an input / output interface 703, a communication interface 704, and a bus 705. The processor 701, the memory 702, the input / output interface 703, and the communication interface 704 are connected to each other within the device via the bus 705.

[0121] The processor 701 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the present invention. The processor 701 can also include a graphics card, which can be an Nvidia Titan X graphics card or a 1080Ti graphics card.

[0122] The memory 702 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 702 can store an operating system and other application programs. When the technical solution provided by the present invention is implemented through software or firmware, the relevant program code is stored in the memory 702 and is called and executed by the processor 701.

[0123] The input / output interface 703 is used to connect to the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.

[0124] The communication interface 704 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WIFI, Bluetooth, etc.).

[0125] The bus 705 comprises a pathway for transmitting information between various components of the device (eg, the processor 701 , the memory 702 , the input / output interface 703 , and the communication interface 704 ).

[0126] It should be noted that although the above device only shows the processor 701, memory 702, input / output interface 703, communication interface 704, and bus 705, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will understand that the above device may only include the components necessary to implement the solution of the present invention, and does not necessarily include all the components shown in the figure.

[0127] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the method described in any of the aforementioned embodiments when the program is executed by a processor.

[0128] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0129] From the above description of the embodiments, it can be seen that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus the necessary general-purpose hardware platform. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention or certain parts of the embodiments.

[0130] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.

[0131] Each embodiment of the present invention is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely illustrative, wherein the modules described as separate components may or may not be physically separated. When implementing the scheme of the present invention, the functions of each module can be implemented in the same one or more software and / or hardware. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the scheme of this embodiment. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0132] Obviously, the above embodiments of the present invention are merely examples for the purpose of illustrating the present invention, and are not intended to limit the embodiments of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.

Claims

1. A method for measuring livestock weight, characterized in that: The method comprises: obtaining dynamic weight data recorded when the livestock passes through the weighbridge; Obtaining a weight change curve graph of the livestock according to the dynamic weight data; Inputting the weight change curve graph into a preset classification network model to obtain the behavior type of the livestock; the behavior type is one of normal passing, fast passing, slow passing, lame passing, uncooperative passing, and non-livestock behavior; The classification network model is a ResNet18 network model, which is specifically used to extract features of the weight change curve graph, integrate the features through maximum pooling, and determine the behavior type of the livestock based on the features; Adopting a prediction strategy corresponding to the behavior type for the dynamic weight data, obtaining a weight regression equation for the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation, specifically comprising: Get the preset first screening coefficient and the second screening coefficient , and the maximum value of the dynamic weight data ; by The first screening value is used to filter out the data whose dynamic weight data is smaller than the first screening value to obtain the first weight data set. ; Calculate the average value of the maximum value of the dynamic weight data and the average of the minimum values , and according to and Calculate the extreme mean of the dynamic weight data ;in, by is the second screening value, screening out The second weight data set is obtained by ; According to the second weight data set , adopting a prediction strategy corresponding to the behavior type, obtaining a weight regression equation of the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation.

2. The method according to claim 1, characterized in that According to the second weight data set , adopting a prediction strategy corresponding to the behavior type, obtaining a weight regression equation of the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation, including: If the behavior type is slow passing, Average value is the predicted weight of the livestock.

3. The method according to claim 2, characterized in that According to the second weight data set , adopting a prediction strategy corresponding to the behavior type, obtaining a weight regression equation of the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation, including: If the behavior type is one of normal passing, fast passing and non-cooperative passing, then The data in is input into a pre-trained weight regression equation corresponding to the behavior type to calculate the predicted weight value of the livestock.

4. The method according to claim 1, wherein According to the second weight data set , adopting a prediction strategy corresponding to the behavior type, obtaining a weight regression equation of the dynamic weight data, and predicting the weight of the livestock based on the weight regression equation, including: If the behavior type is lame pass, get The peak band data in the , and filter out the peak band data less than Data from the 3D image are used to obtain several peak segments; Compare the duration of each peak segment and form a third weight data set based on the data of the peak segment with the longest duration ; Will The data in is input into a pre-trained weight regression equation corresponding to the behavior type to calculate the predicted weight value of the livestock.

5. The method according to claim 1, wherein The independent variables of the weight regression equation are one or more of the maximum value, average value, extreme value mean, median and mode of the dynamic weight data.

6. A livestock weight measuring device, using the livestock weight measuring method according to any one of claims 1 to 5, characterized in that: The device comprises: A data acquisition module, used for acquiring dynamic weight data recorded when the livestock passes through the weighbridge; A curve drawing module, used for obtaining a weight change curve of the livestock according to the dynamic weight data; a behavior classification module, configured to input the weight change curve graph into a preset classification network model to obtain a behavior type of the livestock; the behavior type being one of normal passing, fast passing, slow passing, lame passing, uncooperative passing, and non-livestock behavior; The weight prediction module is used to adopt a prediction strategy corresponding to the behavior type for the dynamic weight data, obtain a weight regression equation of the dynamic weight data, and predict the weight of the livestock based on the weight regression equation.

7. A livestock weight measurement system, characterized in that: The system comprises a floor scale and the livestock weight measuring device according to claim 6.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the livestock weight measurement method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Poultry automatic weighing method and system

    CN108344480A

  • Method for dynamically measuring weight of swinery and analyzing growth trend of swinery

    CN112966651A