Intelligent quantitative proportioning management system for pig feed based on big data
By using big data and cross-task gradient updates, the model for pig nutritional requirements can be quickly adapted, solving the problem of adapting intelligent feeding models across regions and breeds to new environments. This enables precise quantitative matching of pig nutritional requirements, improving the production performance and efficiency of farms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZIGONG KUAIDAKANG AGRICULTURE & ANIMAL HUSBANDRY TECHNOLOGY CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies cannot effectively map the real energy metabolism patterns of pigs in new environments when migrating intelligent feeding models across regions and breeds. This leads to a systematic deviation between the model's predicted nutritional requirements and actual feeding behavior. In particular, when heat stress and disease pressure are superimposed in tropical regions, the intelligent feeding system performs worse than traditional manual experience-based feeding, making it difficult to deploy quickly and operate effectively.
The intelligent quantitative pig feed formulation management system based on big data collects time-series basic data from multiple reference farms, divides the training task set into different categories, determines the initial parameter combination using cross-task gradient update, and fine-tunes the parameters by obtaining a small amount of measured sample data in the target scenario. It generates a special parameter combination adapted to the target farm, generates a dynamic curve of nutritional requirements by combining continuous function mapping, and determines the daily quantitative feed formulation scheme through multi-objective optimization.
This enabled newly commissioned farms to quickly adapt to the local environment and pig condition within a few days, avoiding decreased feed intake and slow growth, reducing trial and error costs and feed waste, and ensuring that nutritional requirements closely follow the growth curve fluctuations while balancing formula costs and nutritional deviations.
Smart Images

Figure CN122177281A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of feed formulation management technology, specifically to a big data-based intelligent quantitative formulation management system for pig feed. Background Technology
[0002] With the development of IoT technology, some large-scale livestock enterprises have begun to try precision feeding methods based on big data. Existing technologies typically collect historical data on environmental temperature and humidity, pig feed intake, and weight gain in the farm, use machine learning algorithms to train a nutritional requirement prediction model, and then combine this with linear programming methods to calculate the daily feed formula.
[0003] Existing technologies face a technical dilemma in the transfer application of intelligent feeding models across regions and breeds: the lack of initial data in the target farm prevents pre-set models from effectively mapping the real energy metabolism patterns of pigs in the new environment. The root cause lies in the fact that traditional machine learning methods can only learn the apparent statistical correlations of data and lack the ability to model the complex biological coupling mechanism between the breeding environment, the genetic background of pigs, and nutritional requirements. When a model trained in a temperate climate zone is deployed to a tropical region, the combined effect of heat stress physiological responses caused by high temperature and humidity and local disease pressures causes the model's predicted nutritional requirements to deviate systematically from the actual feeding behavior of pigs. Existing transfer learning methods are limited by the amount of data required in the target domain and cannot complete effective domain adaptation under the condition of a very small number of samples in the early stage of production. This results in new farms needing to experience a cold start failure period of several months. During this period, the production performance of the intelligent feeding system is actually worse than that of traditional manual experience feeding. This technical bottleneck seriously restricts the rapid deployment and effectiveness release of intelligent quantitative feeding methods in the context of global expansion. Summary of the Invention
[0004] The purpose of this invention is to provide a big data-based intelligent quantitative formulation management system for pig feed to solve the problems mentioned above.
[0005] The objective of this invention can be achieved through the following technical solutions: The intelligent quantitative formulation management system for pig feed based on big data includes: Data acquisition and task set construction module: Collect time-series basic data from multiple reference farms during the complete breeding cycle. The time-series basic data includes environmental monitoring data, individual pig growth data, and corresponding feed feeding data. Based on the geographical and climatic characteristics of the farms and the pig breeds, the time-series basic data is divided into several differentiated training task sets. Initial parameter combination determination module: Input the training task set into the iteratively optimized parameter learning framework, and determine the initial parameter combination through cross-task gradient update. The initial parameter combination is configured to converge quickly to the parameter state that adapts to the new scenario through a finite number of iterations when only a small amount of new sample data is encountered. Target scenario parameter adaptive module: Obtain a small amount of measured sample data of the target farm in the early stage of production, take the initial parameter combination as the starting point, fine-tune the parameters based on the small amount of measured sample data, and generate a special parameter combination that is adapted to the current environment and pig status of the target farm; The nutrient requirement dynamic curve generation module combines a set of special parameters with the predicted environmental data of the target farm throughout the entire growth cycle. It generates a dynamic curve of nutrient requirements for pigs throughout the entire growth cycle through continuous function mapping. The dynamic curve of nutrient requirements represents the nutrient concentration required at different time points. Feed quantitative formulation output module: Based on the dynamic curve of nutritional requirements and the real-time acquired nutritional parameters of feed ingredients, the daily feed ingredient mixing ratio is determined through multi-objective optimization to form a daily feed quantitative formulation plan.
[0006] As a further aspect of the present invention: the determination of the initial parameter combination through cross-task gradient update specifically includes: Multiple training tasks are randomly selected from the training task set, and each training task contains a supporting data part and a query data part. For each selected training task, the temporary parameter combination corresponding to the training task is calculated by gradient descent based on the support data of the training task. The temporary parameter combinations corresponding to each training task are applied to the corresponding query data parts respectively, and the comprehensive loss value of all query data parts is calculated. The initial parameter combination is updated by gradient backpropagation based on the comprehensive loss value, and this process is repeated until the initial parameter combination meets the preset convergence condition.
[0007] As a further aspect of the present invention: the calculation process of the comprehensive loss value is as follows: The temporary parameter combinations corresponding to each training task are loaded into the initial network, and the query data part of the corresponding training task is input to obtain the predicted output value corresponding to each query data part. Calculate the difference between the predicted output value and the actual collected value for each part of the query data to obtain the individual loss value for each training task; The weight coefficients for each training task are calculated based on the individual loss values corresponding to each training task. The weight coefficients are positively correlated with the magnitude of the individual loss values. The individual loss values corresponding to each training task are weighted and summed according to their respective weight coefficients to obtain the comprehensive loss value.
[0008] As a further aspect of the present invention: the process for generating the specific parameter combination is as follows: A small amount of measured sample data is divided into multiple micro-batches, each micro-batch containing at least one sample; Input the current micro-batch into the current network constructed based on the initial parameter combination, calculate the predicted loss value corresponding to the current micro-batch, and obtain the updated parameter combination through gradient backpropagation based on the predicted loss value. Calculate the difference between the updated parameter combination and the initial parameter combination in each parameter dimension to obtain the parameter offset vector; The adaptive step size coefficient is determined based on the magnitude of the parameter offset vector, and the parameter combination after the first update is constrained and adjusted based on the adaptive step size coefficient to generate a special parameter combination.
[0009] As a further aspect of the present invention: the process of obtaining the parameter offset vector is as follows: Get the first value of each parameter dimension in the updated parameter combination, and the second value of each corresponding parameter dimension in the initial parameter combination; The initial difference components of each parameter dimension are obtained by subtracting the first value of each parameter dimension from the second value of the corresponding parameter dimension in each dimension. The initial difference components of each parameter dimension are normalized to obtain the normalized difference components of each parameter dimension. The normalization process is determined based on the numerical distribution range of the corresponding parameter dimension in the entire network. The normalized difference components of all parameter dimensions are combined in the order of the original parameter dimensions to form a parameter offset vector.
[0010] As a further aspect of the present invention: the process of generating the demand dynamic curve is as follows: Arrange the predicted environmental data of the target farm throughout the entire cycle in chronological order to construct an environmental time series, and use each time point in the environmental time series as a coordinate point to be queried; The special parameters are combined and loaded into the continuous mapping network, which takes time coordinates and environmental data as joint inputs and nutrient concentration as output. Each coordinate point to be queried is sequentially input into the continuous mapping network after loading the special parameter combination to obtain the initial nutrient concentration value corresponding to each time point. At the same time, the concentration change rate is calculated based on the initial nutrient concentration values of adjacent time points, and the interpolation weight of key time points is determined based on the concentration change rate. Adaptive and encrypted interpolation of initial nutrient concentration values is performed based on interpolation weights at key time points to generate dynamic nutrient demand curves covering the entire growth cycle.
[0011] As a further aspect of the present invention: the determination of interpolation weights at key time points based on the concentration change rate specifically includes: By iterating through all adjacent time points, the initial nutrient concentration value of the previous time point is subtracted from the initial nutrient concentration value of the next time point to obtain the absolute value of the concentration change rate corresponding to each time interval. Sort all absolute values of concentration change rate in descending order of numerical value, and select the time interval with the first preset proportion in the sort as the high change rate interval; Calculate the mean nutrient concentration values at both ends of each high rate of change interval, and determine the initial interpolation weights for each high rate of change interval based on the degree of deviation between the mean nutrient concentration values and the global mean nutrient concentration values. The initial interpolation weights for each high rate of change interval are normalized so that the sum of the interpolation weights for all high rate of change intervals is a preset fixed value, thus obtaining the final interpolation weights for key time points.
[0012] As a further aspect of the present invention: the method for forming a daily feed quantitative ratio specifically includes: Based on the required nutrient concentration for the day, the daily nutrient target vector is extracted from the nutrient demand dynamic curve, and the nutrient parameter vectors and price parameters corresponding to the various feed ingredients available for the day are obtained. Using the daily nutritional target vector as the constraint benchmark and the mixing ratio of various feed ingredients as the optimization variable, an initial optimization space containing multiple optimization objectives is constructed. These multiple optimization objectives include at least minimizing formula cost and minimizing nutritional deviation. Multiple candidate mixing ratio solutions are randomly generated in the initial optimization space. The formulation cost value and nutrient deviation value corresponding to each candidate mixing ratio solution are calculated respectively. The non-dominated frontier solution set is identified based on the distribution position of each candidate solution on the cost-deviation two-dimensional plane. From the solution set of the non-dominated frontier, select candidate mixing ratio solutions whose slope of the line connecting to the origin is equal to the preset nutrient-cost trade-off slope, and use them as the mixing ratio of feed ingredients for the day to form the quantitative feed formulation for the day.
[0013] The beneficial effects of this invention are: (1) This invention constructs an initial parameter combination that is highly sensitive to data through a meta-learning framework. This allows newly established farms to quickly adapt to a specific parameter combination that suits the local environment and pig herd status through a limited number of gradient updates by collecting only a small amount of sample data in the first few days of production. Compared to the cold start mode of traditional methods that require accumulating local data for several months to half a year before taking effect, this invention shortens the artificial intervention period, effectively avoiding problems such as decreased feed intake and slow growth caused by unsuitable early formulas, and reducing the trial and error costs and feed waste in the first few batches of newly established farms.
[0014] (2) This invention generates a high-resolution dynamic curve of nutritional requirements covering the entire growth cycle through a continuous mapping network, and determines the daily formulation scheme through multi-objective optimization based on real-time raw material nutritional parameters. This mechanism can capture key time points where nutritional requirements change rapidly and perform adaptive densification interpolation, so that the dietary nutrient concentration closely follows the fluctuations of the actual growth curve of the pigs, while taking into account the balance between formulation cost and nutritional deviation. Attached Figure Description
[0015] The invention will now be further described with reference to the accompanying drawings.
[0016] Figure 1 This is a system block diagram of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Please see Figure 1 As shown, this invention is a big data-based intelligent quantitative proportioning management system for pig feed, comprising: Data acquisition and task set construction module: Collect time-series basic data from multiple reference farms during the complete breeding cycle. The time-series basic data includes environmental monitoring data, individual pig growth data, and corresponding feed feeding data. Based on the geographical and climatic characteristics of the farms and the pig breeds, the time-series basic data is divided into several differentiated training task sets. Initial parameter combination determination module: Input the training task set into the iteratively optimized parameter learning framework, and determine the initial parameter combination through cross-task gradient update. The initial parameter combination is configured to converge quickly to the parameter state that adapts to the new scenario through a finite number of iterations when only a small amount of new sample data is encountered. Target scenario parameter adaptive module: Obtain a small amount of measured sample data of the target farm in the early stage of production, take the initial parameter combination as the starting point, fine-tune the parameters based on the small amount of measured sample data, and generate a special parameter combination that is adapted to the current environment and pig status of the target farm; The nutrient requirement dynamic curve generation module combines a set of special parameters with the predicted environmental data of the target farm throughout the entire growth cycle. It generates a dynamic curve of nutrient requirements for pigs throughout the entire growth cycle through continuous function mapping. The dynamic curve of nutrient requirements represents the nutrient concentration required at different time points. Feed quantitative formulation output module: Based on the dynamic curve of nutritional requirements and the real-time acquired nutritional parameters of feed ingredients, the daily feed ingredient mixing ratio is determined through multi-objective optimization to form a daily feed quantitative formulation plan.
[0019] In the data acquisition and task set construction module, time-series basic data from multiple reference farms over a complete breeding cycle are collected. This time-series basic data includes environmental monitoring data, individual pig growth data, and corresponding feed input data. Based on the geographical and climatic characteristics of the farms and the pig breeds, the time-series basic data is divided into several differentiated training task sets, specifically including: Time-series baseline data were collected from multiple reference farms throughout the complete breeding cycle. Specifically, farms distributed across different geographical regions were selected as reference farms, ensuring that these farms covered at least three different climate types, including temperate monsoon climate, subtropical humid climate, and tropical savanna climate. Environmental monitoring equipment, including temperature sensors, relative humidity sensors, and ammonia concentration sensors, was deployed in the pigsties of each reference farm to collect real-time environmental data once per second, and the data was summarized daily to form hourly average records. Simultaneously, each pig was equipped with an electronic identification tag, and its weight was automatically read at 5:00 AM daily using an automatic weighing station. The age and breed information of each pig were also recorded to form individual pig growth data. Furthermore, intelligent feeding equipment automatically recorded the feeding time, amount, and feed formula number for each feeding session daily, serving as corresponding feed feeding data. The above three types of data are uploaded to the data storage center daily via the farm's local area network. The data is arranged and combined in chronological order, with each pig as the basic unit, to form the time-series basic data for each reference farm within the complete breeding cycle. The complete breeding cycle refers to the total number of days from when the pigs are transferred to the fattening shed after weaning until they are ready for slaughter.
[0020] Based on the geographical and climatic characteristics of the farms and the pig breeds, the time-series baseline data were divided into several differentiated training task sets. First, the time-series baseline data of each reference farm was labeled with a climate attribute tag, determined according to the farm's latitude and longitude and the Köppen climate classification system, specifically divided into temperate, subtropical, and tropical tags. Second, the time-series baseline data of each reference farm was labeled with a breed attribute tag, determined according to the main pig breeds raised on the farm, specifically divided into breed A, breed B, and breed C tags. Then, the time-series baseline data of multiple reference farms with the same climate attribute tag and the same breed attribute tag were merged into one data group. For example, data from all farms located in temperate climate zones and raising breed A were merged into one data group. Finally, each data group was defined as a training task, ensuring that each training task included time-series baseline data from at least three different farms. If the number of farms corresponding to a certain combination of climate attribute and breed attribute is less than three, then the combination is merged with the data of the same breed in the nearest climate zone until each training task contains no less than three farms, thus forming several training task sets with differences. Each training task represents the growth pattern under a specific climate environment and a specific pig breed combination.
[0021] In the initial parameter combination determination module, the training task set is input into an iteratively optimizeable parameter learning framework. The initial parameter combination is determined through cross-task gradient update. The initial parameter combination is configured to converge quickly to a parameter state suitable for the new scenario through a finite number of iterations when only a small amount of new sample data is encountered. Specifically, it includes: Multiple training tasks are randomly selected from the pre-defined training task sets to participate in this round of parameter updates. Specifically, in each iteration, sixteen training tasks are randomly selected from the entire training task set, ensuring that the probability of selection is equal and the selection process is independent each time. For each selected training task, its temporal data is divided into two parts in chronological order: the first 70% of the data serves as support data for calculating temporary parameter combinations; the latter 30% serves as query data for evaluating the predictive performance of the temporary parameter combinations.
[0022] For each selected training task, a temporary parameter set is calculated based on the support data portion of that task using gradient descent. First, a six-layer fully connected network is used as the initial network. The number of input layer nodes corresponds to the total dimension of the environmental monitoring data and time features included in the support data portion, totaling eight input nodes; the output layer has one node, representing the required nutrient concentration value at the current time point. The support data portion is input into the initial network line by line to obtain the predicted nutrient concentration value for each input. Mean squared error is used as the loss function, i.e., the square of the difference between each predicted nutrient concentration value and the actual nutrient concentration value in the support data portion is calculated, and the sum of the squared differences of all input samples is divided by the total number of samples to obtain the average loss value of the support data portion. Then, the partial derivative of this average loss value with respect to the connection weights of each parameter node in the current network is calculated, i.e., the gradient value. With a learning rate of 0.1%, the current value of each parameter node is subtracted from the learning rate multiplied by the gradient value corresponding to that node to obtain the updated parameter value. All updated parameter values together constitute the temporary parameter set corresponding to this training task.
[0023] The temporary parameter combinations corresponding to each training task are applied to the corresponding query data parts to calculate the comprehensive loss value for all query data parts. First, the temporary parameter combinations corresponding to each training task are loaded into the initial network, replacing the original parameter values of the initial network, to obtain the temporary network corresponding to that training task. The query data part of the corresponding training task is input into this temporary network, and the predicted output value, i.e., the predicted nutrient concentration value, is calculated for each query data part. Then, the difference between the predicted output value and the actual collected value in the query data part is calculated. This difference is represented by the mean absolute error, i.e., the absolute value of the difference between the predicted output value and the actual collected value is calculated, and the sum of the absolute values of all query samples is divided by the total number of query samples to obtain the individual loss value corresponding to each training task. Finally, the weight coefficients of each training task are calculated based on the individual loss values corresponding to each training task. The specific method is as follows: The loss values of all sixteen individuals participating in this round of calculation are sorted in ascending order of magnitude. The training tasks corresponding to the loss values of the first third of the individuals are assigned a weight coefficient of 2, and the training tasks corresponding to the loss values of the remaining two-thirds of the individuals are assigned a weight coefficient of 1, thus achieving a positive correlation between the weight coefficients and the magnitude of the individual loss values. Finally, the individual loss values corresponding to each training task are weighted and summed according to their respective weight coefficients; that is, each individual loss value is first multiplied by its corresponding weight coefficient, and then all multiplications are summed to obtain the comprehensive loss value.
[0024] The initial parameter combination is updated via gradient backpropagation based on the comprehensive loss value. Using the current parameter values of the initial network as independent variables, the partial derivative of the comprehensive loss value with respect to each parameter node in the initial network is calculated to obtain the global gradient. A global learning rate of 0.01% is set. The current value of each parameter node in the initial network is subtracted from the global learning rate multiplied by the corresponding global gradient value to obtain the updated initial network parameter values, thus completing one update of the initial parameter combination. This process is repeated from randomly selecting multiple training tasks to updating the initial parameter combination until the initial parameter combination meets a preset convergence condition. The preset convergence condition is set as follows: the fluctuation range of the comprehensive loss value calculated in five consecutive iterations is less than 0.5%, or the total number of iterations reaches 5,000. Iteration stops when either condition is met, and the current initial network parameter values are determined as the final initial parameter combination. The characteristic of this initial parameter combination is that when only a small amount of new sample data is input subsequently, a finite number of gradient updates based on this parameter combination can quickly adapt to the data distribution of the new scenario.
[0025] In the target scenario parameter adaptation module, a small amount of measured sample data from the target farm during the initial production phase is obtained. Using the initial parameter combination as a starting point, the parameters are fine-tuned based on this small amount of measured sample data to generate a specific parameter combination adapted to the current environment and pig herd status of the target farm. This specifically includes: A small number of actual sample data were collected during the first three days of operation at the target farm. The specific collection method was as follows: Ten representative healthy pigs were selected from the target farm. Each pig wore an electronic identification tag, and its weight was recorded twice daily (morning and evening) using an automatic weighing station. Simultaneously, the start and end times of each feeding session, as well as the amount of feed consumed, were recorded using intelligent feeding equipment. Temperature, humidity, and ammonia concentration were also recorded at each feeding time using environmental monitoring equipment. These data were aligned chronologically to form sample data, with each feeding event as the recording unit. Approximately 150 to 200 samples were collected, constituting a small amount of actual sample data.
[0026] The small amount of measured sample data was divided into multiple micro-batches. Specifically, all sample data were arranged in chronological order of collection time, and then each batch of eight samples was divided into a micro-batch. If the last batch had fewer than eight samples, the actual number was retained, ensuring that each micro-batch contained at least one sample, resulting in several consecutively arranged micro-batches.
[0027] The current micro-batch is input into the current network constructed based on the initial parameter combination. The predicted loss value corresponding to the current micro-batch is calculated, and the updated parameter combination is obtained through gradient backpropagation based on the predicted loss value. First, the initial parameter combination determined in step two is loaded into a fully connected network with a six-layer structure. The network has eight input layer nodes, corresponding to temperature, humidity, ammonia concentration, age, last feeding interval, current weight, breed coefficient, and time code, respectively. The output layer has one node, representing the predicted nutrient concentration value for this feeding. The input part of each sample in the current micro-batch is sequentially input into this network to obtain the predicted nutrient concentration value corresponding to each sample. The mean absolute error is used as the loss function, that is, the absolute value of the difference between the predicted nutrient concentration value of each sample and the actual nutrient concentration value recorded in the sample is calculated, and the sum of the absolute values of all samples in the current micro-batch is divided by the number of samples in the current micro-batch to obtain the predicted loss value corresponding to the current micro-batch. Then, the partial derivative of the predicted loss value with respect to each parameter node in the current network is calculated. The fine-tuning learning rate is set to 0.01%. The current value of each parameter node in the current network is subtracted from the fine-tuning learning rate multiplied by the partial derivative of that node to obtain the updated parameter value. All the updated parameter values together constitute the updated parameter combination.
[0028] The parameter offset vector is obtained by calculating the difference between the updated parameter combination and the initial parameter combination across each parameter dimension. First, the first value of each parameter dimension in the updated parameter combination and the second value of the corresponding parameter dimension in the initial parameter combination are obtained. Here, parameter dimension refers to each independent parameter node in the network, totaling 12,348 parameter dimensions. Then, the second value of each parameter dimension is subtracted from its first value to obtain the initial difference component for that dimension. A positive difference indicates an increase in parameter value, while a negative difference indicates a decrease. Next, the initial difference components of each parameter dimension are normalized. The normalization process is determined based on the numerical distribution range of the corresponding parameter dimension across the entire network. Specifically, the maximum and minimum values of each parameter dimension in the initial parameter combination are pre-calculated over the entire 5,000 iterations. The initial difference component of each dimension is divided by the difference between its corresponding maximum and minimum values to obtain the normalized difference component for each parameter dimension, ensuring that the difference in each dimension is compressed to between -1 and +1. Finally, the normalized difference components of all parameter dimensions are arranged and combined according to the original parameter dimension order to form a one-dimensional array of length 12,348, which is the parameter offset vector.
[0029] The adaptive step size coefficient is determined based on the magnitude of the parameter offset vector, and the parameter combination after an update is constrained and adjusted based on the adaptive step size coefficient to generate a dedicated parameter combination. First, the magnitude of the parameter offset vector is calculated by squaring each element in the vector, summing the results, and then taking the square root of the sum. A baseline step size threshold of 0.5 is preset. The magnitude value is compared with the baseline step size threshold. If the magnitude value is less than or equal to 0.5, the adaptive step size coefficient is set to 1; if the magnitude value is greater than 0.5, the adaptive step size coefficient is set to the baseline step size threshold divided by the magnitude value. Then, the parameter combination after an update is constrained and adjusted based on this adaptive step size coefficient. Specifically, for each parameter dimension in the updated parameter combination, the initial difference component of that dimension is calculated and multiplied by the adaptive step size coefficient to obtain the constrained difference. The second value of the corresponding dimension in the initial parameter combination is then added to the constrained difference to obtain the adjusted parameter value for that dimension. All the adjusted parameter values for all dimensions together constitute a dedicated parameter combination adapted to the current environment and pig herd status of the target farm. This dedicated parameter combination not only utilizes a small number of measured samples for parameter updates, but also prevents excessive parameter shifts due to insufficient sample size through an adaptive step size coefficient.
[0030] In the dynamic nutrient requirement curve generation module, specialized parameter combinations are combined with predicted environmental data from the target farm throughout its entire growth cycle. A continuous function mapping is used to generate dynamic nutrient requirement curves for pigs throughout their growth cycle. These curves characterize the required nutrient concentrations at different time points, specifically including: The average daily temperature, average relative humidity, and average ammonia concentration for the past ten years were obtained from the meteorological database of the target farm's location. This historical data was arranged chronologically, and the ten-year average of each indicator for each date was calculated to obtain a set of predicted environmental data representing the typical climate characteristics of the farm. This predicted environmental data was then arranged chronologically from weaning age to slaughter age to construct an environmental time series covering the complete growth cycle of the pigs. Each time point in this series represents a specific age and includes three environmental values: temperature, humidity, and ammonia concentration. Each time point in the environmental time series was used as a query coordinate point, resulting in 170 query coordinate points corresponding to the complete growth cycle of pigs from age 30 to 200.
[0031] A continuous mapping network with a fully connected structure is constructed, consisting of an input layer, four hidden layers, and an output layer. The input layer has four nodes, corresponding to time, temperature, humidity, and ammonia concentration values, respectively. The first hidden layer contains 256 nodes, the second 128 nodes, the third 64 nodes, and the fourth 32 nodes. The output layer has one node, representing the nutrient concentration value under the input conditions, expressed as grams of lysine per kilogram of feed. Nodes within each hidden layer are fully connected. Each node receives the output values from all nodes in the previous layer and calculates a weighted sum of these output values. The weighted sum is calculated by multiplying each input value by its corresponding connection weight, summing the sums, and then adding a bias term. The weighted sum is then input to a non-linear activation function using rectified linear units (RCUs). The function outputs the weighted sum if it is greater than 0, and outputs 0 if it is less than or equal to 0, thus obtaining the node's output value. Each value in the special parameter combination obtained in step three is sequentially assigned the initial value of each connection weight and bias term in the continuous mapping network to complete the loading of the network.
[0032] Each query coordinate point is sequentially input into a continuous mapping network with specially configured parameters to obtain the initial nutrient concentration value for each time point. Specifically, the age (in days), temperature, humidity, and ammonia concentration for the first query coordinate point are input to the input layer of the continuous mapping network. After forward propagation through four hidden layers, an output value is obtained from the output layer; this value represents the initial nutrient concentration for the first age point. Each subsequent query coordinate point is processed in the same manner, resulting in 170 initial nutrient concentration values, each corresponding to the nutrient concentration requirement for a given age point.
[0033] The concentration change rate is calculated based on the initial nutrient concentration values at adjacent time points, and the interpolation weights for key time points are determined based on the concentration change rate. First, all adjacent time points are iterated. Starting from the first and second time points, the initial nutrient concentration value at the subsequent time point is subtracted from the initial nutrient concentration value at the previous time point to obtain the concentration difference for that time interval. The absolute value of this concentration difference is taken as the absolute value of the concentration change rate, representing the degree of drastic change in nutrient concentration within a unit age interval. This process is repeated for all adjacent time intervals, resulting in 169 absolute values of the concentration change rate.
[0034] All absolute values of concentration change rates are sorted in descending order of magnitude, starting from the maximum and moving down to the minimum. A preset percentage of 10% is set, and the top 10% of time intervals in the sorted data are selected as high-change-rate intervals, meaning the 17 time intervals with the largest absolute values of concentration change rates are chosen as the key areas of focus.
[0035] The mean nutrient concentration values at both ends of each high-rate-of-change interval are calculated. Specifically, the initial nutrient concentration values at the left and right ends of each high-rate-of-change interval are added together and then divided by 2 to obtain the local mean concentration value for that interval. Simultaneously, the arithmetic mean of all 170 initial nutrient concentration values is calculated to obtain the global mean nutrient concentration value. For each high-rate-of-change interval, the absolute value of the difference between the local mean concentration value and the global mean nutrient concentration value is calculated. The larger the absolute value, the greater the deviation of the nutrient concentration level of that interval from the overall average level. The initial interpolation weights for each high-rate-of-change interval are determined based on this deviation, using the following formula: ; in, Indicates the first Initial interpolation weights for a high rate of change interval. Indicates the first The mean nutrient concentration values at both ends of the high rate of change interval This represents the global mean nutrient concentration across all 170 initial nutrient concentration values. This represents the absolute value of the difference between the local concentration mean and the global concentration mean. The formula implies that the further the local concentration mean deviates from the global average level in a high-rate-of-change range, the greater the initial interpolation weight for that range. This means that more points need to be inserted within that range to capture rapid and significant changes in nutrient concentration.
[0036] The initial interpolation weights for each high-rate-of-change interval are normalized so that the sum of the interpolation weights for all high-rate-of-change intervals equals a preset fixed value. This preset fixed value is set to 17, which is the number of high-rate-of-change intervals. The specific calculation process for normalization is as follows: First, the initial interpolation weights for all high-rate-of-change intervals are summed to obtain a total weight. Then, for each high-rate-of-change interval, its initial interpolation weight is multiplied by the number of high-rate-of-change intervals (17), and then divided by the sum of the weights to obtain the final key time point interpolation weight for that interval. After normalization, the sum of the key time point interpolation weights for all 17 high-rate-of-change intervals is exactly equal to 17. The value of each weight is between 0.5 and 1.5, representing the relative density of additional sampling points that need to be inserted within that interval; a larger weight value indicates that more points need to be inserted within that interval.
[0037] Adaptive and encrypted interpolation of initial nutrient concentration values is performed based on key time point interpolation weights to generate a dynamic nutrient requirement curve covering the entire growth cycle. Specifically, for each high-rate-of-change interval, the number of interpolation points to be inserted within that interval is determined according to the key time point interpolation weights, rounded to the nearest integer. For example, a weight of 1.2 inserts one point, and a weight of 1.8 inserts two points. Within each high-rate-of-change interval, the corresponding number of interpolation points are evenly inserted between the two endpoints using linear interpolation. The age position of each interpolation point is determined at equal intervals, and the nutrient concentration value of the interpolation point is calculated as a linear proportion of the nutrient concentration values at the two endpoints. For non-high-rate-of-change intervals, no additional points are inserted, and the original initial nutrient concentration values are retained. All original initial nutrient concentration points and newly inserted interpolation points are rearranged in age order to form a new sequence containing more sampling points, increasing the number of points in this sequence to between 200 and 230. By connecting each age point in the new sequence with its corresponding nutrient concentration value, a dynamic curve of nutrient requirements covering the entire growth cycle and having higher resolution in high-variable regions is obtained. The corresponding nutrient concentration requirement value can be read at each age coordinate point on the curve.
[0038] In the feed formulation output module, based on the dynamic curve of nutritional requirements and the real-time acquired nutritional parameters of feed ingredients, the daily feed ingredient mixing ratio is determined through multi-objective optimization to form a daily feed formulation plan, which specifically includes: First, the daily nutrient target vector is extracted from the nutrient requirement dynamic curve generated in step four, based on the required nutrient concentration for the day. Specifically, the current age of the pig is determined, for example, 100 days old. The point corresponding to this age value is found on the nutrient requirement dynamic curve, and the vertical coordinate value of this point is read. This value is the required lysine concentration for the day, in grams per kilogram. Simultaneously, the nutrient concentration values of the two adjacent age points before and after the current day are further read from the curve. These five age points are arranged in chronological order of age to form a five-dimensional daily nutrient target vector. This vector comprehensively considers the nutrient requirement trend for the current day and the next few days, avoiding drastic changes in the feed ratio due to single-day fluctuations. Furthermore, real-time data on various available feed ingredients for the day is obtained from the feed warehouse management database, including eight ingredients such as corn, soybean meal, wheat bran, and premixes. Each ingredient corresponds to a nutrient parameter vector and a price parameter. The nutritional parameter vector includes five core nutritional indicators of the raw material, such as crude protein content, lysine content, and energy value. The price parameter is the purchase cost per kilogram of the raw material, expressed in yuan per kilogram.
[0039] Next, using the daily nutritional target vector as the constraint benchmark and the mixing ratio of various feed ingredients as the optimization variable, an initial optimization space containing multiple objectives to be optimized is constructed. The optimization variable is the weight percentage of each of the eight ingredients in the total mixed feed. The sum of all percentages must equal 100%, and the percentage of each ingredient must be within a preset acceptable range. For example, the lower limit for corn is 50%, and the upper limit is 80%, while the lower limit for soybean meal is 15%, and the upper limit is 30%. These ranges are preset according to animal nutrition safety limits. The optimization objectives include two aspects: The first objective is to minimize the formulation cost, which is to calculate the percentage of each of the eight raw materials, multiply them by their corresponding price parameters, and then sum the results. The smaller this value, the lower the cost. The second objective is to minimize the nutritional deviation, which is to calculate the degree of difference between the actual nutritional indicators of the mixed feed and the daily nutritional target vector. The specific calculation method is as follows: For each of the five nutritional indicators, calculate the difference between the content of that indicator in the mixed feed and the corresponding indicator value in the daily nutritional target vector, square the difference, sum the results, and then divide by the weight coefficients corresponding to the five indicators to obtain the weighted sum of squares. The smaller this value, the closer the nutritional content of the mixed feed is to the target requirement.
[0040] Then, multiple candidate mixing ratio solutions are randomly generated in the initial optimization space. One thousand sets of candidate mixing ratio solutions are generated using a random number generation method. Each set of solutions corresponds to eight percentage values for eight raw materials. During generation, it must be ensured that the sum of the eight percentages within each set is 100%, and that each percentage falls within the preset acceptable range for its respective raw material. For each set of candidate mixing ratio solutions, the corresponding formula cost value and nutritional deviation value are calculated according to the calculation methods of the two objective functions mentioned above. Thus, each set of candidate solutions can be represented as a point on a two-dimensional plane with formula cost as the x-axis and nutritional deviation as the y-axis.
[0041] The non-dominated frontier solution set is identified based on the distribution of each candidate solution on the cost-deviation two-dimensional plane. The specific identification rule is as follows: for any two candidate solutions A and B, if the formulation cost of solution A is less than or equal to the formulation cost of solution B, and the nutrient deviation of solution A is less than or equal to the nutrient deviation of solution B, and at least one of these two inequalities is a strictly less-than relationship, then solution A is said to dominate solution B. All one thousand candidate solutions are traversed to find all solutions not dominated by any other solution; these solutions constitute the first layer of non-dominated frontiers. After removing these solutions from the candidate solution set, the above process is repeated for the remaining solutions to find the second layer of non-dominated frontiers. Only the solutions on the first layer of non-dominated frontiers are retained as the candidate set for subsequent selection. Solutions on this frontier cannot further improve both the objectives of reducing cost and reducing nutrient deviation simultaneously; that is, they cannot reduce deviation without increasing cost, nor can they reduce cost without increasing deviation.
[0042] Finally, candidate mixing ratios are selected from the non-dominated frontier solution set whose slope of the line connecting to the origin is equal to the preset nutrient-cost tradeoff slope, and these are used as the daily feed ingredient mixing ratios. The preset nutrient-cost tradeoff slope is determined based on the farm's operating strategy and is set to -0.005, meaning that in the cost-deviation two-dimensional plane, for every unit reduction in nutrient deviation, an acceptable cost increase of no more than 0.005 yuan per kilogram is acceptable. For each solution on the first layer of the non-dominated frontier surface, the slope of the line connecting that solution to the origin is calculated, which is the formula cost value of that solution divided by the nutrient deviation value of that solution. Then, among all frontier solutions, the solution with the smallest absolute value of the difference between this slope value and the preset tradeoff slope is searched. The percentage values of the eight ingredients corresponding to this solution are used as the daily feed ingredient mixing ratios. Based on these mixing ratios and the total planned feeding amount for the day, the required weight of each ingredient for the day is calculated, forming a daily feed quantitative formulation plan that includes the ingredient name, percentage ratio, and feeding weight. This plan is then sent to the feed mixing equipment for production.
[0043] The working principle of this invention is as follows: First, time-series basic data, including environmental monitoring data, individual pig growth data, and feed feeding data, are collected from multiple reference farms throughout the complete breeding cycle. These data are then divided into several differentiated training task sets based on the geographical and climatic characteristics of the farms and the pig breeds. Next, the training task sets are input into an iteratively optimized parameter learning framework. An initial parameter combination is determined through cross-task gradient updates. This initial parameter combination is configured to converge quickly to a parameter state suitable for the new scenario through a limited number of iterations when only a small amount of new sample data is encountered. Then, a small amount of measured sample data from the target farm at the initial production stage is obtained. Starting from the initial parameter combination, parameters are fine-tuned to generate a specific parameter combination adapted to the current environment and pig state of the target farm. This specific parameter combination is then combined with the predicted environmental data of the target farm throughout its entire growth cycle. A dynamic nutrient requirement curve, representing the required nutrient concentration at different time points throughout the pig's growth cycle, is generated through continuous function mapping. Finally, based on the dynamic nutrient requirement curve and the real-time acquired feed ingredient nutrient parameters, the daily feed ingredient mixing ratio is determined through multi-objective optimization, forming a daily feed quantitative formulation scheme. This invention solves the problem of model cold start failure caused by data scarcity in newly built farms, and realizes rapid adaptive precision feeding across regions and species.
[0044] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A big data-based intelligent quantitative proportioning management system for pig feed, characterized in that: include: Data acquisition and task set construction module: Collect time-series basic data from multiple reference farms during the complete breeding cycle. The time-series basic data includes environmental monitoring data, individual pig growth data, and corresponding feed feeding data. Based on the geographical and climatic characteristics of the farms and the pig breeds, the time-series basic data is divided into several differentiated training task sets. Initial parameter combination determination module: Input the training task set into the iteratively optimized parameter learning framework, and determine the initial parameter combination through cross-task gradient update. The initial parameter combination is configured to converge quickly to the parameter state that adapts to the new scenario through a finite number of iterations when only a small amount of new sample data is encountered. Target scenario parameter adaptive module: Obtain a small amount of measured sample data of the target farm in the early stage of production, take the initial parameter combination as the starting point, fine-tune the parameters based on the small amount of measured sample data, and generate a special parameter combination that is adapted to the current environment and pig status of the target farm; The nutrient requirement dynamic curve generation module combines a set of special parameters with the predicted environmental data of the target farm throughout the entire growth cycle. It generates a dynamic curve of nutrient requirements for pigs throughout the entire growth cycle through continuous function mapping. The dynamic curve of nutrient requirements represents the nutrient concentration required at different time points. Feed quantitative formulation output module: Based on the dynamic curve of nutritional requirements and the real-time acquired nutritional parameters of feed ingredients, the daily feed ingredient mixing ratio is determined through multi-objective optimization to form a daily feed quantitative formulation plan.
2. The intelligent quantitative proportioning management system for pig feed based on big data as described in claim 1, characterized in that, The method of determining the initial parameter combination through cross-task gradient update specifically includes: Multiple training tasks are randomly selected from the training task set, and each training task contains a supporting data part and a query data part. For each selected training task, the temporary parameter combination corresponding to the training task is calculated by gradient descent based on the support data of the training task. The temporary parameter combinations corresponding to each training task are applied to the corresponding query data parts respectively, and the comprehensive loss value of all query data parts is calculated. The initial parameter combination is updated by gradient backpropagation based on the comprehensive loss value, and this process is repeated until the initial parameter combination meets the preset convergence condition.
3. The intelligent quantitative proportioning management system for pig feed based on big data as described in claim 2, characterized in that, The calculation process for the comprehensive loss value is as follows: The temporary parameter combinations corresponding to each training task are loaded into the initial network, and the query data part of the corresponding training task is input to obtain the predicted output value corresponding to each query data part. Calculate the difference between the predicted output value and the actual collected value for each part of the query data to obtain the individual loss value for each training task; The weight coefficients for each training task are calculated based on the individual loss values corresponding to each training task. The weight coefficients are positively correlated with the magnitude of the individual loss values. The individual loss values corresponding to each training task are weighted and summed according to their respective weight coefficients to obtain the comprehensive loss value.
4. The intelligent quantitative proportioning management system for pig feed based on big data as described in claim 1, characterized in that, The process for generating the specific parameter combination is as follows: A small amount of measured sample data is divided into multiple micro-batches, each micro-batch containing at least one sample; Input the current micro-batch into the current network constructed based on the initial parameter combination, calculate the predicted loss value corresponding to the current micro-batch, and obtain the updated parameter combination through gradient backpropagation based on the predicted loss value. Calculate the difference between the updated parameter combination and the initial parameter combination in each parameter dimension to obtain the parameter offset vector; The adaptive step size coefficient is determined based on the magnitude of the parameter offset vector, and the parameter combination after the first update is constrained and adjusted based on the adaptive step size coefficient to generate a dedicated parameter combination.
5. The intelligent quantitative proportioning management system for pig feed based on big data according to claim 4, characterized in that, The process of obtaining the parameter offset vector is as follows: Get the first value of each parameter dimension in the updated parameter combination, and the second value of each corresponding parameter dimension in the initial parameter combination; The initial difference components of each parameter dimension are obtained by subtracting the first value of each parameter dimension from the second value of the corresponding parameter dimension in each dimension. The initial difference components of each parameter dimension are normalized to obtain the normalized difference components of each parameter dimension. The normalization process is determined based on the numerical distribution range of the corresponding parameter dimension in the entire network. The normalized difference components of all parameter dimensions are combined in the order of the original parameter dimensions to form a parameter offset vector.
6. The intelligent quantitative proportioning management system for pig feed based on big data as described in claim 1, characterized in that, The process of generating the demand dynamic curve is as follows: Arrange the predicted environmental data of the target farm throughout the entire cycle in chronological order to construct an environmental time series, and use each time point in the environmental time series as a coordinate point to be queried; The special parameters are combined and loaded into the continuous mapping network, which takes time coordinates and environmental data as joint inputs and nutrient concentration as output. Each coordinate point to be queried is sequentially input into the continuous mapping network after loading the special parameter combination to obtain the initial nutrient concentration value corresponding to each time point. At the same time, the concentration change rate is calculated based on the initial nutrient concentration values of adjacent time points, and the interpolation weight of key time points is determined based on the concentration change rate. Adaptive and encrypted interpolation of initial nutrient concentration values is performed based on interpolation weights at key time points to generate dynamic nutrient demand curves covering the entire growth cycle.
7. The intelligent quantitative proportioning management system for pig feed based on big data as described in claim 6, characterized in that, The determination of interpolation weights at key time points based on the concentration change rate specifically includes: By iterating through all adjacent time points, the initial nutrient concentration value of the previous time point is subtracted from the initial nutrient concentration value of the next time point to obtain the absolute value of the concentration change rate corresponding to each time interval. Sort all absolute values of concentration change rate in descending order of numerical value, and select the time interval with the first preset proportion in the sort as the high change rate interval; Calculate the mean nutrient concentration values at both ends of each high rate of change interval, and determine the initial interpolation weights for each high rate of change interval based on the degree of deviation between the mean nutrient concentration values and the global mean nutrient concentration values. The initial interpolation weights for each high rate of change interval are normalized so that the sum of the interpolation weights for all high rate of change intervals is a preset fixed value, thus obtaining the final interpolation weights for key time points.
8. The intelligent quantitative proportioning management system for pig feed based on big data as described in claim 1, characterized in that, The formation of the daily feed quantitative ratio plan specifically includes: Based on the required nutrient concentration for the day, the daily nutrient target vector is extracted from the nutrient demand dynamic curve, and the nutrient parameter vectors and price parameters corresponding to the various feed ingredients available for the day are obtained. Using the daily nutritional target vector as the constraint benchmark and the mixing ratio of various feed ingredients as the optimization variable, an initial optimization space containing multiple optimization objectives is constructed. These multiple optimization objectives include at least minimizing formula cost and minimizing nutritional deviation. Multiple candidate mixing ratio solutions are randomly generated in the initial optimization space. The formulation cost value and nutrient deviation value corresponding to each candidate mixing ratio solution are calculated respectively. The non-dominated frontier solution set is identified based on the distribution position of each candidate solution on the cost-deviation two-dimensional plane. From the solution set of the non-dominated frontier, select candidate mixing ratio solutions whose slope of the line connecting to the origin is equal to the preset nutrient-cost trade-off slope, and use them as the mixing ratio of feed ingredients for the day to form the daily feed quantitative formulation scheme.