Method and device for estimating feed intake of barn-fed cattle and electronic equipment
By segmenting and calibrating feed intake in stall-fed cattle using a sliding time window algorithm and a behavior recognition model, the problem of sensor fit influence is solved, achieving highly robust and adaptive accurate feed intake estimation, applicable to different individuals and environments.
Patent Information
- Application Number
- CN202510729622.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-10-17
AI Technical Summary
In the existing technology, the feed intake estimation method for stall-fed cattle lacks robustness due to over-reliance on sensor fit and is unable to adapt to individual differences and dynamic changes, resulting in a high misjudgment rate and large deviations in the estimation results.
A sliding time window algorithm is used to segment nasal pressure data. Combined with a behavior recognition model, feeding and rumination behaviors are identified. Feed intake estimation is dynamically adjusted by a feeding rate prediction model and rumination behavior calibration parameters to replace static parameters and achieve adaptive and accurate feeding intake estimation.
It improves the robustness and accuracy of feed intake estimation, can adapt to differences in nasal morphology and complex feeding behaviors among different cattle, reduces errors, and provides individualized feed intake data support.
Smart Images

Figure CN120804801A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of animal behavior monitoring and precision breeding, and particularly relates to a method and device for estimating the forage intake of a stall-fed cow and an electronic device. BACKGROUND
[0002] The forage intake of a stall-fed cow is a core indicator of its nutritional status, directly affecting the growth performance, reproductive efficiency and health level of the cow. In large-scale breeding, real-time and accurate forage intake monitoring can not only optimize feeding plans and reduce feed waste, but also early detect health problems (such as oral diseases and digestive disorders) through behavioral abnormalities (such as sudden reduction in forage intake), thereby reducing treatment costs and improving economic benefits. At present, the methods for estimating the forage intake of a stall-fed cow mainly include the weighing trough method and the behavior monitoring method, among which the behavior monitoring method has become the mainstream due to its low cost and real-time monitoring advantages. The existing behavior monitoring method mainly adopts the nose-halter pressure method, which identifies the foraging behavior by analyzing the pressure signals of the cow's nose and estimates the forage intake. However, in actual application, the following problems are faced: first, the fit degree of the pressure sensor to the cow's nose is easily affected by individual differences (such as the shape of the nasal bridge) and dynamic changes (such as the loosening of the sensor caused by the cow's movement), leading to pressure value drift. The existing technology relies on a fixed pressure threshold to determine chewing activity, and changes in the fit degree will directly cause the threshold to fail, significantly increasing the misjudgment rate. Second, when stall-fed cows forage on a total mixed ration, they exhibit a behavior pattern of continuous rolling, swallowing and then regurgitating the food bolus for rumination and chewing, resulting in a high overlap of foraging and rumination waveforms on the time axis. The existing technology uses a fixed time interval to estimate the number of food boluses, which is difficult to adapt to continuous foraging behavior, further leading to estimation bias of the number of food boluses. Third, the weight of a single food bolus is dynamically affected by the type of daily ration, the foraging stage and individual differences, while the existing technology uses a fixed empirical value to estimate the weight of a single food bolus, which cannot adapt to the dynamic changes in actual application, resulting in a large deviation between the estimated forage intake and the actual value.
[0003] The core root of the above-mentioned defects lies in that the existing technology relies too much on the fit degree of the sensor, limiting the robustness of the method, simplifying complex foraging behavior into a fixed pattern while ignoring individual differences and dynamic changes, and using static parameter settings (such as fixed thresholds and empirical values) that cannot adapt to the complexity of the breeding environment. SUMMARY
[0004] The present application provides a method and device for estimating the forage intake of a stall-fed cow and an electronic device to solve the defects in the prior art, such as excessive reliance on sensor fit degree, which limits the robustness of the method, simplifies complex foraging behavior into a fixed pattern while ignoring individual differences and dynamic changes, and uses static parameter settings that cannot adapt to the complexity of the breeding environment, and realizes high-robustness, self-adaptive precision estimation of the forage intake of a stall-fed cow. The technical solution proposed by the present application is as follows: In a first aspect, the present application provides a method for estimating the feed intake of a feedlot cattle, comprising: obtaining nose-halter pressure data of the cattle; segmenting the nose-halter pressure data using a sliding time window algorithm, calculating the time series features in each time window, and inputting the time series features in each time window into a pre-trained behavior recognition model to obtain the corresponding cattle behavior type, wherein the cattle behavior type at least includes feeding behavior and rumination behavior; based on all time window data identified as feeding behavior, predicting the feed intake to obtain an initial estimate of the feed intake; the time window data is the nose-halter pressure data segment obtained by segmenting the nose-halter pressure data using a sliding time window algorithm; based on all time window data identified as rumination behavior, determining a feed intake calibration parameter; inputting the initial estimate of the feed intake and the feed intake calibration parameter into a pre-constructed calibration model to obtain a calibrated feed intake.
[0005] Optionally, the method for estimating the feed intake of a feedlot cattle, comprising: from all nose-halter pressure data segments, filtering out data segments corresponding to feeding behavior to obtain feeding behavior data; applying empirical mode decomposition algorithm to the feeding behavior data to obtain a plurality of intrinsic mode function components; inputting the plurality of intrinsic mode function components into a pre-set change point detection model, dynamically dividing time windows according to the detected change points, and extracting signal feature parameters in each time window from the feeding behavior data according to the divided time windows; inputting the signal feature parameters in each time window into a pre-trained feed rate prediction model to predict the feed rate, and obtaining the corresponding feed rate prediction value; determining the feeding duration of each time window; for each time window, determining the feed intake prediction value according to the feed rate prediction value and the feeding duration in the time window.
[0006] Optionally, the feed rate prediction model is constructed using a random forest model, and the regression feed rate of the corresponding time window of the weighing trough process data is used as the true value during the training process; the weighing trough process data includes the trough weight data and timestamp data in each time window; the feed rate in each time window is determined by the following formula: wherein, is the feed rate of the jth data in the ith time window, is the jth trough weight data in the ith time window, is the j+1th trough weight data in the ith time window, and are the jth timestamp data and the j+1th timestamp data in the ith time window, respectively, j = 1, 2, 3, …. , is the total number of data points in the time window, is the feed intake rate in the ith time window.
[0007] Optionally, the feed intake calibration parameter comprises chewing frequency and rumination duration. The method further comprises determining the feed intake calibration parameter based on all the time window data identified as rumination behavior, comprising: filtering the data segments corresponding to rumination behavior from all the nasal hobbles pressure data segments to obtain rumination behavior data; using a preset change point detection algorithm to dynamically divide the rumination behavior data to obtain rumination behavior data segments in each time window, and determining the rumination duration of each time window; for each rumination behavior data segment in each time window, using a peak-valley detection method to detect the number of peaks and valleys in the rumination behavior data segment, and determining the chewing frequency according to the number of peaks and valleys.
[0008] Optionally, the initial estimated feed intake and the feed intake calibration parameter are input into a pre-constructed calibration model to obtain a calibrated feed intake, comprising: determining feature feed intake rate, feature feed intake duration, feature predicted feed intake, feature chewing frequency, and feature rumination duration according to the feed intake rate, the feed intake duration, the predicted feed intake, the chewing frequency, and the rumination duration in each time window, respectively; inputting the feature feed intake rate, the feature feed intake duration, the feature predicted feed intake, the feature chewing frequency, and the feature rumination duration into the pre-constructed calibration model to obtain the calibrated feed intake.
[0009] Optionally, the calibration model uses a Bayesian model, and the method further comprises training the calibration model by the following method: obtaining a historical training data set, each historical training data comprising: true feed intake rate, feature feed intake rate, feature feed intake duration, feature predicted feed intake, feature chewing frequency, and feature rumination duration; obtaining a constructed Bayesian model, wherein the likelihood function of the Bayesian model is: (f'( , , , ), ) wherein, , , , , respectively are the characteristic feeding rate, the characteristic feeding duration, the characteristic feeding amount prediction value, the characteristic chewing frequency and the characteristic rumination duration; represents a normal distribution; f' represents a mapping function; is the error variance; The Markov Chain Monte Carlo method is used to iteratively optimize the posterior distribution of the model parameters of the Bayesian model, and when the number of iterations reaches a preset threshold or the parameters converge, the trained calibration model is output; wherein the model parameters of the Bayesian model follow a Gaussian distribution.
[0010] In a second aspect, the present application further provides a feedlot cattle feeding amount estimation device, comprising the following modules: A data acquisition module is configured to acquire nose-halter pressure data of a cattle; A behavior recognition module is configured to segment the nose-halter pressure data using a sliding time window algorithm, calculate the time sequence features in each time window, and input the time sequence features in each time window into a pre-trained behavior recognition model to obtain the corresponding cattle behavior type, wherein the cattle behavior type at least includes feeding behavior and rumination behavior; An initial prediction module is configured to predict the feeding amount based on all time window data identified as feeding behavior to obtain an initial estimation result of the feeding amount; the time window data is a nose-halter pressure data segment obtained by segmenting the nose-halter pressure data using the sliding time window algorithm; A parameter determination module is configured to determine the feeding amount calibration parameter based on all time window data identified as rumination behavior; A result calibration module is configured to input the initial estimation result of the feeding amount and the feeding amount calibration parameter into a pre-constructed calibration model to obtain the calibrated feeding amount.
[0011] In a third aspect, the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, wherein the processor implements the feedlot cattle feeding amount estimation method of the first aspect described above when executing the computer program.
[0012] In a fourth aspect, the present application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the feedlot cattle feeding amount estimation method of the first aspect described above.
[0013] In a fifth aspect, the present application further provides a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the feedlot cattle feeding amount estimation method of the first aspect described above.
[0014] Based on the above technical solution, the present invention has the following beneficial effects compared with the prior art: The present invention provides a method, device, and electronic device for estimating feed intake for barn-fed cattle. These devices utilize a sliding time window algorithm to segment the nasal pressure data of cattle, extract temporal features, and perform behavior recognition in conjunction with a behavior recognition model. This method dynamically matches pressure waveform patterns, rather than relying on fixed pressure thresholds. This allows accurate identification of behavior types even when sensor fit changes, improving robustness and automatically adapting to differences in nasal morphology between different cattle. This method addresses the issues of prior art methods that suffer from insufficient robustness due to over-reliance on sensor fit and simplify complex feeding behaviors into fixed patterns while ignoring individual differences and dynamic changes. By using dynamic time windows to identify behaviors such as feeding and rumination window by window, errors caused by segmentation using fixed time intervals or empirical values are avoided. A multi-behavior type recognition mechanism distinguishes the overlapping waveform areas of feeding and rumination, ensuring accurate behavior segmentation and enabling the handling of dynamic changes in complex feeding behaviors. Furthermore, a feeding rate prediction model learns the differences in feeding speed, bolus size, and chewing frequency between different cattle to achieve individualized feed intake estimation. Calibration parameters are calculated based on the time window data of rumination behavior, and the initial estimate of feed intake is dynamically adjusted through the calibration model to compensate for the estimation deviation caused by changes in the physiological state of the cattle. Static parameters (such as fixed thresholds or empirical values) are replaced to achieve data-driven dynamic optimization, thereby achieving highly robust and adaptive accurate estimation of feed intake for barn-fed cattle.
[0015] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description and the drawings.
[0016] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is one of the flow charts of the method for estimating feed intake of barn-fed cattle provided by the present invention.
[0019] Figure 2Figure 2 is a schematic diagram of a second process of the method for estimating the feed intake of a feedlot cattle according to the present application.
[0020] Figure 3 Figure 3 is a schematic diagram of a process of predicting the feed intake according to the present application.
[0021] Figure 4 Figure 4 is a schematic diagram of a process of calibrating the feed intake according to the present application.
[0022] Figure 5 Figure 5 is a schematic diagram of a structure of the device for estimating the feed intake of a feedlot cattle according to the present application.
[0023] Figure 6 Figure 6 is a schematic diagram of a structure of the electronic device according to the present application. DETAILED DESCRIPTION
[0024] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0025] In order to overcome the defects of the current method for estimating the feed intake of a feedlot cattle based on the pressure of a noseband, and more accurately estimate the feed intake of a feedlot cattle, the present application provides a method, a device and an electronic device for estimating the feed intake of a feedlot cattle. The method estimates the feed intake rate through a wearable device with a noseband pressure sensor, estimates the feed intake according to the feed intake rate and the feeding time, and obtains the final feed intake estimation result after secondary calibration according to the rumination behavior, which is referred to as the calibrated feed intake. The method can more scientifically and efficiently estimate the feed intake of a feedlot cattle, and realize more accurate feeding management.
[0026] It should be particularly pointed out that the above-mentioned method of the present application can be adapted to the feed intake estimation scenarios of pigs, sheep, horses and other livestock, and the noseband pressure sensor can be replaced by other forms of contact sensors (such as ear pressure rings for pigs, neck accelerometers for sheep), and only the sensor deployment position and signal acquisition frequency need to be adjusted. For example, the feeding behavior of pigs mainly involves rapid biting, and the pressure signal frequency is higher than that of cattle, so the high-frequency behavior mode can be adapted by adjusting the length of the sliding time window (such as shortening to 0.5 seconds).
[0027] Referring to Figure 1 The method for estimating the feed intake of a feedlot cattle according to the present application comprises the following steps: S110, acquiring noseband pressure data of a cattle.
[0028] The nose halter pressure sensor is attached to the nose halter part of the cow, and the pressure change caused by the nose muscle movement during feeding is sensed in real time through a flexible piezoelectric film or strain gauge. A specific collection frequency (such as 100-500Hz) is used to obtain the nose halter pressure data of the cow to capture subtle actions and ensure complete capture of rapid pressure fluctuations (such as pressure pulse sequence during bolus chewing) in the feeding behavior.
[0029] High-frequency electronic noise is filtered out by the RC low-pass filter (cut-off frequency 10Hz) built-in the sensor. Wavelet threshold method or Kalman filter is used to further eliminate environmental interference and retain effective pressure signals. The data is saved in the format of time stamp + pressure value.
[0030] S120, the nose halter pressure data is segmented and processed by using a sliding time window algorithm, the time sequence characteristics in each time window are calculated, and the time sequence characteristics in each time window are input into a pre-trained behavior recognition model to obtain corresponding cow behavior types, the cow behavior types at least include feeding behavior and rumination behavior.
[0031] In order to realize the accurate identification of the feeding, rumination and chewing behaviors of the cow, the sliding time window algorithm is used to segment and process the nose halter pressure data. First, a time window with a fixed length of 10 seconds is set, and a continuous overlapping window is generated with a sliding step of 10% of the window length (i.e. 1 second), to ensure the integrity of the behavior pattern. For each time window, 8 time sequence characteristics are calculated, including mean, variance, standard deviation, maximum value, minimum value, range, median and quartile, to describe the statistical characteristics of the pressure signal in multiple dimensions. Among them, the variance and range are used to distinguish dynamic behaviors (such as feeding) and stable behaviors (such as rumination), and the median and quartile can suppress abnormal noise interference. Then, the 8-dimensional features of each time window are input into a pre-trained behavior recognition model, and the model outputs the probability labels of the three behaviors of feeding, rumination and chewing. The sliding window and overlapping design of the present application can capture the dynamic changes of the behavior in real time, avoid misjudgment caused by window boundary truncation, and provide high-precision behavior labels for subsequent feeding amount estimation and health monitoring.
[0032] The above behavior recognition model can use a random forest model, a long short-term memory (LSTM) model or other classification models. The present application uses a random forest model as an example to illustrate the training process of the behavior recognition model: 1. First, data preparation and sliding window segmentation are performed: The pressure data is continuously collected for a long time (e.g., 1000 hours) through the nose halter pressure sensor of the cattle, and the behavior types (feeding, rumination) are labeled synchronously to ensure time alignment. A 10-second fixed window and a 1-second sliding step are used to generate continuous overlapping windows, preserving the dynamic information of the behavior. The pressure data is divided into 10-second fixed-length samples (step 1 second) by the sliding window, generating training samples covering the entire scene. For each sample, 8-dimensional time series features (mean, variance, standard deviation, maximum, minimum, range, median, quartile) are extracted to characterize the statistical properties of the pressure signal. All time series features are Z-Score standardized to eliminate dimension differences and improve model convergence speed.
[0033] Next, the hierarchical sampling method is used to divide the dataset composed of all samples (hereinafter referred to as the original dataset) into a training set and a test set. Hierarchical sampling can ensure that the proportion of each category in the training set and the test set is consistent with the original dataset, thereby improving the generalization ability of the model. Specifically, first, determine all behavior categories contained in the dataset. Calculate the proportion of each category in the original dataset. According to the calculated proportion, perform hierarchical sampling, i.e., randomly sample samples from each category independently to form the training set and the test set. For example, if the original dataset has 1000 samples, of which 600 are feeding behaviors and 400 are rumination behaviors, samples can be extracted from each category according to a 6:4 ratio to form the training set and the test set, respectively.
[0034] Hierarchical sampling can avoid model bias caused by unbalanced class proportions. If there are too many samples of a certain category in the training set, the model may overfit the features of this category, and perform poorly on other categories in the test set. By keeping the category proportions consistent, the model can learn a more comprehensive feature distribution, thereby improving the classification accuracy on the test set. Hierarchical sampling helps the model better adapt to unseen data, as the distribution of the training set and the test set is consistent with the original dataset, and the model can learn more representative features.
[0035] 2. Random Forest Model Construction: The input of the random forest model is an 8-dimensional time series feature sequence, and the model output includes the behavior category label and the corresponding classification probability (e.g., feeding probability 92%, rumination probability 8%), quantifying the model's confidence in the classification result. The output is provided in a structured data format.
[0036] 3. Random Forest Model Training, which includes: Random Forest Initialization: Initialize the random forest model and set the initial values of the number of decision trees, maximum depth, and minimum sample size. These parameters will be optimized through grid search in the subsequent steps.
[0037] Grid search for hyperparameter optimization: To find the optimal combination of parameters, define a grid of parameter values, including the number of decision trees, the maximum depth, and the minimum number of samples per leaf. Use the grid search method to evaluate the performance of each parameter combination on the training set, and select the best-performing combination as the optimal parameters.
[0038] Model training: After determining the optimal parameters, re-initialize the random forest model using these parameters. During training, the random forest generates training subsets for each tree through Bootstrap sampling, which helps increase the diversity of the model. At the same time, when splitting nodes, the random forest randomly selects some features for evaluation, which helps prevent model overfitting. To speed up the training process, use parallel computing methods to train multiple decision trees simultaneously using multi-core CPUs.
[0039] 4. Model evaluation and output: After training is complete, use the test set to evaluate the model and calculate indicators such as accuracy, recall rate, and F1 score to measure the performance of the model.
[0040] Accuracy represents the proportion of correctly classified samples in the entire dataset. A higher accuracy generally indicates that the model performs well overall, but if the dataset has a class imbalance problem, accuracy may not be a comprehensive evaluation indicator.
[0041] For each class, recall represents the model's ability to correctly identify samples of that class. A higher recall rate means that the model can better capture samples of that class and reduce the likelihood of missing them.
[0042] F1 Score is the harmonic mean of precision and recall, which can comprehensively reflect the accuracy and recall ability of the model.
[0043] If the overall accuracy of the model on the test set is significantly lower than expected or lower than the requirements of the actual application scenario, adjust the model parameters, such as increasing the number of decision trees, adjusting the maximum depth, and the minimum number of samples per leaf, to improve the complexity and expressiveness of the model.
[0044] If the recall rate of the model in identifying a specific behavior class (such as rumination) is significantly lower than that of other classes, the reason may be that the number of samples of that class is insufficient, causing the model to learn insufficiently. Or the model does not pay enough attention to that class, and the parameter settings are biased towards other classes. For the low-recall-rate class, increase the number of samples. In the random forest model, you can increase the attention to low-recall-rate classes by adjusting the class weights.
[0045] Large variations in F1 scores between different categories indicate that the model performs well in some categories but poorly in others. This may be due to an imbalance in the number of samples between categories, causing the model to favor the category with the most samples. You can balance the number of samples across categories through methods such as undersampling, oversampling, or using synthetic data. Alternatively, during model training, assign different weights to different categories to reflect their importance or scarcity.
[0046] For each input sample, the model outputs a structured classification result, including the behavioral category label and the corresponding classification probability. For example, the model might output "92% probability of feeding, 8% probability of rumination." This structured output facilitates subsequent data analysis and decision-making.
[0047] To improve the generalization ability of the model, the present invention adopts a series of measures to prevent overfitting. In addition to the above-mentioned bootstrap sampling and random feature selection, the complexity of the model is also controlled by limiting the depth of individual trees and increasing sample weights.
[0048] Through refined feature extraction and hyperparameter optimization, the random forest model can more accurately identify the behaviors of different cattle and in different environments. This enables the model to generalize well and adapt to a variety of practical application scenarios. Through steps such as data preprocessing, hyperparameter optimization, model training, evaluation, and output, the model achieves efficient classification of cattle behaviors and provides structured classification results.
[0049] After deployment, the model can receive the 8-dimensional time series features of the sliding window in real time, output behavior labels and probabilities, and provide real-time behavior monitoring data for farmers.
[0050] S130. Predicting the feed intake based on all time window data identified as feeding behaviors to obtain an initial feed intake estimation result; the time window data is nasal pressure data segments obtained by segmenting the nasal pressure data using a sliding time window algorithm.
[0051] The initial estimate of feed intake relies on identifying feeding behavior time windows and performing segment-by-segment predictions using a pretrained feeding rate prediction model. This model's training data is calibrated experimentally by precisely measuring the actual feeding rate of cattle over a fixed time period under a controlled environment, while simultaneously recording the corresponding nasal pressure data. The model inputs consist of time series features within the corresponding time window of feeding behavior. The feeding rate prediction model can employ regression models, such as Support Vector Regression (SVR), or lightweight neural networks.
[0052] S140: Determine feed intake calibration parameters based on all time window data identified as rumination behaviors.
[0053] The introduction of calibration parameters is to correct the errors of initial estimation, which is based on the physiological correlation between rumination behavior and feed intake. There is a statistical correlation between the duration, intensity and pattern (such as chewing frequency) of rumination and feed intake, so the calibration parameters are calculated based on the rumination duration and chewing frequency of the rumination behavior time window: Rumination duration refers to the total time spent on rumination by the cow during the monitoring period. Longer rumination time means that the cow has ingested more roughage that needs to be chewed repeatedly, so it can be used as a positive correction indicator of feed intake.
[0054] Chewing frequency refers to the number of times the cow chews and ruminates per minute, which can reflect the characteristics and difficulty of the feed. For example, high-fiber feed usually results in higher chewing frequency. By analyzing this data, it can be determined whether there is a systematic bias in the initial feed intake estimation. If the chewing frequency of a cow is significantly higher than the average, it may mean that its actual feed intake is underestimated and needs to be adjusted accordingly.
[0055] The calibration parameter is determined by the rumination duration and chewing frequency, which can be combined using linear weighting or more complex machine learning methods. For example, the weight of rumination duration can be set slightly higher than that of chewing frequency, as duration data is usually more stable; or a dynamic weighting strategy can be used to increase the influence weight of chewing frequency during the active rumination period. The final calibration parameter will be used as the direct basis for the next step of feed intake correction.
[0056] S150, input the initial estimation of the feed intake and the feed intake calibration parameter into the pre-constructed calibration model to obtain the calibrated feed intake.
[0057] The role of the calibration model is to fine-tune the initial estimation of feed intake based on rumination behavior data to improve the accuracy of the final result. The calibration strategy can use a dynamic weight calibration method to adjust the initial estimation of feed intake based on the real-time changes of rumination duration and chewing frequency, so that the calibration is more suitable for the current state.
[0058] By introducing rumination duration and chewing frequency as calibration basis, this method can effectively identify the bias in the initial estimation and make targeted corrections. Compared with single-index calibration, the multi-parameter strategy can more comprehensively reflect the digestive behavior characteristics of the cow, especially suitable for different feed types and individual differences in breeding scenarios. Finally, the calibrated feed intake data can provide a reliable basis for precision feeding management.
[0059] The method for estimating the forage intake of a feedlot cattle provided by the present application solves the core defects of the prior art in a systematic manner through multi-dimensional technical design, and achieves high robustness and self-adaptive precise estimation. The method uses a sliding time window algorithm to segment the nose halter pressure data and extract time sequence features, and combines a behavior recognition model to recognize behaviors, which can dynamically match pressure waveform patterns rather than relying on fixed pressure thresholds, so that the behavior type can still be accurately recognized when the sensor adhesion changes, the robustness is improved, and the nose shape differences of different cattle are automatically adapted. The method solves the problems of the prior art, such as insufficient robustness due to excessive reliance on sensor adhesion, simplification of complex foraging behavior into a fixed mode, and neglect of individual differences and dynamic changes. By recognizing behaviors such as foraging and rumination through dynamic time windows, errors caused by fixed time intervals or experience values are avoided, and a multi-behavior type recognition mechanism is used to distinguish the waveform overlap area of foraging and rumination, ensuring the accuracy of behavior segmentation and being able to cope with the dynamic changes of complex foraging behavior. At the same time, a foraging rate prediction model is used to learn the differences in foraging speed, bolus size and chewing frequency of different cattle, and individualized forage intake estimation is achieved. The calibration parameters are calculated based on the time window data of the rumination behavior, and the initial estimated forage intake is dynamically adjusted through a calibration model to compensate for the estimation deviation caused by changes in the physiological state of the cattle, replacing static parameters such as fixed thresholds or experience values, achieving data-driven dynamic optimization, and thus achieving high robustness, self-adaptation and precise estimation of the forage intake of feedlot cattle.
[0060] Reference Figure 2 As shown in the drawings, the method for estimating the forage intake of a feedlot cattle provided by the present application acquires the nose halter pressure data of the cattle through the nose halter pressure sensor worn by the cattle, and estimates the forage intake based on the nose halter pressure data of the cattle. The nose halter pressure data of the cattle is the mouth movement signal during the foraging and rumination processes of the cattle. According to the nose halter pressure data of the cattle, the foraging behavior and the rumination behavior are recognized. The key points of the method are as follows: first, according to the different speeds of foraging and chewing, the nose halter pressure data of the cattle is decomposed by using a dynamic time window to dynamically predict the foraging speed and the chewing frequency; second, the predicted foraging speed and the foraging duration are used to obtain the estimated forage intake, and the chewing frequency and the rumination duration are further used to calibrate the estimated forage intake. The foraging behavior pressure waveform of the same cattle is different due to the different speeds of foraging. The present application uses behavior recognition technology to first recognize the foraging and rumination behaviors, uses EMD empirical mode decomposition and change point detection technology to divide the dynamic time window to calculate the factors related to the forage intake, including the foraging speed, the foraging duration, the rumination duration and the chewing frequency, and initially builds a random forest model as a foraging speed prediction model to predict the foraging speed and obtain the estimated forage intake. On this basis, the estimated forage intake initially predicted is calibrated by using a Bayesian method to obtain the final predicted forage intake data, i.e., the calibrated forage intake.
[0061] In some embodiments, the foraging amount prediction based on all the time window data identified as foraging behavior in S130 is performed to obtain an initial estimation of foraging amount, including: S1301, filtering out data segments corresponding to foraging behavior from all nose halter pressure data segments to obtain foraging behavior data.
[0062] From all the nose halter pressure data segments collected by the nose band pressure sensor, first, the behavior recognition algorithm (such as the random forest model) is used to filter out all the time window data identified as foraging behavior. This step ensures that the subsequent analysis is only for the pressure data when the cow is foraging, and excludes the interference of other behaviors such as rumination on foraging amount estimation.
[0063] S1302, applying the empirical mode decomposition algorithm to the foraging behavior data to obtain a plurality of intrinsic mode function components.
[0064] Referring to Figure 3 The empirical mode decomposition (EMD) algorithm is applied to the filtered foraging behavior data. EMD is an adaptive signal decomposition method that can decompose complex nonlinear and non-stationary signals into a series of intrinsic mode function (IMF) components. Each IMF component represents the fluctuation pattern of the signal at different time scales, which helps to more finely analyze the characteristics of the foraging behavior pressure signal.
[0065] S1303, inputting the plurality of intrinsic mode function components into a preset change point detection model, dynamically dividing time windows according to the detected change points, and extracting signal feature parameters in each time window from the foraging behavior data according to the divided time windows.
[0066] The plurality of IMF components obtained by EMD decomposition are input into a preset change point detection model, such as the Pruned Exact Linear Time (PELT) algorithm model. The change point detection algorithm can identify the mutation points in the signal, which usually correspond to the changes (such as start, end, pause, etc.) of foraging behavior. According to the detected change points, the time windows are dynamically divided, so that the different stages of foraging behavior can be more accurately captured. Those skilled in the art can use the change point detection model in the prior art for detection, which will not be described here.
[0067] Signal feature parameters in each time window are extracted from the foraging behavior data, such as mean, variance, extreme points, etc., which can reflect the specific characteristics of foraging behavior in different time windows.
[0068] S1304, input the signal feature parameters in each time window into the pre-trained feed intake rate prediction model respectively to perform feed intake rate prediction, and obtain corresponding feed intake rate prediction values.
[0069] The signal feature parameters in each time window are input into the pre-trained feed intake rate prediction model (such as a random forest model), and the model outputs the feed intake rate prediction value in the corresponding time window. This prediction value is obtained based on the relationship between the signal feature parameters learned by the model and the feed intake rate. The output result can be a specific numerical value representing the average feed intake rate of the cow in the time window, or a range or confidence interval representing the uncertainty of the prediction value.
[0070] The feed intake rate prediction model is constructed using a random forest model, and the regression feed intake rate of the corresponding time window of the weighing trough process data is used as the true value in the training process. The weighing trough process data includes the trough weight data and timestamp data in each time window; the feed intake rate in each time window is determined by the following formula: (1) (2) wherein, is the feed intake rate of the jth data in the ith time window, is the jth trough weight data in the ith time window, is the j+1th trough weight data in the ith time window, and are the jth timestamp data and the j+1th timestamp data in the ith time window, respectively, j = 1, 2, 3, … is the total number of data points in the time window, is the feed intake rate in the ith time window. i = 1, 2, 3, …, M, M is the number of time windows corresponding to the feeding behavior.
[0071] The training process of the feed intake rate prediction model is as follows: 1. Data collection and preprocessing: Collect a large amount of feeding process data of barn-fed cattle in the weighing trough. These data include the nose halter pressure data of the cattle when feeding and the simultaneously recorded weighing trough process data.
[0072] Divide the continuous feeding process data into multiple time windows of fixed length, and the trough weight data in each time window is used to calculate the feed intake rate in that time window (as the true feed intake rate of that time window). The length of the time window can be adjusted according to actual needs and the characteristics of the data. Clean the collected data to remove outliers, missing values, or obviously erroneous data points, and ensure the quality of the data.
[0073] 2. Signal feature parameter extraction: refer to Figure 3 As shown, feeding behavior data that can reflect feeding behavior are extracted from nasal pressure data, and statistical characteristics of intrinsic mode function components are obtained through empirical mode decomposition (EMD). Multiple intrinsic mode function components are input into a preset change point detection model, time windows are dynamically divided according to the detected change points, and signal feature parameters in each time window are extracted from the feeding behavior data according to the divided time windows. In addition to signal feature parameters, features related to the time window can also be extracted, such as the length of the time window, the start time, the end time, etc. The extracted features are standardized so that they have the same dimension and distribution range, which helps to improve the training efficiency and stability of the model and obtain a preprocessed data set.
[0074] 3. Model Training: Select the random forest model as the feed intake rate prediction model. The random forest model is an ensemble learning method that reduces overfitting and improves prediction accuracy by constructing multiple decision trees and taking the average.
[0075] The preprocessed dataset is divided into a training set and a test set. The training set is used to train the model, and the test set is used to evaluate the model's performance. The random forest model is trained using the training set. During the training process, the model learns the relationship between the signal feature parameters and the feeding rate, and adjusts the parameters of the decision tree to minimize the prediction error. The model's hyperparameters (such as the number of decision trees, maximum depth, etc.) are tuned through methods such as cross-validation to find the optimal model configuration. The trained model is evaluated using the test set, and the error between the predicted value and the true value (such as mean square error, mean absolute error, etc.) is calculated to evaluate the model's prediction performance. In addition to using the test set for evaluation, the generalization ability of the model can also be verified by other methods, such as pilot application in an actual breeding environment, collecting actual data and comparing it with the model's prediction results. The trained model is deployed in an actual breeding management system to predict the feeding rate of barn-fed cattle in real time. It should be noted that the true value of the feeding rate, that is, the actual feeding rate, is calculated based on the weighing trough process data using the above formulas (1) and (2).
[0076] S1305: Determine the feeding duration for each time window. For each time window, determine a predicted feed intake value based on the predicted feeding rate and feeding duration within that time window. Simultaneously, record the predicted feeding rate and feeding duration within each time window as part of the initial feed intake estimate.
[0077] (3) (4) in, is the feeding duration in the i-th time window, and are the timestamp data corresponding to the end time and the start time in the i-th time window, respectively, is the predicted feeding amount in the i-th time window, is the predicted feeding rate in the i-th time window.
[0078] The present application can more accurately analyze the feeding behavior pressure signal (i.e., the above-mentioned feeding behavior data) by EMD decomposition and change point detection algorithm, capture different stages of feeding behavior, and improve the accuracy of feeding amount estimation. Compared with traditional methods, this method can more accurately reflect the actual changes of the feeding amount of cattle. Different cattle have different feeding speeds, and the feeding behavior pressure waveform they show is also different. This method can adapt to the feeding behavior of different cattle and different feeding habits through dynamic time window division, ensuring the reliability of the estimation results. The initial estimation result of the feeding amount not only includes the predicted feeding amount in each time window, but also includes the feeding rate and the feeding duration. These results provide more comprehensive information for breeders, helping them more accurately assess the feed intake of cattle and optimize the feeding plan. This method is suitable for real-time monitoring scenarios and can quickly process the data collected by the nose halter pressure sensor and output the initial estimation result of the feeding amount. This helps breeders to discover and handle problems in a timely manner, improving breeding efficiency and management level.
[0079] In some embodiments, the feeding amount calibration parameters include chewing frequency and rumination duration; The method for determining the feeding amount calibration parameters based on all the time window data identified as rumination behavior includes: S1401, filtering out the data segment corresponding to the rumination behavior from all the nose halter pressure data segments to obtain rumination behavior data.
[0080] Based on the behavior recognition result, the data segment corresponding to the rumination behavior is filtered out from all the nose halter pressure data segments, which can be filtered out according to the timestamp. Each nose halter pressure data segment containing only rumination behavior is obtained as rumination behavior data.
[0081] S1402, using a preset change point detection algorithm to dynamically divide the rumination behavior data to obtain the rumination behavior data segment in each time window and determine the rumination duration of each time window.
[0082] The rumination behavior data is dynamically divided using a preset change point detection algorithm (such as PELT algorithm). The change point detection algorithm can identify the mutation points in the signal, which usually correspond to the changes (such as start, end, pause, etc.) of the rumination behavior.
[0083] According to the detected change point, the rumination behavior data is dynamically divided into multiple time windows. The data in each time window represents a relatively independent rumination behavior segment. For each time window, the time length thereof is calculated to obtain a rumination duration. The rumination duration is an important indicator for measuring the duration of rumination behavior, which is used for subsequent forage intake calibration.
[0084] In S1403, for each rumination behavior data segment in each time window, the peak-valley detection method is used to detect the number of peaks and valleys in the rumination behavior data segment, and the chewing frequency is determined according to the number of peaks and valleys.
[0085] In S1403, for each rumination behavior data segment in each time window, the peak-valley detection method is used to detect the number of peaks and valleys in the rumination behavior data segment, and the chewing frequency is determined according to the number of peaks and valleys.
[0086] Specifically, the rumination behavior data segment is imported into Python, and the minimize and maximize functions in the optimize module of the SciPy library are used to calculate the extreme points of the data segment. The maximum value point is regarded as the peak, and the minimum value point is regarded as the valley, and the number of peaks and valleys in the data segment is counted. By calculating the number of peaks and valleys in the rumination behavior data segment (i.e., a segment of continuous pressure data), the chewing frequency in the kth time window is obtained according to the conversion relationship between the number of peaks and valleys and the chewing frequency as follows, and the rumination duration in the kth time window is calculated, where k = 1, 2, 3, …, P.
[0087] (5) (6) wherein, is the chewing frequency in the kth time window; is a conversion coefficient, representing the actual chewing frequency represented by each peak-valley pair (the present application assumes that each peak-valley pair represents one chewing); is the number of peaks and valleys obtained by the peak-valley detection method in the kth time window; is the rumination duration in the kth time window, and are the time stamp data corresponding to the end time and the start time in the kth time window, respectively; and P is the number of time windows corresponding to the rumination behavior.
[0088] The present application can more accurately reflect the influence of rumination behavior on forage intake estimation by dynamically dividing the time window and determining the calibration parameters such as rumination duration and chewing frequency, thereby improving the accuracy of calibration. The rumination pattern of cattle may vary due to individual differences, feed types and other factors. The method can adapt to the forage intake calibration requirements under different rumination patterns by dynamically dividing the time window and accurately calculating the calibration parameters. The method is suitable for real-time monitoring scenarios, can quickly process the data collected by the noseband pressure sensor, and output the calibrated forage intake estimation results in real time. This helps the breeders to understand the forage intake of cattle in time and make corresponding feeding management decisions.
[0089] In some embodiments, the input of the forage intake initial estimation result and the forage intake calibration parameter into the pre-constructed calibration model in S150 to obtain the calibrated forage intake includes: S1501, determining the characteristic foraging rate, the characteristic foraging duration, the characteristic forage intake prediction value, the characteristic chewing frequency and the characteristic rumination duration according to the foraging rate, the foraging duration, the forage intake prediction value, the chewing frequency and the rumination duration in each time window.
[0090] The average value of the factors in the time period is calculated according to the foraging rate, the foraging duration, the forage intake prediction value in each time window, and the chewing frequency and the rumination duration in each time window, to obtain the characteristic foraging rate, the characteristic foraging duration, the characteristic forage intake prediction value, the characteristic chewing frequency and the characteristic rumination duration.
[0091] (7) (8) (9) (10) (11) wherein, , , , , are the characteristic foraging rate, the characteristic foraging duration, the characteristic forage intake prediction value, the characteristic chewing frequency and the characteristic rumination duration, respectively.
[0092] is the foraging rate in the i-th time window; is the foraging duration in the i-th time window; is the forage intake prediction value in the i-th time window; i=1, 2, 3…M, M is the number of time windows corresponding to the foraging behavior.
[0093] chewing frequency in the kth time window; rumination duration in the kth time window, k = 1, 2, 3, …, P; P is the number of time windows corresponding to rumination behavior.
[0094] cumulative M time windows The estimated intake amount in the time period corresponding to the M time windows can be obtained. The estimated intake amount is averaged to obtain the above-mentioned characteristic intake amount prediction value.
[0095] S1502, input the characteristic intake rate, characteristic intake duration, characteristic intake amount prediction value, characteristic chewing frequency and characteristic rumination duration into the pre-constructed calibration model to obtain a calibrated intake amount.
[0096] The calculated characteristic intake rate, characteristic intake duration, characteristic intake amount prediction value, characteristic chewing frequency and characteristic rumination duration are input into the pre-constructed calibration model as input data. The calibration model is a mathematical model trained by a large amount of historical data, constructed by machine learning algorithms (such as neural networks, decision trees, etc.). The calibration model calculates and deduces the input parameters according to its internal learning mechanism and algorithm rules, and finally outputs a more accurate intake amount estimation result, i.e. the calibrated intake amount.
[0097] The present application can effectively eliminate the random fluctuations of the intake-related data in each time window caused by individual animal behavior differences, environmental transient fluctuations and other factors by calculating the average value. For example, the animal may temporarily stop feeding due to external interference in a certain time window, resulting in abnormal data such as feeding rate and feeding duration in that time window. However, by calculating the average value, the abnormal influence can be greatly weakened, so that the data input into the calibration model can better reflect the true feeding situation of the animal, thereby improving the accuracy of the final intake amount estimation. By considering and inputting multiple intake-related parameters (feeding rate, feeding duration, intake amount prediction value, chewing frequency and rumination duration) into the calibration model, the model can explore the potential correlation and mutual influence between these parameters. For example, the feeding rate and feeding duration together determine the total intake amount of the animal, while the chewing frequency and rumination duration are related to the degree of digestion and absorption of feed by the animal, which may affect its subsequent feeding behavior and intake amount. By integrating this information, the calibration model can more comprehensively and accurately estimate the final intake amount of the animal.
[0098] Since the calibration model is trained based on multiple parameters and a large amount of historical data, it can learn the variation rules of animal feeding behavior under different environmental conditions. When environmental factors such as feed quality, feeding density, climate conditions, etc. change, even if the values of each parameter fluctuate, by inputting the average value and using the comprehensive analysis capability of the model, a relatively stable calibrated feed intake can still be output, thereby enhancing the adaptability and robustness of the model to different environmental conditions.
[0099] There are certain differences in feeding behavior and physiological characteristics among different animal individuals. By calculating the average value and using the comprehensive processing capability of the calibration model, the influence of individual differences on the estimation results of feed intake can be reduced. The model can learn the common rules among different individuals from a large amount of data, thereby more accurately estimating the average feed intake of the group or giving a more accurate estimated feed intake for each individual.
[0100] Accurate calibrated feed intake is of great significance for feeding management. Feeding personnel can reasonably arrange the amount of feed delivery according to the estimation results, avoid feed waste or deficiency, and reduce feeding costs. At the same time, they can also discover animal health problems or abnormal factors in the feeding environment in a timely manner according to the changes in feed intake, so as to take appropriate measures for adjustment and improvement in a timely manner, and improve the growth performance of animals and the breeding efficiency.
[0101] In summary, the process of calculating the average value of the relevant feeding data in each time window and inputting it into the calibration model to obtain the calibrated feed intake can effectively improve the accuracy of feed intake estimation, enhance the robustness of the model, and provide reliable decision basis for feeding management.
[0102] In some embodiments, the above calibration model is based on the relationship between the characteristic feed intake prediction value and the characteristic feed rate , while introducing the influencing factors (the above , , ) to further improve the calibration effect and make it closer to the real feed intake. The calibration model is constructed using the calibration based on the Bayesian method, and the calibrated feed intake prediction value, i.e. the above calibrated feed intake, is obtained. The calibration model uses a Bayesian model, and the calibration model is as follows: wherein, is the calibrated feed intake; f is the calibration function, which is a Bayesian function determined by Bayesian inference.
[0103] The specific form of the calibration function f can be designed according to actual data and requirements. Through training, the characteristic feed rate , the characteristic feeding time , characteristic feed intake prediction value , characteristic chewing frequency and characteristic rumination duration The complex relationship between the feed intake and the calibration function f is analyzed. The calibration function f is trained using the historical training dataset, and the model performance is evaluated using the validation dataset. The calibration effect is optimized by adjusting the model parameters and structure.
[0104] The calibration model can be expressed as: FIC= =β0+β1 +β2 +β3 +β4 +β5 +β6( × ).
[0105] in, represents the first regression coefficient.
[0106] The method further comprises training the calibration model by referring to Figure 4 As shown, this includes prior distribution setting, likelihood function definition, posterior distribution update and predictive distribution: S210: Obtain a historical training data set.
[0107] Collect historical training data sets, each historical training data includes: real feeding rate, characteristic feeding rate , characteristic feeding time , characteristic feed intake prediction value , characteristic chewing frequency and characteristic rumination duration The data should cover records from different cattle and different feeding conditions to ensure the generalization ability of the model. The collected data should be cleaned to remove outliers or missing values and normalized so that each feature is within a similar numerical range to facilitate model training.
[0108] S220: Acquire the constructed Bayesian model, where the likelihood function of the Bayesian model is: (f'( , , , ), ) in, represents normal distribution; f' is the mapping function used to map the input features (FI', FIT', CF', RT') to the output variables ( )’s expected value; is the error variance. The likelihood function can be expressed as: f'(FI',FIT',CF',RT')= + FI'+ FIT'+ CF'+ RT' The likelihood function represents the feature feeding rate subject to a normal distribution with mean , , , and variance . (β2) represents the second regression coefficient.
[0109] To construct the Bayesian model, first set the model parameters (including the parameters β0 to β6 of the calibration function f and the error variance ) subject to a Gaussian distribution as the prior distribution.
[0110] S230, the posterior distribution of the model parameters of the Bayesian model is iteratively optimized using the Markov Chain Monte Carlo method, and when the number of iterations reaches a preset threshold or the parameters converge, the trained calibration model is output.
[0111] Specifically, the posterior distribution of the model parameters is iteratively optimized using the Markov Chain Monte Carlo (MCMC) method, and based on the posterior distribution, the input data is predicted to obtain the calibrated feeding amount (FIC). The MCMC method constructs a Markov chain whose stationary distribution is equal to the target posterior distribution, and then samples from the chain to estimate the posterior distribution. Then perform iterative optimization, in each iteration, calculate the product of the likelihood function and the prior distribution based on the current parameter value to obtain the posterior distribution. Then, a sampling method (such as the Metropolis-Hastings algorithm) is used to draw new parameter samples from the posterior distribution. When the number of iterations reaches a preset threshold or the parameters converge (i.e., the parameter values change very little in multiple iterations), stop iteration and output the trained calibration model.
[0112] Before model training, the prior distribution of the parameters needs to be set. The first regression coefficient and the second regression coefficient both use a weak information normal prior: The error variance is subject to an inverse gamma distribution : The training process iteratively updates parameters by MCMC method. The specific process is as follows: 1. Initialize parameters: randomly generate initial parameters .
[0113] 2. Iterative sampling: Regression coefficient update: for each or , generate candidate value ( , ), calculate acceptance probability a: wherein is the minimum value function, is the variance of the normal distribution used to generate candidate values in MCMC. is the current value of the first regression coefficient at the tth iteration. represents the set of all observation data used to train the Bayesian model, i.e., the historical training data set mentioned above.
[0114] If a ≥ Uniform(0, 1), accept , otherwise keep the original value. Uniform(0, 1) represents a value randomly drawn from a uniform distribution U(0, 1).
[0115] Error variance update: directly sample from the conjugate posterior distribution.
[0116] wherein is the number of samples, is the true feeding rate of the i th observation, is the predicted value of the feeding rate of the i th observation by the model. The true feeding rate is calculated by the above-mentioned weighing trough process data, i.e., first calculate the feeding rate in the i th time window using the above-mentioned formulas (1) (2) , and then take the average of the M time windows to get the true feeding rate.
[0117] 3. Convergence judgment: stop training when the number of iterations reaches the preset threshold (such as 10,000 times) or the Gelman-Rubin statistic <1.1.
[0118] After training, the posterior predictive mean of the calibrated feed intake is: wherein, is the parameter value obtained by the s-th posterior sampling, is the total number of posterior samplings.
[0119] The present application can more accurately estimate the intake of cattle by introducing rumination behavior data (chewing frequency and rumination duration) as a calibration factor, combining the initial prediction value of the intake and the feeding duration. The use of the Bayesian method enables the model to handle uncertainty and quantify this uncertainty through the estimation of the posterior distribution. This helps to enhance the robustness of the model when facing noisy data or outliers. The calibrated model after training can be used for real-time monitoring of the intake of cattle and provide timely feedback to the breeders. This helps breeders to adjust the feeding plan in time, optimize the utilization of feed and improve the breeding efficiency. Accurate intake estimation provides strong support for precision feeding management. Breeders can develop individualized feeding programs based on the intake of each cow to meet the nutritional needs of different cattle and promote the healthy growth of cattle.
[0120] The present application can realize real-time monitoring of the intake of cattle, with an accuracy rate of 99% in intake estimation on the self-built data set, solving the problem of low-cost acquisition of individual cattle intake and helping breeders to accurately assess the feed intake of cattle to effectively master the health status of cattle.
[0121] The cattle intake estimation device provided by the present application is described below, and the cattle intake estimation device described below can be referred to in conjunction with the cattle intake estimation method described above.
[0122] The cattle intake estimation device provided by the present application, as shown in Figure 5 includes: The data acquisition module 310 is configured to acquire the nose halter pressure data of the cattle. The behavior recognition module 320 is configured to segment the nose halter pressure data using a sliding time window algorithm, calculate the time sequence features in each time window, and input the time sequence features in each time window into a pre-trained behavior recognition model to obtain the corresponding cattle behavior type, wherein the cattle behavior type at least includes feeding behavior and rumination behavior. The initial prediction module 330 is configured to predict the intake based on all time window data identified as feeding behavior to obtain an initial estimation result of the intake; the time window data is a nose halter pressure data segment obtained by segmenting the nose halter pressure data using a sliding time window algorithm. The parameter determination module 340 is configured to determine the intake calibration parameter based on all time window data identified as rumination behavior. The result calibration module 350 is configured to input the initial forage intake estimation result and the forage intake calibration parameter into a pre-constructed calibration model to obtain a calibrated forage intake.
[0123] Figure 6 An example of a schematic diagram of a physical structure of an electronic device is shown in FIG. 1. Figure 6 As shown in FIG. 1, the electronic device can include a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 can communicate with each other through the communications bus 440. The processor 410 can invoke a logical instruction in the memory 430 to execute the method for estimating forage intake of a confined cattle.
[0124] In addition, the logical instruction in the memory 430 described above can be implemented in the form of a software functional unit and sold or used as an independent product, which can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0125] On the other hand, the present application also provides a computer program product, which includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor to enable a computer to execute the method for estimating forage intake of a confined cattle.
[0126] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method for estimating forage intake of a confined cattle.
[0127] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0128] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0129] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for estimating feed intake of barn-fed cattle, characterized in that: include: Obtain cattle nasal pressure data; The nasal pressure data is segmented using a sliding time window algorithm, the time series features in each time window are calculated, and the time series features in each time window are respectively input into a pre-trained behavior recognition model to obtain a corresponding cattle behavior type, wherein the cattle behavior type includes at least feeding behavior and rumination behavior; Based on all time window data identified as feeding behavior, feed intake is predicted to obtain an initial feed intake estimation result; the time window data is nasal pressure data segments obtained by segmenting the nasal pressure data using a sliding time window algorithm; Determine feed intake calibration parameters based on all time window data identified as rumination behavior; The initial feed intake estimation result and the feed intake calibration parameters are input into a pre-built calibration model to obtain a calibrated feed intake.
2. The method for estimating feed intake of barn-fed cattle according to claim 1, wherein: The feed intake prediction based on all time window data identified as feeding behavior to obtain an initial feed intake estimation result includes: Filtering the data segments corresponding to the feeding behavior from all the nasal pressure data segments to obtain the feeding behavior data; Applying an empirical mode decomposition algorithm to perform empirical mode decomposition on the feeding behavior data to obtain a plurality of intrinsic mode function components; Inputting the multiple intrinsic mode function components into a preset change point detection model, dynamically dividing time windows according to the detected change points, and extracting signal feature parameters within each time window from the feeding behavior data according to the divided time windows; Inputting the signal characteristic parameters in each time window into a pre-trained feeding rate prediction model to perform feeding rate prediction to obtain corresponding feeding rate prediction values; Determine the feeding duration for each time window; For each time window, the feed intake prediction value is determined based on the feed intake rate prediction value and feed intake duration within the time window.
3. The method for estimating feed intake of barn-fed cattle according to claim 2, wherein: The feeding rate prediction model is constructed using a random forest model. During the training process, the feeding rate regressed from the weighing trough process data corresponding to the time window is used as the true value; the weighing trough process data includes the trough weight data and timestamp data within each time window; the feeding rate within each time window is determined by the following formula: in, is the feeding rate of the jth data in the i-th time window, is the j-th trough weight data in the i-th time window, is the weight data of the j+1th trough in the i-th time window, and They are the jth timestamp data and the j+1th timestamp data in the i-th time window, respectively, j=1,2,3... , is the total number of data points in the time window, is the feeding rate in the i-th time window.
4. The method for estimating feed intake of barn-fed cattle according to claim 2, wherein: The feed intake calibration parameters include chewing frequency and rumination time; The feed intake calibration parameters are determined based on all time window data identified as rumination behaviors, including: Filtering the data segments corresponding to rumination behavior from all nasal pressure data segments to obtain rumination behavior data; Dynamically segmenting the rumination behavior data using a preset change point detection algorithm to obtain rumination behavior data segments within each time window, and determining the rumination duration of each time window; For each rumination behavior data segment within a time window, a peak-valley detection method is used to detect the number of peaks and troughs in the rumination behavior data segment, and the chewing frequency is determined according to the number of peaks and troughs.
5. The method for estimating feed intake of barn-fed cattle according to claim 4, characterized in that: Inputting the initial feed intake estimation result and the feed intake calibration parameters into a pre-built calibration model to obtain a calibrated feed intake, including: According to the feeding rate, feeding time, feeding amount prediction value, chewing frequency and rumination time in each time window, the characteristic feeding rate, characteristic feeding time, characteristic feeding amount prediction value, characteristic chewing frequency and characteristic rumination time are determined respectively; The characteristic feeding rate, characteristic feeding duration, characteristic feed intake prediction value, characteristic chewing frequency and characteristic rumination duration are input into a pre-built calibration model to obtain a calibrated feed intake.
6. The method for estimating feed intake of barn-fed cattle according to claim 1, wherein: The calibration model adopts a Bayesian model, and the method further includes training the calibration model in the following manner: Obtain a historical training data set, each historical training data includes: actual feeding rate, characteristic feeding rate, characteristic feeding time, characteristic feeding amount prediction value, characteristic chewing frequency, characteristic rumination time; Obtain the constructed Bayesian model, the likelihood function of the Bayesian model is: (f' ( , , , ), ) in, 、 、 、 、 They are characteristic feeding rate, characteristic feeding duration, characteristic feeding amount prediction value, characteristic chewing frequency and characteristic rumination duration; represents normal distribution; f' represents mapping function; is the error variance; The Markov Chain Monte Carlo method is used to iteratively optimize the posterior distribution of the model parameters of the Bayesian model. When the number of iterations reaches a preset threshold or the parameters converge, a trained calibration model is output; wherein the model parameters of the Bayesian model obey a Gaussian distribution.
7. A feed intake estimation device for barn-fed cattle, characterized in that: include: A data acquisition module is used to obtain the nasal pressure data of cattle; a behavior recognition module for segmenting the nasal pressure data using a sliding time window algorithm, calculating the time series features within each time window, and inputting the time series features within each time window into a pre-trained behavior recognition model to obtain a corresponding cattle behavior type, wherein the cattle behavior type includes at least feeding behavior and rumination behavior; An initial prediction module is used to predict the feed intake based on all time window data identified as feeding behavior, and obtain an initial feed intake estimation result; the time window data is the nasal pressure data segments obtained by segmenting the nasal pressure data using a sliding time window algorithm; a parameter determination module, configured to determine a feed intake calibration parameter based on all time window data identified as rumination behaviors; The result calibration module is used to input the initial feed intake estimation result and the feed intake calibration parameter into a pre-built calibration model to obtain a calibrated feed intake.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method for estimating feed intake of stall-fed cattle according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for estimating feed intake of stall-fed cattle according to any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for estimating feed intake of stall-fed cattle according to any one of claims 1 to 6 is implemented.