A visual interactive method for fish feed formula design

Through visual interaction methods, combined with multi-layer solution architecture and heuristic algorithms, a variety of fish feed formulas are generated, which solves the problems of unreasonable nutrition and high cost caused by relying on artificial experience in the existing technology, achieves cost optimization and accurate satisfaction of nutritional needs, and improves breeding benefits.

CN120319367BActive Publication Date: 2025-09-02SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510819503.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-02
Estimated Expiration
2045-06-19

AI Technical Summary

Technical Problem

The existing fish feed formula design mainly relies on manual experience, lacks precise nutrition analysis and scientific optimization algorithm support, making it difficult to optimize feed cost, resulting in unreasonable nutrition distribution ratio, slow growth of fish, poor disease resistance, and high cost.

Method used

Using a visual interaction method, by collecting feed raw material data and fish nutritional demand data, a constraint planning model with the lowest cost is established, a solver is used to solve, and multiple feasible solutions are generated through multi-layer solution architecture and heuristic algorithms, providing a variety of feed formula design solutions, combining visual output to assist decision-making.

Benefits of technology

A variety of feasible feed formula optimization has been achieved, reducing breeding costs, accurately meeting the nutritional needs of fish growth, improving the economic benefits of breeding, and providing intuitive model search process understanding and cost distribution visualization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120319367B_ABST
    Figure CN120319367B_ABST
Patent Text Reader

Abstract

This application belongs to a visualization interaction method, and in particular relates to a visualization interaction method for fish feed formula design, which aims to achieve accurate design of feed formulas that meet the nutritional needs of large yellow croaker and are low in cost. At the same time, it uses visualization means to assist users in decision-making, reduce the subjective bias and time cost of manual formula design, and improve the overall effectiveness of feed formula design in aquaculture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a visualization interaction method, and in particular to a visualization interaction method for fish feed formula design. Background Art

[0002] In the field of aquaculture, the rational design of fish feed formulas is crucial for reducing farming costs, improving farming efficiency, and ensuring healthy growth. With the rapid innovation of computer technology and optimization algorithms, intelligent formula design has gradually become the key to improving farming efficiency. At the same time, visualization technology is gradually becoming the core driving force for innovating the formula design process and improving the scientific nature of decision-making. Data visualization, as a key branch in the intersection of computer graphics and data processing, can present complex feed raw material data, nutritional requirement data, and cost data in an intuitive and easy-to-understand graphical form. In many fields such as industrial production and financial analysis, data visualization has been widely used to assist decision-making and optimize processes. It has also been explored in the formulation of livestock feed. However, its in-depth application in fish feed formula design is still lagging behind.

[0003] Currently, fish feed formulation relies primarily on manual experience and simple solution models. Traditionally, fish farmers rely on their long-term experience to subjectively adjust the proportions of various feed ingredients based on the approximate nutritional requirements of fish at different growth stages. This approach presents numerous problems and drawbacks. Due to the lack of precise nutritional analysis and scientific optimization algorithms, it is difficult to optimize feed costs while meeting comprehensive and precise nutritional requirements for fish. This often results in irrational nutrient composition, leading to slow growth and poor disease resistance. Alternatively, feed costs can be excessively high, increasing aquaculture costs and reducing economic returns. Summary of the Invention

[0004] Existing research can only provide a single optimal solution and cannot meet the diverse needs of users. Based on this, this application uses this technology to generate feasible solutions in multiple model search processes and provide users with multiple feed formula design solutions. Its technical solution is:

[0005] A visual interactive method for fish feed formula design includes the following steps:

[0006] S1. Collect feed raw material data;

[0007] S2. Calculate fish nutritional requirements;

[0008] S3. Establish a constraint programming model with the lowest cost and solve the established model using a solver;

[0009] S4. Adjust model parameters;

[0010] S5. Setting the feed formula ratio for the solver's initial search;

[0011] S6. solving the model;

[0012] S7. Visualization output.

[0013] Preferably, in step S1, the nutritional components of the feed raw materials and the real-time price information of each raw material are obtained, and the price data of each raw material is updated daily.

[0014] Preferably, in step S2, the nutritional requirements of the set fish at different growth stages are obtained, and the range of each nutrient component in the feed formula is calculated as a nutritional requirement constraint. At the same time, based on the impact of the formula components on the growth status of the fish, the upper and lower limits of the percentage of various raw material components in the formula are calculated.

[0015] Preferably, in step S3, it is assumed that there are n kinds of raw material components, each of which contains r kinds of nutrients, and the content is expressed as a 11 、a 12 ……a 1r , and so on to a n1 、a n2 ……a nr ; The proportions of each raw material in the feed formula are x1, x2...x n , the nutrient content in the feed is constrained to p1, p2...p r The lower limit of the proportion of each raw material in the feed formula is b1, b2...b n The lower limit of the proportion of feed formula is u1, u2...u n , the prices of the raw materials are c1, c2...c n , find the ratio of each formula when the feed formula price G is the lowest:

[0016] The lowest cost is the objective function, and the expression is as follows:

[0017] ;

[0018] Considering the quality of the feed formula from the perspective of the raw material composition ratio as a constraint condition, the expression is as follows:

[0019] ;

[0020] .

[0021] Preferably, the architecture of the solver during the search in step S3 is divided into four layers:

[0022] The first layer "destroys" the current solution by removing several elements from it, and then "repairs" the destroyed solution by reinserting the removed elements into the solution, in order to obtain a higher-quality solution. By designing multiple sets of destruction and repair operators, large neighborhood search can expand the search range of the solution space and improve the current solution. During the iterative process, destruction and repair methods with good performance will receive higher scores and weights. The algorithm will select and adjust the weights of each operator based on past performance to find the optimal solution. The specific method is as follows:

[0023] During the search process, a feasible solution pool is generated. Assume that the size of the feasible solution pool is , then there are A feasible feed formula, let v be a feasible feed formula, expressed as v1=[x 11、 x 12 ...x 1n ], and so on to ; The model selects a feasible solution for a feed formula in the solution pool, removes some variables from the solution, and then explores the neighborhood of these variables to find a feasible solution with lower cost. Then, in the copied model, the remaining variables are fixed to their current values, and then other heuristic search strategies are used to solve the model. If a feasible solution is found, the feasible solution is released into the feasible solution pool. If the feasible solution pool is full, the previous feasible solution is removed. Assuming that the solution in the feasible solution pool selected by the model is v1, a copy of the solution model is made, and x is selected according to the heuristic strategy. 11 、x 14 、x 15 If these three variables are removed, the other variables are fixed and added to the copied model as equality constraints, requiring x2==x 12 、x3==x 13 , and so on, for the copied model, if a feasible solution v4 with lower cost is found, the solution in the feasible solution pool can be replaced according to the replacement strategy;

[0024] The linear relaxation algorithm used by the second-level solver is used to determine the lower bound of each search process;

[0025] The third layer is integer encoding, which converts all constraints of integer variables into constraints of two Boolean variables;

[0026] In the fourth layer, during the solution process, new constraint clauses are generated and added to the problem model only when necessary, rather than explicitly expressing all possible constraints at the beginning. When searching the solution space, the solver first tries to find a solution using only the existing constraints. When a conflict is encountered or the search cannot continue, the cause of the problem is analyzed and new constraint clauses are dynamically generated based on this information. These new clauses can exclude the solution space area that currently causes the conflict, thereby guiding the search towards a more likely optimal solution. In step S4, the heuristic algorithm ERWA is used to adjust the model parameters. ERWA is used to dynamically estimate the moving average of the "score" of each variable in the input formula online to reflect the frequency and persistence of conflicts in the past, and to assist the solver in determining the order of branch variables. initial_variables_activity represents the initial value of the variable activity, i.e., the feed ingredients x1, x2...x n polarity. When the "learning rate" of a variable is lower than this initial activity value, the solver will be more inclined to branch on variables that have never been explored before. random_branches_ratio represents the proportion of randomly selected branch variables during the cp_sat solver solution process. That is, when deciding which variable to branch on, a certain proportion of decisions will be made randomly instead of selecting the first variable according to the pre-set variable sorting strategy. num_workers is a variable used to control the number of parallel worker threads during the solver search process. The default value is 0, and the solver will try to use all cores of the machine. Setting it to 1 means not to use parallel computing. relative_gap_limit is a parameter used to control the solver search stop condition. In solving optimization problems, the solver will continuously search for feasible solutions and improve the objective function value. There is an optimal feasible objective value and an optimal objective boundary. relative_gap_limit sets the upper limit of the relative gap. When the calculated relative gap is less than or equal to the set value, the solver stops searching and marks the search status as OPTIMAL.

[0027] Preferably, in step S5, the user can add a prompt message to the solver. During the constraint programming solution process, if the user already knows the possible values ​​of certain feed formulas or wants to observe what search paths will be generated by different search starting points, by adding the prompt message, the solver can be specified to start searching from this feed formula. Regardless of whether the formula is a feasible solution, the model will proceed normally.

[0028] Preferably, all feasible solutions in the model search process in step S6 are saved in a file for the user to select; the user can make a selection based on various factors. If the user wants to further adjust the feed formula at this time, the parameters can be adjusted or the search starting point can be reset.

[0029] Preferably, the visual output in step S7 includes drawing a two-dimensional plane projection diagram of the search process, and the specific method is as follows:

[0030] By fixing two raw material components in the feed, we deeply observe the intrinsic relationship between the values ​​of these two raw material components and the cost, and save and present them in the form of vivid animated graphics. When drawing, each scatter point carries a wealth of information: the order in which the scatter points are generated, the specific values ​​of the horizontal and vertical coordinates, and the corresponding cost values ​​are all clearly marked next to the scatter points as prompt information, making it easy for users to understand intuitively. The color and size of the scatter points are also closely related to the cost value. In order to more intuitively display the cost difference, the cost value is transformed by a specific function and then color mapped. The color range is set to gradually change from bright yellow to deep red. The darker the color, the higher the cost. The size of the scatter points also increases with the increase of the cost value. The higher the cost value, the larger the scatter points appear in the graph.

[0031] Preferably, the visualization output of step S7 includes drawing a heat map, and the specific method is as follows:

[0032] When the user specifies that two feed ingredient variables be fixed, the system will comprehensively traverse all possible variable combinations within the upper and lower limits of the two raw material components. For each such combination, the system will maintain the other variables in a free-changing state and then accurately calculate the corresponding minimum cost value with the help of the cp_sat solver. When drawing the graph, their values ​​are used as the horizontal and vertical coordinates, and the cost value is reflected by the depth of the color; the darker the color, the lower the corresponding cost value.

[0033] Compared with the prior art, this application has the following beneficial effects:

[0034] With the existing technology, users cannot intuitively feel the search process of the model, while the method provided by this application can draw the projection of high-dimensional scattered points on a two-dimensional plane during the search process. Users can intuitively feel the solution process of the model and better understand the distribution range of low-cost feasible solutions under the current nutritional constraints. In addition, the technology of this application can generate a cost heat map after the feasible solution set in high-dimensional space is projected onto a two-dimensional plane, so that users can intuitively see the distribution range of low-cost feed formulas.

[0035] Unlike existing technologies, which prevent users from specifying the initial feed formula for the search process, the entire search process is uncontrollable and depends on the algorithm's preprocessing. The method provided by this application allows users to input a feed formula and specify that the model begin searching from this formula, allowing for flexible selection of search starting points. This provides farmers with a cost-effective fish feed formula optimization solution that provides access to multiple feasible formulas and offers visual interactive functionality. This solution accurately meets the nutritional needs of fish growth, reduces farming costs, and improves economic benefits. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 Visualize the 2D floor plan for the search process;

[0037] Figure 2 This is a heat map of feed formulation costs;

[0038] Figure 3 Enter a graph for the initial feedstock composition;

[0039] Figure 4 This is the flow chart of this application. DETAILED DESCRIPTION

[0040] The technical solution of the present application is described in detail below through specific embodiments and drawings. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application, and the specific technical features can be combined with each other.

[0041] This embodiment takes large yellow croaker as an example. The same idea can be used to design different visual interactive methods for fish feed formulas.

[0042] A visual interactive method for fish feed formula design includes the following steps:

[0043] S1. Feed raw material data collection:

[0044] During the implementation of large yellow croaker feed formula optimization, data collection is a crucial and fundamental step. Its comprehensiveness, accuracy, and timeliness directly impact the effectiveness and reliability of subsequent formula optimization. To accurately determine the nutritional composition of feed ingredients, specialized testing instruments are deployed. High-performance liquid chromatography (HPLC) is used to separate and determine the various amino acids, vitamins, and other organic compounds in feed ingredients, with microgram-level accuracy, ensuring high data accuracy. Data accuracy is ensured through multiple parallel measurements, enabling precise acquisition of key data and laying a solid foundation for feed formula optimization. Real-time price information for each raw material is obtained through market research, price monitoring on e-commerce platforms, and direct communication with suppliers. A price fluctuation monitoring mechanism is established, with price data updated daily to ensure timely and accurate formula cost calculations.

[0045] S2. Calculate the nutritional requirements of large yellow croaker:

[0046] We collaborate closely with aquatic research institutions and universities to obtain research results on the nutritional requirements of large yellow croaker at different growth stages (juvenile, adult, etc.). These results include the appropriate intake ranges of various nutrients and energy requirements for large yellow croaker. Through professional calculations, we have determined the ranges of nutrients such as α-aminoadipic acid, threosylglycine, methylhydroxylamine, and aminovaleric acid that can be included in feed formulas as constraints on nutritional requirements. Furthermore, based on the impact of formula ingredients on fish growth, we have calculated the upper and lower limits of the percentages of various raw materials in the formula, as shown in Table 1:

[0047] Table 1 Upper and lower limits of the percentage of various raw materials in the formula

[0048] .

[0049] Table 2 shows that CP54 means that the sum of the crude protein content of each raw material in the feed is 54%.

[0050] Table 2 shows the nutritional composition constraints

[0051] .

[0052] S3. Build a constraint programming model:

[0053] The following mathematical model is established. There are n raw materials, each of which contains r nutrients, and the content can be expressed as a 11 、a 12 ……a 1r , and so on to a n1 、a n2 ……a nr The proportions of the raw materials in the feed formula are x1, x2...x n , the nutrient content in the feed is constrained to p1, p2...p r Here we discuss the nutrient content constraint of less than or equal to. The same is true for equality constraints and other symbolic constraints. Let the lower limit of the proportion of each raw material component in the feed formula be b1, b2...b n The lower limit of the proportion of feed formula is u1, u2...u n , the prices of the raw materials are c1, c2...c n , find the proportion of each formula when the feed formula price G is the lowest.

[0054] Since the lowest cost is one of the factors that users consider, and users will also consider the quality of the feed formula from the perspective of the raw material composition ratio, we model this problem as an integer programming problem.

[0055] The lowest cost is the objective function, and the expression is as follows:

[0056] ;

[0057] Considering the quality of the feed formula from the perspective of the raw material composition ratio as a constraint condition, the expression is as follows:

[0058] ;

[0059] .

[0060] The cp_sat solver is used to build the model and solve the problem. The core principle of the cp_sat solver is constraint programming based on delayed clause generation. It also uses the simplex algorithm and linear relaxation to operate as a combined solver.

[0061] The first phase of the solution process reads the model from its protocol buffer representation and verifies its correctness. The second phase performs preprocessing, reducing the problem size through operations such as domain reduction, expanding high-level constraints, detecting equivalent variables and affine relations, replacing canonical representations, and variable detection. The third phase loads the preprocessed model into the base solver and creates a linear relaxation. The fourth phase conducts the search phase. During this phase, multiple subsolvers using different strategies run in parallel on different threads. A first-solution searcher is also launched to search for a feasible solution. Once a feasible solution is found, local search heuristics (such as large neighborhood search) are used to further optimize the solution. Linear relaxation is used during this process to detect infeasibility, determine bounds, and assist in branching decisions. Finally, the solution is converted back to the original model format. If the solution is optimal, the optimal solution is saved. Otherwise, the optimal solution is processed and feedback is provided on whether a feasible solution has been found. The entire process can be adjusted based on different parameter settings (such as whether to enumerate all solutions or use heuristic search).

[0062] The solver's search architecture is divided into four layers:

[0063] The first layer "destroys" the current solution by removing several elements from it, and then "repairs" the destroyed solution by reinserting the removed elements into the solution, in order to obtain a higher-quality solution. By designing multiple sets of destruction and repair operators, large neighborhood search can expand the search range of the solution space and improve the current solution. During the iterative process, destruction and repair methods with good performance will receive higher scores and weights. The algorithm will select and adjust the weights of each operator based on past performance to find the optimal solution. The specific method is as follows:

[0064] During the search process, a feasible solution pool is generated. Assume that the size of the feasible solution pool is , then there are A feasible feed formula, let v be a feasible feed formula, expressed as v1=[x 11、 x 12 ...x 1n ], and so on to ; The model selects a feasible solution for a feed formula in the solution pool, removes some variables from the solution, and then explores the neighborhood of these variables to find a feasible solution with lower cost. Then, in the copied model, the remaining variables are fixed to their current values, and then other heuristic search strategies are used to solve the model. If a feasible solution is found, the feasible solution is released into the feasible solution pool. If the feasible solution pool is full, the previous feasible solution is removed. Assuming that the solution in the feasible solution pool selected by the model is v1, a copy of the solution model is made, and x is selected according to the heuristic strategy. 11 、x 14 、x 15 If these three variables are removed, the other variables are fixed and added to the copied model as equality constraints, requiring x2==x 12 、x3==x 13 , and so on, for the copied model, if a feasible solution v4 with lower cost is found, the solution in the feasible solution pool can be replaced according to the replacement strategy;

[0065] The linear relaxation algorithm used by the second-level solver is used to determine the lower bound of each search process. The relaxation algorithms in the solver include the dual simplex algorithm, cutting plane method, branch and bound method, etc. The dual simplex algorithm can solve x1...x n When is an integer, the lowest cost, this cost is the lower bound of the cost of integer programming;

[0066] The cutting plane method uses the Gomori method. The basic idea is to solve the linear relaxation problem of the integer programming problem, obtain the optimal simplex table, and check whether the optimal solution satisfies the integer constraints. If all variables take integer values, the optimal solution of the integer programming is obtained and the algorithm ends; otherwise, a non-integer basis variable x is selected. i , according to the selected non-integer basis variable x i The constraint equations are used to generate the Gomori cutting plane. Add the Gomori cutting plane to the linear relaxation problem to obtain a new linear programming problem. Use the simplex method or other appropriate methods to solve the new linear programming problem. Return to the step of selecting non-integer basis variables and continue iterating until the optimal solution of the integer programming is obtained or it is determined that the problem has no solution. The method of generating the Gomori cutting plane is to set x i is a non-integer variable, and its constraint equation in the simplex table is: where a ij is the coefficient, b i are constants, decompose them into the sum of the integer part and the decimal part, a ij The decimal part is fij , b i The decimal part is f i , their value range is [0,1),

[0067] From this, the Gomori cutting plane is constructed. , where N is the set of non-basic variables. This cutting plane is constructed based on the fractional part information of non-integer basis variables, which can cut off the non-integer optimal solution of the current linear relaxation problem;

[0068] The third layer is integer encoding, which converts all integer variable constraints into two Boolean variable constraints. For example, if the ratio of a certain raw material is x, and during the model operation, the constraint of x is x<=a, then for all integers i in the interval [0, a], a Boolean clause x==i is generated. When the value of x is i, an additional Boolean clause x<=i is generated.

[0069] In the fourth layer, during the solution process, new constraint clauses are generated and added to the problem model only when needed, rather than explicitly expressing all possible constraints at the beginning. When searching the solution space, the solver first tries to find a solution using only the existing constraints. When a conflict is encountered or the search cannot continue, the cause of the problem is analyzed and new constraint clauses are dynamically generated based on this information. These new clauses can exclude the solution space area that currently causes the conflict, thereby guiding the search towards a direction that is more likely to find a feasible solution. For example, when an infeasible solution v1=[x1…x n ], the solver can record the cause of the conflict, generate new constraint clauses, and start searching from the node that caused the conflict.

[0070] In this case, the data collected was for a formula composed of 22 raw materials: soy hull fiber, seaweed meal, barley by-product, brown algae protein powder, fermented starch residue, cassava protein residue, high-protein mealworms, squid meal, water-soluble protein, various fish-derived plant and animal proteins, and bacterial protein. Instruments were used to measure the various feed ingredients, such as the typical dry matter percentage, the percentage of various amino acid derivatives, and the percentage of common ingredients. Nutrient constraints were calculated using specialized knowledge of fish farming. In this example, a crude protein content of 54% was required. Four amino acid derivatives had corresponding range constraints, and the 22 raw material ingredients had their own upper and lower limit composition constraints. These various linear constraints were added to the solver to establish the basic solver model.

[0071] S4. Adjust model parameters:

[0072] The ERWA heuristic algorithm, a technique for incrementally estimating moving averages, assigns greater weight to recent results, making the estimate more consistent with recent trends. In single-state reinforcement learning problems such as the multi-armed bandit problem, it can be used to estimate the expected rewards of different actions, helping the agent balance exploration and exploitation. In the branching heuristic method for solving Boolean satisfiability problems, each variable is likened to an "arm." ERWA dynamically and online estimates the moving average of the "scores" of each variable in the input formula, reflecting the frequency and persistence of past conflicts between variables and assisting the solver in determining the order of variable branches. initial_variables_activity represents the initial value of the variable activity. When the "learning rate" of a variable is lower than this initial activity value, the solver will prefer to branch on previously unexplored variables. This strategy helps the solver explore more comprehensively and avoid getting stuck in local optima. random_branches_ratio represents the proportion of randomly selected branch variables during the cp_sat solver's solution. This means that when deciding which variable to branch on, a certain percentage of decisions will be made randomly, rather than selecting the first variable according to a pre-defined variable ranking strategy. num_workers is a variable that controls the number of parallel worker threads used by the solver during the search process. The default value of 0 means the solver will attempt to use all cores on the machine. Setting it to 1 disables parallel computing. When solving complex problems, many computational tasks can be performed in parallel. For example, in solving Boolean satisfiability problems, different search branches can be processed simultaneously by different threads. More threads allow for simultaneous exploration of multiple search paths, significantly reducing the time required to find a solution. relative_gap_limit is a parameter that controls the solver's stopping condition. In optimization problems, the solver continuously searches for feasible solutions and improves the objective function value. There is an optimal feasible objective value and an optimal objective bound. relative_gap_limit sets an upper limit on the relative gap. When the calculated relative gap is less than or equal to this value, the solver stops searching and marks the search status as OPTIMAL.

[0073] S5. Set the feed formula ratio for the solver's initial search:

[0074] For example, if we know that the proportions of twenty-two raw materials are 3, 0, 0, 3, 5, 3, 20, 0, 0, 5, 29, 2, 0, 0, 0, 2, 8, 8, 0, 0, 12, 0, the prepared feed formula meets all nutritional constraints. We hope that the search starting point of the model is the above value, so we can enter the corresponding feed proportions in the interactive interface. The input interface is as follows Figure 3 shown.

[0075] Users can add a hint to the solver. During the constraint programming process, users may already know the possible values ​​of a certain feed formula or want to observe the search paths produced by different search starting points. By adding a hint, the solver can be instructed to start the search from this feed formula. Regardless of whether the formula is a feasible solution, the model will proceed normally.

[0076] S6. Run the model to solve:

[0077] All feasible solutions during the model search are saved to a file for the user to select. The user can make a selection based on various factors such as the ratio of nutrients and cost. If the user feels that the current feed formula can be further adjusted, they can adjust the parameters or reset the search starting point.

[0078] S7. Visualization output:

[0079] Plot a two-dimensional projection of the search process. During feed formula optimization, because the formula involves multiple ingredients, plotting a high-dimensional image is difficult. Therefore, this technology cleverly processes the feed formulas obtained during the search process and projects them onto a two-dimensional plane. Specifically, by fixing two raw material components in the feed, we can deeply observe the intrinsic relationship between their values ​​and cost, and present this information in a vivid animated graphic. This visualization is implemented using the Matplotlib and Plotly libraries in Python. During the plotting process, each scatter point carries a wealth of information: the order in which the scatter point was generated, the specific values ​​of the horizontal and vertical coordinates, and the corresponding cost value are clearly marked next to the scatter point as a tooltip, making it easy for users to intuitively understand. The color and size of the scatter point are also closely related to the cost value. To more intuitively display cost differences, the cost values ​​are transformed using a specific function and then color mapped. The color range is set to gradually change from bright yellow to dark red, with darker colors representing higher costs. The size of the scatter point also increases with increasing cost values, with higher cost values ​​resulting in larger scatter points in the graph. See the attached figure for a two-dimensional visualization of the search process.

[0080] Heatmap: To more intuitively demonstrate the impact of varying values ​​of different raw material components on cost, the system presents the results as a heatmap. In this heatmap, for example, when the user specifies that the variables for soy hull fiber and high-ash meat meal are fixed, the system comprehensively explores all possible combinations of these variables within their respective upper and lower limits. For each such combination, the system maintains the other variables in a free-floating state and then uses the cp_sat solver to accurately calculate the corresponding minimum cost. The values ​​of these variables are plotted as the horizontal and vertical axes, and the cost is represented by the color. Darker colors represent lower costs. The system clearly marks the location of the lowest cost point on the graph, and the corresponding horizontal and vertical coordinate values, as well as the specific cost value, are clearly displayed below the graph. A color bar is also added to the right side of the graph to visually demonstrate the relationship between cost and color.

[0081] Furthermore, to further analyze and visualize the probability density distribution of the data, the system uses a Gaussian kernel function as a kernel density estimation function. This kernel density estimation generates a smooth, continuous graph, allowing users to intuitively understand the range of values ​​for two specific, lower-cost raw material components and adjust the search starting point and final formula ratio. See the attached feed formula cost heat map.

[0082] Kernel density estimation is to infer the distribution of the overall data based on a limited sample. Using the above method, we can obtain a scatter plot of feed cost as a function of two variables. Using kernel density estimation, we can infer the clustering area of ​​the data and find the range in which the feed cost is low. The formula for the two-dimensional kernel density estimation function is as follows:

[0083] ;

[0084] n is the number of sample points, h is the smoothing parameter, k is the kernel function, here we use the Gaussian kernel function, and dist is the Euclidean distance.

[0085] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A visual interactive method for fish feed formula design, characterized in that: The following steps are involved: S1. Collect feed raw material data; S2. Calculate fish nutritional requirements; S3. Establish a constraint programming model with the lowest cost and solve the established model using a solver; The solver's search architecture is divided into four layers: The first layer "destroys" the current solution by removing several elements from it, and then "repairs" the destroyed solution by reinserting the removed elements into the solution, thereby obtaining a higher-quality solution. By designing multiple sets of destruction and repair operators, large neighborhood search can expand the search range of the solution space and improve the current solution. During the iterative process, destruction and repair methods with good performance will receive higher scores and weights. The algorithm will select and adjust the weights of each operator based on past performance to find the optimal solution. The specific method is as follows: During the search process, a feasible solution pool is generated. Assume that the size of the feasible solution pool is , then there are A feasible feed formula, let v be a feasible feed formula, expressed as v1=[x 11、 x 12 ...x 1n ], and so on to ; The model selects a feasible solution for a feed formula in the solution pool, removes some variables from the solution, and then explores the neighborhood of these variables to find a feasible solution with lower cost. Then, in the copied model, the remaining variables are fixed to their current values, and then other heuristic search strategies are used to solve the model. If a feasible solution is found, the feasible solution is released into the feasible solution pool. If the feasible solution pool is full, the previous feasible solution is removed. Assuming that the solution in the feasible solution pool selected by the model is v1, a copy of the solution model is made, and x is selected according to the heuristic strategy. 11 、x 14 、x 15 If these three variables are removed, the other variables are fixed and added to the copied model as equality constraints, requiring x2==x 12 、x3==x 13 , and so on, for the copied model, if a feasible solution v4 with lower cost is found, the solution in the feasible solution pool can be replaced according to the replacement strategy; The linear relaxation algorithm used by the second-level solver is used to determine the lower bound of each search process; The third layer is integer encoding, which converts all constraints of integer variables into constraints of two Boolean variables; During the fourth layer of the solution process, new constraint clauses are generated and added to the problem model only when needed, rather than explicitly expressing all possible constraints from the outset. When searching the solution space, the solver first attempts to find a solution using only the currently existing constraints. When a conflict is encountered or the search cannot continue, the solver analyzes the cause of the problem and dynamically generates new constraint clauses based on this information. These new clauses can eliminate the areas of the solution space that are currently causing the conflict, thereby guiding the search towards a direction that is more likely to find a feasible solution. S4. Adjust model parameters; The heuristic algorithm ERWA is used to adjust the model parameters. ERWA is used to dynamically estimate the moving average of the "score" of each variable in the input formula online to reflect the frequency and persistence of past conflicts between variables. The auxiliary solver determines the order of branch variables. initial_variables_activity represents the initial value of the variable activity, i.e., the feed components x1, x2, ... x n When the learning rate of a variable is lower than the initial activity value, the solver will be more inclined to branch on variables that have not been explored before; random_branches_ratio represents the ratio of randomly selected branch variables during the cp_sat solver solution process, that is, when deciding which variable to branch on, a certain proportion of decisions will be made randomly instead of choosing the first variable according to the pre-set variable sorting strategy; num_workers is a variable used to control the number of parallel worker threads in the solver search process, and the default value is If it is 0, the solver will try to use all cores of the machine. If it is set to 1, it means that parallel computing is not used. Different threads will execute different heuristic strategies to speed up the solution. relative_gap_limit is a parameter used to control the solver search stop condition. In solving optimization problems, the solver will continuously search for feasible solutions and improve the objective function value. There is an optimal feasible objective value and an optimal objective boundary. relative_gap_limit sets the upper limit of the relative gap. When the calculated relative gap is less than or equal to the set value, the solver stops searching and marks the search status as OPTIMAL. S5. Setting the feed formula ratio for the solver's initial search; Users can add a prompt to the solver. During the constraint programming process, if the user already knows the possible values ​​of a certain feed formula or wants to observe what search paths will be generated by different search starting points, by adding a prompt, the solver can be instructed to start the search from this feed formula. Regardless of whether the formula is a feasible solution, the model will proceed normally. S6. solving the model; All feasible solutions during the model search process are saved in a file for the user to select. The user can make a selection based on a variety of factors. If the user wants to further adjust the feed formula at this time, they can adjust the parameters or reset the search starting point. S7. Visualization output.

2. The visual interactive method for fish feed formula design according to claim 1, characterized in that: In step S1, the nutritional components of feed raw materials and the real-time price information of each raw material are obtained, and the price data of each raw material is updated daily.

3. The visual interactive method for fish feed formula design according to claim 1, characterized in that: In step S2, the nutritional requirements of the set fish at different growth stages are obtained, and the range of each nutrient component in the feed formula is calculated as a nutritional requirement constraint. At the same time, based on the impact of the formula components on the growth status of the fish, the upper and lower limits of the percentage of various raw material components in the formula are calculated.

4. The visual interactive method for fish feed formula design according to claim 1, characterized in that: In step S3, it is assumed that there are n kinds of raw materials, each of which contains r kinds of nutrients, and the content is expressed as a 11 、a 12 ……a 1r , and so on to a n1 、a n2 ……a nr ; The proportions of each raw material in the feed formula are x1, x2...x n , the nutrient content in the feed is constrained to p1, p2...p r The lower limit of the proportion of each raw material in the feed formula is b1, b2...b n The upper limit of the proportion of feed formula is u1, u2...u n , the prices of the raw materials are c1, c2...c n , find the ratio of each formula when the feed formula price G is the lowest: The lowest cost is the objective function, and the expression is as follows: ; Considering the quality of the feed formula from the perspective of the raw material composition ratio as a constraint condition, the expression is as follows: ; 。 5. The visual interactive method for fish feed formula design according to claim 1, characterized in that: Step S7, the visualization output, includes drawing a two-dimensional plane projection diagram of the search process. The specific method is as follows: By fixing the two raw material components in the feed, we deeply observe the intrinsic relationship between the values ​​of these two raw material components and the cost, and save and present them in the form of vivid animated graphics; when drawing, each scatter point carries rich information: the order in which the scatter points are generated, the specific values ​​of the horizontal and vertical coordinates, and the corresponding cost values ​​will all be used as prompt information, clearly marked next to the scatter points, making it easy for users to understand intuitively.

6. The visual interactive method for fish feed formula design according to claim 1, characterized in that: Step S7: Visualization output includes drawing a heat map. The specific method is as follows: When the user specifies that two feed ingredient variables be fixed, the system will comprehensively traverse all possible variable combinations within the upper and lower limits of the two raw material components. For each such combination, the system will maintain the other variables in a free-changing state and then accurately calculate the corresponding minimum cost value with the help of the cp_sat solver. When drawing the graph, their values ​​are used as the horizontal and vertical coordinates, and the cost value is reflected by the depth of the color; the darker the color, the lower the corresponding cost value.

Citation Information

Patent Citations

  • Policy automation verification technology in networks are intended to be driven

    CN112636958A

  • Feed formula optimization method and system, computer and storage medium

    CN113935233A