Cow growth trend prediction method based on multi-source data fusion
By collecting multi-source data and utilizing a multi-channel spatiotemporal attention fusion model, the environmental stress index and behavioral health index are calculated, and the parameters are dynamically updated. This solves the problems of single data and static models in existing cattle growth prediction methods, and achieves highly accurate and adaptive growth trend prediction.
Patent Information
- Application Number
- CN202511882666.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-01-09
AI Technical Summary
Existing methods for predicting cattle growth suffer from problems such as a single data source, shallow data fusion, static models with weak generalization ability, and ambiguous parameter acquisition process, resulting in insufficient prediction accuracy and adaptability.
Environmental, physiological, behavioral, and nutritional data are collected and deeply fused using a multi-channel spatiotemporal attention fusion model to calculate the environmental stress index and behavioral health index. A dynamic parameter update mechanism is also employed to dynamically capture growth patterns and adaptively adjust the data.
It enables multi-dimensional and dynamic prediction of cattle growth trends, improves prediction accuracy and model generalization ability, reduces retraining costs, and provides a highly operable technical solution.
Smart Images

Figure CN121303484A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart agriculture and animal husbandry technology, and in particular to a method for predicting cattle growth trends through multi-source data fusion. Background Technology
[0002] In intensive dairy and beef cattle farming, accurate prediction of cattle growth trends is crucial for optimizing feed formulation, early detection of health risks, determining the optimal slaughter time, and improving economic efficiency. Existing cattle growth prediction methods mainly suffer from the following problems:
[0003] Single data source, lacking global perspective: Existing technologies often rely on single types of data, such as weight data from regular weighings or simple feed intake records. Cattle growth is a complex physiological process influenced by multiple dimensions of factors, including genetics, nutrition, environment, health, and behavior. A single data source cannot comprehensively reflect these interactions, leading to biased predictive models and a sharp decline in accuracy when environmental changes or individual health conditions shift.
[0004] The data fusion is superficial and feature extraction is insufficient: even when using multiple data sources, existing methods typically remain at the level of simple data splicing or weighted averaging, failing to delve into the temporal correlations, nonlinear interactions, and lagged effects on growth between data from different sources. For example, changes in environmental temperature and humidity may not immediately affect daily body weight, but they will manifest as changes in growth rate several days later by influencing feeding behavior and digestive efficiency. This deep-seated causal and temporal correlation has not been effectively modeled.
[0005] The models are static and have poor generalization ability: Most models use fixed parameters and structures, which cannot adapt to the dynamic changes of different seasons, different barn environments, and different growth stages (such as calves, heifers, and adult cattle). A model that trains well on spring data may completely fail in the hot and humid environment of summer, requiring data to be collected and retrained, which is costly and impractical.
[0006] The parameter acquisition process is vague: many solutions directly provide prediction formulas and parameters, but lack clear and feasible descriptions on how to extract and calculate key parameters (such as environmental stress coefficients, behavioral health indices, etc.) from raw sensor data, making it impossible for those skilled in the art to reproduce and implement the solutions.
[0007] Therefore, there is an urgent need in this field for a method to predict cattle growth trends that can deeply integrate multi-dimensional data, dynamically capture growth patterns, and have strong generalization capabilities. Summary of the Invention
[0008] To achieve the above objectives, this invention provides a method for predicting cattle growth trends using multi-source data fusion, comprising the following steps:
[0009] Four types of raw data were collected: environmental data, physiological data, behavioral data, and nutritional data, and then preprocessed.
[0010] Based on preprocessed time-series data, an environmental stress index and a behavioral health index are calculated. The environmental stress index is used to quantify the stress caused by environmental factors to cattle, and its calculation process integrates the deviation of temperature, humidity, ammonia concentration, and carbon dioxide concentration from their respective suitable ranges. The behavioral health index is used to quantify the health trend of individual cattle, and its calculation process integrates the changes in feeding, rumination, and activity behavior relative to their own historical baselines.
[0011] The preprocessed data, environmental stress index, and behavioral health index are input into a multi-channel spatiotemporal attention fusion model. The model processes different types of data through parallel channels and uses temporal attention mechanism and channel attention mechanism to dynamically evaluate the importance of different time points and different data channels to the prediction target, and then performs weighted fusion.
[0012] Based on the fused features, the predicted weight of cattle within a specific future time window is output.
[0013] Based on the error between the predicted value and the actual measured value, the parameters of the multi-channel spatiotemporal attention fusion model are dynamically triggered and updated.
[0014] Preferably, the four types of raw data collected—environmental data, physiological data, behavioral data, and nutritional data—specifically include:
[0015] Environmental data, including temperature, humidity, ammonia concentration, and carbon dioxide concentration, is collected by fixed sensors deployed inside the cattle shed.
[0016] Physiological and behavioral data are collected by wearable devices mounted on cattle. The physiological data includes weight data collected by a weighing scale, body surface temperature data collected by an ear temperature sensor, and respiratory rate data obtained by analyzing data from a neck accelerometer. The behavioral data includes feeding duration data obtained by reading RFID records from feeding stations, rumination duration data obtained by analyzing specific waveform patterns in neck accelerometer data, and activity data obtained by integrating vector changes in triaxial accelerometer data.
[0017] Nutritional data is obtained through manual input, including feed dry matter content, crude protein content, and metabolizable energy content.
[0018] Preferably, the preprocessing of the raw data includes:
[0019] For data loss caused by communication interruption or signal loss, a time series-based linear interpolation method is used to fill in the gaps.
[0020] For outliers caused by instantaneous false alarms from sensors, an outlier detection method based on statistical distribution is used for identification and removal, and the positions after removal are interpolated using the same method as data missing imputation.
[0021] For the complete data sequence after filling in and removing outliers, a data standardization method is used to transform all feature values to the same numerical dimension in order to eliminate the impact of differences in sensor range and unit on model training.
[0022] Preferably, the process of calculating the environmental stress index includes:
[0023] Based on the breed and growth stage of the target cattle, a predefined data table is consulted to determine their optimal temperature and humidity ranges, and comfort thresholds for ammonia and carbon dioxide concentrations are set.
[0024] Calculate the absolute difference between the current temperature reading and the median of the optimal temperature range, calculate the absolute difference between the current humidity reading and the median of the optimal humidity range, calculate the portion of the current ammonia concentration reading that exceeds the comfort threshold, and calculate the portion of the current carbon dioxide concentration reading that exceeds the comfort threshold.
[0025] The difference calculation results are multiplied by a weighting coefficient and then summed. The weighting coefficient is determined by analyzing the correlation strength between various environmental factors and the daily weight gain decline rate of cattle in historical breeding data. The stronger the correlation, the larger the weighting coefficient of the factor.
[0026] The weighted summation result is input into a monotonically increasing nonlinear function, and the output of the nonlinear function is mapped to a closed interval between 0 and 1 to finally obtain the environmental stress index.
[0027] Preferably, the process of calculating the behavioral health index includes:
[0028] Establish an individual behavioral baseline for each cow, which is the cow’s average feeding time, average rumination time and average activity level in a specific time window in the past when it is in a healthy state.
[0029] Calculate the percentage change in the actual feeding time of the cattle relative to the average feeding time in its behavioral baseline during the current monitoring period, calculate the percentage change in the actual rumination time relative to the average rumination time, and calculate the percentage change in the actual activity level relative to the average activity level.
[0030] The three percentage change values are multiplied by a weighting coefficient and then summed. The weighting coefficient is determined by analyzing the correlation strength between various behavioral abnormalities in historical breeding data and subsequent health events diagnosed by veterinarians. The higher the correlation strength, the larger the weighting coefficient of the behavioral indicator.
[0031] The weighted summation result is input into a monotonically increasing nonlinear function, and the output of the nonlinear function is mapped to a closed interval between 0 and 1 to finally obtain the behavioral health index.
[0032] Preferably, the temporal attention mechanism in the multi-channel spatiotemporal attention fusion model operates in the following manner:
[0033] For each data channel's time-series feature sequence, calculate the similarity score between the feature vector of each historical time point and the feature vector of the latest time point;
[0034] The similarity scores of all historical time points are input into a normalized exponential function and converted into a set of weight coefficients, the sum of which is 1.
[0035] The feature vectors at historical time points are weighted and summed using this set of weighting coefficients to obtain a channel summary vector that can represent the entire sequence and focus on the historical information most relevant to the current state.
[0036] Preferably, the channel attention mechanism in the multi-channel spatiotemporal attention fusion model operates in the following manner:
[0037] The channel summary vectors processed by the temporal attention mechanism are concatenated to form a new comprehensive feature vector.
[0038] The integrated feature vector is input into a small feedforward neural network, which outputs a weight vector with a value equal to the number of data channels.
[0039] Input the weight vector into a normalized exponential function to obtain a set of channel weight coefficients that sum to 1;
[0040] The channel summary vectors are weighted and summed using these channel weight coefficients to generate a unified feature vector that incorporates information from all data sources, which is then used for final prediction.
[0041] Preferably, the dynamic triggering and parameter updating of the multi-channel spatiotemporal attention fusion model specifically includes:
[0042] The absolute error between the predicted weight value and the actual measured weight value is continuously monitored.
[0043] Set an error threshold. When the number of consecutive prediction errors exceeds a preset limit and each error is greater than the error threshold, the model performance is determined to be degraded and the update process is triggered.
[0044] The error threshold is not a fixed value, but is dynamically set proportionally according to the range of the cow's current weight.
[0045] Preferably, the parameter update refers to:
[0046] The newly collected sequence data, which includes multi-source data and their corresponding actual weights, constitutes a new training sample set;
[0047] A transfer learning strategy is adopted to keep the parameters of the basic network layer used to extract low-level temporal features in the multi-channel spatiotemporal attention fusion model unchanged, and only fine-tune the parameters of the network layer responsible for high-level feature fusion and prediction output in the model.
[0048] Train the model on the parameters that need updating using a new training sample set and an optimized learning rate, so that the model adapts to the latest data distribution.
[0049] Preferably, the process of obtaining respiratory rate data by analyzing neck acceleration sensor data specifically involves:
[0050] The raw triaxial acceleration data were bandpass filtered to separate the signal components in a specific frequency range generated by the minute chest movements caused by breathing.
[0051] Perform spectral analysis on the filtered signal to find the dominant frequency with the highest energy within the physiologically reasonable respiratory frequency range in its power spectrum;
[0052] Converting this primary frequency into respiratory rates per minute yields the desired respiratory rate data.
[0053] The beneficial effects of this invention are:
[0054] 1. This invention comprehensively reflects the multi-dimensional factors in the growth process of cattle by collecting and integrating four types of raw data—environmental data, physiological data, behavioral data, and nutritional data. These data include not only environmental data such as temperature, humidity, ammonia concentration, and carbon dioxide concentration, but also physiological data such as weight, body surface temperature, and respiratory rate, as well as behavioral data such as feeding, rumination, and activity, fully considering the influence of genetics, health, nutrition, and other aspects of the cattle. Therefore, this invention can comprehensively consider multiple factors when predicting the growth trend of cattle, avoiding the one-sidedness caused by a single data source in existing methods, thereby greatly improving the accuracy of prediction.
[0055] 2. This invention utilizes a multi-channel spatiotemporal attention fusion model to dynamically evaluate the importance of different data sources to the growth prediction target at various time points. The model processes different types of data through parallel channels and combines temporal attention and channel attention mechanisms to deeply explore the temporal correlations and nonlinear interactions between data, enabling it to capture the lag effect of environmental factors on cattle growth rates. Therefore, this invention not only achieves multi-dimensional data fusion but also effectively reveals the causal relationships and lag effects between data, significantly improving the model's predictive ability for cattle growth trends.
[0056] 3. This invention employs a dynamic model structure based on a multi-channel spatiotemporal attention mechanism. This model can adaptively adjust according to different seasons, environmental changes, and cattle growth stages. By dynamically capturing the patterns of environmental changes and cattle growth, the model can effectively adjust to different breeding environments and individual differences among cattle, improving its generalization ability. Furthermore, the dynamic triggering and parameter update mechanisms in the model enable real-time optimization based on error feedback, avoiding the limitations of static models and thus reducing the high cost of retraining.
[0057] 4. This invention details how to extract and calculate key parameters, such as the environmental stress index and behavioral health index, from raw sensor data. By calculating weighting coefficients for environmental data and combining historical breeding data with the correlation between cattle weight gain, the calculation process for the environmental stress index is clearly defined. Simultaneously, the calculation of the behavioral health index considers changes in cattle's feeding, rumination, and activity behaviors relative to their behavioral baseline, as well as the strength of their association with health events. Through a clear calculation process and parameter extraction method, this invention provides a highly operable and repeatable technical solution, ensuring that technicians can implement and apply these methods in practice. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in this invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0059] Figure 1 This is a flowchart of the steps of the method of the present invention;
[0060] Figure 2 This is a flowchart illustrating the steps involved in updating the parameters of the method of the present invention.
[0061] Figure 3 This is a flowchart illustrating the steps of the method of the present invention to obtain respiratory rate data by analyzing data from a neck acceleration sensor. Detailed Implementation
[0062] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. It should also be noted that, to make the embodiments more comprehensive, the following embodiments are the best and preferred embodiments, and those skilled in the art can use other alternative methods to implement some well-known technologies; moreover, the accompanying drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.
[0063] Please see Figures 1-3 This invention provides a method for predicting cattle growth trends using multi-source data fusion. First, various sensor devices are used to collect environmental data (such as temperature, humidity, ammonia concentration, carbon dioxide concentration, etc.), physiological data (such as cattle weight, body surface temperature, heart rate, etc.), behavioral data (such as feeding, rumination, activity behavior, etc.), and nutritional data (such as feed intake, nutrient composition, etc.) in real time. These data are typically high-dimensional and time-series, therefore preprocessing is necessary, including noise reduction, normalization, and missing value imputation, to ensure data consistency and accuracy, preparing for subsequent analysis.
[0064] The preprocessed data was further used to calculate two key indices:
[0065] Environmental stress index: Based on environmental data such as temperature, humidity, ammonia concentration, and carbon dioxide concentration, this index calculates the degree of deviation of these indicators from their suitable ranges. The specific steps include standardizing each environmental factor to obtain a quantitative value of its deviation from the suitable range, and then weighting these values to obtain a comprehensive environmental stress index. This index reflects the degree of environmental impact on cattle and can effectively assess the stress impact of environmental changes on cattle growth.
[0066] Behavioral Health Index: This index is calculated by analyzing the deviation of cattle's feeding, rumination, and activity behaviors from historical baselines. Specifically, it involves quantitatively analyzing the behavior of each cattle, comparing current behavioral patterns with historical data trends to determine changes in health status.
[0067] The calculation of these two indices provides the model with dynamic inputs of health and environmental factors.
[0068] Preprocessed data, environmental stress index, and behavioral health index are input into a multi-channel spatiotemporal attention fusion model. The innovation of this model lies in using parallel channels to process different types of data separately, fully leveraging the complementarity between data sources. The input data for each channel is first processed for feature extraction using a convolutional neural network (CNN), and then a temporal attention mechanism is employed to dynamically capture important features over time, evaluating the impact of different time points on cattle growth trends. Furthermore, the channel attention mechanism is used to evaluate the contribution of different data sources to the prediction target, improving the accuracy of the prediction model by weighted fusion of information from different channels.
[0069] Based on the fused features, the model outputs predicted cattle weights within a specific future time window. Body weight is a core indicator of cattle growth; therefore, accurate prediction is crucial for optimizing feed formulation, health monitoring, and slaughter decisions. The error between the predicted and actual measurements triggers a dynamic parameter update mechanism. Specifically, by calculating the prediction error and feeding it back to the model, the model's weights and parameters are adjusted using the error feedback mechanism, thereby continuously optimizing the model's predictive ability. This process ensures the model has good adaptability and generalization ability, maintaining high accuracy under different seasonal and environmental conditions.
[0070] This invention, by combining multi-source data, advanced spatiotemporal attention mechanisms, and dynamic update algorithms, can accurately predict cattle growth trends, provide effective decision support, optimize feed allocation, health monitoring, and slaughter timing, thereby improving the efficiency and economic benefits of livestock management.
[0071] In one possible implementation, environmental data is acquired through fixed sensors deployed within the cattle shed, primarily including:
[0072] Temperature data: The air temperature inside the cattle shed is collected in real time by temperature sensors, which has a direct impact on the growth of cattle. Too high or too low temperatures can cause stress response and affect their feeding and activity.
[0073] Humidity data: Humidity sensors monitor the humidity level in the cattle shed. Too high or too low humidity can affect the comfort of the cattle and cause stress.
[0074] Ammonia concentration data: Ammonia concentration has a direct impact on the respiratory system and health of cattle, especially in enclosed environments, where excessively high ammonia concentrations can lead to breathing difficulties and health problems.
[0075] Carbon dioxide concentration data: Monitoring carbon dioxide concentration helps assess air circulation in cattle sheds. Excessive carbon dioxide concentration can cause discomfort to cattle, thus affecting their growth and activity.
[0076] The environmental data collected by these sensors, after preprocessing, will provide the model with quantitative information about environmental stress, supporting subsequent prediction and analysis.
[0077] Physiological data is collected through wearable devices that can monitor the health status of cattle in real time, including:
[0078] Weight data: The weight of cattle is collected regularly using a weighing scale. Weight is an important indicator for assessing the growth status of cattle.
[0079] Body surface temperature data: The body surface temperature of cattle is obtained through ear temperature sensors. Excessively high or low body temperature is a signal of health problems and can be used to monitor whether cattle are under stress or infected with disease.
[0080] Respiratory rate data: The respiratory rate of cattle is calculated by analyzing data from neck accelerometers and based on their neck movement patterns. Abnormal respiratory rates may be an early sign of health problems in cattle.
[0081] The collection of this physiological data can reflect the health status of cattle in real time, providing the model with dynamic information about the physiological condition of cattle.
[0082] Behavioral data is collected through wearable devices and other sensor devices, specifically including:
[0083] Feeding duration data: By reading RFID records at the feeding station, the feeding duration of cattle can be obtained. A short feeding duration may indicate poor appetite in cattle, which is associated with stunted growth.
[0084] Rumination duration data: By analyzing specific waveform patterns in the neck accelerometer, the rumination duration of cattle is determined. Rumination is part of the normal digestive process in cattle, and abnormal rumination duration may reflect problems with their digestive system.
[0085] Activity data: The activity level of cattle is obtained by integrating the vector changes in triaxial accelerometer data. A decrease in activity may be due to health problems or stress responses caused by environmental factors.
[0086] These behavioral data can reflect the activity level and physiological needs of cattle, providing behavioral state input for predictive models.
[0087] Nutritional data is usually entered manually, and includes:
[0088] Dry matter content data: Record the dry matter content in the feed, which directly affects the nutrient absorption and growth of cattle.
[0089] Crude protein content data: Crude protein is a major nutrient that cattle must have during their growth. Insufficient intake will affect the growth rate.
[0090] Metabolizable energy content data: Metabolizable energy data provides basic information on the amount of energy intake of cattle. Insufficient energy may lead to slowed growth in cattle.
[0091] Nutritional data is typically obtained through analysis reports provided by feed suppliers or by manual entry into the feed management system.
[0092] This invention, through diversified data acquisition methods and the precise acquisition of data from various sensors and devices, can provide more comprehensive and dynamic predictions of cattle growth trends, offering a more scientific and efficient management approach for the livestock industry.
[0093] In one possible implementation, due to signal loss or communication interruption that may occur with sensors or communication devices, some data may be missing. To fill in these missing data, a time-series-based linear interpolation method is employed. The specific implementation is as follows:
[0094] Linear interpolation of time series data: This method estimates the location of missing values by performing linear interpolation calculations on existing data points. For example, if data is missing at a certain point in time, but the data values before and after it are known, linear interpolation can predict the missing data based on the linear relationship between the two known data points.
[0095] Linear interpolation is simple and computationally inexpensive. It can effectively fill in data gaps for most continuous data (such as environmental data, weight, etc.) without introducing too many assumptions or biases.
[0096] Sensor malfunctions or momentary false alarms can lead to outliers in the data, which can severely impact model accuracy. Therefore, a statistical distribution-based outlier detection method is employed to identify and remove outliers. The specific implementation steps are as follows:
[0097] First, calculate the statistical distribution (such as mean, standard deviation, etc.) for each data feature. Then, by setting a reasonable threshold (such as the 3-times-standard-deviation rule), identify outliers that significantly deviate from the normal data distribution.
[0098] For values identified as outliers, they are directly removed, and their positions are filled using the same linear interpolation method as for missing data filling.
[0099] This method can effectively filter out meaningless data caused by sensor malfunctions, interference, or instantaneous changes, ensuring the accuracy and consistency of the dataset and helping to improve the stability and reliability of the prediction model.
[0100] To eliminate the impact of differences in sensor range and units on model training, the final step in preprocessing is data standardization. Its main steps include:
[0101] All features (such as temperature, humidity, weight, feeding time, etc.) are converted into the same numerical units through standardization methods. Common standardization methods include Z-score standardization (subtracting the mean and dividing by the standard deviation) or Min-Max standardization (compressing the data to the range of 0 to 1).
[0102] Standardization can effectively avoid data deviations caused by differences in the measurement range and units of different sensors, ensuring that the influence of each feature is treated equally in model training, thereby improving the accuracy of the model and the training effect.
[0103] In one possible implementation, firstly, based on the breed and growth stage of the target cattle, the optimal temperature range, humidity range, and comfort thresholds for ammonia and carbon dioxide concentrations are determined by querying a predefined database or data table. Different breeds and growth stages have different adaptability to environmental conditions, therefore these optimal values need to be defined based on historical data and animal husbandry studies. For example, the optimal temperature range for dairy cows may differ from that for beef cattle, and the tolerance of young cattle to temperature and humidity also differs from that of adult cattle.
[0104] When calculating the stress index, it is necessary to calculate the difference between the current environmental parameters and the optimal environmental parameters for the target cattle. The specific steps are as follows:
[0105] Temperature difference: Calculates the absolute difference between the temperature reading at the current time point and the median of the optimal temperature range.
[0106] Humidity difference: Calculates the absolute difference between the current humidity reading and the median of the optimal humidity range.
[0107] Ammonia and carbon dioxide concentration difference: Calculate the portion of the current ammonia and carbon dioxide concentrations that exceeds the comfort threshold.
[0108] These differences represent the degree of deviation between the current environment and the desired comfortable environment for the target cattle; a larger difference indicates greater environmental stress.
[0109] To account for the varying impacts of different environmental factors on cattle growth, the above differences are weighted during the calculation process. Specifically, the weighting coefficients are determined based on the correlation strength between each environmental factor and the rate of decline in daily weight gain in historical breeding data. This step is implemented as follows:
[0110] Collect historical data, including the relationship between different environmental factors (temperature, humidity, ammonia concentration, carbon dioxide concentration) and the growth status of cattle (such as daily weight gain, health status, etc.).
[0111] Statistical analysis was used to calculate the correlation between each environmental factor and the rate of decline in daily weight gain of cattle, assigning a larger weight coefficient to factors with stronger correlations. For example, if temperature has the greatest impact on cattle growth, then the weight coefficient for temperature differences would be larger.
[0112] The difference of each environmental factor is multiplied by its corresponding weighting coefficient, and then summed to obtain a weighted sum.
[0113] The weighted summation result is input into a monotonically increasing nonlinear function, which maps the output to a closed interval between 0 and 1. The use of a nonlinear function ensures that the stress index output changes smoothly and gradually, avoiding drastic fluctuations due to extreme volatility in a single environmental factor. A common nonlinear function is the sigmoid function (S-shaped curve), which maps any input to the interval between 0 and 1, representing the degree of stress from no stress to extreme stress.
[0114] After the above steps, the final environmental stress index value falls within a closed interval of 0 to 1. The closer the index is to 1, the greater the stress in the environment for the cattle; conversely, the closer it is to 0, the more comfortable the environment. This value can serve as an important input factor in cattle growth trend prediction models, affecting the health status and growth rate of the cattle.
[0115] The calculation process of the environmental stress index enables an accurate assessment of the environmental comfort of cattle, and optimizes the weighting coefficient through historical data analysis, ultimately outputting a smooth and effective environmental stress index, which provides strong support for the prediction of cattle growth trends.
[0116] In one possible implementation, first, a behavioral baseline is established for each cow, representing its behavioral pattern in a healthy state. The behavioral baseline is primarily constructed using statistical data on the following behaviors over a specific time window (e.g., the past 30 or 60 days):
[0117] Average feeding time: The average amount of time cattle spend feeding each day.
[0118] Average rumination time: The average amount of time a cow spends ruminating each day.
[0119] Average activity level: The total daily activity level of cattle, usually obtained through activity tracking devices they wear.
[0120] These behavioral data are usually relatively stable in a healthy state. In this way, the normal behavioral patterns of each cow can be quantified, providing a benchmark for subsequent health index calculations.
[0121] Next, based on the current monitoring period (e.g., the past 24 hours or 72 hours), calculate the percentage change between the cow's actual behavior and baseline behavior:
[0122] Calculate the percentage difference between the actual feeding time of the cattle during the current monitoring period and the average feeding time in its behavioral baseline. The formula is:
[0123] Percentage change in feed intake = (Current feeding duration − baseline feeding duration) / baseline feeding duration × 100%;
[0124] Calculate the percentage change in current rumination time from baseline.
[0125] Calculate the percentage change in current activity level compared to baseline activity level.
[0126] These percentage changes reflect whether cattle exhibit abnormal behavior during the current cycle. For example, excessively short feeding times may be due to indigestion or other health problems, while a reduction in rumination time may indicate stress or disease.
[0127] To more accurately reflect the impact of each behavioral indicator on health status, different weighting coefficients need to be assigned to each indicator based on historical breeding data. By analyzing past historical data, the correlation strength between different abnormal behaviors (such as reduced feed intake, decreased activity, etc.) and subsequent health events (such as diseases diagnosed by a veterinarian) can be studied, and weights can be assigned to each percentage change in behavior. For example, if historical data shows a strong correlation between reduced feed intake duration and cattle contracting diseases, then the weighting coefficient for changes in feed intake duration will be larger.
[0128] The specific steps are as follows:
[0129] Collect historical data and statistically analyze the correlation between abnormal behaviors (such as abnormal feeding duration, decreased activity level, etc.) and health events (such as illness, weight loss, etc.).
[0130] Statistical analysis methods (such as correlation analysis) were used to determine the strength of the association between each behavioral indicator and the health event, and a weighting coefficient was assigned to each percentage change in behavior.
[0131] Multiply these percentage changes by their corresponding weighting coefficients to obtain the weighted result.
[0132] The weighted sum is input into a monotonically increasing non-linear function, such as the sigmoid function or other smoothing functions. The non-linear function smoothly maps the weighted result to the interval between 0 and 1. The purpose of this non-linear mapping is:
[0133] This ensures that even with significant behavioral changes, the index does not fluctuate excessively, thus avoiding over-sensitivity in prediction.
[0134] The weighted summation result is converted into a standardized behavioral health index to make it more interpretable, with 0 representing perfect health and 1 representing extreme poor health.
[0135] Ultimately, the output behavioral health index value will be within a closed interval of 0 to 1, reflecting the health status of the cattle during the current monitoring period. The closer the index is to 1, the more obvious the cattle's behavior is, which may indicate the occurrence of health problems; while the closer it is to 0, the more healthy the cattle's behavior is.
[0136] Quantitative analysis of cattle behavior and health not only improves the accuracy of health monitoring but also provides a scientific basis for breeding management, helping farms achieve more efficient and intelligent operation and management.
[0137] In one possible implementation, firstly, for each data channel (e.g., feeding duration, activity level, etc.), its temporal feature sequence needs to be processed. Each feature sequence consists of feature vectors from multiple historical time points, representing cattle behavior data at different times. The first step of the temporal attention mechanism is to calculate the similarity score between the feature vector of each historical time point and the feature vector of the latest time point. Common similarity metrics include cosine similarity and Euclidean distance, and their calculation formulas are as follows:
[0138] ;
[0139] in, Indicates a historical point in time. eigenvectors, This represents the feature vector at the latest time point. In this way, the similarity between each historical time point and the current state can be quantified, thus providing a basis for the subsequent weighting process.
[0140] After obtaining the similarity score for each historical time point, the next step is to input these similarity scores into a normalized exponential function, converting them into a set of weight coefficients. The exponential function's role is to strengthen the weight of historical time points most similar to the latest time point, while compressing the weight of historical time points that differ significantly from the latest time point. Commonly used normalized exponential functions are as follows:
[0141] ;
[0142] Normalization ensures that the sum of all weight coefficients is 1. This prevents bias in the model's calculations, ensuring its stability and rationality. At this point, the weight coefficients of historical time points reflect the correlation between that time point and the current state, with the most relevant historical information receiving higher weights.
[0143] Next, the feature vectors of all historical time points are weighted and summed using the weight coefficients calculated above, resulting in a channel summary vector. This vector represents the entire feature sequence while focusing on the historical information most relevant to the current state. The specific weighted summation formula is as follows:
[0144] ;
[0145] In this way, the final channel summary vector not only contains the essence of the entire time series information, but also avoids interference from information that is irrelevant to the current state or noise to some extent, providing a more accurate mapping of historical behavior.
[0146] Temporal attention mechanisms provide important technical support for predicting cattle growth trends in multi-source data fusion, improving prediction accuracy, enhancing model stability, and increasing management efficiency, thus providing a more intelligent basis for agricultural production decisions.
[0147] In one possible implementation, firstly, the temporal features of each data channel are processed using a temporal attention mechanism to obtain a channel summary vector for each channel. These channel summary vectors represent the historical information most relevant to the current state in each data channel. Next, all the channel summary vectors processed by temporal attention are concatenated to form a new comprehensive feature vector. This feature vector contains key information from all data channels, providing a foundation for subsequent weighted processing.
[0148] Next, the synthesized feature vector is input into a small feedforward neural network. This network learns the correlations in the data and outputs a weight vector equal to the number of data channels. Each element of this weight vector represents the relative importance of the corresponding channel in the final prediction. The structure of a feedforward neural network is relatively simple, typically containing several fully connected layers for non-linear mapping of the concatenated features.
[0149] To ensure the comparability and rationality of channel weight coefficients, the weight vector output by the feedforward neural network is processed by a normalized exponential function. The exponential function helps to amplify the influence of larger values in the weight vector and suppress smaller values, thereby highlighting channel features more relevant to the prediction results. The specific calculation method is as follows:
[0150] ;
[0151] in, It is the first The weights of each channel are normalized, ensuring that the sum of all coefficients is 1, thus maintaining the balance of feature fusion.
[0152] Finally, the calculated channel weight coefficients are used to weight and sum the respective channel summary vectors to obtain a unified feature vector. This feature vector contains information from all data sources and is weighted according to the relative importance of each channel. Ultimately, the resulting unified feature vector will be used as input for subsequent prediction models to predict cattle growth trends.
[0153] The channel attention mechanism of this invention can significantly improve the accuracy and stability of cattle growth trend prediction by automatically weighting and fusing multi-source data, and has good interpretability and flexibility in practical applications.
[0154] In one possible implementation, the model outputs predicted weight values for cattle in real-time or periodically during daily operation. Simultaneously, the system collects actual weight measurements, compares the predicted values with the actual measurements, and calculates the absolute error.
[0155] Absolute error = |Predicted weight - Actual weight|;
[0156] This monitoring process can be implemented through database or streaming data processing. After each prediction is completed, the error is calculated and the historical error sequence is stored for subsequent judgment of the model status.
[0157] Unlike traditional fixed error thresholds, this invention proposes a dynamic error threshold strategy. The error threshold is dynamically set proportionally to the current weight range of the cattle; for example, a slightly larger absolute error is allowed for heavier individuals, while the error is strictly limited for lighter individuals. This method avoids unreasonable error judgments by the model at different growth stages, improving the rationality and applicability of the judgments.
[0158] Specifically, a scaling factor k can be set, and the error threshold calculation formula is as follows:
[0159] Error threshold = k × current weight;
[0160] k can be determined through historical data statistics or expert experience.
[0161] The system compares consecutive prediction errors with a dynamic error threshold. If the number of consecutive prediction errors exceeds a preset limit, and each error is greater than the threshold, the model performance is deemed to have degraded. This triggers a model parameter update process, including:
[0162] Collect multi-source data and actual body weight data from a recent period of time;
[0163] Incremental training or fine-tuning of the multi-channel spatiotemporal attention fusion model allows the model to readjust to the current growth state of the cattle.
[0164] After the update is complete, the new model parameters will be deployed to the prediction system, and real-time monitoring will continue.
[0165] Through dynamic monitoring and triggering mechanisms, the model can adjust in a timely manner when performance degrades, avoiding error accumulation caused by prolonged use.
[0166] In one possible implementation, the newly collected multi-source data and their corresponding actual weight data are first integrated into a new training sample set. This sample set contains the latest cattle growth data, including time-series data for various data channels (such as feed intake, activity level, temperature, and humidity), and the corresponding actual measured weight values. By collecting the latest data, it is ensured that the model can adapt to changes in current growth trends, rather than relying solely on historical data.
[0167] In multi-channel spatiotemporal attention fusion models, low-level temporal feature extraction layers are typically used to capture more fundamental time-series information in the data, such as the growth patterns and activity patterns of cattle. These features are relatively stable and have strong applicability across different datasets. Therefore, when updating parameters, a transfer learning strategy is adopted to keep the parameters of the low-level temporal feature extraction layers unchanged. This avoids retraining these layers on new data, thus saving computational resources and time.
[0168] The key to transfer learning lies in fine-tuning only the parameters of the network layers responsible for high-level feature fusion and predictive output. These high-level layers are typically responsible for fusing, weighting, and ultimately predicting outputs from features of multi-source data. In this case, a new training set is used to optimize the parameters of these network layers so that the model can adapt to the new data distribution. This fine-tuning adjusts the model's predictive ability at different stages and growth conditions, making it more accurately reflect the current growth trend of the cattle.
[0169] To ensure effective model fine-tuning, an optimized learning rate is employed. The learning rate determines the step size for each parameter update. In transfer learning, a lower learning rate is typically chosen to avoid over-updating the model during tuning, which could lead to the loss of existing knowledge. Therefore, optimizing the learning rate is a crucial step in improving fine-tuning performance and can be achieved through cross-validation or other hyperparameter optimization methods.
[0170] When training with a new training sample set, the model is progressively updated based on the optimized learning rate, allowing it to adapt to the latest data distribution. As training progresses, the model learns how to make more accurate predictions of cattle growth trends based on current multi-source data. In this way, the model can handle changes in growth characteristics across different time periods and individuals, thereby improving the accuracy and stability of predictions.
[0171] By employing a transfer learning strategy, combined with new datasets and an optimized learning rate, the method of this invention can effectively update and optimize the model, thereby enhancing the ability to predict cattle growth trends through multi-source data fusion, adapting to constantly changing environments and data, and ensuring long-term stable prediction results.
[0172] In one possible implementation, an accelerometer mounted on the cow's neck first continuously collects its triaxial acceleration data. This data reflects the minute vibrations of the cow's neck during movement and respiration, especially the chest cavity movements caused by respiration. The raw data typically contains multiple frequency components, including signals caused by other behaviors such as movement and chewing. Therefore, further processing is required to extract respiration-related signals.
[0173] Since respiratory signals caused by chest cavity movements are typically within a certain frequency range, bandpass filtering can remove low-frequency noise (such as low-frequency movements generated by gait) and high-frequency noise (such as other external vibrations or sensor noise). The design of the bandpass filter is determined based on the normal respiratory frequency range of cattle, typically between 0.2 Hz and 1.5 Hz. The filtered signal will contain only the frequency components related to breathing, facilitating further analysis.
[0174] The filtered signal undergoes further processing via spectral analysis. Using techniques such as the Fast Fourier Transform (FFT), the time-domain signal can be converted into a frequency-domain signal, thus obtaining its power spectrum. The power spectrum displays the energy distribution of different frequency components; by observing the energy distribution at different frequencies within the power spectrum, the dominant frequency of the respiratory signal can be effectively identified.
[0175] After spectral analysis, the frequency with the highest energy within the physiologically reasonable respiratory frequency range of the power spectrum is identified. This frequency corresponds to the breathing frequency of cattle, because the chest movements caused by breathing exhibit distinct frequency characteristics. Typically, the breathing frequency of cattle fluctuates within a certain physiological range (e.g., 10-30 breaths per minute), therefore this dominant frequency accurately reflects the breathing state of the cattle.
[0176] By converting the dominant respiratory rate into respiratory counts per minute, the final respiratory rate data is obtained. This data reflects the number of times the cattle breathe per minute, providing important physiological data support for further analysis of the cattle's growth trends and health status.
[0177] This method processes neck accelerometer data to obtain accurate respiratory rate data, which can effectively improve the accuracy and stability of cattle growth trend prediction based on multi-source data fusion, providing strong data support for scientific breeding.
[0178] It is understood that, in this invention, the effective range of respiratory rate data is typically determined by physiological principles. For example, the normal respiratory rate of cattle is approximately between 10 and 30 breaths per minute, so a minimum and maximum frequency range can be set as a threshold, such as a frequency range of 0.2 Hz to 1.5 Hz, for the design of bandpass filters to remove irrelevant signals.
[0179] In signal processing, a noise filtering threshold is typically set to remove background noise or other irrelevant signals. This threshold can be based on experience or the distribution of actual data. For example, if the power of certain frequency components is below a certain threshold (such as -40dB), they are considered noise and can be removed.
[0180] In machine learning or deep learning models, when a model performs a classification task, it outputs a probability value. Typically, a threshold needs to be set to determine the classification result. For example, if the model predicts a probability greater than 0.8 for a certain class, it is classified into that class; if it is less than 0.5, it is classified into another class. This threshold needs to be adjusted according to the specific requirements.
[0181] In multi-source data fusion, each data source may have different importance to the final prediction result, so different weight coefficients are assigned to different data sources. For example, if neck acceleration data has a greater impact on predicting growth trends, then the weight coefficient of this data source should be higher, possibly 0.6 or 0.7, while the weight coefficients of other data sources are relatively lower, possibly 0.2 or 0.3.
[0182] In signal processing, filter coefficients are used to determine the frequency response of a bandpass filter. Filter design involves selecting an appropriate frequency bandwidth and filter order. The filter coefficients determine the filter's throughput and attenuation characteristics within a specific frequency range. For example, if the set filter frequency is 0.5Hz to 1Hz, then the filter coefficients need to be adjusted according to this frequency band to ensure effective extraction of signals within that band.
[0183] When training machine learning models, regularization coefficients (such as L2 regularization coefficients) are used to avoid overfitting. This coefficient is typically a small positive value (such as 0.01, 0.001, etc.), which reduces overfitting by penalizing large parameter values in the model. The magnitude of the regularization coefficient determines the degree of constraint on model complexity.
[0184] During optimization, the learning rate controls the step size of each parameter update. If the learning rate is too large, the optimization process may become unstable and fail to converge; if the learning rate is too small, the optimization speed will slow down. Typically, the learning rate is between 0.001 and 0.1, adjusted according to the complexity of the model and the amount of training data.
[0185] A model is a mathematical framework or algorithm used for data analysis, prediction, classification, or regression. It learns patterns from historical data to predict future unknown data.
[0186] Spatiotemporal attention fusion models: In situations involving time-series and spatial data, spatiotemporal attention models are used to extract useful information from multidimensional data. This model automatically identifies the importance of different time points and spatial locations by introducing an attention mechanism, thereby weighting and fusing data from different times and spaces. For example, in cattle growth prediction, the model can weight data based on the importance of features such as the cattle's health status, activity level, and respiratory rate at different time points.
[0187] Baseline network layers: In deep learning, baseline network layers typically refer to the fundamental structure of a neural network, such as convolutional layers, pooling layers, and fully connected layers. These layers are responsible for extracting low-level features from the input data, such as extracting frequency features related to breathing from acceleration data.
[0188] Advanced Feature Fusion Layer: The advanced feature fusion layer is used to integrate features from multiple sources or different layers. In cattle growth trend prediction, data from different sensors (such as temperature, humidity, activity level, respiratory rate, etc.) can be combined through the fusion layer to synthesize a comprehensive feature representation, thereby more accurately predicting the growth trend of cattle.
[0189] Respiratory Rate Prediction Model: This model predicts the respiratory rate of cattle based on signals obtained from neck accelerometers through a series of processing steps (such as filtering and spectral analysis). The model typically uses machine learning algorithms (such as regression models and deep learning networks) to fit the data and predict the cattle's respiratory rate based on the input acceleration signal.
[0190] Multi-channel fusion models: When using multiple sensors or data sources, data fusion is a common method to improve prediction accuracy. Multi-channel fusion models can integrate data from different data sources (such as temperature, humidity, respiratory rate, etc.) to obtain a more comprehensive picture of cattle growth trends.
[0191] Transfer learning models: Transfer learning is a machine learning method that improves the learning efficiency of a new task by transferring knowledge from a model trained on one task to a new task. In cattle growth prediction, transfer learning models can be trained on a large amount of cattle health data first, and then the learned knowledge can be transferred to a new, smaller group of cattle, quickly adapting to the new prediction task.
[0192] Optimal learning rate: During model training, the learning rate controls the size of each update step in the gradient descent process. It directly affects the training speed and the convergence of the results. Typically, the learning rate can be started from a small value (such as 0.001) and gradually increased or decreased until the optimal learning rate is found.
[0193] Standardization parameters in data preprocessing: Standardization is a common method in data preprocessing used to eliminate dimensional differences between different features. Typically, data is converted to a form with a mean of 0 and a standard deviation of 1. The standardization parameters include the mean and standard deviation of the data, usually calculated from the statistics of the training data.
[0194] Weighting coefficients in multi-source data fusion: In the process of multi-source data fusion, each data source may have different importance or accuracy. Weighting coefficients represent the contribution of each data source to the final prediction result by assigning a weight to each data source. For example, if temperature data is more helpful in predicting growth trends than humidity data, the weighting coefficient for temperature data may be higher (e.g., 0.7), while the weighting coefficient for humidity data may be lower (e.g., 0.3).
[0195] Activation functions in advanced feature fusion layers: In deep learning models, activation functions determine the output value of each neuron. Common activation functions include ReLU, Sigmoid, and Tanh. Choosing different activation functions affects the model's learning ability and non-linear expressive power. Generally, ReLU is widely used in most deep learning models, especially in convolutional neural networks.
[0196] Power spectral density in spectrum analysis: Power spectral density is an indicator that describes the distribution of a signal in the frequency domain. In spectrum analysis, power spectral density is used to measure the energy distribution of a signal at various frequencies. Through power spectral density, the dominant frequency of the signal can be determined, which is analogous to the breathing frequency of a cow.
[0197] The following provides a specific embodiment. This embodiment is intended to fully disclose the technical details of the present invention, enabling those skilled in the art to implement the present invention without creative effort, and strongly supporting the scope of protection of the claims.
[0198] Application Scenario: This study focuses on a 12-month-old Simmental fattening bull weighing approximately 400 kg at an intensive beef cattle fattening farm. The target weight is predicted to be reached 7 days from now.
[0199] 1. Data acquisition and preprocessing;
[0200] 1.1 Data Acquisition;
[0201] Environmental data (collected every 10 minutes):
[0202] Temperature (°C): Obtained via temperature and humidity sensors installed inside the cattle shed. Current value: 28.5°C.
[0203] Humidity (%): Same as above. Current value: 75%.
[0204] Ammonia concentration (ppm): obtained via an ammonia sensor. Current value: 18 ppm.
[0205] Carbon dioxide concentration (ppm): obtained via CO2 sensor. Current value: 3500 ppm.
[0206] Physiological data:
[0207] Weight (kg): Collected daily via a smart weighing scale. Yesterday's measured value: 402 kg.
[0208] Body surface temperature (°C): Collected every 30 minutes using an ear tag temperature sensor. Current value: 38.6°C.
[0209] Respiratory rate (breaths / minute): Calculated using data from a neck accelerometer (method described in Part 6). Current value: 26 breaths / minute.
[0210] Behavioral data:
[0211] Feeding duration (minutes / day): Recorded via RFID reader at the feeding station. Yesterday's value: 245 minutes.
[0212] Rumination duration (minutes / day): Calculated by analyzing specific waveforms (0.8-2.5Hz) from a neck accelerometer. Yesterday's value: 455 minutes.
[0213] Activity level (arbitrary units): The vector magnitude sum of triaxial accelerometer data calculated by integration (Σ√(x)). 2 +y 2 +z 2 Yesterday's value: 12500 units.
[0214] Nutritional data (manually entered once daily):
[0215] Dry matter content (%): 55% of the current diet.
[0216] Crude protein content (%): 12.5% of the current diet.
[0217] Metabolizable energy content (MJ / kg): The current diet is 11.2 MJ / kg.
[0218] 1.2 Data Preprocessing;
[0219] Missing value handling: For data missing every minute due to communication interruption, linear interpolation is used to fill in the missing data.
[0220] Formula: V missing =V prev +((V next -V prev ) / (t next -t prev ))×(t missing -t prev );
[0221] For example, t prev The temperature at that moment was 28.0℃, t next The temperature was 29.0℃ at the time of the interpolation, with an interpolated temperature of 28.5℃ for the minute that was missing.
[0222] Outlier handling: Outliers are detected using the Z-score method, with a threshold of 3.
[0223] Formula: Z=(X-μ) / σ, where μ is the mean and σ is the standard deviation.
[0224] If the absolute value of the temperature Z-score is greater than 3 at a certain moment, it is determined to be an outlier, removed, and filled in using the interpolation method described above.
[0225] Data standardization: Z-score standardization is used to transform all features to a distribution with a mean of 0 and a standard deviation of 1.
[0226] Formula: X normalized =(X-μ train ) / σ train;
[0227] Where, μ train and σ train Statistics derived from the training set data. For example, if the mean temperature in the training set is μ=20℃ and the standard deviation is σ=5℃, then 28.5℃, after standardization, becomes (28.5-20) / 5=1.7.
[0228] 2. Calculation of key indices;
[0229] 2.1 Calculation of the Environmental Stress Index (ESI);
[0230] Querying optimal parameters: Based on the Simmental fattening cattle predefined table, determine:
[0231] Optimal temperature range T opt 15-25℃ (median 20℃)
[0232] Optimal humidity range H opt 50-70% (median 60%)
[0233] Ammonia comfort threshold (NH3max): 10 ppm
[0234] CO2 comfort threshold: 3000 ppm
[0235] Calculate the degree of deviation:
[0236] ∆T = |28.5 - 20| = 8.5;
[0237] ∆H = |75 - 60| = 15;
[0238] ∆NH3=max(0,18-10)=8;
[0239] ΔCO2=max(0,3500-3000)=500;
[0240] Weighted summation: Based on historical data analysis, the correlation coefficients between each factor and the daily weight gain decrease rate are as follows: temperature (0.65), humidity (0.55), ammonia (0.5), and carbon dioxide (0.4). Softmax normalization of the correlation coefficients yields the weights.
[0241] W(T)=0.65 / (0.65+0.55+0.5+0.4)≈0.31;
[0242] W(H)≈0.26;
[0243] W(NH3)≈0.24;
[0244] W(CO2) ≈ 0.19;
[0245] WeightedSum=0.31×8.5+0.26×15+0.24×8+0.19×500≈108.2;
[0246] Non-linear mapping: Map to [0,1] using the Sigmoid function.
[0247] Formula: ESI=1 / (1+exp(-k×(WeightedSum-b)))
[0248] The scaling factor k = 0.01 and the offset b = 50 (determined by fitting historical data).
[0249] ESI=1 / (1+exp(-0.01×(108.2-50)))≈1 / (1+exp(-0.582))≈0.64
[0250] Conclusion: The current environmental stress index is 0.64, which is at a moderately high level, mainly due to high temperature and humidity and excessive gas concentration.
[0251] 2.2 Calculation of Behavioral Health Index (BHI);
[0252] Establish a behavioral baseline: Take the average behavior of the cow over the past 30 days (in a healthy state) as the baseline.
[0253] Baseline Feeding = 280 minutes / day
[0254] Baseline Rumination = 480 minutes / day
[0255] Baseline Activity=15000units / day
[0256] Calculate the percentage change:
[0257] ∆Feed%=(245-280) / 280×100%=-12.5%
[0258] ∆Rum%=(455-480) / 480×100%=-5.2%
[0259] ∆Act%=(12500-15000) / 15000×100%=-16.7%
[0260] Weighted summation: The weights are determined based on the logistic regression coefficients of behavioral abnormalities and health events in historical data (abnormal feeding has the highest weight).
[0261] W Feed =0.5,W Rum =0.3, WAct=0.2
[0262] WeightedSum=0.5×(-12.5)+0.3×(-5.2)+0.2×(-16.7)=-10.61
[0263] Non-linear mapping: using the Sigmoid function.
[0264] BHI=1 / (1+exp(-m×(WeightedSum-c)))
[0265] Where m=0.2, c=-5 (determined through training).
[0266] BHI=1 / (1+exp(-0.2×(-10.61-(-5))))≈1 / (1+exp(1.122))≈0.25
[0267] Conclusion: The current behavioral health index is 0.25, indicating a slight decline in health status, but still within an acceptable range.
[0268] 3. Multi-channel spatiotemporal attention fusion model prediction;
[0269] 3.1 Model Input:
[0270] The time-series data from the past 14 days (4 dimensions of environment + 3 dimensions of physiology + 3 dimensions of behavior + 3 dimensions of nutrition, totaling 13 features) along with the daily calculated ESI and BHI are combined to form a daily feature vector of 13 + 2 = 15 dimensions. The 14 days of data form a 14x15 matrix.
[0271] 3.2 Temporal Attention Mechanism:
[0272] For each data channel (such as temperature channel) with a 14-day sequence, calculate the cosine similarity between day i and the latest 14th day as the attention score.
[0273] Formula: Score i =(V i ·V 14 ) / (||V i ||×||V 14 ||)
[0274] The 14 scores were normalized to weights α using the Softmax function. i .
[0275] The feature vector of the channel is obtained by weighted summation of the features at all times.
[0276] 3.3 Channel Attention Mechanism:
[0277] The summary vectors of all 15 channels are concatenated into a single composite vector.
[0278] Input it into a small feedforward neural network (one layer, 8 hidden units, ReLU activation), and it outputs a 15-dimensional weight vector.
[0279] Softmax normalization is applied to the weight vector to obtain the weight β for each channel. j .
[0280] The summation vectors of the 15 channels are weighted and summed to obtain the final fused feature vector.
[0281] 3.4 Prediction Output:
[0282] The fused feature vector is input into a fully connected layer (output dimension is 1) to obtain the predicted weight value for the next 7 days.
[0283] Predicted weight output: Predicted weight = 408.5 kg;
[0284] 4. Dynamic triggering and parameter updates;
[0285] Seven days later, the actual weight was 405.0 kg.
[0286] Calculate the absolute error: |408.5 - 405.0| = 3.5 kg;
[0287] Dynamic error threshold: Threshold = k × current weight, where k is 0.01. The current weight is approximately 405 kg, therefore the threshold = 0.01 × 405 = 4.05 kg.
[0288] Judgment: The error is 3.5kg < 4.05kg, so no update will be triggered.
[0289] Hypothetical scenario: If the error exceeds the threshold for 3 consecutive times (e.g., the error is 5.0kg, 4.8kg, 5.2kg), then an update is triggered.
[0290] Update process:
[0291] 1. Collect data from the last 30 days to form a new training set.
[0292] 2. Freeze the feature extraction layer (CNN layer) at the bottom of the model.
[0293] 3. Only fine-tune the top attention fusion layer and output layer.
[0294] 4. Train using a small learning rate (1 / 10 of the original learning rate, i.e., 0.0001) for 10 epochs.
[0295] 5. Update the model with the new parameters and continue making predictions.
[0296] As shown in Table 1, comparative experiments were conducted in the same herd of cattle during the same period to verify the effectiveness of the present invention.
[0297] Table 1. Comparison of the effects of different prediction methods;
[0298] Prediction methods Data source Model Core Mean Absolute Error (MAE, kg) Root mean square error (RMSE, kg) Remark Traditional Method A Historical weight data only ARIMA time series model 8.2 10.5 Unable to respond to environmental or behavioral changes Traditional Method B Body weight + food intake Linear Regression 6.5 8.1 Simple integration, ignores timing. Existing technology C Environment + Physiology + Behavior LSTM model 5.0 6.3 Lack of attention mechanisms, insufficient integration Method of the present invention All four types of data Multi-channel spatiotemporal attention fusion model 2.9 3.7 Error significantly reduced, most accurate prediction
[0299] in conclusion:
[0300] 1. Advantages of multi-source data fusion: This invention (MAE=2.9kg) is significantly superior to methods using a single data source (A:8.2kg) or a few data sources (B:6.5kg), demonstrating the necessity of comprehensive data fusion.
[0301] 2. Advantages of advanced model structure: This invention outperforms models that use multiple data points but only LSTM (C: 5.0kg), demonstrating the superiority of the spatiotemporal attention mechanism in feature weighting and fusion, and enabling more accurate capture of key information.
[0302] 3. Practicality and adaptability: The dynamic update mechanism of this invention ensures that the model can maintain long-term accuracy when the environment changes (such as seasonal changes) or the herd changes, which is something that static models (A, B, C) cannot achieve.
[0303] This detailed implementation method provides a complete closed loop from data acquisition, processing, calculation, modeling to update and verification, including all core formulas, parameter values, and decision logic. Comparative experiments demonstrate the technical superiority of this invention. It is sufficient for those skilled in the art to understand and implement this invention, and provides solid and sufficient disclosure support for the claims.
[0304] This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the following preferred embodiments; however, those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0305] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for predicting cattle growth trends through multi-source data fusion, characterized in that, Includes the following steps: Four types of raw data were collected: environmental data, physiological data, behavioral data, and nutritional data, and then preprocessed. Based on preprocessed time-series data, an environmental stress index and a behavioral health index are calculated. The environmental stress index is used to quantify the stress caused by environmental factors to cattle, and its calculation process integrates the deviation of temperature, humidity, ammonia concentration, and carbon dioxide concentration from their respective suitable ranges. The behavioral health index is used to quantify the health trend of individual cattle, and its calculation process integrates the changes in feeding, rumination, and activity behavior relative to their own historical baselines. The preprocessed data, environmental stress index, and behavioral health index are input into a multi-channel spatiotemporal attention fusion model. The model processes different types of data through parallel channels and uses temporal attention mechanism and channel attention mechanism to dynamically evaluate the importance of different time points and different data channels to the prediction target, and then performs weighted fusion. Based on the fused features, the predicted weight of cattle within a specific future time window is output. Based on the error between the predicted value and the actual measured value, the parameters of the multi-channel spatiotemporal attention fusion model are dynamically triggered and updated.
2. The method for predicting cattle growth trends by multi-source data fusion according to claim 1, characterized in that, The four categories of raw data collected—environmental data, physiological data, behavioral data, and nutritional data—specifically include: Environmental data, including temperature, humidity, ammonia concentration, and carbon dioxide concentration, is collected by fixed sensors deployed inside the cattle shed. Physiological and behavioral data are collected by wearable devices mounted on cattle. The physiological data includes weight data collected by a weighing scale, body surface temperature data collected by an ear temperature sensor, and respiratory rate data obtained by analyzing data from a neck accelerometer. The behavioral data includes feeding duration data obtained by reading RFID records from feeding stations, rumination duration data obtained by analyzing specific waveform patterns in neck accelerometer data, and activity data obtained by integrating vector changes in triaxial accelerometer data. Nutritional data is obtained through manual input, including feed dry matter content, crude protein content, and metabolizable energy content.
3. The method for predicting cattle growth trends by multi-source data fusion according to claim 1, characterized in that, The preprocessing of the raw data includes: For data loss caused by communication interruption or signal loss, a time series-based linear interpolation method is used to fill in the gaps. For outliers caused by instantaneous false alarms from sensors, an outlier detection method based on statistical distribution is used for identification and removal, and the positions after removal are interpolated using the same method as data missing imputation. For the complete data sequence after filling in and removing outliers, a data standardization method is used to transform all feature values to the same numerical dimension in order to eliminate the impact of differences in sensor range and unit on model training.
4. The method for predicting cattle growth trends by multi-source data fusion according to claim 1, characterized in that, The process of calculating the environmental stress index includes: Based on the breed and growth stage of the target cattle, a predefined data table is consulted to determine their optimal temperature and humidity ranges, and comfort thresholds for ammonia and carbon dioxide concentrations are set. Calculate the absolute difference between the current temperature reading and the median of the optimal temperature range, calculate the absolute difference between the current humidity reading and the median of the optimal humidity range, calculate the portion of the current ammonia concentration reading that exceeds the comfort threshold, and calculate the portion of the current carbon dioxide concentration reading that exceeds the comfort threshold. The difference calculation results are multiplied by a weighting coefficient and then summed. The weighting coefficient is determined by analyzing the correlation strength between various environmental factors and the daily weight gain decline rate of cattle in historical breeding data. The stronger the correlation, the larger the weighting coefficient of the factor. The weighted summation result is input into a monotonically increasing nonlinear function, and the output of the nonlinear function is mapped to a closed interval between 0 and 1 to finally obtain the environmental stress index.
5. The method for predicting cattle growth trends by multi-source data fusion according to claim 1, characterized in that, The process of calculating the behavioral health index includes: Establish an individual behavioral baseline for each cow, which is the cow’s average feeding time, average rumination time and average activity level in a specific time window in the past when it is in a healthy state. Calculate the percentage change in the actual feeding time of the cattle relative to the average feeding time in its behavioral baseline during the current monitoring period, calculate the percentage change in the actual rumination time relative to the average rumination time, and calculate the percentage change in the actual activity level relative to the average activity level. The three percentage change values are multiplied by a weighting coefficient and then summed. The weighting coefficient is determined by analyzing the correlation strength between various behavioral abnormalities in historical breeding data and subsequent health events diagnosed by veterinarians. The higher the correlation strength, the larger the weighting coefficient of the behavioral indicator. The weighted summation result is input into a monotonically increasing nonlinear function, and the output of the nonlinear function is mapped to a closed interval between 0 and 1 to finally obtain the behavioral health index.
6. The method for predicting cattle growth trends by multi-source data fusion according to claim 1, characterized in that, The temporal attention mechanism in the multi-channel spatiotemporal attention fusion model operates as follows: For each data channel's time-series feature sequence, calculate the similarity score between the feature vector of each historical time point and the feature vector of the latest time point; The similarity scores of all historical time points are input into a normalized exponential function and converted into a set of weight coefficients, the sum of which is 1. The feature vectors at historical time points are weighted and summed using this set of weighting coefficients to obtain a channel summary vector that can represent the entire sequence and focus on the historical information most relevant to the current state.
7. A method for predicting cattle growth trends using multi-source data fusion according to claim 1 or 6, characterized in that, The channel attention mechanism in the multi-channel spatiotemporal attention fusion model works as follows: The channel summary vectors processed by the temporal attention mechanism are concatenated to form a new comprehensive feature vector. The integrated feature vector is input into a small feedforward neural network, which outputs a weight vector with a value equal to the number of data channels. Input the weight vector into a normalized exponential function to obtain a set of channel weight coefficients that sum to 1; The channel summary vectors are weighted and summed using these channel weight coefficients to generate a unified feature vector that incorporates information from all data sources, which is then used for final prediction.
8. The method for predicting cattle growth trends by multi-source data fusion according to claim 1, characterized in that, The dynamic triggering and parameter updating of the multi-channel spatiotemporal attention fusion model specifically includes: The absolute error between the predicted weight value and the actual measured weight value is continuously monitored. Set an error threshold. When the number of consecutive prediction errors exceeds a preset limit and each error is greater than the error threshold, the model performance is determined to be degraded and the update process is triggered. The error threshold is not a fixed value, but is dynamically set proportionally according to the range of the cow's current weight.
9. A method for predicting cattle growth trends using multi-source data fusion according to claim 1 or 8, characterized in that, The parameter update mentioned above refers to: The newly collected sequence data, which includes multi-source data and their corresponding actual weights, constitutes a new training sample set; A transfer learning strategy is adopted to keep the parameters of the basic network layer used to extract low-level temporal features in the multi-channel spatiotemporal attention fusion model unchanged, and only fine-tune the parameters of the network layer responsible for high-level feature fusion and prediction output in the model. Train the model on the parameters that need updating using a new training sample set and an optimized learning rate, so that the model adapts to the latest data distribution.
10. The method for predicting cattle growth trends by multi-source data fusion according to claim 2, characterized in that, The process of obtaining respiratory rate data by analyzing data from a neck acceleration sensor is as follows: The raw triaxial acceleration data were bandpass filtered to separate the signal components in a specific frequency range generated by the minute chest movements caused by breathing. Perform spectral analysis on the filtered signal to find the dominant frequency with the highest energy within the physiologically reasonable respiratory frequency range in its power spectrum; Converting this primary frequency into respiratory rates per minute yields the desired respiratory rate data.
Citation Information
Patent Citations
Pig health monitoring method based on multi-source information fusion
CN119229475A
Beef cattle breeding decision-making method and device based on environmental factor analysis and medium
CN120634301A
Coaching based on reproductive phases
EP4358857A1