Neural network-based cattle weight intelligent measurement system and method
Through real -time detection of the stress status of the cattle and collecting feature data, build a multi -layer perceptual machine model to set the weight control group, solve the problem of large bull weight prediction deviations in existing technologies, improve the accuracy of prediction, reduce the farm field loss.
Patent Information
- Application Number
- CN202411609099.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-01-28
AI Technical Summary
When predicting cattle weight, existing neural networks cause data acquisition deviation due to cattle stress response, which increases prediction deviation and causes farm losses.
By screening the sample and marking, the behavior and physiological status of the standard cow bull in real time, determine whether there is a stress reaction, collect feature data based on the judgment results, build a multi -layer perceptual model to set the weight control group, and make the predicted cattle for weight prediction. Essence
Improve the accuracy of characteristic data collection, reduce the error of predictive weight, improve the accuracy of forecasting, and reduce the loss of farms.
Smart Images

Figure CN119377776A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of neural network technology, and more specifically, to a neural network-based intelligent cattle weight measurement system and method. Background Art
[0002] Neural network technology is a computational model that simulates the working mode of neurons in the human brain. It is used to process complex data and solve various machine learning tasks. It is suitable for image recognition, language processing, etc. The application of neural network and intelligent measurement of cattle weight can improve detection accuracy and reduce breeding losses.
[0003] The prior art has the following deficiencies:
[0004] In the past, when neural networks predicted cattle weight, they needed to collect more feature data as analysis parameters because cattle themselves weigh a lot and have strong stress reactions. When collecting feature data, the stress reactions of the tested cattle would cause the data collection deviation to be too large, which greatly increased the prediction deviation of the neural network and caused losses to the farm. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art, the embodiments of the present invention provide a neural network-based intelligent cattle weight measurement system and method, which screens cattle samples and marks them, detects in real time the behavioral state and physiological state of the marked cattle when collecting characteristic data to determine whether the marked cattle have a stress response, and collects the characteristic data of the marked cattle based on the judgment result to predict the weight of the cattle samples that need to be predicted, so as to solve the problems raised in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] The method for intelligently measuring cattle weight based on neural network includes the following steps:
[0008] Step S1: Obtain historical data of cattle samples, obtain a standard weight range of cattle samples, and screen and mark cattle samples according to the standard weight of cattle samples;
[0009] Step S2: collecting characteristic data of the marked cattle, monitoring the behavioral characteristics and physiological characteristics of the marked cattle in real time, and using fuzzy reasoning to determine whether the marked cattle are in a stress state;
[0010] Step S3: According to the stress state of the marked cattle, the food intake and exercise state of the marked cattle of different weights obtained by detection are selected or the food intake and exercise state of the marked cattle are re-detected, a multi-layer perceptron model is constructed according to the food intake and exercise state of the marked cattle, and a weight control group of the marked cattle is set by the multi-layer perceptron model;
[0011] Step S4: Obtain the predicted food intake and exercise status of the cattle, and predict the weight of the cattle sample according to the weight control group.
[0012] In a preferred embodiment, in step S1, the historical data is a weight record of cattle samples in a historical database, a plurality of weight records of cattle samples are selected, and a standard weight range of the cattle samples is determined using a K-means clustering method according to the weight records of the cattle samples;
[0013] The historical database is a system used to record past testing data, which contains the weight ranges of past cattle samples;
[0014] K-means clustering is a widely used unsupervised learning algorithm to divide a dataset into multiple clusters.
[0015] In a preferred embodiment, in step S1, the standard weight range of the cattle sample is determined using the K-means clustering method according to the weight record of the cattle sample. The specific steps are as follows:
[0016] Record the weight records of cattle samples, randomly select K values as initial centroids, use the difference between two values as the numerical distance, calculate the distance between each weight record value of each cattle sample and each centroid, merge it and the nearest centroid into the same group, and use each group as a cluster. Whenever the weight record value is assigned to a cluster, retain each value in the cluster and recalculate the centroid of each cluster. The centroid is the mean of all data points in the cluster. Repeat the assignment until only three clusters are left. Select the cluster with the middle centroid among the three clusters, and use the range from the minimum to the maximum value of the weight record value in the cluster as the standard weight range of the cattle sample.
[0017] After determining the standard weight range of cattle samples, multiple cattle samples with weights within the standard weight range are selected as analysis samples for data collection, and the selected analysis samples are marked.
[0018] In a preferred embodiment, in step S2, the characteristic data of the marked cattle include the food intake and movement status of the cattle sample, the behavioral characteristics of the marked cattle are the number of calls when the characteristic data is detected, and the physiological characteristics of the marked cattle are the breathing frequency when the characteristic data is detected;
[0019] The movement status is the movement distance of the marked cattle in a fixed time.
[0020] In a preferred embodiment, in step S2, the specific steps of using fuzzy reasoning to determine whether the marked cattle are in a stress state are as follows:
[0021] Behavioral and physiological characteristics of tagged cattle were defined as input variables;
[0022] Whether the marked cattle are in a stress state is defined as the output variable;
[0023] Formulate a set of fuzzy rules to describe the impact of different input variables on the output variables;
[0024] Fuzzy reasoning is performed based on fuzzy rules to determine whether the marked cattle are in a stress state.
[0025] In a preferred embodiment, in step S3, a time interval is selected to collect characteristic data of the marked cattle, and when it is determined that the marked cattle are in a stress state within the time interval, the characteristic data of the marked cattle detected within the corresponding time interval is cancelled and re-collected within the next same time interval;
[0026] The food intake and movement status of the marked cattle are merged into a food intake data set and a movement data set respectively, the weight records of the marked cattle are obtained from the historical database, and the weight records of the marked cattle are merged into a weight data set;
[0027] A multi-layer perceptron model was constructed by integrating the food intake dataset, exercise dataset, and weight dataset to set the weight control group of marked cattle.
[0028] In a preferred embodiment, in step S3, the specific steps of setting the weight control group of the marked cattle using the multi-layer perceptron model are as follows:
[0029] Input data: The food intake dataset and exercise dataset are passed into the input layer as input features. The input layer normalizes the data in the food intake dataset and exercise dataset and then passes them into the hidden layer.
[0030] Initialization parameters: Set the initial weights and bias parameters from the input layer to the hidden layer in the multi-layer perceptron model;
[0031] Hidden layer algorithm setting: The appetite dataset and the exercise dataset are processed by setting the hidden layer activation function, and the activation function is set to calculate the output of the hidden layer. The data in the appetite dataset processed by the input layer and the data in the exercise dataset are weighted summed and then the bias parameter is added to obtain the output of the hidden layer.
[0032] Output layer algorithm settings: Set the activation function of the output layer, and take the sum of the normalized average value of the food intake of the marked cows in the food intake data set and the normalized average value of the movement state of the corresponding marked cows in the movement data set as the output of the output layer;
[0033] Calculate the comparison classification threshold: Compare the output result of the multilayer perceptron model with the preset actual label to calculate the loss function, obtain the calculation result of the loss function by subtracting the actual label from the output result, and use the partial derivatives of the hidden layer weight and bias parameter to the loss function as the gradient weight gradient and bias parameter gradient respectively; subtract the weight or bias parameter from the product of the preset learning rate and gradient to obtain the adjusted weight or bias parameter;
[0034] Repeat the process: calculate the output of each adjusted weight and bias parameter through the output layer, and use each output as a control classification threshold;
[0035] Output result: Arrange the control classification thresholds from small to large, and use two adjacent control classification thresholds as a control classification group. Calculate the output result for each marked cow in the multi-layer perceptron and classify them in the control classification group. Fill the weight record values in the weight data set of the classified marked cows into different control classification groups to obtain a weight control group composed of weight record values, and output the weight control group.
[0036] In a preferred embodiment, in step S4, the predicted food intake and movement status of the cattle are obtained, and the output results obtained by passing the predicted food intake and movement status of the cattle through the input layer, hidden layer and output layer of the multi-layer perceptron in sequence are compared with the control classification group and the predicted weight control group of the cattle is determined, and the average value of the weight record of the corresponding weight control group is used as the predicted weight value of the cattle.
[0037] The neural network-based cattle weight intelligent measurement system is used to implement the above-mentioned neural network-based cattle weight intelligent measurement method, including a data acquisition module, a data monitoring module, a data analysis module and a weight prediction module;
[0038] The data acquisition module is used to collect characteristic data, behavioral characteristics and physiological characteristics of cattle samples and transmit the behavioral characteristics and physiological characteristics to the data monitoring module and the weight prediction module, and transmit the characteristic data to the data analysis module;
[0039] The data monitoring module is used to receive behavioral characteristics and physiological characteristics to determine whether the marked cattle are in a stress state, and transmit the judgment result back to the data acquisition module. The data acquisition module determines whether to re-collect characteristic data based on the judgment result;
[0040] The data analysis module is used to receive feature data to build a multi-layer perceptron model, set a weight control group through the output results of the multi-layer perceptron model, and pass the weight control group to the weight prediction module;
[0041] The weight prediction module is used to receive the characteristic data of the predicted cattle and compare it with the weight control group to predict the weight of the predicted cattle.
[0042] The technical effects and advantages of the neural network-based cattle weight intelligent measurement system and method of the present invention are as follows:
[0043] The present invention detects behavioral changes and physiological changes of cattle samples during the feature data collection stage, determines the detection status of the cattle samples, and judges whether the cattle samples are in a stress state. When the cattle samples are in a stress state, the feature data collection of the cattle samples is stopped and the corresponding feature data is re-detected after the stress reaction ends, thereby greatly improving the feature data collection error and the accuracy of subsequent weight prediction. The feature data detected by cattle samples of different weights are merged to determine the weight range and feature data range of the cattle samples. The weight of the cattle is predicted based on the weight range and feature data range of the cattle samples, thereby improving the accuracy of the predicted cattle weight and reducing the loss of the farm due to weight prediction deviation. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 Schematic diagram of the intelligent cattle weight measurement method based on neural network of the present invention,
[0045] Figure 2 This is a flow chart of the neural network-based intelligent cattle weight measurement system of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] The present invention detects behavioral changes and physiological changes of cattle samples in the feature data collection stage, determines the detection status of the cattle samples to judge whether the cattle samples are in a stress state, stops collecting feature data of the cattle samples when the cattle samples are in a stress state, and re-detects the corresponding feature data after the stress reaction ends, merges the feature data detected by cattle samples of different weights, determines the weight range and feature data range of the cattle samples, and predicts the weight of the cattle according to the weight range and feature data range of the cattle samples, thereby improving the accuracy of predicting the cattle weight and reducing the loss of the farm due to the deviation of weight prediction.
[0048] Example 1, a method for intelligently measuring cattle weight based on a neural network, such as Figure 1 As shown, the following steps are included:
[0049] Step S1: Obtain historical data of cattle samples, obtain a standard weight range of cattle samples, and screen and mark cattle samples according to the standard weight of cattle samples;
[0050] Step S2: collecting characteristic data of the marked cattle, monitoring the behavioral characteristics and physiological characteristics of the marked cattle in real time, and using fuzzy reasoning to determine whether the marked cattle are in a stress state;
[0051] Step S3: According to the stress state of the marked cattle, the food intake and exercise state of the marked cattle of different weights obtained by detection are selected or the food intake and exercise state of the marked cattle are re-detected, a multi-layer perceptron model is constructed according to the food intake and exercise state of the marked cattle, and a weight control group of the marked cattle is set by the multi-layer perceptron model;
[0052] Step S4: Obtain the predicted food intake and exercise status of the cattle, and predict the weight of the cattle sample according to the weight control group.
[0053] The specific implementation is as follows:
[0054] In step S1, the historical data is the weight record of cattle samples in the historical database. After accessing the historical data set to obtain the historical data, the standard weight range of the cattle samples is determined. The weight records of multiple cattle samples are selected. The standard weight range of the cattle samples is determined using the K-means clustering method according to the weight records of the cattle samples. The specific steps are as follows:
[0055] Record the weight records of cattle samples, randomly select K values as the initial centroid, and use the difference between two values as the numerical distance. For each weight record value of cattle samples, calculate its distance to each centroid, and merge it and the nearest centroid into the same cluster, that is, merge into one group. Whenever the weight record value is assigned to a cluster, retain each value in the cluster and recalculate the centroid of each cluster. The centroid is the mean of all data points in the cluster. Repeat the assignment until only three clusters are left. Select the cluster with the center of mass in the middle of the three clusters, and use the range from the minimum to the maximum value of the weight record values in the cluster as the standard weight range of cattle samples.
[0056] After determining the standard weight range of cattle samples, multiple cattle samples with weights within the standard weight range are selected as analysis samples for data collection, and the selected analysis samples are marked.
[0057] It should be noted that the historical database is used to record past test data in the system, which contains the weight range of past cattle samples. K-means clustering is a widely used unsupervised learning algorithm used to divide data sets into multiple clusters, and implement range division and data selection based on multiple clusters. The K-means algorithm is one of the clustering algorithms with a fast calculation speed. The clustering of data in the data set is determined by calculating the final mass point. In this example, the middle cluster is selected as the standard weight range after calculating the remaining three clusters. It can also be set to more than three clusters for processing. In addition, the number of historical data and screened cattle samples can be selected according to the screening accuracy. For example, 100 historical data and 150 screened cattle samples are selected.
[0058] In step S2, the characteristic data of the marked cattle include the food intake and movement status of the cattle sample, and the movement status is the movement distance of the marked cattle in a fixed time. The behavioral characteristics of the marked cattle are the number of calls when the characteristic data is detected, and the physiological characteristics of the marked cattle are the breathing frequency when the characteristic data is detected. The characteristic data, behavioral characteristics and physiological characteristics of the cattle can be obtained by installing a collection device on the cattle sample, including an acoustic sensor to monitor the number of calls of the marked cattle, a respiratory rate monitor to monitor the breathing rate of the marked cattle, and a locator to collect the movement status of the marked cattle.
[0059] It needs to be explained that when cattle are highly nervous, they will make frequent calls and their breathing rate will increase, so it can be determined whether the marked cattle have a stress response. The acoustic sensor is a device used to detect and analyze sound waves, and can be used to record the calls of marked cattle. The respiratory rate monitor is a device used to measure and monitor the respiratory rate of individuals, and can be used to monitor the respiratory rate of marked cattle when collecting characteristic data. The locator is a device that records the movement trajectory of an individual, and can obtain the individual's movement distance based on the individual's running trajectory, and can be used to collect the movement status of the marked cattle.
[0060] The behavioral characteristic threshold and physiological characteristic threshold of the marked cattle are obtained by using the percentile method according to the analysis samples, the number of calls and the respiratory frequency of the marked cattle in the analysis samples are merged into a call data set and a respiratory data set respectively, the data in the call data set or the respiratory data set are arranged from small to large, N% is set as the percentile ratio, and the data value exceeding N% of the data in the call data set or the respiratory data set is used as the behavioral characteristic threshold or the physiological characteristic threshold.
[0061] When collecting characteristic data for weight prediction of cattle, time intervals are set to monitor the marked cattle in real time, the behavioral characteristics and physiological characteristics of the marked cattle are obtained through the collection equipment, and fuzzy reasoning is performed through fuzzy sets.
[0062] In each time interval, it is judged whether the marked cattle are in a stress state. The behavioral and physiological characteristics of the marked cattle are defined as input variables, which are divided into fuzzy sets, for example, "High" and "Low" for the behavioral characteristics of the marked cattle, and "Fast" and "Slow" for the physiological characteristics of the marked cattle.
[0063] The flag whether the cattle are in a state of stress is defined as the output variable, which is divided into fuzzy sets, for example, “Yes”, “No” for whether they are in a state of stress.
[0064] Formulate a set of fuzzy rules to describe the impact of different input variables on output variables. The definitions can be based on professional knowledge or obtained through a large amount of data analysis and experiments. For example:
[0065] Mark the behavioral characteristics of the marked cow as X, the physiological characteristics of the marked cow as S, and the output result as Z, then we can define
[0066] Rule 1: IF(X is High)AND(S is Fast)THEN(Z is Yes)
[0067] Rule 2: IF(X is Low)AND(S is Slow)THEN(Z is No) ...
[0069] Fuzzy reasoning is performed according to fuzzy rules. When the output result is Yes, it is judged that the marked cattle are in a state of stress; when the output result is No, it is judged that the marked cattle are not in a state of stress.
[0070] If the marked cattle are in a state of stress, the characteristic data of the marked cattle collected within the corresponding time interval will be discarded.
[0071] It should be noted that the division of fuzzy sets can be adjusted according to actual conditions. For instance, only two fuzzy sets are used as examples in this example. In fact, the behavioral characteristics and physiological characteristics of marked cattle can be divided into three or more sets to facilitate better matching with the adjustment accuracy. The high and low speed of the behavioral characteristics and physiological characteristics of marked cattle can be judged by comparing with the behavioral characteristic threshold and the physiological characteristic threshold. When the behavioral characteristics of the marked cattle exceed the behavioral characteristic threshold, it is marked as "High", otherwise it is marked as "Low". When the physiological characteristics of the marked cattle exceed the physiological characteristic threshold, it is marked as "Fast", otherwise it is marked as "Slow". No further explanation will be given here.
[0072] In step S3, when it is determined that the marked cow is in a state of stress within the time interval for collecting data, the characteristic data of the marked cow detected within the corresponding time interval is canceled, and the marked cow is comforted and then re-detected, and the food intake and movement status of the marked cow are collected within the time interval, and the food intake and movement status of the marked cow are respectively merged into a food intake data set and a movement data set, and the weight record of the marked cow is obtained from the historical database, and the weight record of the marked cow is merged into a weight data set.
[0073] The multi-layer perceptron model is constructed by integrating the food intake data set, exercise data set and weight data set to set the weight control group of the marked cattle. The multi-layer perceptron model consists of three layers: input layer, hidden layer and output layer. The input layer is used to receive input features and convert the input features into digital data. The hidden layer is used to calculate and process the converted data. The output layer is used to convert the calculation results to obtain the final output results for output. The specific steps are as follows:
[0074] Input data: The food intake dataset and exercise dataset are passed into the input layer as input features. The input layer normalizes the data in the food intake dataset and exercise dataset and then passes them into the hidden layer.
[0075] Initialization parameters: Set the initial weights and bias parameters from the input layer to the hidden layer in the multi-layer perceptron model;
[0076] Hidden layer algorithm setting: The food intake data set and the movement data set are processed by setting the hidden layer activation function. The activation function is exemplified by a weighted function: A=-w1a+w2b+c, where A is the output of the hidden layer, a is the normalized result of the food intake of the marked cows in the food intake data set, b is the normalized result of the movement state of the marked cows in the movement data set, w1 and w2 are the two initial weights set from the input layer to the hidden layer, and C is the bias parameter set from the output layer to the hidden layer;
[0077] Output layer algorithm settings: Set the activation function of the output layer: Where B is the output result of the output layer, is the initial control classification threshold; it can be set to the sum of the average value of the normalized food intake of the marked cattle in the food intake data set and the average value of the normalized movement state of the corresponding marked cattle in the movement data set;
[0078] Transfer: The multilayer perceptron passes the input features through the input layer, hidden layer and output layer in sequence, and finally the output layer calculates the output result as the classification standard of the weight control group;
[0079] Calculate the control classification threshold: Compare the output result of the multilayer perceptron model with the preset actual label to calculate the loss function, which can be obtained by subtracting the actual label from the output result, calculate the gradient of the influence of the hidden layer and the input layer on the loss function, and use the partial derivatives of the weight and bias parameters of the hidden layer to the loss function as the gradient weight gradient and the bias parameter gradient respectively; adjust the weight and bias parameters by the preset learning rate, and obtain the adjusted weight or bias parameter by subtracting the weight or bias parameter from the product of the learning rate and the gradient; repeat the operation, calculate the output result of each adjusted weight and bias parameter calculated by the output layer, and use each output result as a control classification threshold;
[0080] Output result: Arrange the control classification thresholds from small to large, and use two adjacent control classification thresholds as a control classification group. Calculate the output result for each marked cow in the multi-layer perceptron and classify them in the control classification group. Fill the weight record values in the weight data set of the classified marked cows into different control classification groups to obtain a weight control group composed of weight record values, and output the weight control group.
[0081] It should be noted that the activation function and loss function involved in the multi-layer perceptron are not unique. The initial weights and bias parameters mentioned above are randomly given values and will not be elaborated here.
[0082] In step S4, when predicting the weight of the predicted cow, the predicted food intake and movement status of the cow are obtained by the same method, and the output results obtained after the predicted food intake and movement status of the cow pass through the input layer, hidden layer and output layer of the multi-layer perceptron in turn are compared with the control classification group and the weight control group of the predicted cow is determined, and the average weight record value of the corresponding weight control group is used as the predicted weight value of the predicted cow.
[0083] It should be noted that the error in predicting the weight of cattle can be greatly reduced by using a multi-layer perceptron model to determine the screening range of the weight control group of unstressed marked cattle and then predicting the weight of the predicted cattle.
[0084] Example 2, a cattle weight intelligent measurement system based on neural network, such as Figure 2 As shown, a method for realizing an intelligent measurement of cattle weight based on a neural network includes a data acquisition module, a data monitoring module, a data analysis module and a weight prediction module;
[0085] The data acquisition module is used to collect characteristic data, behavioral characteristics and physiological characteristics of cattle samples and transmit the behavioral characteristics and physiological characteristics to the data monitoring module and the weight prediction module, and transmit the characteristic data to the data analysis module;
[0086] The data monitoring module is used to receive behavioral characteristics and physiological characteristics to determine whether the marked cattle are in a stress state, and transmit the judgment result back to the data acquisition module. The data acquisition module determines whether to re-collect characteristic data based on the judgment result;
[0087] The data analysis module is used to receive feature data to build a multi-layer perceptron model, set a weight control group through the output results of the multi-layer perceptron model, and pass the weight control group to the weight prediction module;
[0088] The weight prediction module is used to receive the characteristic data of the predicted cattle and compare it with the weight control group to predict the weight of the predicted cattle.
[0089] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product.
[0090] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application of the technical solution and the invention constraints. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0091] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0092] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0093] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for intelligently measuring cattle weight based on neural network, characterized in that: The following steps are included: Step S1: obtaining historical data of cattle samples, obtaining a standard weight range of cattle samples, and screening and marking cattle samples according to the standard weight of cattle samples; Step S2: collecting characteristic data of the marked cattle, monitoring the behavioral characteristics and physiological characteristics of the marked cattle in real time, and using fuzzy reasoning to determine whether the marked cattle are in a stress state; Step S3: According to the stress state of the marked cattle, the food intake and exercise state of the marked cattle of different weights obtained by detection are selected or the food intake and exercise state of the marked cattle are re-detected, a multi-layer perceptron model is constructed according to the food intake and exercise state of the marked cattle, and a weight control group of the marked cattle is set by the multi-layer perceptron model; Step S4: Obtain the predicted food intake and exercise status of the cattle, and predict the weight of the cattle sample according to the weight control group.
2. The method for intelligently measuring cattle weight based on neural network according to claim 1 is characterized in that: In step S1, the historical data is the weight records of cattle samples in the historical database, multiple weight records of cattle samples are selected, and the standard weight range of the cattle samples is determined by using the K-means clustering method according to the weight records of the cattle samples; The historical database is a system used to record past testing data, which contains the weight ranges of past cattle samples; K-means clustering is a widely used unsupervised learning algorithm to divide a dataset into multiple clusters.
3. The method for intelligently measuring cattle weight based on neural network according to claim 2 is characterized in that: In step S1, the standard weight range of cattle samples is determined using the K-means clustering method based on the weight records of cattle samples. The specific steps are as follows: Record the weight records of cattle samples, randomly select K values as initial centroids, use the difference between two values as the numerical distance, calculate the distance between each weight record value of each cattle sample and each centroid, merge it and the nearest centroid into the same group, and use each group as a cluster. Whenever the weight record value is assigned to a cluster, retain each value in the cluster and recalculate the centroid of each cluster. The centroid is the mean of all data points in the cluster. Repeat the assignment until only three clusters are left. Select the cluster with the middle centroid among the three clusters, and use the range from the minimum to the maximum value of the weight record value in the cluster as the standard weight range of the cattle sample. After determining the standard weight range of cattle samples, multiple cattle samples with weights within the standard weight range are selected as analysis samples for data collection, and the selected analysis samples are marked.
4. The method for intelligently measuring cattle weight based on neural network according to claim 3 is characterized in that: In step S2, the characteristic data of the marked cattle include the food intake and movement status of the cattle sample, the behavioral characteristics of the marked cattle are the number of calls when the characteristic data is detected, and the physiological characteristics of the marked cattle are the breathing frequency when the characteristic data is detected; The movement status is the movement distance of the marked cattle in a fixed time.
5. The method for intelligently measuring cattle weight based on neural network according to claim 4 is characterized in that: In step S2, fuzzy reasoning is used to determine whether the marked cattle are in a stress state. The specific steps are as follows: The behavioral and physiological characteristics of the tagged cattle were defined as input variables; Whether the marked cattle are in a stress state is defined as the output variable; Formulate a set of fuzzy rules to describe the impact of different input variables on the output variables; Fuzzy reasoning is performed based on fuzzy rules to determine whether the marked cattle are in a stress state.
6. The method for intelligently measuring cattle weight based on neural network according to claim 5 is characterized in that: In step S3, a time interval is selected to collect characteristic data of the marked cattle. If it is determined that the marked cattle are in a stress state within the time interval, the characteristic data of the marked cattle detected within the corresponding time interval is cancelled and the characteristic data of the marked cattle detected within the corresponding time interval is collected again within the next same time interval. The food intake and movement status of the marked cattle are merged into a food intake data set and a movement data set respectively, the weight records of the marked cattle are obtained from the historical database, and the weight records of the marked cattle are merged into a weight data set; A multi-layer perceptron model was constructed by integrating the food intake dataset, exercise dataset, and weight dataset to set the weight control group of marked cattle.
7. The method for intelligently measuring cattle weight based on neural network according to claim 6 is characterized in that: In step S3, the weight control group of the marked cattle is set using the multi-layer perceptron model. The specific steps are as follows: Input data: The food intake dataset and exercise dataset are passed into the input layer as input features. The input layer normalizes the data in the food intake dataset and exercise dataset and then passes them into the hidden layer. Initialization parameters: Set the initial weights and bias parameters from the input layer to the hidden layer in the multi-layer perceptron model; Hidden layer algorithm setting: The appetite dataset and the exercise dataset are processed by setting the hidden layer activation function, and the activation function is set to calculate the output of the hidden layer. The data in the appetite dataset processed by the input layer and the data in the exercise dataset are weighted summed and then the bias parameter is added to obtain the output of the hidden layer. Output layer algorithm settings: Set the activation function of the output layer, and take the sum of the normalized average value of the food intake of the marked cows in the food intake data set and the normalized average value of the movement state of the corresponding marked cows in the movement data set as the output of the output layer; Calculate the comparison classification threshold: Compare the output result of the multilayer perceptron model with the preset actual label to calculate the loss function, obtain the calculation result of the loss function by subtracting the actual label from the output result, and use the partial derivatives of the hidden layer weight and bias parameter to the loss function as the gradient weight gradient and bias parameter gradient respectively; subtract the weight or bias parameter from the product of the preset learning rate and gradient to obtain the adjusted weight or bias parameter; Repeat the process: calculate the output of each adjusted weight and bias parameter through the output layer, and use each output as a control classification threshold; Output result: Arrange the control classification thresholds from small to large, and use two adjacent control classification thresholds as a control classification group. Calculate the output result for each marked cow in the multi-layer perceptron and classify them in the control classification group. Fill the weight record values in the weight data set of the classified marked cows into different control classification groups to obtain a weight control group composed of weight record values, and output the weight control group.
8. The method for intelligently measuring cattle weight based on neural network according to claim 7 is characterized in that: In step S4, the predicted food intake and movement status of the cattle are obtained, and the output results obtained by passing the predicted food intake and movement status of the cattle through the input layer, hidden layer and output layer of the multi-layer perceptron in sequence are compared with the control classification group and the predicted weight control group of the cattle is determined, and the average weight record value of the corresponding weight control group is used as the predicted weight value of the cattle.
9. A method for intelligently measuring cattle weight based on a neural network, based on the method for intelligently measuring cattle weight based on a neural network according to any one of claims 1 to 8, characterized in that: It includes data collection module, data monitoring module, data analysis module and weight prediction module; The data acquisition module is used to collect characteristic data, behavioral characteristics and physiological characteristics of cattle samples and transmit the behavioral characteristics and physiological characteristics to the data monitoring module and the weight prediction module, and transmit the characteristic data to the data analysis module; The data monitoring module is used to receive behavioral characteristics and physiological characteristics to determine whether the marked cattle are in a stress state, and transmit the judgment result back to the data acquisition module. The data acquisition module determines whether to re-collect characteristic data based on the judgment result; The data analysis module is used to receive feature data to build a multi-layer perceptron model, set a weight control group through the output results of the multi-layer perceptron model, and pass the weight control group to the weight prediction module; The weight prediction module is used to receive the characteristic data of the predicted cattle and compare it with the weight control group to predict the weight of the predicted cattle.