A method for predicting the weight of a dairy cow

By constructing a dairy cow weight prediction model using neural networks and greedy algorithms, and using 3D point cloud data for weight prediction, the problems of time-consuming and laborious measurement and stress response of weight scales are solved, and efficient and accurate weight monitoring is achieved.

CN116972942BActive Publication Date: 2026-05-29AMU CLOUD (GUIZHOU) TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AMU CLOUD (GUIZHOU) TECHNOLOGY CO LTD
Filing Date
2023-08-07
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The existing technology of using a weighing scale to measure the weight of dairy cows is time-consuming and laborious, easily causing stress to the cows, and the measurement accuracy is difficult to control.

Method used

A neural network is used to construct a dairy cow weight prediction model. By using historical 3D point cloud data and weight data of dairy cows, network parameter encoding is generated through training. Combined with greedy algorithm and mutation update, a trained weight prediction model is constructed, and weight prediction is performed using real-time 3D point cloud data.

Benefits of technology

It improved the efficiency of weight monitoring, avoided stress reactions in dairy cows, and enhanced measurement accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116972942B_ABST
    Figure CN116972942B_ABST
Patent Text Reader

Abstract

The application discloses a kind of dairy cow weight prediction methods, belong to dairy cow weight prediction technical field, historical three-dimensional point cloud data and dairy cow historical weight are obtained, and based on this, dairy cow weight prediction model is trained, then real-time three-dimensional point cloud data are obtained, and the input of dairy cow weight prediction model is constructed with real-time three-dimensional point cloud data, so that the weight of dairy cow can be predicted, the method of deep learning not only improves weight monitoring efficiency, but also avoids emergency reaction of dairy cow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of dairy cow weight prediction technology, and specifically relates to a method for predicting dairy cow weight. Background Technology

[0002] Measurement of cow weight plays a crucial role in dairy cow breeding and reproduction. Cow weight is not only an important indicator of growth and development, but also a primary basis for assessing production performance, monitoring fattening, diagnosing diseases, daily weight gain, and milk production. Currently, most dairy farms in China use weighing scales to measure cow weight. This method is time-consuming and labor-intensive, easily causing stress in cows, reducing milk production, and its measurement accuracy is difficult to control. Summary of the Invention

[0003] This invention provides a method for predicting the weight of dairy cows, which solves the problems of time-consuming and labor-intensive methods, stress response in dairy cows, reduced milk production, and difficulty in controlling measurement accuracy caused by using a scale to measure the weight of dairy cows in the prior art.

[0004] A method for predicting the weight of dairy cows includes:

[0005] Acquire historical 3D point cloud data and historical weight of dairy cows, and construct historical weight data based on the historical 3D point cloud data and historical weight of dairy cows;

[0006] A dairy cow weight prediction model is constructed using a neural network, the network parameters of the dairy cow weight prediction model are generated, the network parameter codes are obtained, and multiple network parameter codes are acquired.

[0007] Based on historical weight data, the fitness of each network parameter encoding is obtained, and the network parameter encodings are sorted in descending order of fitness.

[0008] The network parameter encoding of the first half is updated for the first time, and the network parameter encoding of the second half is updated for the second time to obtain the updated network parameter encoding, and thus obtain the encoding population;

[0009] A portion of the network parameter codes are randomly selected from the coding population for a third update, resulting in an updated coding population. A greedy algorithm is then used to mutate and update the network parameter codes in the updated coding population, resulting in a second updated coding population.

[0010] After the maximum number of updates is reached, the optimal code in the second updated coding population is output, and this optimal code is used as the final network parameter of the dairy cow weight prediction model to obtain the trained dairy cow weight prediction model; before the maximum number of updates is reached, the fitness sorting step is returned to the second update based on the network parameter encoding in the second updated coding population.

[0011] Acquire real-time 3D point cloud data of dairy cows, and obtain the predicted weight of dairy cows based on the real-time 3D point cloud data and the trained dairy cow weight prediction model.

[0012] Further, historical 3D point cloud data and historical weight of the cows are acquired, and historical weight data is constructed based on the historical 3D point cloud data and historical weight of the cows, including:

[0013] Acquire historical 3D point cloud data and historical weight of dairy cows, both of which are pre-stored data.

[0014] Based on historical 3D point cloud data of dairy cows, the body oblique length, body straight length, shoulder width, belly width, body height, and body depth of dairy cows are obtained;

[0015] Input data is constructed using the cow's body length, body length, shoulder width, belly width, body height, and body depth. Ground truth label data is constructed using the cow's historical weight, resulting in historical weight data, i.e., training data.

[0016] Furthermore, a dairy cow weight prediction model is constructed using a neural network, generating network parameters for the model, obtaining network parameter codes, and acquiring multiple network parameter codes, including:

[0017] A convolutional neural network was used to construct a dairy cow weight prediction model;

[0018] Determine the upper and lower limits of the network parameters for the dairy cow weight prediction model, and randomly generate each dimension parameter of the dairy cow weight prediction model between the upper and lower limits to obtain the network parameter code corresponding to the dairy cow weight prediction model. Obtain the network parameter code multiple times to obtain multiple network parameter codes.

[0019] Furthermore, based on historical weight data, the fitness of each network parameter encoding is obtained, and the network parameter encodings are sorted in descending order of fitness, including:

[0020] Network parameter encoding is applied to a dairy cow weight prediction model. The input data from historical weight data is used as the input to the dairy cow weight prediction model, and the ground truth label data from historical weight data is used as the expected output of the dairy cow weight prediction model to obtain the fitness of the network parameter encoding.

[0021] Obtain the fitness of each network parameter encoding and sort the network parameter encodings in descending order of fitness.

[0022] Furthermore, the network parameter encoding of the first half is updated as follows:

[0023]

[0024] ω=(ω min +ω max ) / 2+(ω min +ω max cos(tπ / T)

[0025] in, This represents the j-th dimension parameter in the encoding of the i-th network parameter during the t-th update process. Indicates the updated i = 1, 2, ..., I, where I represents the total number of network parameter codes for the first update; j = 1, 2, ..., J, where J represents the total number of parameter dimensions in the network parameter codes; and ω represents the inertia weight. Let M represent the j-th dimension parameter of the global optimum during the t-th update process, rand represent the first random number between (0,1), Q represent the second random number following a normal distribution [0,1], R1 represent the second random number between (0,1), and M... S Let ω represent a constant between (0.5, 1). min The inertia weight ω represents the initial weight at the start of the iteration. max The inertia weight at the end of the iteration is represented by π, and T represents the maximum number of updates.

[0026] Furthermore, the second half of the network parameter encoding is updated a second time, including:

[0027]

[0028] in, This represents the j-th dimension parameter in the encoding of the n-th network parameter during the t-th update process. Indicates the updated n = 1, 2, ..., N, where N represents the total number of network parameter codes to be updated in the second update. This represents the j-th dimension parameter in the network parameter encoding with the minimum fitness during the t-th update process. Let A represent the j-th dimension parameter in the network parameter encoding with the highest fitness during the t-th update process, and let A represent a random number between -1 and 1.

[0029] Furthermore, a portion of the network parameter encodings are randomly selected from the encoding population for a third update, resulting in an updated encoding population, including:

[0030]

[0031] in, This represents the j-th dimension parameter in the encoding of the m-th network parameter during the t-th update process. Indicates the updated version m = 1, 2, ..., M, where M represents the total number of network parameter codes to be updated for the third time. This represents the j-th dimension parameter in the network parameter encoding with the minimum fitness during the t-th update process. This represents the j-th dimension parameter in the network parameter encoding that has the highest fitness during the t-th update process. f represents the fitness of the network parameter encoding with the highest fitness during the t-th update. m t express The corresponding fitness level.

[0032] Furthermore, for the updated coding population, a greedy algorithm is used to mutate and update the network parameter coding, resulting in a second-updated coding population, including:

[0033] For the updated coding population, the network parameter codes in the coding population are arranged in descending order of fitness. The first target network parameter code is extracted from the first half of the network parameter codes, and the second and third target network parameter codes are extracted from the second half of the network parameter codes. The second target network parameter code is different from the third target network parameter code.

[0034] Based on the encoding of the first target network parameters, the encoding of the second target network parameters, and the encoding of the third target network parameters, the mutation encoding is obtained as follows:

[0035]

[0036] Among them, V G+1 Indicates the variant encoding. Indicates the encoding of the first target network parameters. This indicates the encoding of the second target network parameters. This represents the encoding of the third target network parameters, where γ represents the scaling factor;

[0037] For each network parameter encoding in the updated encoding population, a crossover operation is performed between the network parameter encoding and the mutated encoding to obtain a crossover encoding; the crossover operation is as follows:

[0038]

[0039] in, This represents the j-th dimension parameter in the network parameter encoding. This represents the j-th dimension parameter in the mutation encoding. Let Rj represent the j-th dimension parameter in the cross-coding, R2 represent the third random number between (0,1), and C represent the cross rate between (0,1).

[0040] Based on cross-coding, a greedy algorithm is used to update the network parameter encoding, resulting in a second-updated encoding population.

[0041] Furthermore, based on cross-coding, a greedy algorithm is used to update the network parameter encoding, resulting in a second-updated encoding population, including:

[0042] Obtain the fitness of the cross-coding and the fitness of the network parameter encoding, and determine whether the fitness of the cross-coding is greater than that of the network parameter encoding. If so, replace the network parameter encoding with the cross-coding to obtain the encoded population after the second update. Otherwise, retain the network parameter encoding to obtain the encoded population after the second update.

[0043] Furthermore, real-time 3D point cloud data of the cows is acquired, and based on the real-time 3D point cloud data and the trained cow weight prediction model, the predicted weight of the cows is obtained, including:

[0044] Acquire real-time 3D point cloud data of dairy cows, and based on the real-time 3D point cloud data of dairy cows, obtain the cow's body oblique length, body straight length, shoulder width, belly width, body height, and body depth;

[0045] Input data is constructed using the cow's body length, body length, shoulder width, belly width, body height, and body depth. This input data is then fed into the trained cow weight prediction model to obtain the cow's predicted weight.

[0046] This invention provides a method for predicting the weight of dairy cows. It acquires historical 3D point cloud data and the historical weight of dairy cows, and trains a dairy cow weight prediction model based on this data. Then, it acquires real-time 3D point cloud data and uses the real-time 3D point cloud data as input to construct the dairy cow weight prediction model, thereby enabling the prediction of dairy cow weight. The use of deep learning not only improves the efficiency of weight monitoring, but also avoids emergency reactions in dairy cows. Attached Figure Description

[0047] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0048] Figure 1 A flowchart of a method for predicting the weight of dairy cows provided by the present invention.

[0049] The accompanying drawings have illustrated specific embodiments of the invention, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the invention in any way, but rather to illustrate the concept of the invention to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0050] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0051] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0052] like Figure 1 As shown, a method for predicting the weight of dairy cows includes:

[0053] S101. Obtain historical 3D point cloud data and historical weight of the cows, and construct historical weight data based on the historical 3D point cloud data and historical weight of the cows.

[0054] Cow weight is highly correlated with body size parameters; therefore, extracted cow body size data can be used to predict cow weight.

[0055] Various body size parameters of dairy cows can be obtained through historical 3D point cloud data, and the historical weight of dairy cows can be data that is manually measured and recorded. Therefore, the correlation between the body size parameters of dairy cows and their historical weight can be learned.

[0056] S102. A dairy cow weight prediction model is constructed using a neural network, the network parameters of the dairy cow weight prediction model are generated, the network parameter codes are obtained, and multiple network parameter codes are acquired.

[0057] Optionally, the neural network can be set as a convolutional neural network, and network parameters can be generated between the upper and lower bounds of the network parameters to obtain the network parameter encoding. The network parameters can be the weights and bias parameters of the cow weight prediction model.

[0058] S103. Based on historical weight data, obtain the fitness of each network parameter encoding and sort the network parameter encodings in descending order of fitness.

[0059] Optionally, fitness is used to represent the quality of an individual network parameter encoding; a higher fitness indicates better network parameters. The error function of a convolutional neural network can also represent the quality of network training; a smaller error function indicates better network parameters. Therefore, the reciprocal of the error function can be used as the fitness function. Furthermore, to avoid the denominator being zero, a very small constant can be added, which has minimal impact on the calculation result while still preventing the denominator from being zero. For example, adding 0.00001 to the denominator.

[0060] S104. Perform a first update on the network parameter encoding of the first half and a second update on the network parameter encoding of the second half to obtain the updated network parameter encoding and obtain the encoding population.

[0061] The first update can be a search of the solution space, and the second update can be a local search, thus balancing search efficiency with avoiding getting trapped in local optima.

[0062] S105. Randomly select a portion of the network parameter codes from the coding population for a third update to obtain the updated coding population. Then, for the updated coding population, use a greedy algorithm to mutate and update the network parameter codes to obtain the second updated coding population.

[0063] Although the algorithm can search for the global optimum after the first, second, and third updates, its search accuracy is generally low. To further improve the search capability of the algorithm, a greedy algorithm is used to mutate and update the network parameter encoding to obtain the encoded population after the second update, thereby improving the convergence speed, accuracy, and global optimization capability.

[0064] S106. After the maximum number of updates is reached, output the optimal code in the updated coding population and use this optimal code as the final network parameters of the cow weight prediction model to obtain the trained cow weight prediction model. Before the maximum number of updates is reached, return to the fitness sorting step based on the network parameter codes in the updated coding population for the next update.

[0065] Optionally, an update termination condition can be set. Once the termination condition is met, the optimal code can be output. For example, an error threshold can be set. When the error function value corresponding to a certain network parameter code is less than the error threshold, the update can be terminated and the optimal code can be output.

[0066] S107. Obtain real-time 3D point cloud data of the cows, and obtain the predicted weight of the cows based on the real-time 3D point cloud data and the trained cow weight prediction model.

[0067] To ensure consistency of input data, real-time 3D point cloud data needs to undergo the same processing as historical 3D point cloud data.

[0068] This invention provides a method for predicting the weight of dairy cows. It acquires historical 3D point cloud data and the historical weight of dairy cows, and trains a dairy cow weight prediction model based on this data. Then, it acquires real-time 3D point cloud data and uses the real-time 3D point cloud data as input to construct the dairy cow weight prediction model, thereby enabling the prediction of dairy cow weight. The use of deep learning not only improves the efficiency of weight monitoring, but also avoids emergency reactions in dairy cows.

[0069] In this embodiment, historical 3D point cloud data and historical weight of dairy cows are acquired, and historical weight data is constructed based on the historical 3D point cloud data and historical weight of dairy cows, including:

[0070] The system acquires historical 3D point cloud data and historical weight of dairy cows, both of which are pre-stored data. It's worth noting that, in addition to pre-stored data, the historical 3D point cloud data and historical weight can also be obtained from other data sources. For example, data input by staff through human-computer interaction can be received.

[0071] Based on historical 3D point cloud data of dairy cows, the body oblique length, body straight length, shoulder width, belly width, body height, and body depth of dairy cows are obtained.

[0072] The input to a convolutional neural network is typically an image, but it can also be matrix data. Therefore, in this embodiment, the input data is constructed as matrix data. For example, the body length, body width, shoulder width, belly width, body height, and body depth of a cow are continuously acquired over P days, and the data from these P days are combined into a P×6 matrix.

[0073] Body oblique length represents the Euclidean distance from the cow's shoulder tip to the ischial tuberosity. Body straight length represents the horizontal distance from the cow's shoulder tip to the vertical line of the ischial tuberosity. Shoulder width represents twice the distance from the cow's shoulder tip to the plane of body symmetry. Abdominal width represents twice the distance from the cow's largest point on its abdomen to the plane of body symmetry. Body height represents the distance from the highest point of the cow's forearm to the ground plane. Body depth represents the vertical distance between the highest and lowest points of the cow's trunk.

[0074] Input data is constructed using the cow's body length, body length, shoulder width, belly width, body height, and body depth. Ground truth label data is constructed using the cow's historical weight, resulting in historical weight data, i.e., training data.

[0075] In this embodiment, a neural network is used to construct a dairy cow weight prediction model, generate network parameters for the dairy cow weight prediction model, obtain network parameter codes, and acquire multiple network parameter codes, including:

[0076] A convolutional neural network was used to construct a model for predicting the weight of dairy cows.

[0077] It is worth noting that, in addition to using convolutional neural networks to build a cow weight prediction model, other neural networks can also be used as cow weight prediction modules.

[0078] Determine the upper and lower limits of the network parameters for the dairy cow weight prediction model, and randomly generate each dimension parameter of the dairy cow weight prediction model between the upper and lower limits to obtain the network parameter code corresponding to the dairy cow weight prediction model. Obtain the network parameter code multiple times to obtain multiple network parameter codes.

[0079] Optionally, in addition to randomly generating network parameters, other network parameter generation mechanisms can also be used to generate network parameters.

[0080] In this embodiment, based on historical weight data, the fitness of each network parameter encoding is obtained, and the network parameter encodings are sorted in descending order of fitness, including:

[0081] Network parameter encoding was applied to a dairy cow weight prediction model. Historical weight data was used as input to the model, and ground truth labels from the historical weight data were used as the expected output. The fitness of the network parameter encodings was obtained. The fitness of each network parameter encoding was calculated and sorted in descending order of fitness.

[0082] In this embodiment, the first half of the network parameter encoding is updated as follows:

[0083]

[0084] ω=(ω min +ω max ) / 2+(ω min +ω max cos(tπ / T)

[0085] in, This represents the j-th dimension parameter in the encoding of the i-th network parameter during the t-th update process. Indicates the updated i = 1, 2, ..., I, where I represents the total number of network parameter codes for the first update; j = 1, 2, ..., J, where J represents the total number of parameter dimensions in the network parameter codes; and ω represents the inertia weight. Let M represent the j-th dimension parameter of the global optimum during the t-th update process, rand represent the first random number between (0,1), Q represent the second random number following a normal distribution [0,1], R1 represent the second random number between (0,1), and M... S Let ω represent a constant between (0.5, 1). min The inertia weight ω represents the initial weight at the start of the iteration. max The inertia weight at the end of the iteration is represented by π, and T represents the maximum number of updates.

[0086] This embodiment introduces the previous generation's global optimal solution and dynamic weight factor, which can prevent the algorithm from getting trapped in local optima and improve convergence speed. As the number of iterations increases, the inertia weight will gradually decrease non-linearly. This is because when the iteration begins, using a larger inertia weight can improve the algorithm's search ability, while in the later stages of the iteration, a smaller inertia weight can enhance the algorithm's exploration ability.

[0087] In this embodiment, the second half of the network parameter encoding is updated, including:

[0088]

[0089] in, This represents the j-th dimension parameter in the encoding of the n-th network parameter during the t-th update process. Indicates the updated n = 1, 2, ..., N, where N represents the total number of network parameter codes to be updated in the second update. This represents the j-th dimension parameter in the network parameter encoding with the minimum fitness during the t-th update process. Let A represent the j-th dimension parameter in the network parameter encoding with the highest fitness during the t-th update process, and let A represent a random number between -1 and 1.

[0090] In this embodiment, a portion of the network parameter codes are randomly selected from the coding population for a third update, resulting in an updated coding population, including:

[0091]

[0092] in, This represents the j-th dimension parameter in the encoding of the m-th network parameter during the t-th update process. Indicates the updated version m = 1, 2, ..., M, where M represents the total number of network parameter codes to be updated for the third time. This represents the j-th dimension parameter in the network parameter encoding with the minimum fitness during the t-th update process. This represents the j-th dimension parameter in the network parameter encoding that has the highest fitness during the t-th update process. This represents the fitness of the network parameter encoding with the highest fitness during the t-th update. express The corresponding fitness level.

[0093] To achieve more efficient searching, once the network parameter encoding is at its optimal position, it is updated to any position between the optimal and worst positions. Otherwise, the updated value is placed at any position between the current and optimal positions. This ensures population diversity, increases search efficiency, and avoids getting trapped in local searches.

[0094] In this embodiment, for the updated coding population, a greedy algorithm is used to mutate and update the network parameter coding to obtain a second-updated coding population, including:

[0095] For the updated coding population, the network parameter codes in the coding population are arranged in descending order of fitness. The first target network parameter code is extracted from the first half of the network parameter codes, and the second and third target network parameter codes are extracted from the second half. The second and third target network parameter codes are different.

[0096] It is worth noting that this embodiment can also use other methods to select the first target network parameter code, the second target network parameter code, and the third target network parameter code. For example, the first target network parameter code can be extracted from the first 20%, 30%, or 40% of the network parameter codes, and the second and third target network parameter codes can be extracted from the remaining network parameter codes.

[0097] Based on the encoding of the first target network parameters, the encoding of the second target network parameters, and the encoding of the third target network parameters, the mutation encoding is obtained as follows:

[0098]

[0099] Among them, V G+1 Indicates the variant encoding. Indicates the encoding of the first target network parameters. This indicates the encoding of the second target network parameters. γ represents the encoding of the third target network parameters, and γ represents the scaling factor.

[0100] For each network parameter encoding in the updated encoding population, a crossover operation is performed between the network parameter encoding and the mutated encoding to obtain a crossover encoding. The crossover operation is as follows:

[0101]

[0102] in, This represents the j-th dimension parameter in the network parameter encoding. This represents the j-th dimension parameter in the mutation encoding. Let R2 represent the j-th dimension parameter in the cross-coding, R2 represent the third random number between (0,1), and C represent the cross rate between (0,1).

[0103] Based on cross-coding, a greedy algorithm is used to update the network parameter encoding, resulting in a second-updated encoding population.

[0104] Although the algorithm in this embodiment considers both global and local search, the method for updating positions, in the process of finding the optimal parameters, cannot fully consider all individuals, being limited to only a small region. This can easily lead to a lack of community richness during iteration, resulting in getting trapped in local optima and mistakenly taking the optimal solution within a small area as the optimal solution for the entire system. This embodiment uses a greedy algorithm to mutate and update the network parameter encoding. During the position update process, there are more points existing in the main positions, covering a wider range, thus overcoming the problem of getting trapped in local optima during the original iteration process.

[0105] In this embodiment, based on cross-coding, a greedy algorithm is used to update the network parameter encoding, resulting in a second-updated encoding population, including:

[0106] Obtain the fitness of the cross-coding and the fitness of the network parameter encoding, and determine whether the fitness of the cross-coding is greater than that of the network parameter encoding. If so, replace the network parameter encoding with the cross-coding to obtain the encoded population after the second update. Otherwise, retain the network parameter encoding to obtain the encoded population after the second update.

[0107] In this embodiment, real-time 3D point cloud data of the cow is acquired, and the predicted weight of the cow is obtained based on the real-time 3D point cloud data and the trained cow weight prediction model, including:

[0108] Acquire real-time 3D point cloud data of dairy cows, and based on the real-time 3D point cloud data of dairy cows, obtain the cow's body oblique length, body straight length, shoulder width, belly width, body height, and body depth.

[0109] Input data is constructed using the cow's body length, body length, shoulder width, belly width, body height, and body depth. This input data is then fed into the trained cow weight prediction model to obtain the cow's predicted weight.

[0110] To ensure the consistency of input data, real-time 3D point cloud data needs to be converted into the data format used for training the neural network. For example, obtain 3D point cloud data from the previous P days and convert it into P*6 matrix data.

[0111] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.

[0112] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for predicting the weight of dairy cows, characterized in that, include: Acquire historical 3D point cloud data and historical weight of dairy cows, and construct historical weight data based on the historical 3D point cloud data and historical weight of dairy cows; A dairy cow weight prediction model is constructed using a neural network, the network parameters of the dairy cow weight prediction model are generated, the network parameter codes are obtained, and multiple network parameter codes are acquired. Based on historical weight data, the fitness of each network parameter encoding is obtained, and the network parameter encodings are sorted in descending order of fitness. The network parameter encoding of the first half is updated for the first time, and the network parameter encoding of the second half is updated for the second time to obtain the updated network parameter encoding, and thus obtain the encoding population; A portion of the network parameter codes are randomly selected from the coding population for a third update, resulting in an updated coding population. A greedy algorithm is then used to mutate and update the network parameter codes in the updated coding population, resulting in a second updated coding population. After the maximum number of updates is reached, the optimal code in the second updated coding population is output, and this optimal code is used as the final network parameter of the dairy cow weight prediction model to obtain the trained dairy cow weight prediction model; before the maximum number of updates is reached, the fitness sorting step is returned to the second update based on the network parameter encoding in the second updated coding population. Acquire real-time 3D point cloud data of dairy cows, and obtain the predicted weight of dairy cows based on the real-time 3D point cloud data and the trained dairy cow weight prediction model.

2. The method for predicting dairy cow weight according to claim 1, characterized in that, Acquire historical 3D point cloud data and historical weight of dairy cows, and construct historical weight data based on the historical 3D point cloud data and historical weight of dairy cows, including: Acquire historical 3D point cloud data and historical weight of dairy cows, both of which are pre-stored data. Based on historical 3D point cloud data of dairy cows, the body oblique length, body straight length, shoulder width, belly width, body height, and body depth of dairy cows are obtained; Input data is constructed using the cow's body length, body length, shoulder width, belly width, body height, and body depth. Ground truth label data is constructed using the cow's historical weight, resulting in historical weight data, i.e., training data.

3. The method for predicting dairy cow weight according to claim 2, characterized in that, A neural network is used to construct a dairy cow weight prediction model, generating network parameters for the model, obtaining network parameter codes, and acquiring multiple network parameter codes, including: A convolutional neural network was used to construct a dairy cow weight prediction model; Determine the upper and lower limits of the network parameters for the dairy cow weight prediction model, and randomly generate each dimension parameter of the dairy cow weight prediction model between the upper and lower limits to obtain the network parameter code corresponding to the dairy cow weight prediction model. Obtain the network parameter code multiple times to obtain multiple network parameter codes.

4. The method for predicting dairy cow weight according to claim 3, characterized in that, Based on historical weight data, the fitness of each network parameter encoding is obtained, and the network parameter encodings are sorted in descending order of fitness, including: Network parameter encoding is applied to a dairy cow weight prediction model. The input data from historical weight data is used as the input to the dairy cow weight prediction model, and the ground truth label data from historical weight data is used as the expected output of the dairy cow weight prediction model to obtain the fitness of the network parameter encoding. Obtain the fitness of each network parameter encoding and sort the network parameter encodings in descending order of fitness.

5. The method for predicting dairy cow weight according to claim 3, characterized in that, The first half of the network parameter encoding is updated as follows: ω=(ω min +oh max ) / 2+(ω min +oh max )cos(tπ / T) in, This represents the j-th dimension parameter in the encoding of the i-th network parameter during the t-th update process. Indicates the updated i = 1, 2, ..., I, where I represents the total number of network parameter codes for the first update; j = 1, 2, ..., J, where J represents the total number of parameter dimensions in the network parameter codes; and ω represents the inertia weight. Let M represent the j-th dimension parameter of the global optimum during the t-th update process, rand represent the first random number between (0,1), Q represent the second random number following a normal distribution [0,1], R1 represent the second random number between (0,1), and M... S Let ω represent a constant between (0.5, 1). min The inertia weight ω represents the initial weight at the start of the iteration. max The inertia weight at the end of the iteration is represented by π, and T represents the maximum number of updates.

6. The method for predicting dairy cow weight according to claim 5, characterized in that, The second half of the network parameter encoding is updated, including: in, This represents the j-th dimension parameter in the encoding of the n-th network parameter during the t-th update process. Indicates the updated n = 1, 2, ..., N, where N represents the total number of network parameter codes to be updated in the second update. This represents the j-th dimension parameter in the network parameter encoding with the minimum fitness during the t-th update process. Let A represent the j-th dimension parameter in the network parameter encoding with the highest fitness during the t-th update process, and let A represent a random number between -1 and 1.

7. The method for predicting dairy cow weight according to claim 6, characterized in that, A portion of network parameters are randomly selected from the coding population for a third update, resulting in an updated coding population, including: in, This represents the j-th dimension parameter in the encoding of the m-th network parameter during the t-th update process. Indicates the updated version M represents the total number of network parameter codes that will be updated for the third time. This represents the j-th dimension parameter in the network parameter encoding with the minimum fitness during the t-th update process. This represents the j-th dimension parameter in the network parameter encoding that has the highest fitness during the t-th update process. This represents the fitness of the network parameter encoding with the highest fitness during the t-th update. express The corresponding fitness level.

8. The method for predicting dairy cow weight according to claim 7, characterized in that, For the updated coding population, a greedy algorithm is used to mutate and update the network parameter codes, resulting in a second-updated coding population, including: For the updated coding population, the network parameter codes in the coding population are arranged in descending order of fitness. The first target network parameter code is extracted from the first half of the network parameter codes, and the second and third target network parameter codes are extracted from the second half of the network parameter codes. The second target network parameter code is different from the third target network parameter code. Based on the encoding of the first target network parameters, the encoding of the second target network parameters, and the encoding of the third target network parameters, the mutation encoding is obtained as follows: Among them, V G+1 Indicates the variant encoding. Indicates the encoding of the first target network parameters. This indicates the encoding of the second target network parameters. This represents the encoding of the third target network parameters, where γ represents the scaling factor; For each network parameter encoding in the updated encoding population, a crossover operation is performed between the network parameter encoding and the mutated encoding to obtain a crossover encoding; the crossover operation is as follows: in, V represents the j-th dimension parameter in the network parameter encoding. j G+1 This represents the j-th dimension parameter in the mutation encoding. Let Rj represent the j-th dimension parameter in the cross-coding, R2 represent the third random number between (0,1), and C represent the cross rate between (0,1). Based on cross-coding, a greedy algorithm is used to update the network parameter encoding, resulting in a second-updated encoding population.

9. The method for predicting dairy cow weight according to claim 8, characterized in that, Based on cross-coding, a greedy algorithm is used to update the network parameter encoding, resulting in a second-updated encoding population, including: Obtain the fitness of the cross-coding and the fitness of the network parameter encoding, and determine whether the fitness of the cross-coding is greater than that of the network parameter encoding. If so, replace the network parameter encoding with the cross-coding to obtain the encoded population after the second update. Otherwise, retain the network parameter encoding to obtain the encoded population after the second update.

10. The method for predicting dairy cow weight according to claim 1, characterized in that, Acquire real-time 3D point cloud data of dairy cows, and based on the real-time 3D point cloud data and the trained dairy cow weight prediction model, obtain the predicted weight of the dairy cows, including: Acquire real-time 3D point cloud data of dairy cows, and based on the real-time 3D point cloud data of dairy cows, obtain the cow's body oblique length, body straight length, shoulder width, belly width, body height, and body depth; Input data is constructed using the cow's body length, body length, shoulder width, belly width, body height, and body depth. This input data is then fed into the trained cow weight prediction model to obtain the cow's predicted weight.