An AI-based dairy cow feed ratio optimization method and system
Through the hierarchical heterogeneous graph network and hierarchical learning system constructed by AI, the problems of individual differences and social relations neglect in traditional dairy cattle feed ratio methods are solved, dynamic and accurate feed ratio decisions are achieved, and the production efficiency and economic benefits of dairy cattle ranch are improved.
Patent Information
- Application Number
- CN202510408729.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-04-02
AI Technical Summary
Traditional dairy cow feed rationing methods are difficult to balance individual differences with group optimization, ignore social relations, single decision-making levels, lack of adaptability in static proportions, resulting in insufficient or overnutrition of dairy cows and unreasonable resource allocation, which affects the production efficiency and economic benefits of modern large-scale dairy cow pastures.
The AI-based hierarchical heterogeneous graph network construction system is used to process the characteristic data of dairy cow herds, generate a dynamic cow herd map network structure, and process real-time group network state tensors through a hierarchical graph reinforcement learning system, generate a multi-level feed ratio decision-making plan, and use a multi-level Nash balance optimization system to process the decision-making plan to generate the optimal feed distribution strategy.
It realizes accurate modeling of the social relations of dairy herds, dynamically responds to changes in the group structure, improves the accuracy of overall milk production and feed ratio, reduces social conflicts, improves resource utilization and economic benefits, and adapts to changes in different scales and environments.
Smart Images

Figure CN119920409B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of feed ratio optimization, and more specifically, to an AI-based method and system for optimizing dairy cow feed ratio. Background Art
[0002] Currently, feed formulation technology in the dairy industry faces several key challenges. Traditional feed formulation methods primarily employ linear programming based on nutrient requirements or fixed formulations based on experience. These methods suffer from the following significant shortcomings: First, they struggle to balance individual differences with group optimization. Cows at different stages of production, in different body conditions, and with different genetic backgrounds have varying nutritional requirements. A one-size-fits-all formulation results in nutritional deficiencies in high-producing cows and nutritional excesses in low-producing cows. Second, they neglect the social relationships within the herd. Dominance, affiliation, and competition influence feed intake, yet are not considered in existing formulation systems. Third, the single-level decision-making process prevents precise feeding from the herd to the individual, leading to irrational feed resource allocation. Fourth, static formulations lack adaptability, making them difficult to adjust in real time to changes in the environment, herd structure, and individual status.
[0003] The above technical problems seriously restrict the production efficiency and economic benefits of modern large-scale dairy farms. Therefore, there is an urgent need for an innovative feed ratio technology solution that can comprehensively solve the above problems. Summary of the Invention
[0004] The present invention provides an AI-based method and system for optimizing dairy cow feed ratios to solve the technical problems mentioned in related technologies.
[0005] In a first aspect, the present invention provides an AI-based method for optimizing dairy cow feed ratios, comprising the following steps: processing dairy cow group characteristic data through a hierarchical heterogeneous graph network construction system to generate a dynamic dairy cow group graph network structure; processing real-time group network state tensors through a hierarchical graph reinforcement learning system to generate a multi-level feed ratio decision plan; processing multi-level decision plans through a multi-level Nash equilibrium optimization system to generate an optimal feed allocation strategy table.
[0006] As a further optimization scheme of the present invention, the hierarchical heterogeneous graph network construction system includes a feature extraction unit, a relationship modeling unit and a dynamic update unit; the dynamic cow group graph network structure includes a node set, an edge set and an attribute set, and the processing of cow group feature data through the hierarchical heterogeneous graph network construction system includes: processing individual cow feature data through a multimodal feature fusion network to generate cow node feature vectors; processing group interaction time series data through a multidimensional social relationship modeling network to generate a cow relationship edge feature matrix; processing node features and edge features through a time series graph dynamic update network to generate a real-time group network state tensor.
[0007] As a further optimization solution of the present invention, the multimodal feature fusion network includes three parallel encoder modules and a feature fusion module, and the three parallel encoder modules include:
[0008] Basic information encoder module, used to process the basic information vector of the cow ,in, is the basic information vector containing age, lactation period, and weight characteristics, is the basic feature dimension, express dimensional real space; output basic eigenvectors It represents the 128-dimensional feature vector processed by the basic information encoder, and its calculation expression is:
[0009] ;
[0010] in, is the weight matrix of the fully connected layer, is the bias vector, is the rectified linear unit activation function;
[0011] Metabolic state encoder module for processing time-series metabolic state sequences ,in, represents a metabolic state sequence containing time series data of milk production, feed intake, and body condition score, is the length of time series data; output metabolic feature vector represents the 256-dimensional feature vector processed by the metabolic state encoder, and its calculation expression is:
[0012] ;
[0013] in, and are the matrix and bias vector of the encoder respectively, and are the forward and backward hidden states of LSTM respectively, is the vector concatenation operator;
[0014] Behavior feature encoder module for processing spatiotemporal behavior data tensors ,in, represents a spatiotemporal behavior data tensor containing activity level, feeding time, and rest time. and are the height and width dimensions of the spatial data respectively; output behavioral feature vector It represents the 256-dimensional feature vector processed by the behavioral feature encoder, and its calculation expression is:
[0015] ;
[0016] in, For the pooling operation, 、 and These are the 1st, 2nd, and 3rd layer 3D convolution operations respectively.
[0017] As a further optimization solution of the present invention, the multidimensional social relationship modeling network includes a relationship type identification module, a feature extraction module and an edge feature generation module, including:
[0018] Relation type identification module for processing position sequence data and behavioral interaction records ,in, Represents dairy cows and Position sequence data between Represents dairy cows In time location, Represents dairy cows and The behavioral interaction records between Indicates that they are in time Interaction behavior; output relationship type vector The three-dimensional vector representing the relationship type between cows corresponds to the probability distribution of dominant relationship, affinity relationship and competitive relationship, and its calculation expression is:
[0019] ;
[0020] in, is the weight matrix, and They are convolutional neural networks and long short-term memory networks, is the normalized exponential function;
[0021] Interaction feature extraction module, used to process interaction frequency statistics and interaction duration ,in, Represents dairy cows and between the frequency of different types of interactions, Represents dairy cows and between The average duration of different types of interactions; output interaction feature vector Represents dairy cows and The 128-dimensional interaction feature vector between is calculated as follows:
[0022] ;
[0023] in, is the weight matrix, is the bias vector;
[0024] Edge feature generation module, used to process relationship type vectors and interaction eigenvectors , output edge feature vector Represents dairy cows and The 256-dimensional edge feature vector between is calculated as:
[0025] ;
[0026] in, Generates functions for edge features, is the weight matrix, is the bias vector.
[0027] As a further optimization scheme of the present invention, the multi-level feed ratio decision-making scheme includes a system-level benchmark feed formula vector, a group differentiated formula matrix and a personalized precision feeding plan set. The real-time group network state tensor is processed by a hierarchical graph reinforcement learning system, including: processing global graph state data through a system-level graph attention strategy network to generate a benchmark feed formula vector; processing sub-group feature data through a group-level multi-agent advantage actor critic network to generate a group differentiated formula matrix; processing individual state data through an individual-level graph attention reinforcement learning network to generate a personalized precision feeding plan set.
[0028] As a further optimization solution of the present invention, the system-level graph attention strategy network includes a graph attention encoding module, a global information aggregation module and a strategy generation module, including:
[0029] The graph attention encoding module is used to generate the node attention weight matrix ,in, express The attention weight matrix between nodes, is the total number of dairy cows, and its calculation expression is:
[0030] ;
[0031] in, Representation node For Node The attention weight, For nodes The query vector, For nodes The key vector of is the attention vector, For nodes The neighbor set of Indicates the index variable when summing. represents the natural exponential function, is the activation function of the rectified linear unit with leakage;
[0032] The global information aggregation module is used to generate node message vectors ,in, represents the node message vector matrix, is the feature dimension graph level, and its calculation expression is:
[0033] ;
[0034] in, For nodes The message vector, is the transformation matrix of the value, For nodes In time The eigenvector of is a nonlinear activation function and ,in, represents the global representation vector of the entire graph, is the set of all nodes in the graph, is the weight matrix of graph level representation;
[0035] The strategy generation module is used to generate the benchmark feed formula vector ,in, represents the system-level benchmark feed recipe vector, is the amount of feed components, and its calculation expression is:
[0036] ;
[0037] in is the system-level decision-making strategy function, and are the weights and biases of the policy network, respectively.
[0038] As a further optimization solution of the present invention, the group-level multi-agent advantage actor-critic network includes a subgroup division module, a state encoding module, a policy network module and a value network module, including:
[0039] The subpopulation partitioning module uses the spectral clustering algorithm, and its calculation expression is:
[0040] ;
[0041] in, Indicates the A graph representation of the subgroups, is the spectral clustering algorithm, is the number of subgroups, where Representation node and nodes The feature similarity of is the cosine similarity function;
[0042] The policy network module is used to generate the group recipe adjustment vector ,in, Representing a group The formula adjustment vector is calculated as follows:
[0043] ;
[0044] in, For the group The policy function, For the group The state vector of is a normal distribution, where the mean network is , and are the mean network weight and bias respectively, and the standard deviation network is , and are the standard deviation network weights and biases, is a soft positive function;
[0045] The value network module is used to generate state value estimates Representing a group The state value estimation of is calculated as follows:
[0046] ;
[0047] in, and are the weights and biases of the value network, Representing a group Communication information, is the communication information conversion matrix;
[0048] The individual-level graph attention reinforcement learning network includes a state encoding module, an attention calculation module, a strategy generation module, and a reward calculation module, including:
[0049] The attention calculation module is used to generate the attention context vector , representing a node The attention context vector is calculated as follows:
[0050] ;
[0051] in, is the individual-level attention coefficient, For nodes The value vector of is the scaling factor of the attention mechanism;
[0052] The strategy generation module is used to generate personalized feeding plans ,in, Represents an individual The feeding plan vector is calculated as follows:
[0053] ;
[0054] in, For individuals The policy function, For individuals The state vector of is the policy network function;
[0055] The reward calculation module is used to calculate the comprehensive reward value:
[0056] ;
[0057] in, Represents an individual The comprehensive reward value, is the reward weight coefficient, 、 and They are production performance rewards, health status rewards and social relationship rewards.
[0058] As a further optimization scheme of the present invention, the multi-level Nash equilibrium optimization system includes a utility function construction unit, an equilibrium solution unit and a resource allocation unit. The processing of multi-level decision-making schemes through the multi-level Nash equilibrium optimization system includes: processing decision-making scheme data through a multi-level utility function construction network to generate an intelligent agent utility function set; processing the utility function set through an iterative optimal response algorithm to generate a Nash equilibrium strategy set; processing the equilibrium strategy set through a priority resource allocation algorithm to generate a final feed allocation strategy table.
[0059] As a further optimization solution of the present invention, the multi-level utility function construction network includes three parallel utility calculation modules, and the three parallel utility calculation modules include:
[0060] System-level utility calculation module, used to calculate the system-level utility function:
[0061] ;
[0062] in, represents the system-level utility function, is the production benefit function, is the cost function, is the nutritional balance function, is the system-level utility weight;
[0063] Group-level utility calculation module, used to calculate group-level utility function:
[0064] ;
[0065] in, represents the group-level utility function, For individuals The weight in the group, is the group-level action value function, for Divergence, measuring strategy and The difference, for The weight coefficient of the divergence;
[0066] Individual-level utility calculation module, used to calculate individual-level utility function:
[0067] ;
[0068] in, represents the individual-level utility function, is the individual immediate reward function, is the L2 norm of the difference between the individual recipe and the group recipe, is the competition cost function, is the weight coefficient of individual-level utility loss.
[0069] In the second aspect, the present invention also provides an AI-based dairy cow feed ratio optimization system for executing the above-mentioned AI-based dairy cow feed ratio optimization method, including: a relationship modeling module, which is used to process dairy cow group characteristic data through a hierarchical heterogeneous graph network construction system to generate a dynamic dairy cow group graph network structure; a hierarchical feed decision module, which is used to process real-time group network state tensors through a hierarchical graph reinforcement learning system to generate multi-level feed ratio decision plans; an equilibrium optimization module, which is used to process multi-level decision plans through a multi-level Nash equilibrium optimization system to generate an optimal feed allocation strategy table.
[0070] The beneficial effects of the present invention are as follows: accurate modeling of social relationships among dairy cow groups is achieved through heterogeneous graph networks, capturing more important social interaction information; the dynamic graph update mechanism enables the system to respond to changes in group structure in real time, reducing average response latency; and overall milk production is improved through a hierarchical learning architecture; the graph attention mechanism significantly improves decision-making accuracy and the accuracy of individual feed ratios; multi-agent collaborative learning accelerates strategy convergence and reduces training time;
[0071] In addition, the dynamic Nash equilibrium mechanism ensures fair resource allocation and improves the nutritional intake of vulnerable individuals; the dynamic priority adjustment strategy reduces internal competition and social conflict within the group; and the global resource constraint management improves feed utilization.
[0072] Through the adaptive graph network structure, it supports ranch applications of any scale. The real-time update mechanism quickly responds to environmental changes. The multi-level collaborative optimization framework has strong generalization capabilities and can adapt to different dairy cow groups. It improves the feed ratio efficiency and accuracy of large-scale dairy ranches, and effectively solves the problem that traditional feed ratio methods seriously restrict the production efficiency and economic benefits of modern large-scale dairy ranches. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 This is a flow chart of an AI-based dairy cow feed ratio optimization method provided by the present invention;
[0074] Figure 2 This is a basic information table of a pasture provided by an embodiment of the present invention;
[0075] Figure 3 This is a feed resource status table of a pasture provided by an embodiment of the present invention;
[0076] Figure 4 is a system-level benchmark recipe table provided by an embodiment of the present invention;
[0077] Figure 5 This is a group-level differentiated formula table (high-yield group) provided in an embodiment of the present invention;
[0078] Figure 6 This is a utility function calculation table for individual cow numbered A001 provided in an embodiment of the present invention;
[0079] Figure 7 This is a Nash equilibrium strategy table for a high-yield group provided by an embodiment of the present invention;
[0080] Figure 8 This is a resource allocation priority table (top 5) provided in an embodiment of the present invention;
[0081] Figure 9 is a social relationship recognition accuracy table provided by an embodiment of the present invention;
[0082] Figure 10 is a dynamic response performance table provided by an embodiment of the present invention;
[0083] Figure 11 is a feature representation accuracy table provided by an embodiment of the present invention;
[0084] Figure 12 This is a table showing the effect of increasing milk production in dairy cows with a test period of 12 weeks provided by an embodiment of the present invention;
[0085] Figure 13 This is a feed ratio accuracy table provided by an embodiment of the present invention;
[0086] Figure 14 This is a strategy convergence efficiency table provided by an embodiment of the present invention;
[0087] Figure 15 This is a nutritional intake compliance rate table provided by an embodiment of the present invention;
[0088] Figure 16 is a statistical table of social conflict events provided by an embodiment of the present invention;
[0089] Figure 17 This is a feed utilization efficiency table provided by an embodiment of the present invention;
[0090] Figure 18 It is a schematic diagram of the module composition of the feed ratio optimization system provided by the present invention. DETAILED DESCRIPTION
[0091] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed solely to enable those skilled in the art to better understand and implement the subject matter described herein, and that the functions and arrangements of the elements discussed may be varied without departing from the scope of this specification. Various examples may omit, substitute, or add various processes or components as needed. In addition, features described with respect to some examples may also be combined in other examples.
[0092] In one embodiment, if Figure 1 As shown, the present invention provides an AI-based dairy cow feed ratio optimization method, comprising the following steps:
[0093] Step 1: Process the cow population characteristic data through a hierarchical heterogeneous graph network construction system to generate a dynamic cow population graph network structure;
[0094] The input data in this step include: individual cow characteristic data, including basic information, metabolic status, behavioral data, and group interaction data, including location information, behavioral records, and social relationship data.
[0095] The hierarchical heterogeneous graph network construction system consists of a feature extraction unit, a relationship modeling unit, and a dynamic update unit. The feature extraction unit first processes individual data to generate node features, and then passes the output results to the relationship modeling unit to construct edge features. Finally, the dynamic update unit integrates the node features and edge features to generate a complete graph network structure. The system output is a set of nodes containing , edge set and attribute collections Dynamic Heterogeneous Graph Network .
[0096] The specific implementation process includes the following sub-steps:
[0097] Sub-step 1.1: Process individual cow feature data through a multimodal feature fusion network to generate cow node feature vectors. Specifically, the multimodal feature fusion network consists of three parallel encoder modules and a feature fusion module. The contents of each module include:
[0098] Basic information encoder module, used to process the basic information vector of the cow ,in, is the basic information vector containing age, lactation period, and weight characteristics, is the basic feature dimension, express dimensional real space; output basic eigenvectors It represents the 128-dimensional feature vector processed by the basic information encoder, and its calculation expression is:
[0099] ;
[0100] in, is the weight matrix of the fully connected layer, is the bias vector, is the rectified linear unit activation function.
[0101] Metabolic state encoder module for processing time-series metabolic state sequences ,in, represents a metabolic state sequence containing time series data of milk production, feed intake, and body condition score, is the length of time series data; output metabolic feature vector represents the 256-dimensional feature vector processed by the metabolic state encoder, and its calculation expression is:
[0102] ;
[0103] ;
[0104] in, for The hidden state of the moment, for Metabolic state input at each moment, for The hidden state of the moment, and are the weight matrix and bias vector of the encoder respectively, and are the final hidden states of the forward and backward LSTM, respectively.
[0105] Behavior feature encoder module for processing spatiotemporal behavior data tensors ,in, represents a spatiotemporal behavior data tensor containing activity level, feeding time, and rest time. and are the height and width dimensions of the spatial data respectively; output behavioral feature vector It represents the 256-dimensional feature vector processed by the behavioral feature encoder, and its calculation expression is:
[0106] ;
[0107] in, For the pooling operation, 、 and These are the 1st, 2nd, and 3rd layer 3D convolution operations respectively.
[0108] Feature fusion module, used to process the output feature vectors of the above three encoders, and output them as node feature vectors , its calculation expression is:
[0109] ;
[0110] in, is the feature fusion weight matrix; the generated node feature vector This will be used as input for sub-step 1.2.
[0111] Sub-step 1.2: Process the group interaction time series data through a multidimensional social relationship modeling network to generate a cow relationship edge feature matrix. The multidimensional social relationship modeling network includes a relationship type recognition module, a feature extraction module, and an edge feature generation module. The specific contents include the following:
[0112] Relation type identification module for processing position sequence data and behavioral interaction records ,in, Represents dairy cows and Position sequence data between Represents dairy cows In time location, Represents dairy cows and The behavioral interaction records between Indicates that they are in time Interaction behavior; output relationship type vector The three-dimensional vector representing the relationship type between cows corresponds to the probability distribution of dominant relationship, affinity relationship and competitive relationship, and its calculation expression is:
[0113] ;
[0114] ;
[0115] in, Represents dairy cows and cows At the moment The Euclidean distance of and Represents dairy cows and cows At the moment The location coordinates of represents the Euclidean distance norm, is the weight matrix, and They are convolutional neural networks and long short-term memory networks, is the normalized exponential function.
[0116] Interaction feature extraction module, used to process interaction frequency statistics and interaction duration ,in, Represents dairy cows and between the frequency of different types of interactions, Represents dairy cows and between The average duration of different types of interactions; output interaction feature vector Represents dairy cows and The 128-dimensional interaction feature vector between is calculated as follows:
[0117] ;
[0118] in, is the weight matrix, is the bias vector.
[0119] Edge feature generation module, used to process relationship type vectors and interaction eigenvectors , output edge feature vector Represents dairy cows and The 256-dimensional edge feature vector between is calculated as:
[0120] ;
[0121] in, Generates functions for edge features, is the weight matrix, is the bias vector. The generated edge feature matrix This will be used as input for sub-step 1.3.
[0122] Sub-step 1.3: Process node and edge features through the time-series graph dynamic update network to generate a real-time group network state tensor. The time-series graph dynamic update network includes a state update module, a structure update module, and a graph state generation module. The contents of each module are as follows:
[0123] Status update module, used to process historical node status , current moment characteristics , historical edge weight and current interaction features , output the updated node status and the updated edge weights ; Its calculation expression is:
[0124] .
[0125] Structure update module, used to process historical graph structure , add a new node collection , remove the node collection , the output is the updated graph structure , its calculation expression is:
[0126] .
[0127] The graph state generation module is used to process the updated node state, edge weights and graph structure, and outputs the graph state tensor , its calculation expression is: ;
[0128] in, is the feature dimension. The generated graph state tensor It will serve as the input of step 2 for subsequent decision optimization.
[0129] Step 2: Process the real-time group network state tensor through the hierarchical graph reinforcement learning system to generate a multi-level feed ratio decision plan; the input of this step is the graph state tensor generated in step 1 , a hierarchical graph reinforcement learning system is used to generate three-level feed ratio decision plans. The system consists of system-level decision units, group-level decision units, and individual-level decision units, which are collaboratively optimized through hierarchical information flow. The specific execution process includes the following sub-steps:
[0130] Sub-step 2.1: Process the global graph state data through the system-level graph attention policy network to generate the baseline feed recipe vector; the system-level graph attention policy network includes a graph attention encoding module, a global information aggregation module, and a policy generation module:
[0131] Graph attention encoding module, used to generate node attention weight matrix ,in, express The attention weight matrix between nodes, is the total number of dairy cows, and its calculation expression is:
[0132] ;
[0133] in, Representation node For Node The attention weight, For nodes The query vector, For nodes The key vector of is the attention vector, For nodes The neighbor set of Indicates the index variable when summing. represents the natural exponential function, is the activation function of the leaky rectified linear unit.
[0134] Global information aggregation module, used to generate node message vectors ,in, represents the node message vector matrix, is the feature dimension graph level, and its calculation expression is:
[0135] ;
[0136] in, For nodes The message vector, is the transformation matrix of the value, For nodes In time The eigenvector of is a nonlinear activation function, , represents the global representation vector of the entire graph, is the set of all nodes in the graph, is the weight matrix of graph level representation.
[0137] Strategy generation module for generating benchmark feed formula vectors ,in, represents the system-level benchmark feed recipe vector, is the amount of feed components, and its calculation expression is:
[0138] ;
[0139] in, is the system-level decision-making strategy function, and are the weights and biases of the policy network respectively. The generated baseline feed recipe vector This will be used as input for sub-step 2.2.
[0140] Sub-step 2.2: Process the sub-group feature data through the group-level multi-agent superior actor-critic network to generate a group differentiation recipe matrix; the group-level multi-agent superior actor-critic network includes a sub-group partitioning module, a state encoding module, a policy network module, and a value network module:
[0141] The subpopulation partitioning module uses a spectral clustering algorithm to process graph state tensors. and the benchmark recipe vector ; The output is Graph representation of subpopulations , its calculation expression is:
[0142] ;
[0143] in, Indicates the A graph representation of the subgroups, is the spectral clustering algorithm, is the number of subgroups, Representation node and nodes The feature similarity of is the cosine similarity function.
[0144] The state encoding module is used to process the subgroup graph representation , the benchmark recipe vector , group characteristic vector , including statistical characteristics such as lactation stage distribution and age structure; the output is the group state vector , the calculation expression is: ;
[0145] in For subgroups The graph pooling feature vector of For the graph pooling operation, For subgroups Graph representation of .
[0146] The policy network module is used to generate the group recipe adjustment vector ,in, Representing a group The formula adjustment vector is calculated as follows: ;
[0147] in, For the group The policy function, For the group The state vector of is a normal distribution, and the mean network is , and are the mean network weight and bias respectively, and the standard deviation network is , and are the standard deviation network weights and biases, is a soft positive function.
[0148] The value network module is used to generate state value estimates Representing a group The state value estimation of is calculated as follows: ;
[0149] in, and are the weights and biases of the value network, Representing a group Communication information, is the communication information conversion matrix. The generated group differentiation recipe matrix This will be used as input for sub-step 2.3.
[0150] Sub-step 2.3: Process individual state data through the individual-level graph attention reinforcement learning network to generate a personalized precision feeding plan set; the individual-level graph attention reinforcement learning network includes a state encoding module, an attention calculation module, and a strategy generation module. The specific contents of each module are as follows:
[0151] The state encoding module is used to generate Represents the individual state vector, and its calculation expression is:
[0152] ;
[0153] in, Represents individual node characteristics, represents the neighbor message vector, Indicates the group formula, Represents an individual demand vector, including milk production, weight, health status, etc.
[0154] The attention calculation module is used to process individual state vectors and neighbor state set ,generate Represents the attention context vector, which is calculated as follows: ;
[0155] in, is the individual-level attention coefficient, For nodes The value vector of is the scaling factor of the attention mechanism.
[0156] The strategy generation module is used to process individual state vectors and attention context vector , generate personalized feeding plans , its calculation expression is: ;
[0157] in For individuals The policy function, For individuals The state vector of is the policy network function.
[0158] The reward calculation module is used to generate Represents the comprehensive reward value, and its calculation expression is:
[0159] ;
[0160] in Represents an individual The comprehensive reward value, is the reward weight coefficient, 、 and They are production performance rewards, health status rewards and social relationship rewards.
[0161] Generated personalized precision feeding plan set Will be used as input for step 3.
[0162] Step 3: Process the multi-level decision-making scheme through the multi-level Nash equilibrium optimization system to generate the optimal feed allocation strategy table; the input of this step includes: the benchmark feed formula vector generated in step 2.1 , the population differentiation recipe matrix generated in step 2.2 , personalized precision feeding plan set generated in step 2.3 The multi-level Nash equilibrium optimization system consists of a utility function construction unit, an equilibrium solution unit, and a resource allocation unit, and achieves coordination and consistency of multi-level decisions through iterative optimization.
[0163] The specific implementation process includes the following sub-steps:
[0164] Sub-step 3.1: Process the decision-making data through a multi-level utility function construction network to generate a set of agent utility functions. The multi-level utility function construction network consists of three parallel utility calculation modules. The specific contents of each module are as follows:
[0165] The system-level utility calculation module is used to calculate the system-level utility function , the calculation expression is:
[0166] ;
[0167] in, represents the benchmark recipe vector, represents the group-level utility function, For individuals The weight in the group, is the group-level action value function, for Divergence, measuring strategy and The difference, for The weight coefficient of the divergence.
[0168] Group-level utility calculation module, used to calculate ; Its calculation expression is:
[0169] ;
[0170] in, represents the group-level utility function, For individuals The weight in the group, is the group-level action value function, for Divergence, measuring strategy and The difference, for The weight coefficient of the divergence.
[0171] The individual utility calculation module is used to calculate , its calculation expression is:
[0172] ;
[0173] in, represents the individual-level utility function, is the individual immediate reward function, is the L2 norm of the difference between the individual recipe and the group recipe, is the competition cost function, is the weight coefficient of individual-level utility loss. The utility function set generated This will be used as input for sub-step 3.2.
[0174] Sub-step 3.2: Process the utility function set through the iterative best response algorithm to generate the Nash equilibrium strategy set; the iterative best response algorithm includes a strategy initialization module, an iterative update module, and a convergence test module:
[0175] The strategy initialization module is used to generate the initial strategy set , its calculation expression is:
[0176]
[0177] ;
[0178] ;
[0179] in is the system-level initial strategy, is the policy network weight matrix, is the benchmark feed formula vector; is the group-level initial strategy, is a normal distribution, is the mean function, is the standard deviation function, is the group state vector; is the individual-level initial strategy, is the strategy generation function, is the individual state vector, is the attention context vector, is the vector concatenation operator.
[0180] The iterative update module is used to generate Round Strategy Set , its calculation expression is:
[0181] ;
[0182] ;
[0183] ;
[0184] in, Indicates the Round system-level strategy, is the system-level benchmark recipe vector, is the system-level utility function, represents the parameters that maximize the utility function; Indicates the Wheel Group strategy, is the population recipe vector, is the group-level utility function based on the system strategy; Indicates the Wheel Individual strategy, For individual feeding plans, is the individual-level utility function based on group and system strategies.
[0185] The convergence test module is used to generate the convergence judgment result, and its calculation expression is:
[0186] ;
[0187] in, represents the maximum difference between two adjacent rounds of strategies, Indicates the The strategy set of the round, Indicates the The strategy set of the round, is an infinite norm, , Is a Boolean value indicating whether it converges. is the preset convergence threshold. The generated Nash equilibrium strategy set This will be used as input for sub-step 3.3.
[0188] Sub-step 3.3: Process the balanced strategy set through the priority resource allocation algorithm to generate the final feed allocation table; the priority resource allocation algorithm includes a constraint checking module, a priority calculation module, and an allocation execution module:
[0189] Constraint checking module is used to handle individual resource requirements , generate the feasibility check result; its calculation expression is: ;
[0190] in, Boolean value indicating whether resource allocation is feasible. For all The sum of the individuals, Indicates feeding plan, Indicates the Individuals in the feeding program The amount of resources required, Indicates the total available resource constraints of the system.
[0191] The priority calculation module is used to process the individual state vector , Historical Reward Sequence , strength of social relationships , generating individual priority vectors , its calculation expression is:
[0192]
[0193]
[0194]
[0195] ;
[0196] in, represents the productivity score, is the productivity assessment weight matrix, For the Individuals in The state vector at the moment; represents the historical performance score, is a long short-term memory network, For the The historical reward sequence of an individual, represents the social relationship score, For the The set of neighbors of an individual, for Moment Individual and The strength of social relationships between For the Individuals in The priority vector of the moment, is the priority calculation function.
[0197] Assign execution modules to process individual feeding plans , individual priorities , remaining resources , generate the final allocation plan , its calculation expression is:
[0198] ;
[0199] in, Indicates the The resource allocation ratio coefficient of each individual, Represents the S-type activation function, which maps the output to the (0,1) interval. represents the priority conversion weight matrix, Indicates the Individuals in The priority vector of the moment, Indicates the The final allocation plan for each individual, represents the allocation function considering resource constraints, Indicates the The initial feeding plan for each individual, express The amount of available resources remaining in the system at that moment.
[0200] Generated final feed distribution table As the final output result of this embodiment.
[0201] In yet another embodiment, Figure 18 The present invention also provides an AI-based dairy cow feed ratio optimization system for executing the above-mentioned feed ratio optimization method, including: a relationship modeling module, which is used to process dairy cow group characteristic data through a hierarchical heterogeneous graph network construction system to generate a dynamic dairy cow group graph network structure; a hierarchical feed decision module, which is used to process real-time group network state tensors through a hierarchical graph reinforcement learning system to generate a multi-level feed ratio decision plan; and an equilibrium optimization module, which is used to process multi-level decision plans through a multi-level Nash equilibrium optimization system to generate an optimal feed allocation strategy table.
[0202] In the above-mentioned embodiment, by innovatively combining graph reinforcement learning with a multi-agent collaborative competition mechanism, a heterogeneous graph network is used to accurately model the social relationships of dairy cows, capturing more important social interaction information. A dynamic graph update mechanism enables the system to respond to changes in group structure in real time, reducing average response latency. Multimodal feature fusion improves the accuracy of individual feature representation, increasing feature representation accuracy. Furthermore, a hierarchical learning architecture enables collaborative optimization from group to individual, increasing overall milk production. A graph attention mechanism significantly enhances decision-making accuracy and improves the accuracy of individual feed ratios. Multi-agent collaborative learning accelerates strategy convergence and reduces training time. Furthermore, a dynamic Nash equilibrium mechanism ensures fair resource allocation and improves the nutritional intake rate of disadvantaged individuals. Priority adjustment reduces conflicts, and global resource management improves feed utilization. Furthermore, an adaptive graph network structure supports application on any scale of ranches, with scalability reaching tens of thousands of cows. A real-time update mechanism ensures rapid system response to environmental changes, improving adaptability. The multi-level collaborative optimization framework has strong generalization capabilities and can adapt to dairy cows of different breeds and ages.
[0203] Through the three steps of the above technical solution, the following specific technical effects are achieved:
[0204] 1. Accurate Modeling: This system accurately models the social relationships of dairy cows through a heterogeneous graph network, capturing over 95% of important interaction information. A dynamic graph update mechanism enables real-time system response, with an average latency of less than 30 seconds. Multimodal feature fusion improves feature representation accuracy by 40%.
[0205] 2. Decision-making optimization effect: The hierarchical learning architecture increased overall milk production by 15%-20%, the graph attention mechanism increased the accuracy of individual feed ratios to 92%, and multi-agent collaborative learning reduced training time by 35%;
[0206] 3. Resource allocation effect: Dynamic Nash equilibrium ensures fair resource allocation, increasing the nutritional intake of vulnerable individuals by 50%. Dynamic adjustment strategies reduce competition and reduce social conflicts by 60%. Resource management improves feed utilization and reduces waste.
[0207] 4. System adaptability: The adaptive graph network structure supports applications on ranches of any size, with scalability reaching 10,000 heads. The real-time update mechanism ensures the system's rapid response to environmental changes, improving adaptability by 80%. The multi-level collaborative optimization framework has strong generalization capabilities and can adapt to dairy cows of different breeds and ages.
[0208] Real application examples of the above embodiments
[0209] like Figure 2 and Figure 3As shown in the figure, the above embodiment is actually applied in a large modern dairy farm. It can be seen that the individual differences of cows in the entire farm are large, the group structure is complex, social relationships affect feeding, and resources are limited, resulting in poor allocation of dairy cow feeding resources, unbalanced dairy cow feed ratios, and affected balanced nutrient absorption of dairy cows.
[0210] The system collects cow characteristics from multiple data sources: basic information is updated daily from the pasture management system, metabolic status is assessed weekly using a body condition scoring system, feeding behavior is monitored in real time using an electronic ear tag system, movement data is collected every five minutes using a GPS positioning system, and milk production records are automatically recorded at every milking. Together, these data form a complete profile of individual cows.
[0211] The system identifies and monitors social relationships among cows through multiple methods: dominance relationships are updated weekly through behavioral observations and location data; affiliation relationships are determined daily based on synchronized activity and spatial proximity; and competitive relationships are updated in real time based on feeding conflicts and interaction frequency. This multi-layered social relationship monitoring ensures the system accurately captures dynamic changes within the herd.
[0212] In addition, the ranch is equipped with an environmental monitoring station that collects and monitors environmental parameters such as temperature, humidity, wind speed and light every 10 minutes, realizing real-time monitoring of the breeding environment.
[0213] like Figures 4 to 18 As shown, this example selected multiple dairy cows from a large dairy farm for an experiment and obtained the required data. For example, cow A001 has basic information: age 4, parity 2, weight 650 kg, and lactation period of 120 days. In terms of metabolic status, daily feed intake was 23.5 kg, body condition score was 3.25, daily rumination was 420 minutes, and body temperature was 38.5°C. Behavioral data showed: daily standing time of 14.2 hours, movement distance of 2.8 km, drinking water 12 times, and feeding 8 times. These data comprehensively reflect the physiological and behavioral characteristics of this dairy cow.
[0214] Data on the social relationships between cow A001 and its surrounding cows show that: A001 maintains a close distance with cow A002 (distance frequency 85%) and a dominant relationship (relationship strength 0.82); A001 maintains an amicable relationship with cow A003 (relationship strength 0.65) and a moderate distance (relationship frequency 75%); A001 is in a competitive relationship with cow A004 (relationship strength -0.38) and a distant relationship (relationship frequency 45%); A001 maintains a neutral relationship with cow A005 (relationship strength 0.12) and a moderate distance (relationship frequency 60%). These data reflect A001's social status and interaction patterns within the group. The system generates a 640-dimensional feature vector for each cow node. Each node is connected to an average of 12-18 other nodes, and each edge contains 256 dimensions of feature information. Taking A001-A005 as an example, they establish connections with 15, 12, 18, 14, and 16 other nodes respectively, forming a close social network structure.
[0215] Continuing with the example of cow A001, feeding is divided into different time periods throughout the day based on her production status. In the morning, she is fed 3.5 kg of concentrate, 4.0 kg of silage, and 1.5 kg of hay, primarily to meet peak milk production needs. At noon, she is fed 2.75 kg of concentrate, 4.25 kg of silage, and 1.5 kg of hay to maintain production and replenish water. In the evening, she is fed 2.5 kg of concentrate, 3.0 kg of silage, and 1.5 kg of hay to meet her nighttime metabolic needs. A daily supplement of 0.5 kg is also fed for nutritional supplementation. This feeding plan fully considers the cow's physiological rhythms and nutritional needs.
[0216] The system demonstrated excellent performance on farms of varying sizes. In tests on farms with 1,000 to 10,000 head of cattle, the average response time was 287.7ms, memory usage was 9.4GB, and accuracy remained high at 98.2%. Performance only slightly degraded with increasing scale, demonstrating excellent scalability. The system also exhibited excellent adaptability to environmental changes. The average detection time for changes in environmental factors such as temperature, humidity, and weather was 12.8 seconds, and adjustments were completed in 45.6 seconds, with a system recovery rate of 96.5%. This demonstrates the system's ability to quickly identify and respond to environmental changes while maintaining stable performance. Furthermore, the system exhibited excellent generalization capabilities. In scenarios such as the introduction of new breeds, seasonal transitions, and feed changes, the average adaptation period was only 3.2 days, with an optimization effect of 92.8% and a high system stability of 95.5%. This demonstrates the system's excellent transfer learning capabilities and its ability to quickly adapt to various changing scenarios.
[0217] Analysis and research show that this implementation method has achieved remarkable technical effects in practical applications, with all indicators reaching or exceeding the expected goals and even exceeding expectations in some aspects, proving the feasibility and advancement of the technical solution.
[0218] The above describes an embodiment of the present invention, but this embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Ordinary technicians in this field can also make many forms based on the inspiration of this embodiment, all of which are protected by this embodiment.
Claims
1. A method for optimizing dairy cow feed ratio based on AI, characterized in that: The following steps are involved: The hierarchical heterogeneous graph network construction system processes the cow herd characteristic data and generates a dynamic cow herd graph network structure; A hierarchical graph reinforcement learning system processes real-time group network state tensors to generate multi-level feed ratio decision plans; Processing multi-level decision-making schemes through a multi-level Nash equilibrium optimization system to generate an optimal feed allocation strategy table; The method of constructing a system for processing dairy cow population characteristic data through a hierarchical heterogeneous graph network includes: The cow's individual feature data is processed through a multimodal feature fusion network to generate a cow node feature vector; Process group interaction time series data through a multi-dimensional social relationship modeling network to generate a cow relationship edge feature matrix; Dynamically update network processing node features and edge features through the time sequence graph to generate real-time group network state tensors; The multi-level feed ratio decision-making scheme includes a system-level benchmark feed formula vector, a group-differentiated formula matrix, and a personalized precision feeding plan set. The hierarchical graph reinforcement learning system processes the real-time group network state tensor, including: Processing global graph state data through a system-level graph attention strategy network to generate a baseline feed recipe vector; The subgroup feature data are processed through a group-level multi-agent advantage actor-critic network to generate a group differentiation recipe matrix; Through the individual-level graph attention reinforcement learning network, individual status data is processed to generate a personalized and precise feeding plan set; The multi-level Nash equilibrium optimization system includes a utility function construction unit, an equilibrium solution unit, and a resource allocation unit. The multi-level decision-making scheme processed by the multi-level Nash equilibrium optimization system includes: By constructing a network with multi-level utility functions to process decision-making scheme data, a set of intelligent agent utility functions is generated; The utility function set is processed by iterative optimal response algorithm to generate the Nash equilibrium strategy set; The balanced strategy set is processed by the priority resource allocation algorithm to generate the final feed allocation strategy table.
2. The AI-based dairy cow feed ratio optimization method according to claim 1, characterized in that: The hierarchical heterogeneous graph network construction system includes a feature extraction unit, a relationship modeling unit and a dynamic update unit; the dynamic cow group graph network structure includes a node set, an edge set and an attribute set.
3. The AI-based dairy cow feed ratio optimization method according to claim 2, characterized in that: The multimodal feature fusion network includes three parallel encoder modules and a feature fusion module, and the three parallel encoder modules include: Basic information encoder module, used to process the basic information vector of the cow ,in, is the basic information vector containing age, lactation period, and weight characteristics, is the basic feature dimension, express dimensional real space; output basic eigenvectors It represents the 128-dimensional feature vector processed by the basic information encoder, and its calculation expression is: ; in, is the weight matrix of the fully connected layer, is the bias vector, is the rectified linear unit activation function; Metabolic state encoder module for processing time-series metabolic state sequences ,in, represents a metabolic state sequence containing time series data of milk production, feed intake, and body condition score, is the length of time series data; output metabolic feature vector represents the 256-dimensional feature vector processed by the metabolic state encoder, and its calculation expression is: ; in, and are the matrix and bias vector of the encoder respectively, and are the forward and backward hidden states of LSTM respectively, is the vector concatenation operator; Behavior feature encoder module for processing spatiotemporal behavior data tensors ,in, represents a spatiotemporal behavior data tensor containing activity level, feeding time, and rest time. and are the height and width dimensions of the spatial data respectively; output behavioral feature vector It represents the 256-dimensional feature vector processed by the behavioral feature encoder, and its calculation expression is: ; in, For the pooling operation, 、 and These are the 1st, 2nd, and 3rd layer 3D convolution operations respectively.
4. The AI-based dairy cow feed ratio optimization method according to claim 2, characterized in that: The multidimensional social relationship modeling network includes a relationship type identification module, a feature extraction module and an edge feature generation module, including: Relation type identification module for processing position sequence data and behavioral interaction records ,in, Represents dairy cows and Position sequence data between Represents dairy cows In time location, Represents dairy cows and The behavioral interaction records between Indicates that they are in time Interaction behavior; output relationship type vector The three-dimensional vector representing the relationship type between cows corresponds to the probability distribution of dominant relationship, affinity relationship and competitive relationship, and its calculation expression is: ; in, is the weight matrix, and They are convolutional neural networks and long short-term memory networks, is the normalized exponential function; Interaction feature extraction module, used to process interaction frequency statistics and interaction duration ,in, Represents dairy cows and between the frequency of different types of interactions, Represents dairy cows and between The average duration of different types of interactions; output interaction feature vector Represents dairy cows and The 128-dimensional interaction feature vector between is calculated as follows: ; in, is the weight matrix, is the bias vector; Edge feature generation module, used to process relationship type vectors and interaction eigenvectors , output edge feature vector Represents dairy cows and The 256-dimensional edge feature vector between is calculated as follows: ; in, Generates functions for edge features, is the weight matrix, is the bias vector.
5. The AI-based dairy cow feed ratio optimization method according to claim 1, characterized in that: The system-level graph attention strategy network includes a graph attention encoding module, a global information aggregation module, and a strategy generation module, including: The graph attention encoding module is used to generate the node attention weight matrix ,in, express The attention weight matrix between nodes, is the total number of dairy cows, and its calculation expression is: ; in, Representation node For Node The attention weight, For nodes The query vector, For nodes The key vector of is the attention vector, For nodes The neighbor set of Indicates the index variable when summing. represents the natural exponential function, is the activation function of the rectified linear unit with leakage; The global information aggregation module is used to generate node message vectors ,in, represents the node message vector matrix, is the feature dimension graph level, and its calculation expression is: ; in, For nodes The message vector, is the transformation matrix of the value, For nodes In time The eigenvector of is a nonlinear activation function and ,in, represents the global representation vector of the entire graph, is the set of all nodes in the graph, is the weight matrix of graph level representation; The strategy generation module is used to generate the benchmark feed formula vector ,in, represents the system-level benchmark feed recipe vector, is the amount of feed components, and its calculation expression is: ; in is the system-level decision-making strategy function, and are the weights and biases of the policy network, respectively.
6. The AI-based dairy cow feed ratio optimization method according to claim 1, characterized in that: The swarm-level multi-agent advantage actor-critic network comprises a sub-swarm partitioning module, a state encoding module, a policy network module, and a value network module, including: The subpopulation partitioning module uses the spectral clustering algorithm, and its calculation expression is: ; in, Indicates the A graph representation of the subgroups, is the spectral clustering algorithm, is the number of subgroups, where Representation node and nodes The feature similarity of is the cosine similarity function; The policy network module is used to generate the group recipe adjustment vector ,in, Representing a group The formula adjustment vector is calculated as follows: ; in, For the group The policy function, For the group The state vector of is a normal distribution, where the mean network is , and are the mean network weight and bias respectively, and the standard deviation network is , and are the standard deviation network weights and biases, is a soft positive function; The value network module is used to generate state value estimates Representing a group The state value estimation of is calculated as follows: ; in, and are the weights and biases of the value network, Representing a group Communication information, is the communication information conversion matrix; The individual-level graph attention reinforcement learning network includes a state encoding module, an attention calculation module, a strategy generation module, and a reward calculation module, including: The attention calculation module is used to generate the attention context vector , representing a node The attention context vector is calculated as follows: ; in, is the individual-level attention coefficient, For nodes The value vector of is the scaling factor of the attention mechanism; The strategy generation module is used to generate personalized feeding plans ,in, Represents an individual The feeding plan vector is calculated as follows: ; in, For individuals The policy function, For individuals The state vector of is the policy network function; The reward calculation module is used to calculate the comprehensive reward value: ; in, Represents an individual The comprehensive reward value, is the reward weight coefficient, where 、 and They are production performance rewards, health status rewards and social relationship rewards.
7. The AI-based dairy cow feed ratio optimization method according to claim 6, characterized in that: The multi-level utility function construction network includes three parallel utility calculation modules, and the three parallel utility calculation modules include: System-level utility calculation module, used to calculate the system-level utility function: ; in, represents the system-level utility function, is the production benefit function, is the cost function, is the nutritional balance function, is the system-level utility weight; Group-level utility calculation module, used to calculate group-level utility function: ; in, represents the group-level utility function, For individuals The weight in the group, is the group-level action value function, for Divergence, measuring strategy and The difference, for The weight coefficient of the divergence; Individual-level utility calculation module, used to calculate individual-level utility function: ; in, represents the individual-level utility function, is the individual immediate reward function, is the L2 norm of the difference between the individual recipe and the group recipe, is the competition cost function, is the weight coefficient of individual-level utility loss.
8. An AI-based dairy cow feed ratio optimization system, characterized in that: A method for optimizing dairy cow feed ratio based on AI for executing any one of claims 1 to 7, comprising: The relational modeling module is used to process the cow population characteristic data through a hierarchical heterogeneous graph network construction system to generate a dynamic cow population graph network structure; Hierarchical feed decision module, which is used to process real-time group network state tensors through a hierarchical graph reinforcement learning system to generate multi-level feed ratio decision plans; The equilibrium optimization module is used to process multi-level decision-making schemes through a multi-level Nash equilibrium optimization system and generate an optimal feed distribution strategy table.
Citation Information
Patent Citations
Risk early warning method for prevention and control of epidemic diseases in animal husbandry
CN114781952A
Intelligent rationing method and system for pig house feed supply
CN118607361A