Pig daily feed formula optimization method based on improved SOA
By combining the improved snake optimization algorithm (EISOA) with Latin hypercube sampling and elite guidance mechanism, the amino acid requirements are dynamically adjusted, which solves the problems of insufficient amino acid utilization and high cost in pig feed formulation, realizes full-stage optimization, reduces feed costs and improves utilization efficiency.
Patent Information
- Application Number
- CN202511647611.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-02-13
AI Technical Summary
While existing pig feed formulation optimization technologies can meet the nutritional needs of different growth stages, they suffer from problems such as insufficient amino acid utilization, high costs, and environmental pollution, and lack a continuous optimization mechanism on a daily scale.
An improved snake optimization algorithm (EISOA) is adopted, which combines Latin hypercube sampling, interactive learning mechanism and elite guidance mechanism to dynamically adjust amino acid requirements. The fitness function is constructed through exponential decay model to optimize the pig diet formula and realize a continuous and feasible solution at the whole stage and daily scale.
It significantly reduces feed costs by 7%–15%, improves amino acid utilization, optimizes raw material ratios, and enhances feed utilization efficiency and economic benefits. It is suitable for optimizing feed formulations for pigs and other livestock.
Smart Images

Figure CN121528355A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of pig feed formula optimization, more specifically, to a pig daily feed formula optimization method based on improved SOA. BACKGROUND
[0002] In the research of pig feed formula, the utilization rate of amino acids not only determines the nutrition of feed, but also directly affects the economic benefits of breeding. Total amino acid (TAA) or apparent ileal digestible amino acid (AID) is a commonly used reference index in traditional evaluation methods. Because it does not exclude the loss of endogenous amino acids, it often overestimates the actual utilization rate of amino acids, making it difficult to accurately reflect the real contribution of feed formula to production performance and economic benefits. Therefore, standardized ileal digestible amino acid (SID) is introduced into the daily feed formula optimization research.
[0003] In actual research, how to meet the nutritional needs of different growth stages while minimizing costs has been a core problem for a long time. Specifically, excessive intake of key amino acids such as crude protein, phosphorus, and lysine can lead to decreased feed utilization efficiency, increased costs, and high nitrogen emissions. To solve this problem, Ferreira's team proposed a simplified daily ration fitting model (Daily Fit Model, DFM). This model achieves daily dynamic adjustment of daily ration by prospectively mixing the next stage of daily ration in the stage feeding. Studies have shown that DFM can significantly reduce the intake of crude protein and digestible phosphorus, and reduce feed costs by about 2.4%. However, although traditional daily ration formula can reduce nitrogen emissions, the lack of amino acid utilization is still a bottleneck. Remus et al. used a precision feeding system to reduce lysine supply by 26%, while reducing nitrogen emissions by about 30% and feed costs by 10%. Pomar et al. further used a daily ration model of low protein combined with crystalline amino acids, which increased nitrogen utilization by 54% while significantly improving the utilization efficiency of crude protein and lysine. However, low-protein daily ration is prone to affect the development of pigs due to imbalanced amino acid balance in practical application. To this end, Liu Yaojun's team proved that reducing protein levels can not only maintain growth performance, but also reduce environmental pollution by reasonably supplementing essential amino acids. On the other hand, different pig populations have different mineral requirements, making feed regulation more complex. When conducting experiments on 25-125 kg growing and finishing pigs, Wei Jingjing et al. found that different effective phosphorus levels significantly affect nutrient deposition, and appropriate supply levels can improve production performance while reducing excessive mineral addition, providing a basis for precise regulation of phosphorus in daily ration. SUMMARY
[0004] Existing research has made significant progress in nutritional balance, cost control, and environmental friendliness, but most studies focus on phased feeding patterns and lack mechanism designs for continuous optimization at the daily scale. Based on this, this invention proposes EISOA, which integrates Latin hypercube sampling initialization, interactive learning mechanisms, and elite guidance mechanisms to balance amino acid supply and demand and control costs, achieving a continuously implementable diet optimization program across all phases and at the daily scale.
[0005] To achieve the above objectives, the present invention provides the following technical solution: The method for optimizing daily feed formulation for pigs based on improved SOA includes the following steps: Step 1: A method for optimizing daily feed for pigs with the goal of minimizing feed costs was constructed. The method takes the SID amino acid requirement of pigs at different body weights as the main constraint, and adds upper and lower limits of raw material ratio constraints and total formula constraints. The SID amino acid constraint is dynamically calculated through an exponential decay model to adjust the target value of amino acid requirement in real time according to the continuous change of pig body weight. Based on this, a penalty term is introduced to construct a fitness function so that solutions that violate nutritional constraints are automatically eliminated during the search process. Step 2: Subsequently, an improved snake optimization algorithm is used to solve the problem. While retaining the original SOA (Sexuality of Affected ...
[0006] A further optimization of this technical solution involves the introduction of an exponential decay model, defined as follows:
[0007] in For the first Individual weight (kg) For weight Next Percentage of SID amino acids, For the first The initial demand intensity of each amino acid, For the first The decay rate of each amino acid, For the first The stable requirement level of each amino acid.
[0008] The further optimization of the technical solution comprises the following: the constraint conditions include upper and lower limits of the amount of raw materials, SID amino acid requirement corresponding to daily weight gain, and total constraint of the sum of proportions of all raw materials being 1.
[0009] The further optimization of the technical solution comprises the following: the objective function aiming at minimizing the cost of feed is as follows: In the formula, is the price of each raw material, is the proportion of different raw materials in 1 kg of feed formula.
[0010] The further optimization of the technical solution comprises the following: the fitness function is as follows: In the formula: is a penalty term for punishing solutions that do not meet the constraint conditions, a calculation formula of SID amino acids, total number of raw materials, number of amino acid types, the first amino acid content (%) in the raw material, the first amino acid in the raw material, the first amino acid in the raw material, total penalty strength adjustment factor, is a total proportion constraint penalty term, is an SID amino acid constraint penalty term, is a raw material proportion upper and lower limit constraint penalty term, which is defined as follows: In the formula: , the first raw material proportion upper and lower limit, , the first amino acid target SID range, , , the proportion of each type of constraint penalty.
[0011] The further optimization of the technical solution comprises the following: the Latin hypercube sampling initializes the population, divides each raw material proportion interval into non-overlapping sub-intervals, and randomly selects a point in each interval, thereby ensuring that the proportions of each raw material are uniformly covered in the entire defined domain, and the mathematical form is as follows:
[0012] In the formula: represents the initial position of the candidate formula in the first raw material dimension, respectively, the upper and lower limits of the raw material proportion, is the hierarchical number, is the population size.
[0013] Further optimization of the technical solution, the interactive learning mechanism makes individuals update at the same time draw on the information of the global optimal solution and multiple high-quality solutions,
[0014] In the formula: is the global optimal formula, is a randomly selected high-quality individual, respectively, the two types of guidance intensity coefficients.
[0015] Further optimization of the technical solution, the elite guidance mechanism uses the information of the historical optimal formula to guide the update direction of other individuals, and applies disturbance near the elite solution to enhance the local search ability.
[0016]
[0017] In the formula: is the position of the elite individual, is the elite guidance coefficient, is a disturbance term subject to a normal distribution, used for local search near the elite.
[0018] Unlike the prior art, the above technical solution has the following beneficial effects: 1. Dynamic constraint modeling: By introducing an exponential decay model into the fitness function, a dynamic mapping between pig body weight and standardized ileal digestible amino acid (SID) requirements is achieved, which can automatically adjust the nutritional constraint parameters according to the continuous change in body weight, thereby avoiding the problem that traditional stage-based fixed constraint models cannot accurately reflect individual nutritional requirements.
[0019] 2. Optimization search performance improvement: The improved snake optimization algorithm maintains the biological behavior mechanism of SOA, introduces Latin hypercube sampling, interactive learning mechanism and elite guidance mechanism, so that the population search covers more comprehensively, the information interaction is more sufficient, and the convergence path is more stable; this improvement significantly enhances the global exploration ability and local development ability of the algorithm, effectively avoiding the phenomenon of premature convergence in the search process.
[0020] 3. Significant economic benefits: In the optimization of daily feed formulation for pigs, the optimal formulation obtained by the EISOA algorithm can reduce feed costs by an average of 7%–15% while meeting the SID amino acid requirements, reduce cost curve fluctuations, and improve feed utilization efficiency, thus having significant economic application value.
[0021] 4. Intelligence and scalability: This method can be integrated with existing livestock management platforms or feed formulation software to achieve automatic formulation adjustment for pigs at different stages; its algorithm framework is suitable for multi-constraint, nonlinear, and multi-stage optimization problems, and can be extended to other livestock feed formulation optimization fields such as poultry and aquaculture. Attached Figure Description
[0022] Figure 1 Fitted curves of amino acids at different weight stages of pigs; Figure 2 Test function convergence curve; Figure 3 The cost optimization curve for feed formulation of pigs throughout all stages based on EISOA; Figure 4 The proportions and prices of raw materials in feed at each stage; Figure 5 The amino acid content in the feed; Figure 6 The standard ileal digestibility of amino acids in pig feed; Figure 7 This is a test function for CEC2022. Detailed Implementation
[0023] To explain in detail the technical content, structural features, objectives, and effects of the technical solution, the following description is provided in conjunction with specific embodiments and accompanying drawings.
[0024] Based on the daily weight of pigs and the amino acid requirements of different weights, the pig diet formula is optimized to avoid nutritional deficiencies caused by overestimating utilization rates and to prevent waste caused by excessive addition of protein raw materials. While ensuring growth performance, feed utilization efficiency is improved, feed costs are reduced, and the overall economic benefits of breeding are ultimately enhanced.
[0025] The method for optimizing daily feed formulation for pigs based on improved SOA is as follows: Step 1: A method for optimizing daily feed for pigs with the goal of minimizing feed costs was constructed. The method takes the standardized ileal digestible amino acid (SIDAA) requirements of pigs at different body weights as the main constraint, and adds upper and lower limits of raw material ratio constraints and total formula constraints. Among them, the SIDAA constraint is dynamically calculated through an exponential decay model to adjust the amino acid requirement target value in real time according to the continuous changes in pig body weight. Based on this, a penalty term is introduced to construct a fitness function so that solutions that violate nutritional constraints are automatically eliminated during the search process. Amino acid requirements for lean pigs vary significantly across different weight stages. Standardized ileal digestible amino acids (SID AA), as an evaluation index that eliminates endogenous losses, can more accurately reflect the true utilization rate of amino acids. Table 1 shows the SID AA requirements for lean pigs at different weight stages from 3 to 120 kg. It can be seen that the requirements for all essential amino acids decrease with increasing weight, but the magnitude and pattern of this decrease are not entirely consistent. Lysine (Lys), as the most limiting amino acid, has a requirement as high as 1.42% in the 3–8 kg stage, gradually decreasing to 0.60% in the large pig stage (100–120 kg); while the requirement for methionine (Met) is relatively low, decreasing from 0.41% to 0.17%. Furthermore, the requirements for amino acids such as tryptophan (Trp), threonine (Thr), and valine (Val) remain relatively high during the nursery and growth stages, reflecting their crucial role in growth rate.
[0026] Table 1. SID Requirements for Lean-type Pigs
[0027] Overall, the 3–25 kg stage is the peak period for amino acid demand, especially lysine, leucine, and threonine, which are closely related to rapid growth and muscle deposition. The 25–75 kg stage is a period of gradual decline, during which amino acid demand decreases significantly, but a relatively high balance level still needs to be maintained to support the continued development of bones and muscles. The 75–120 kg stage enters a period of stable low demand, with amino acid levels maintained in a lower range, emphasizing the matching of energy supply and nitrogen deposition efficiency.
[0028] SID amino acid demand curve fitting Table 1 shows that the amino acid requirements of lean-type pigs decrease significantly at different weight stages, and the rate of decrease is closely related to the initial requirement level. To accurately characterize this trend, this invention introduces an exponential decay model to mathematically model the amino acid requirements. Based on the standard data in Table 1, six typical body weights (5.5, 15, 30, 50, 80, and 110 kg) were selected to fit the amino acid requirements for 10 essential amino acids: lysine, tryptophan, threonine, methionine, cysteine, leucine, isoleucine, valine, phenylalanine, and histidine. The exponential decay model is defined as follows:
[0029] in For the first Individual weight (kg) For weight Next Percentage of SID amino acids, For the first The initial demand intensity of each amino acid, For the first The decay rate of each amino acid, For the first The stable requirement level of each amino acid.
[0030] See Figure 1 The figure shows the amino acid fitting curves for different weight stages of pigs. Figure 1 The fitting results are presented. The results show that the exponential decay model can effectively capture the dynamic changes in amino acid requirements of pigs at different growth stages. Lysine, threonine, and methionine have higher requirements in the 0–25 kg stage, with a significant decrease, followed by a gradual stabilization. Tryptophan, valine, and isoleucine show moderate decay, with smooth overall demand curves and moderate rates of decline, indicating sustained demand at all stages. Leucine and phenylalanine decrease rapidly in the early stages, gradually slowing down in the middle and later stages, and eventually maintaining a high level. Cystine and histidine show relatively smaller decreases and flatter curves, demonstrating strong stability and playing a supporting role in the overall amino acid balance.
[0031] Optimize daily feed formulations for different body weight stages Because daily weight gain varies significantly during pig growth, their nutritional requirements adjust continuously with changes in body weight. Therefore, minimizing formulation cost is the optimization objective, and several constraints are introduced, including: upper and lower limits on raw material usage, SID amino acid requirements corresponding to daily weight gain, and a total quantity constraint that the sum of all raw material proportions is 1. A fitness function is constructed based on these conditions to systematically evaluate daily formulation schemes and generate daily-scale optimal formulations covering the entire growth stage. The defined objective function is as follows: In this formula, The price of each raw material, This represents the proportion of different ingredients in 1 kg of feed formulation. The fitness function is defined as follows: In the formula: This is a penalty term used to penalize solutions that do not meet the constraints. —The formula for calculating SID amino acids, —Total amount of raw materials, —Number of amino acid types, —No. The first of the raw materials The content of each amino acid (%) —No. The first of the raw materials The digestibility of each amino acid —Total penalty intensity adjustment factor, It is a penalty term for the total proportion constraint. It is a SID amino acid constraint penalty term. These are the upper and lower limits of raw material ratio constraint penalties, defined as follows: In the formula: , —No. The upper and lower limits of the proportion of the raw materials , —No. The target SID range for each amino acid. , , —The weight of penalties for each type of constraint. (From Table 1) Figure 4 It can be seen that in this experiment =13, =10. The range of values for the content of each raw material and the range of SID amino acids are based on the recommended values, with a fluctuation of 10% above and below. Taking corn for piglets in the early nursery feed as an example, its content is 38.4%, then the corresponding lower limit is... and upper limit . Set them to 50, 500, 200, and 100 respectively.
[0032] Step 2: Subsequently, an improved snake optimization algorithm is used to solve the fitness function of the introduced exponential decay model. While retaining the original SOA (Sexuality of Animals) male-female classification and explore-development framework, the algorithm introduces Latin hypercube sampling to improve the diversity of the initial population. In the exploration phase, an interactive learning mechanism allows individuals to simultaneously reference information from the global optimum and high-quality candidate solutions, thereby enhancing the group's collaborative search ability. In the development phase, an elite guidance mechanism propels individuals closer to the global optimum, combined with elite perturbation to avoid stagnation. Through iterative updates, candidate formulations in the population gradually evolve, and the raw material ratios gradually converge to a feasible solution that satisfies the SID amino acid constraint and has a cost advantage. The final optimal individual output is the optimized feed formulation for the target stage, which can be directly applied to pig diet design.
[0033] Snake optimization algorithm SOA (Swarm Optimization) is a swarm intelligence optimization algorithm inspired by the foraging and reproductive behaviors of snakes. This algorithm divides the optimization process into three phases: initialization, exploration, and development. By simulating the activity patterns of snakes under different environmental conditions, it guides the population to search for the optimal solution in the solution space. The SOA algorithm is defined as follows: Individual: A solution vector in the search space; a combination of feed ingredient proportions (e.g., a proportion vector of 13 ingredients).
[0034] Population: A set of multiple candidate solutions that exist simultaneously in multiple feed formulation candidate schemes.
[0035] Dimension: Number of decision variables, such as the number of types of feed ingredients (e.g., corn, soybean meal, rice bran meal, malt root, etc.).
[0036] Female / Male individuals: Two different search strategies (different behavioral characteristics). Two search subgroups, each using different update formulas to enhance diversity (not the actual meaning of gender).
[0037] Temperature: A global parameter search intensity adjustment factor that controls the ratio of exploration to development. It is used to control the global search in the early stage of iteration and the local convergence in the later stage (it has no actual physical temperature significance).
[0038] Food factors: Dynamic parameter algorithm control variables that affect the snake's movement direction. They are used to randomly adjust the search range or the attraction intensity of "food location", and can be compared with the "target guidance weight" in feed formula search.
[0039] Competition / Mating: Inter-individual interactions involve information exchange, combination, and local optimization of candidate formulations to generate better solutions.
[0040] Egg / Newborn Individual: Newly generated solutions (maintaining diversity) Newly randomly initialized recipe combinations to prevent premature convergence of the algorithm.
[0041] First, generate a size of The initial population, the location of each individual Calculated using the following formula: In the formula, r is a random number in the interval [0,1]. and These represent the upper and lower bounds of each dimension. The population is then divided into female individuals according to a preset ratio. Number of male individuals ,make .
[0042] Introducing temperature factor and food factor It simulates the dynamic changes in climate and food supply in nature to regulate the balance between global exploration and local development.
[0043]
[0044] when This indicates that the population is in an active foraging state, and the snakes are searching for food by selecting random locations, entering the exploration phase. The location updates for females and males are calculated as follows:
[0045] In the formula, and These represent the locations of randomly selected male and female individuals within the population. It is a constant. Parameter and The method for adjusting the range of movement of an individual is as follows:
[0046] During the development phase, the behavior of snakes was simulated under conditions of abundant food and competition. When food is plentiful and Temp > 0.6, snakes will only move to food, and individuals will approach the currently known optimal solution.
[0047] In the formula, Indicates the location of the snake. It is the position of the optimal individual. .
[0048] When Temp < 0.6, competitive behavior occurs within the snake group. Males and females approach the currently best individual of the opposite sex, and after competition, they pair up. During pairing, the male / female pair is ranked according to their reproductive capacity coefficient. , Mutual influence on position updates, competitive updates are as follows: Mating pattern: In the formula, and These represent the optimal individual positions within the female and male groups, respectively. FM and FF are combat ability coefficients. It is a food factor.
[0049] If eggs are produced after mating and hatch, new individuals are generated using a random initialization method, replacing the worst individuals in the male / female populations respectively using the following formula. , Maintain diversity and avoid premature convergence.
[0050]
[0051] Multi-strategy enhanced snake optimization algorithm SOA, as a novel intelligent optimization algorithm, still has certain shortcomings in solving complex, multi-constraint problems. In feed formulation optimization, directly applying SOA can lead to the following issues: First, the population initialization uses random sampling, leaving some raw material ratio ranges uncovered. This results in early solutions focusing on commonly used raw materials like corn and soybean meal, while neglecting alternatives such as rice bran and wheat germ, reducing solution diversity. Second, inter-individual communication relies solely on sex-based populations or the global optimum, easily leading to local optima like "corn-soybean meal," neglecting the role of other raw materials in amino acid supply and cost control. Third, under complex constraints such as SID amino acids and raw material upper and lower limits, SOA's local exploitation capabilities are insufficient, resulting in slow convergence and poor stability of the generated formulation.
[0052] The Elite-guided Interactive Learning Enhanced Snake Optimization Algorithm (EISOA) improves upon the SOA explore-develop framework in several ways to enhance optimization performance. First, a Latin hypercube sampling method is introduced during population initialization, resulting in a more uniform distribution of candidate solutions in the search space and avoiding insufficient initial diversity that might result from random initialization. During iterative updates, individuals in the exploration phase not only rely on local reference individuals based on sex division but also interact with the global optimum and high-quality candidate solutions. This information-sharing mechanism effectively enhances the population's collaborative search capability, leading to a more reasonable trade-off between cost and nutritional constraints in candidate formulations. In the development phase, the algorithm uses an elite-guided strategy to guide individuals towards the global optimum, applying elite perturbations to finely adjust solutions within the local space. Through these improvements, the Elite-guided Interactive Learning Enhanced Snake Optimization Algorithm achieves a dynamic balance between exploration and development, gradually converging the ingredient ratios to a high-quality solution set that satisfies SID amino acid requirements while maintaining cost advantages, thus yielding optimized formulations directly applicable to pig diet design.
[0053] 1. Latin hypercube sampling initialization (population initialization phase) In feed formulation optimization, the random initialization used in SOA often results in the proportions of some raw materials (such as rice bran meal and fermented soybean meal) remaining unexplored for a long time, reducing the effectiveness of early global search. EISOA uses Latin Hypercube Sampling (LHS) to initialize the population, dividing each raw material proportion range into N non-overlapping sub-ranges, and randomly selecting a point within each range, thereby ensuring that the proportions of each raw material are uniformly covered throughout the entire domain. Its mathematical form is: In the formula: Indicates the first The candidate formulation in the first The initial position of the raw material dimension. , These are the upper and lower limits of the proportion of this raw material. For layered numbering, For population size. This method ensures that all raw materials, such as corn, soybean meal, rice bran meal, and malt root, are covered during the initialization phase, significantly improving early exploration capabilities and preventing the population from favoring a few high-frequency raw material combinations.
[0054] 2. Interactive learning mechanism (exploration phase updates the main SOA formula + interactive learning add-ons) In SOA, male and female individuals primarily refer to the best individuals in the current population for updates, resulting in limited information exchange and a tendency to fall into local optima where "high nutrition comes at a high cost" or "low cost comes at a low cost." To enhance collaboration among different candidate solutions, EISOA introduces an interactive learning mechanism, enabling individuals to simultaneously draw upon information from the global optimum and multiple high-quality solutions during updates.
[0055] In the formula: This is the globally optimal formula. These are randomly selected high-quality individuals. , These are two types of guidance strength coefficients. In feed optimization, this mechanism enables the algorithm to simultaneously learn the advantages of high-lysine formulations and low-cost formulations, ultimately generating a balanced solution that satisfies SID amino acid constraints while reducing costs.
[0056] 3. Elite guidance mechanism (adding additional local perturbations of elites in the later stages (convergence stagnation)) SOA has limited local exploration capabilities under complex constraints, often causing cost optimization to stagnate near suboptimal solutions. To address this, EISOA introduces an elite-guided exploration mechanism, which uses information from historical best recipes to guide the update direction of other individuals and applies perturbations near elite solutions to enhance local search capabilities.
[0057] In the formula: Positions for elite individuals As an elite guidance coefficient, The perturbation term follows a normal distribution and is used for local search in the vicinity of elites.
[0058] EISOA Algorithm Test To comprehensively evaluate the performance of the improved algorithm EISOA, the CEC2022 benchmark test function set was used as the test set for simulation experiments. This test set contains 12 representative functions, covering diverse optimization scenarios from unimodal functions to complex combined functions, effectively verifying the algorithm's adaptability and stability under different search space structures. Specifically, F1 is the unimodal test function; F2–F5 are multimodal basic functions; F6–F8 are mixed functions; and F9–F12 are combined functions. See [link to detailed function information] for more information. Figure 7 .
[0059] Four representative metaheuristic algorithms were selected as controls for the experiment: Snake Optimization Algorithm (SOA), Whale Optimization Algorithm (WOA), Harris Eagle Optimization Algorithm (HHO), and Particle Swarm Optimization (PSO). Six typical functions (F1, F2, F3, F6, F11, F12) were selected for the experiment in the CEC2022 test set. All algorithms used the same parameter settings: population size of 50, maximum number of iterations of 1000, and problem dimension fixed at 20. Each algorithm was run independently 30 times to reduce the impact of randomness, and the average fitness value was calculated for each algorithm. ) and standard deviation The parameter values for each algorithm in the experiment are shown in Table 2. The experimental results are shown in Table 3.
[0060] Table 2 Algorithm Parameter Table
[0061] Table 3 Statistical Table of Test Results
[0062] Experimental results show that, in terms of accuracy indicators In the above tests, EISOA achieved the best results on all six test functions, with an overall average ranking of 1.00, significantly outperforming SOA (2.17), HHO (3.33), PSO (3.50), and WOA (5.00). This table demonstrates that the improved mechanism effectively enhances the algorithm's global optimization capability, enabling it to obtain better solutions in different types of search spaces. Stability Indicators In terms of performance, EISOA achieved the lowest standard deviation across the five functions, ranked second on F6, and had an overall average score of 1.17, which is also better than SOA (2.17), HHO (3.17), PSO (3.50), and WOA (5.00). This result demonstrates that ESOA maintains consistency and robustness in multiple independent runs.
[0063] Evaluation of Algorithm Convergence Characteristics To analyze the convergence performance of EISOA under different optimization scenarios, iteration-fitness curves were plotted for six objective functions on the CEC2022 test set, as follows: Figure 2 As shown. By Figure 2 As can be seen, EISOA exhibits extremely fast convergence speed in the unimodal function F1, rapidly approaching the global optimum in the early iteration stages. In the multimodal functions F2 and F3, EISOA effectively escapes local optima traps and maintains a steady downward trend, ultimately achieving higher accuracy than the compared algorithms. In the mixed function F6, EISOA maintains a stable convergence trend, preserving good diversity in the complexly coupled search space and achieving continuous optimization through an elite-guided mechanism. In the combined functions F11 and F12, EISOA can incorporate multi-stage search strategies, rapidly reducing fitness in the early stages and continuing refined development in the mid-to-late stages, thus obtaining superior final solution quality. In challenging combined functions such as F12, EISOA's convergence accuracy and stability are significantly better than the other algorithms.
[0064] The pig feed data used in this implementation was derived from formulation information provided by a certain company, and the amino acid content and digestibility of each ingredient were determined with reference to the "Chinese Feed Composition and Nutritional Value Table" (35th edition, 2024). A total of 13 ingredients were used, including corn, flour, soybean meal, malt root, extruded soybeans, and premixed feed; their nutritional components covered the content and digestibility of 10 essential amino acids, including lysine and methionine. The feed was divided into four stages according to the pig's growth stage: early nursery feed, late nursery feed, growing pig feed, and finishing pig feed. Specific feed ingredient information from the company is as follows: Figure 4 Amino acid content, such as Figure 5 Amino acid digestibility, such as Figure 6 As shown.
[0065] Figure 5Ten essential amino acids in pigs have a direct impact on growth performance, immune function, and production efficiency: Lysine, as the first limiting amino acid, directly limits the rate of protein deposition and affects daily weight gain; Methionine and Cystine participate in the synthesis of sulfur-containing compounds, promote muscle development, and enhance antioxidant capacity; Threonine is crucial for intestinal mucosal repair and immunoglobulin production, and its deficiency reduces feed conversion rate; Tryptophan can improve feed intake, alleviate stress, and maintain growth stability; Valine, Isoleucine, and Leucine play a central role in muscle protein synthesis, energy metabolism, and tissue repair; Phenylalanine is a precursor for the synthesis of tyrosine and various hormones, affecting growth and reproductive performance; Histidine participates in hemoglobin production, affecting oxygen transport and growth rate.
[0066] Analysis of Daily Feed Formulation Optimization Results Depend on Figure 4 As can be seen, the pig feed formulation in this study is divided into four stages: 0–10 kg for the early nursery stage, 10–25 kg for the late nursery stage, 25–70 kg for the growing pigs, and 70–120 kg for the finishing pigs. For the optimization of the formulation at each stage, the snake optimization algorithm (SOA) and the improved multi-strategy augmented snake optimization algorithm (EISOA) were used for solution and performance comparison. Taking the growing pig feed at 50 kg body weight as an example, the optimization results are shown in Table 4. This study dynamically adjusts the SID amino acid requirement based on the daily changes in pig body weight and simultaneously generates the lowest cost formulation for the day, forming a closed-loop decision of "daily body weight—daily SID requirement—daily cost-optimal formulation," as shown in the cost curve. Figure 3 As shown.
[0067] Table 4 Comparison of Optimization Results
[0068] The experiments above show that EISOA, while ensuring nutritional balance, optimizes the proportions of raw materials, making the combination of corn, soybean meal, and rice bran meal more economical and reasonable. In the early nursery stage, late nursery stage, mid-season pig stage, and finishing pig stage, the average cost per kilogram optimized by EISOA was 3.1476, 3.1360, 2.4265, and 2.2252 yuan, respectively, which is a reduction of 1.49%, 1.20%, 1.60%, and 1.78% compared to SOA (3.1953, 3.1741, 2.4659, and 2.2655 yuan / kg). Simultaneously, the cost curve is more stable with reduced fluctuations, indicating that EISOA significantly enhances its ability to finely control the proportions of raw materials at each stage, and the optimization process is more stable and reliable. Further comparison with the original formula shows that EISOA reduced the average cost by approximately 7.92%, 11.24%, 7.29%, and 15.51% in the four stages, demonstrating significant economic benefits. In summary, EISOA not only reduces costs while meeting feed nutritional requirements, but also achieves both cost stability and economic efficiency across all stages by optimizing raw material ratios, providing efficient and stable algorithmic support for feed formulation optimization.
[0069] This invention constructs a nutritional requirement model based on the SID amino acid index and proposes an improved snake optimization algorithm, EISOA, to address complex issues such as multivariate coupling and multiple constraints in feed formulation prediction. By introducing Latin hypercube sampling, an interactive learning mechanism, and an elite-guided mechanism, EISOA significantly enhances its global exploration capability and local convergence accuracy. Experimental results show that this algorithm outperforms comparative algorithms in terms of optimization accuracy, operational stability, and feed cost control, providing an efficient and feasible technical path for achieving refined and intelligent feed formulation design in the pig farming industry.
[0070] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Unless otherwise specified, an element defined by the phrase "comprising..." or "including..." does not exclude the presence of additional elements in the process, method, article, or terminal device that includes said element. Additionally, in this document, "greater than," "less than," "exceeding," etc., are understood to exclude the stated number; "above," "below," "within," etc., are understood to include the stated number.
[0071] Although the above embodiments have been described, those skilled in the art, once they understand the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the above descriptions are merely embodiments of the present invention and do not limit the scope of patent protection of the present invention. Any equivalent structural or procedural transformations made using the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for optimizing daily feed formulation for pigs based on improved SOA, characterized in that, Includes the following steps: Step 1: A method for optimizing daily feed for pigs with the goal of minimizing feed costs was constructed. The method takes the SID amino acid requirement of pigs at different body weights as the main constraint, and adds upper and lower limits of raw material ratio constraints and total formula constraints. The SID amino acid constraint is dynamically calculated through an exponential decay model to adjust the target value of amino acid requirement in real time according to the continuous change of pig body weight. Based on this, a penalty term is introduced to construct a fitness function so that solutions that violate nutritional constraints are automatically eliminated during the search process. Step 2: Subsequently, an improved snake optimization algorithm is used to solve the daily feed optimization method for pigs. The improved snake optimization algorithm retains the original SOA sex division and exploration-development framework, and introduces Latin hypercube sampling to improve the diversity of the initial population. In the exploration phase, an interactive learning mechanism allows individuals to simultaneously refer to information from the global optimum and high-quality candidate solutions. In the development phase, an elite guidance mechanism is used to push individuals closer to the global optimum, and elite perturbation is combined to avoid stagnation. Through iterative updates, the candidate formulations in the population gradually evolve, and the proportion of raw materials gradually converges to a feasible solution that satisfies the SID amino acid constraint and has a cost advantage. The optimal individual output is the optimized feed formulation for the target stage.
2. The method for optimizing daily feed formulation for pigs based on improved SOA as described in claim 1, characterized in that, The introduced exponential decay model is defined as follows: in For the first Individual weight (kg) For weight Next Percentage of SID amino acids, For the first The initial demand intensity of each amino acid, For the first The decay rate of each amino acid, For the first The stable requirement level of each amino acid.
3. The method for optimizing daily feed formulation for pigs based on improved SOA as described in claim 1, characterized in that, The objective function for minimizing feed costs is as follows: In this formula, The price of each raw material, This refers to the proportion of different raw materials in 1 kg of feed formulation.
4. The method for optimizing daily feed formulation for pigs based on improved SOA as described in claim 1, characterized in that, The fitness function is as follows: In the formula: This is a penalty term used to penalize solutions that do not meet the constraints. —The formula for calculating SID amino acids, —Total amount of raw materials, —Number of amino acid types, —No. The first of the raw materials The content of each amino acid (%) —No. The first of the raw materials The digestibility of each amino acid —Total penalty intensity adjustment factor, It is a penalty term for the total proportion constraint. It is a SID amino acid constraint penalty term. These are the upper and lower limits of raw material ratio constraint penalties, defined as follows: In the formula: , —No. The upper and lower limits of the proportion of the raw materials , —No. The target SID range for each amino acid. , , —The proportion of penalties for each type of constraint.
5. The method for optimizing daily feed formulation for pigs based on improved SOA as described in claim 1, characterized in that, The Latin hypercube sampling initialization population divides each raw material proportion range into... The system uses three non-overlapping sub-intervals, and randomly selects a point within each interval to ensure that the proportions of each raw material are uniformly covered throughout the entire domain. Its mathematical form is: In the formula: Indicates the first The candidate formulation in the first The initial position of the raw material dimension. These are the upper and lower limits of the proportion of this raw material. For layered numbering, Population size.
6. The method for optimizing daily feed formulation for pigs based on improved SOA as described in claim 1, characterized in that, The interactive learning mechanism allows the individual to simultaneously draw upon information from the globally optimal solution and multiple high-quality solutions during updates. In the formula: This is the globally optimal formula. These are randomly selected high-quality individuals. , These are two types of guiding strength coefficients.
7. The method for optimizing daily feed formulation for pigs based on improved SOA as described in claim 1, characterized in that, The elite guidance mechanism utilizes information from historically optimal recipes to guide other individuals in updating their strategies, and applies perturbations near elite solutions to enhance local search capabilities. In the formula: Positions for elite individuals As an elite guidance coefficient, The perturbation term follows a normal distribution and is used for local search in the vicinity of elites.