Visual interaction method for fish feed formula design

The visual interaction method for fish feed formulation addresses the imprecision of manual methods by using solver-based optimization and interactive visual outputs to provide cost-effective and nutritionally balanced fish feed solutions.

CN120319367AActive Publication Date: 2025-07-15SHANDONG UNIV
View PDF 10 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing fish feed formula design mainly relies on manual experience, making it difficult to meet precise nutrition content and optimize feed costs, resulting in slow growth of fish, poor disease resistance and high breeding costs.

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 the model parameters are adjusted through multi-layer solution architecture and heuristic algorithms, and finally multiple feed formula schemes are output visually.

Benefits of technology

Provide a variety of feasible feed formula solutions to accurately meet the nutritional needs of fish growth, reduce breeding costs, improve economic benefits, and enable users to intuitively understand the model's search process and cost distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120319367A_ABST
    Figure CN120319367A_ABST
Patent Text Reader

Abstract

The invention belongs to a visual interaction method, particularly relates to a visual interaction method for fish feed formula design, and aims to achieve accurate feed formula design which meets the nutritional requirements of large yellow croakers and is low in cost, assist a user in decision making by means of a visual means, reduce subjective deviation and time cost of manual formula design, and improve the accuracy of feed formula design. And the overall efficiency of the feed formula design in aquaculture is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of visual interaction methods, and particularly relates to a visual interaction method for fish feed formula design. Background Art

[0002] In the field of aquaculture, for fish farming, the rational design of its feed formula is crucial for reducing breeding costs, improving breeding efficiency, and ensuring its healthy growth. With the rapid innovation of computer technology and optimization algorithms, intelligent formula design has gradually become the key to improving breeding efficiency. At the same time, visualization technology is gradually becoming the core driving force for innovating the formula design process and enhancing the scientific nature of decision-making. Data visualization, as a key branch in the cross-field of computer graphics and data processing, can present complex feed raw material data, nutritional requirement data, cost data, etc. 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 in assisting decision-making and optimizing processes, and there has also been some exploration in the feed formula of livestock farming. However, its in-depth application in fish feed formula design is still lagging behind.

[0003] Currently, the formulation of fish feed formula mainly relies on manual experience and simple solution models. The traditional method is that breeders, relying on their own long-term accumulated experience, subjectively allocate the proportions of various feed raw materials according to the approximate nutritional requirements of fish at different growth stages. This method has many problems and disadvantages. Due to the lack of precise nutritional analysis and scientific optimization algorithm support, it is very difficult to optimize the feed cost while meeting the comprehensive and accurate nutritional content constraints of fish. There are often problems such as unreasonable nutrient composition ratios, resulting in slow fish growth and poor disease resistance, or excessive feed costs, increasing breeding costs and reducing the economic benefits of breeding. 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 can use this technology to generate feasible solutions in the process of searching for multiple models and provide multiple feed formula design schemes for users. Its technical solution is as follows: A visual interaction method for fish feed formula design, comprising the following steps: S1. Collect feed raw material data; S2. Calculate fish nutritional requirement data; S3. Establish a constraint programming model with the lowest cost and use a solver to solve the established model; S4. Adjust model parameters; S5. Set the feed formula ratio for the initial search of the solver; S6. Solve the model; S7. Visualize and output.

[0005] 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.

[0006] Preferably, in step S2, the nutritional requirements of the set fish at different growth stages are obtained, the range of each nutritional component in the feed formula is calculated as the nutritional requirement constraint, and at the same time, according to the influence 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.

[0007] Preferably, in step S3, it is assumed that there are n raw material components, and each raw material component has r nutritional components, 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 component in the feed formula are x1, x2... x n respectively, and the nutritional component content constraints in the feed are p1, p2... p r ; The lower limits of the proportion of each raw material component in the feed formula are b1, b2... b n respectively, and the lower limits of the proportion in the feed formula are u1, u2... u n respectively, and the prices of each raw material are c1, c2... c n respectively. Solve the proportions of each formula when the price G of the feed formula is the lowest: The cost is the lowest as the objective function, and the expression is as follows: ; Considering the quality of the feed formula from the proportion of the raw material components of the feed formula as the constraint condition, the expression is as follows: ; 。

[0008] Preferably, in step S3, the architecture of the solver during the search is divided into four layers: In the first layer, the current solution is first "destroyed", that is, several elements are removed from the current solution, and then the destroyed solution is "repaired", and the removed elements are reinserted into the solution. In this way, a higher-quality solution is obtained; by designing multiple sets of destruction operators and repair operators, the large neighborhood search can expand the search range of the solution space, improve the current solution, and during the iteration process, the good destruction and repair methods will obtain higher scores and weights, and the algorithm will select and adjust the weights of each operator according to the previous performance to find the optimal solution. The specific method is as follows: A feasible solution pool is generated during the search process. Assume that the size of the feasible solution pool is , then there are groups of feasible feed formulations. Let v be a group of feasible feed formulations, expressed as v1 = [x 11、 x 12 ……x 1n , and so on until ; The model selects a feasible solution of a feed formulation in the solution pool, removes a part of the variables from the solution, and then explores the neighborhoods 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 put into the feasible solution pool. If the feasible solution pool is full, the previous feasible solution is removed; Assume that the solution in the feasible solution pool selected by the model is v1. Copy a solution model. According to the heuristic strategy, select x 11 , x 14 , x 15 These three variables are removed, then the other variables are fixed and added to the copied model as equality constraints, that is, it is required that x2 == x 12 , x3 == x 13 , and so on. Solve 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-layer solver is used to determine the lower bound of each search process; The third layer is integer encoding, which converts the constraint conditions of all integer variables into the constraint conditions of two boolean variables; 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 representing all possible constraints at the beginning; When the solver searches the solution space, it first tries to find a solution only using the current existing constraints. When encountering conflicts or being unable to continue the search, it will analyze the reasons for the problem and dynamically generate new constraint clauses based on this information. These new clauses can exclude the solution space regions that currently cause conflicts, thereby guiding the search towards a more likely to find an optimal one. In step S4, the heuristic algorithm ERWA is used to adjust the model parameters. ERWA dynamically and online estimates the moving average of the "scores" of each variable in the input formula to reflect the frequency and persistence of variable conflicts in the past, and assists the solver in determining the branch variable order; initial_variables_activity represents the initial value of variable activity, that is, the feed ingredients x1, x2... x nRegarding the polarity, when the "learning rate" of a certain variable is lower than this initial activity value, the solver is more inclined to branch on variables that have never been explored before; random_branches_ratio represents the ratio of randomly selecting branch variables during the solution process of the cp_sat solver. That is to say, when deciding which variable to branch on, a certain proportion of decisions will be made randomly, rather than selecting the first variable according to the pre-set variable sorting strategy; num_workers is a variable used to control the number of parallel working threads of the solver during the search process. The default value is 0, and the solver will try to use all the cores of the machine. Setting it to 1 means not using parallel computing; relative_gap_limit is a parameter used to control the search stop condition of the solver. In the solution of optimization problems, the solver will continuously search for feasible solutions and improve the objective function value. There are the best feasible objective value and the best objective bound. 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.

[0009] Preferably, in step S5, the user can add a hint message to the solver. During the constraint programming solution process, if the user already knows the possible values of some feed formulations or hopes to observe the search paths generated by different search starting points, by adding a hint message, the solver can be specified to start the search from this feed formulation. Whether the formulation is a feasible solution or not, the model will proceed normally.

[0010] Preferably, in step S6, all feasible solutions during the model search process are saved to a file for the user to select; the user can make a selection based on multiple factors. If you want to further adjust the feed formulation at this time, you can adjust the parameters or reset the search starting point.

[0011] Preferably, the visualization output in step S7 includes drawing a two-dimensional plane projection diagram of the search process. The specific method is as follows: By fixing two raw material components in the feed, deeply observe the internal relationship between the values of these two raw material components and the cost, and save and present it in the form of a vivid animated graph; when drawing, each scatter point carries rich information: the order of generation of the scatter points, the specific numerical values of the horizontal and vertical coordinates, and the corresponding cost values will be used as hint messages and clearly marked next to the scatter points for the user to intuitively understand. The color and size of the scatter points are also closely related to the cost value. To more intuitively display the cost difference, after performing a specific function transformation on the cost value, color mapping is performed; the color interval 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 as the cost value increases. The higher the cost value, the larger the scatter points appear in the graph.

[0012] Preferably, the visual output in step S7 includes drawing a heat map, and the specific method is as follows: When the user specifies to fix two feedstock variables, the system will comprehensively traverse all possible variable combinations within the upper and lower limits of the two raw material components respectively; for each such combination, the system will keep other variables in a freely variable state, and then accurately calculate the corresponding lowest cost value with the help of the cp_sat solver; when plotting, their values are used as the horizontal and vertical coordinates respectively, and the cost value is reflected by the depth of the color; among them, the darker the color, the lower the corresponding cost value.

[0013] Compared with the prior art, the beneficial effects of the present application are as follows: In the prior art, users cannot intuitively feel the search process of the model, while the method provided by the present application can draw the projection of high-dimensional scatter points in the two-dimensional plane during the search process. Users can intuitively feel the solution process of the model, better understand the distribution range of the lower-cost feasible solutions under the current nutritional constraints, and the technology of the present application can generate a cost heat map of the projection of the feasible solution set in the high-dimensional space onto the two-dimensional plane. Users can intuitively see the distribution range of the lower-cost feed formulations.

[0014] In the prior art, users cannot specify the initial feed formulation of the search process and have no control over the entire search process. The initial feed formulation depends on the preprocessing of the algorithm. However, with the method provided by the present application, users can input a feed formulation and specify the model to start searching from this feed formulation, flexibly selecting the search starting point. It provides a cost-effective fish feed formulation optimization solution for farmers, which can obtain multiple feasible formulations, has a visual interaction function, precisely meets the nutritional requirements of fish growth, reduces breeding costs, and improves breeding economic benefits. Description of the Drawings

[0015] Figure 1 It is a two-dimensional plan view for visualizing the search process; Figure 2 It is a cost heat map of the feed formulation; Figure 3 It is an input diagram of the initial raw material components; Figure 4 It is a flow chart of the present application. Detailed Embodiments

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

[0017] This embodiment takes large yellow croaker as an example. The same idea can be applied to the visual interaction method for designing different fish feed formulas.

[0018] A visual interaction method for fish feed formula design includes the following steps: S1. Feed raw material data collection: During the implementation of large yellow croaker feed formula optimization, data collection is a crucial fundamental step. Its comprehensiveness, accuracy, and timeliness directly affect the effect and reliability of subsequent formula optimization. To accurately obtain the nutritional components of feed raw materials, professional testing instruments are equipped. High-performance liquid chromatography is used to separate and determine various amino acids, vitamins, and other organic compounds in feed raw materials, with an accuracy of up to the microgram level, ensuring high data accuracy. The accuracy of the data is ensured through multiple parallel measurements, thereby accurately obtaining key data and laying a solid foundation for feed formula optimization. Through market research, price monitoring on e-commerce platforms, and direct communication with suppliers, real-time price information of each raw material is obtained. A price fluctuation monitoring mechanism is established to update price data daily, ensuring the timeliness and accuracy of formula cost calculation.

[0019] S2. Calculate the nutritional requirement data of large yellow croaker: Closely cooperate with aquatic product scientific research institutions and universities to obtain research results on the nutritional requirements of large yellow croaker at different growth stages (juvenile fish stage, adult fish stage, etc.). These results include the appropriate intake ranges of various nutritional components and energy requirements for large yellow croaker. Through professional knowledge, the ranges of substances such as α-aminoadipic acid, threonine glycine, methionine, and aminovaleric acid in the feed formula are calculated as nutritional requirement constraints. At the same time, based on the influence of formula components on the growth status of fish, the upper and lower limits of the percentage of various raw material components in the formula are calculated, as shown in Table 1:

[0020] Table 1 Upper and lower limits of the percentage of various raw material components in the formula 。

[0021] The meaning of Table 2 for CP54 is that the sum of the crude protein contents of each raw material in the feed is 54%.

[0022] Table 2 is for nutritional component constraints 。

[0023] S3. Establish a constraint programming model: Establish the following mathematical model. Suppose there are n raw material components, and each raw material component contains r nutritional components, and the content can be expressed as a 11 、a 12 ……a 1r , and so on to a n1 、a n2 ……anr The proportion of each raw material component in the feed formula is x1, x2... x n , and the content constraints of the nutritional components in the feed are p1, p2... p r , here we discuss the content constraints of less than or equal to nutritional components. The equality constraints and other symbolic constraints are the same. Let the lower limits of the proportion of each raw material component in the feed formula be b1, b2... b n , and the upper limits of the proportion in the feed formula are u1, u2... u n , and the prices of each raw material are c1, c2... c n , solve for the proportion of each formula when the price G of the feed formula is the lowest.

[0024] Since the lowest cost is one of the factors considered by users, and users will also consider the quality of the feed formula from the proportion of raw material components in the feed formula, so we model this problem as an integer programming problem.

[0025] The lowest cost is the objective function, and the expression is as follows: ; Considering the quality of the feed formula from the proportion of raw material components in the feed formula as a constraint condition, the expression is as follows: ; .

[0026] Use the cp_sat solver to build a model for solving. The core principle of the cp_sat solver is constraint programming based on delayed clause generation, and it also uses the simplex algorithm and linear relaxation, and runs in the way of a combined solver.

[0027] In the first stage of the solving process, the model is read from its protocol buffer representation form, and the correctness of the model is verified. In the second stage, preprocessing is carried out, and the problem scale is reduced through operations such as domain reduction, expansion of high-level constraints, detection of equivalent variables and affine relationships, replacement of canonical representations, and variable detection. In the third stage, the preprocessed model is loaded into the basic solver, and a linear relaxation is created. In the fourth stage, search is carried out, the search stage of the solution. Multiple sub-solvers using different strategies run in parallel on different threads, and a first solution searcher will also be started to find a feasible solution. After finding it, a local search heuristic algorithm (such as large neighborhood search) is used for further optimization. Linear relaxation is used in this process to detect infeasibility, determine boundaries, and assist in branch decisions. Finally, the obtained solution is converted back to the original model format. If the solving status is optimal, the optimal solution is saved, otherwise it is processed according to the situation and feedback is given on whether a feasible solution is found. The whole process can also be adjusted according to different parameter settings (such as whether to enumerate all solutions, use heuristic search, etc.).

[0028] The architecture of the solver during the search is divided into four layers: In the first layer, the current solution is first "destroyed", that is, several elements are removed from the current solution, and then the destroyed solution is "repaired" by reinserting the removed elements back into the solution, so as to obtain a solution of higher quality; by designing multiple sets of destruction operators and repair operators, the large neighborhood search can expand the search scope of the solution space and improve the current solution. During the iteration process, the better-performing destruction and repair methods will obtain higher scores and weights, and the algorithm will select and adjust the weights of each operator according to past performance to find the optimal solution. The specific method is as follows: During the search process, a feasible solution pool is generated. Suppose the size of the feasible solution pool is , then there are groups of feasible feed formulations. Let v be a group of feasible feed formulations, denoted as v1 = [x 11、 x 12 ……x 1n , and so on to ; The model selects a feasible solution of a feed formulation from the solution pool, removes a part of the variables from the solution, and then explores the neighborhood of these variables to find a feasible solution with lower cost. Then, in the replicated 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 put into the feasible solution pool. If the feasible solution pool is full, the previous feasible solution is removed; Suppose the solution in the feasible solution pool selected by the model is v1, copy a solution model, and select x 11 , x 14 , x 15 these three variables are removed, then the other variables are fixed and added to the replicated model as equality constraints, that is, it is required that x2 == x 12 , x3 == x 13 , and so on. Solve the replicated 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-layer solver is used to determine the lower bound of each search process. The relaxation algorithms in the solver include the dual simplex algorithm, the cutting plane method, the branch and bound method, etc. The dual simplex algorithm can find the lowest cost when x1...x n is an integer, and this cost is the lower bound of the cost of the integer programming; The cutting plane method uses the Gomory method. The basic idea is to solve the linear relaxation problem of the integer programming problem to obtain the optimal simplex table, and check whether the optimal solution satisfies the integer constraint conditions. If all variables take integer values, the optimal solution of the integer programming is obtained and the algorithm ends; otherwise, select a non-integer basic variable x i , according to the selected non-integer basic variable x iConstraint equations are used to generate Gomory cutting planes. The Gomory cutting planes are added to the linear relaxation problem to obtain a new linear programming problem. The new linear programming problem is solved using the simplex method or other appropriate methods. Return to the step of selecting non-integer basic 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 Gomory cutting planes is to set x i as a non-integer variable, and its constraint equation in the simplex table is: where a ij are coefficients, and b i is a constant. They are decomposed into the sum of the integer part and the fractional part. The fractional part of a ij is f ij , and the fractional part of b i is f i , and their value ranges are [0, 1). From this, a Gomory 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 basic variables, and it can cut off the non-integer optimal solution of the current linear relaxation problem; The third layer is integer encoding. The constraint conditions of all integer variables are transformed into the constraint conditions of two Boolean variables. For example, if the proportion 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 running to judge the value of x as i, an additional Boolean clause x <= i is generated; 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 representing all possible constraints at the beginning. When the solver searches the solution space, it first tries to find a solution using only the current existing constraints. When encountering a conflict or unable to continue the search, it will analyze the cause of the problem and dynamically generate new constraint clauses based on this information. These new clauses can exclude the solution space region that causes the current conflict, thus guiding the search towards a direction more likely to find a feasible solution. For example, when generating 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 causes the conflict.

[0029] In this case, the data collected is that the formula consists of 22 kinds of raw materials, namely bean curd fiber, seaweed powder, barley by-products, brown algae protein powder, fermented starch residue, cassava protein residue, high-protein mealworm, squid powder, water-soluble protein, various fish-derived animal and plant proteins, bacterial protein, etc. Various components of feed raw materials are measured by instruments, such as the percentage content of typical dry matter, the percentage content of various amino acid derivatives, and the percentage content of conventional ingredients; the constraints of nutrient components are calculated through fish farming expertise. In this example, the crude protein content is required to be 54%, the four types of amino acid derivatives have corresponding range constraints, and the 22 types of raw material components also have their own upper and lower limit component constraints. Add various linear constraints to the solver to build the basic model of the solver.

[0030] S4. Adjust model parameters: Use the heuristic algorithm ERWA, which is a technique for incrementally estimating the moving average. It makes the estimate more conform to the recent trend by assigning greater weights to recent results. 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 to help the agent balance exploration and exploitation. In the branch heuristic method for solving the Boolean satisfiability problem, each variable is analogized to an "arm", and ERWA is used to dynamically and online estimate the moving average of the "scores" of each variable in the input formula to reflect the frequency and persistence of conflicts generated by the variable in the past, assisting the solver in determining the branching variable order. The initial_variables_activity represents the initial value of variable activity. When the "learning rate" of a certain variable is lower than this initial activity value, the solver is more inclined to branch on variables that have never been explored before. This strategy helps the solver explore more comprehensively and prevent getting stuck in local optimal solutions. The random_branches_ratio represents the ratio of randomly selecting branching variables during the solution process of the cp_sat solver. That is, when deciding which variable to branch on, a certain proportion of decisions will be made randomly rather than selecting the first variable according to the pre-set variable sorting strategy. The num_workers is a variable used to control the number of parallel working threads of the solver during the 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 using parallel computing. When solving complex problems, many computing tasks can be executed in parallel. For example, in the solution of the Boolean satisfiability problem, different search branches can be processed by different threads simultaneously. More threads mean that multiple search paths can be explored simultaneously, thus greatly reducing the time required to find a solution. The relative_gap_limit is a parameter used to control the search stop condition of the solver. In the solution of optimization problems, the solver continuously searches for feasible solutions and improves the objective function value. There are the best feasible objective value and the best objective bound, and the 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 state as OPTIMAL.

[0031] S5. Set the feed formula ratio for the initial search of the solver: For example, when we know that the ratio of twenty-two raw material components is 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. If we hope that the search starting point of the model is the above value, we can input the ratio of the corresponding feed in the interactive interface. The input interface is as follows Figure 3 shown.

[0032] The user can add a hint message to the solver. During the constraint programming solving process, sometimes the user may already know the possible values of certain feed formulations or hope to observe the search paths generated by different search starting points. By adding a hint message, the solver can be specified to start the search from this feed formulation. Whether the formulation is a feasible solution or not, the model can proceed normally.

[0033] S6. Run the model for solving: All feasible solutions during the model search process are saved to a file for the user to select. The user can make a selection based on various factors such as the proportion of nutritional components and the cost. If the user feels that the current feed formulation can be further adjusted at this time, the parameters can be adjusted or the search starting point can be reset.

[0034] S7. Visualization output: Draw a two-dimensional plane projection diagram of the search process. During the optimization of the feed formulation, since the formulation involves multiple raw materials, it is difficult to draw an image of a high-dimensional plane. Therefore, this technology cleverly processes the feed formulations obtained during the search process and projects them onto a two-dimensional plane. Specifically, by fixing two raw material components in the feed, the internal relationship between the values of these two raw material components and the cost is deeply observed, and it is saved and presented in the form of a vivid animated graph. The Matplotlib and Plotly libraries in Python are used to implement this visualization process. When drawing, each scatter point carries rich information: the order of generation of the scatter points, the specific numerical values of the horizontal and vertical coordinates, and the corresponding cost values will be clearly marked as hint messages beside the scatter points for the user to intuitively understand. The color and size of the scatter points are also closely related to the cost value. To more intuitively display the cost difference, after a specific function transformation of the cost value, color mapping is performed. The color interval is set to gradually change from bright yellow to deep red. The darker the color, the higher the cost; the size of the scatter point also increases as the cost value increases. The higher the cost value, the larger the scatter point appears in the graph. See the two-dimensional plane diagram of the search process visualization in the attached drawing.

[0035] Drawing heat maps: In order to more intuitively show the impact of different values of different raw material components on cost, the system will present the results in the form of heat maps. In the heat map, taking soybean husk fiber and high-ash meat meal as examples, when the user specifies that the variables of these two feed raw materials are fixed, the system will comprehensively traverse all possible variable combinations within the upper and lower limits of the two raw material components. For each set of such combinations, 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, their values are used as horizontal and vertical coordinates respectively, and the cost value is reflected by the depth of color. Among them, the darker the color, the lower the corresponding cost value. The system will clearly mark the position of the lowest cost point in the figure, and clearly prompt the horizontal and vertical coordinate values and specific cost values corresponding to the point when the cost is the lowest at the bottom of the image. At the same time, a color bar will be added to the right side of the image to intuitively display the correspondence between cost and color value.

[0036] In addition, in order to further analyze and visualize the probability density distribution of the data, the system will use the Gaussian kernel function as the kernel density estimation function. Through kernel density estimation, a smooth continuous image can be generated, and the user can intuitively feel the value range of the two specified raw material components with lower costs, thereby adjusting the specified search starting point and the final selected formula ratio. See the attached feed formula cost heat map.

[0037] Kernel density estimation is to infer the distribution of overall data based on a limited sample. Using the above method, we get 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 out the range in which the feed cost is lower. The formula for the two-dimensional kernel density estimation function is as follows: ; 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.

[0038] The above is only a preferred implementation 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 interaction method for fish feed formula design, characterized in that It includes the following steps: S1. Collect feed raw material data; S2. Calculate the nutritional requirement data of fish; S3. Establish a constraint programming model with the lowest cost, and use a solver to solve the established model; S4. Adjust the model parameters; S5. Set the feed formula ratio for the initial search of the solver; S6. Solve the model; S7. Visualize and output.

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

3. The visual interaction method for fish feed formula design according to claim 1, characterized in that In step S2, obtain the nutritional requirements of the set fish at different growth stages, calculate the range of each nutritional component in the feed formula as the nutritional requirement constraint. At the same time, according to the influence of the formula components on the growth status of fish, calculate the upper and lower limits of the percentage of various raw material components in the formula.

4. The visualization interaction method for fish feed formula design according to claim 1, characterized in that In step S3, it is assumed that there are n raw material components, and each raw material component contains r nutrient components, with the contents expressed as a 11 、a 12 ……a 1r , and so on until a n1 、a n2 ……a nr ; the proportions of each raw material component in the feed formula are x1, x2... x n , and the constraints on the nutrient component contents in the feed are p1, p2... p r ; the lower limits of the proportions of each raw material component in the feed formula are b1, b2... b n , and the upper limits of the proportions in the feed formula are u1, u2... u n , and the prices of each raw material are c1, c2... c n , solve for the proportions of each formula when the price G of the feed formula is the lowest: The lowest cost is the objective function, and the expression is as follows: ; Consider the quality of the feed formula from the proportion of raw material components in the feed formula as a constraint condition, and the expression is as follows: ; 。 5. The visual interaction method for fish feed formula design according to claim 1, characterized in that, In step S3, the architecture of the solver during the search is divided into four layers: In the first layer, first "destroy" the current solution, that is, remove several elements from the current solution, and then "repair" the destroyed solution by inserting the removed elements back into the solution. In this way, a higher-quality solution can be obtained; by designing multiple groups of destruction operators and repair operators, large neighborhood search can expand the search range of the solution space and improve the current solution. During the iteration process, good destruction and repair methods will obtain higher scores and weights, and the algorithm will select and adjust the weights of each operator according to past performance to find the optimal solution. The specific method is as follows: A feasible solution pool is generated during the search process. Assume the size of the feasible solution pool is , then there are groups of feasible feed formulations. Let v be a group of feasible feed formulations, denoted as v1 = [x 11、 x 12 ... x 1n , and so on until ; The model selects a feasible solution of a feed formulation from the solution pool, removes a part of the variables from the solution, and then explores the neighborhood of these variables to find a feasible solution with lower cost. Then, in the replicated 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 put into the feasible solution pool. If the feasible solution pool is full, the previous feasible solution is removed; Assume the solution selected by the model from the feasible solution pool is v1. Make a copy of the solution model. According to the heuristic strategy, select x 11 , x 14 , x 15 and remove these three variables. Then the other variables are fixed and added to the replicated model as equality constraints, that is, it is required that x2 == x 12 , x3 == x 13 , and so on. Solve the replicated 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 in the second layer of the solver is used to determine the lower bound of each search process; The third layer is integer encoding, which transforms the constraint conditions of all integer variables into the constraint conditions of two Boolean variables; 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 representing all possible constraints at the beginning; when the solver searches the solution space, it first tries to find a solution using only the existing constraints. When conflicts occur or the search cannot continue, it will analyze the reasons for the problem and dynamically generate new constraint clauses based on this information. These new clauses can exclude the solution space area that currently causes conflicts, thus guiding the search in a direction more likely to find a feasible solution.

6. The visual interaction method for fish feed formula design according to claim 1, characterized in that In step S4, the heuristic algorithm ERWA is used to adjust the model parameters. ERWA dynamically and online estimates the moving average of the "scores" of each variable in the input formula to reflect the frequency and persistence of variable conflicts in the past, and assists the solver in determining the branching variable order; initial_variables_activity represents the initial value of variable activity, that is, the polarities of feed ingredients x1, x2... x n When the "learning rate" of a certain variable is lower than this initial activity value, the solver is more inclined to branch on variables that have never been explored before; random_branches_ratio represents the ratio of randomly selecting branching variables during the solution process of the cp_sat solver. That is to say, when deciding which variable to branch on, a certain proportion of decisions will be made randomly, rather than selecting the first variable according to the pre-set variable sorting strategy; num_workers is a variable used to control the number of parallel working threads of the solver during the 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 using parallel computing. Different threads will execute different heuristic strategies to accelerate the solution; relative_gap_limit is a parameter used to control the search stop condition of the solver. In the optimization problem solution, the solver will continuously search for feasible solutions and improve the objective function value. There are the best feasible objective value and the best objective bound. 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.

7. The visual interaction method for fish feed formula design according to claim 1, characterized in that In step S5, the user can add a hint message to the solver. During the constraint programming solution process, if the user already knows the possible values of some feed formulas or hopes to observe how different search starting points will generate search paths, by adding a hint message, the solver can be specified to start the search from this feed formula. Whether the formula is a feasible solution or not, the model will proceed normally.

8. The visual interaction method for fish feed formula design according to claim 1, characterized in that In step S6, all feasible solutions during the model search process are saved to a file for the user to select; the user can make a selection based on multiple factors. If you want to further adjust the feed formula at this time, you can adjust the parameters or reset the search starting point.

9. The visual interaction method for fish feed formula design according to claim 1, characterized in that The visual output in step S7 includes drawing a two-dimensional plane projection diagram of the search process. The specific method is as follows: By fixing two raw material components in the feed, the internal relationship between the values of these two raw material components and the cost is deeply observed, and it is saved and presented in the form of vivid animated pictures; when drawing, each scatter point carries rich information: the order of generation of the scatter points, the specific values of the horizontal and vertical coordinates, and the corresponding cost values will be clearly marked as prompt information beside the scatter points for the convenience of users to understand intuitively.

10. The visual interaction method for fish feed formula design according to claim 1, characterized in that Step S7. The visualization output in step S7 includes drawing a heat map, and the specific method is as follows: When the user specifies to fix two feed raw material variables, the system will comprehensively traverse all possible variable combinations within the upper and lower limits of each of these two raw material components; for each such combination, the system will keep other variables in a freely variable state, and then accurately calculate the corresponding lowest cost value with the help of the cp_sat solver; when drawing, their values are used as the horizontal and vertical coordinates respectively, and the cost value is reflected by the depth of the color; among them, 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

  • Feed formula determination method and device, electronic equipment and storage medium

    CN114239933A

  • Multi-ship cooperative offshore wind power operation and maintenance scheduling efficient optimization method and related device

    CN117892893A

  • Method and device for determining feasible solution of MILP problem and storage medium

    CN118134000A