Method and device for determining production data of soy sauce, electronic equipment and medium
By constructing a nonlinear regression model of soy sauce production data and indicators, and using genetic algorithms and Bayesian optimization algorithms to optimize production data, the problem of untimely and inaccurate regulation in soy sauce production is solved, and more efficient and accurate determination of production data is achieved.
Patent Information
- Application Number
- CN202411779356.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-18
AI Technical Summary
During the soy sauce production process, due to the inaccurate and inaccurate experience of staff, the raw material input is large but the soy sauce yield is low.
Using machine learning method, a nonlinear regression model of production data and indicators is constructed based on the historical production data and indicator values of soy sauce, and the objective function is constructed based on the yield rate and raw material input ratio as variables. Through genetic algorithms and Bayesian optimization algorithms, the production data value that meets the preset conditions is determined.
Improve the efficiency and accuracy of soy sauce production data, ensuring a higher yield, a lower raw material investment ratio, and no manual participation is required.
Smart Images

Figure CN119644949A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of soy sauce manufacturing and computer technology, and in particular to a method, device, electronic device and medium for determining production data of soy sauce. Background Art
[0002] A lot of production data is used in the production process of soy sauce, such as raw material data such as soybean properties and feed amount, environmental data such as external temperature, equipment parameters such as equipment pressure, and process data such as koji making process, etc. These production data are currently mainly regulated by the experience of the staff. Summary of the invention
[0003] The inventors have discovered that when the staff regulates the production data of soy sauce, the regulation may be untimely and inaccurate, resulting in a large amount of raw material input but a low yield of soy sauce produced.
[0004] A technical problem to be solved by the present disclosure is: how to improve the efficiency and accuracy of determining the production data of soy sauce.
[0005] According to some embodiments of the present disclosure, a method for determining production data of soy sauce is provided, comprising: determining a nonlinear regression model of the production data and the index according to the values of the production data in the historical production process of the soy sauce and the values of the index of the produced soy sauce, wherein the production data includes at least one of raw material data, environmental data, equipment data, and process data, and the index includes yield; constructing an objective function with the yield and raw material input ratio as variables, wherein the value of the objective function is positively correlated with the value of the yield and negatively correlated with the value of the raw material input ratio; and determining the value of the production data when preset conditions are met according to the nonlinear regression model and the objective function.
[0006] In some embodiments, determining the value of the production data when a preset condition is met based on the nonlinear regression model and the objective function includes: based on a genetic algorithm, determining the value of the production data when a preset condition is met based on the nonlinear regression model and the objective function, wherein the objective function serves as a fitness function in the genetic algorithm.
[0007] In some embodiments, the genetic algorithm-based method, according to the nonlinear regression model and the objective function, determines the value of the production data when the preset conditions are met, including: in each iteration of the genetic algorithm, according to the nonlinear regression model, determining the value of the fitness function; when the iteration stop condition is not met, updating the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model based on the Bayesian optimization algorithm according to the value of the fitness function, wherein the preset conditions include the iteration stop condition, and the updated hyperparameters of the nonlinear regression model are used for the next iteration process; when the iteration stop condition is met, determining the value of the production data.
[0008] In some embodiments, during each iteration of the genetic algorithm, determining the value of the fitness function according to the nonlinear regression model includes: during each iteration of the genetic algorithm, inputting the value of the production data corresponding to each individual in the current population into the nonlinear regression model to determine the value of the fitness function corresponding to each individual in the current population.
[0009] In some embodiments, the genetic algorithm-based method, according to the nonlinear regression model and the objective function, determines the value of the production data when the preset conditions are met, and further includes: when the iteration stop condition is not met, performing selection operations, crossover operations and mutation operations based on the updated hyperparameters of the genetic algorithm and the value of the fitness function corresponding to each individual in the current population to obtain the value of each individual in the next generation population and its corresponding production data.
[0010] In some embodiments, the indicator also includes a quality indicator, and the quality indicator includes at least one of total acidity, amino acid nitrogen content, total nitrogen content, reducing sugar content and alcohol content. The selection operation, crossover operation and mutation operation are performed according to the updated hyperparameters of the genetic algorithm and the value of the fitness function corresponding to each individual in the current population to obtain the value of each individual in the next generation population and its corresponding production data, including: inputting the value of the production data corresponding to each individual in the current population into the nonlinear regression model to determine the value of the quality indicator corresponding to each individual in the current population; and performing selection operation, crossover operation and mutation operation according to the updated hyperparameters of the genetic algorithm, the value of the fitness function corresponding to each individual in the current population and the value of the quality indicator to obtain the value of each individual in the next generation population and its corresponding production data.
[0011] In some embodiments, updating the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model based on the Bayesian optimization algorithm according to the value of the fitness function includes: constructing a proxy model in the Bayesian optimization algorithm corresponding to the fitness function, wherein the proxy model is a Gaussian process regression model; updating the parameters of the proxy model according to the value of the fitness function; updating the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model according to the updated proxy model and acquisition function, wherein the acquisition function is an expected improvement function.
[0012] In some embodiments, the genetic algorithm-based, nonlinear regression model and objective function-based, determination of the value of the production data when preset conditions are met also includes: determining an initialization range of hyperparameters of the genetic algorithm based on a Bayesian optimization algorithm; randomly generating a primary population based on the initialization range, wherein a preset number of groups of production data values are randomly selected as the values of the production data corresponding to multiple individuals in the primary population.
[0013] In some embodiments, the nonlinear regression model includes a random forest model, and determining the nonlinear regression model of the production data and the index according to the value of the production data in the historical production process of the soy sauce and the value of the index of the produced soy sauce includes: constructing a random forest model for each of a plurality of raw material types and a plurality of mash types; training the random forest model corresponding to each raw material type and each mash type using the value of the production data corresponding to the historical production process of the soy sauce and the value of the index of the produced soy sauce to determine the parameters of the random forest model; determining the value of the production data when the preset conditions are met according to the nonlinear regression model and the objective function includes: determining the value of the production data when the preset conditions are met according to the random forest model corresponding to the raw material type and the mash type and the objective function for each raw material type and each mash type.
[0014] In some embodiments, the raw material input ratio is the ratio of the raw material input amount to the equipment capacity, and constructing the objective function with the yield and the raw material input ratio as variables includes: taking the weighted sum of the yield and the raw material input ratio to determine the objective function.
[0015] According to other embodiments of the present disclosure, a device for determining production data of soy sauce is provided, comprising: a first determination module, configured to determine a nonlinear regression model of the production data and the index according to the values of the production data in the historical production process of the soy sauce and the values of the index of the produced soy sauce, wherein the production data includes at least one of raw material input data, environmental data, equipment data, and process data, and the index includes yield; a construction module, configured to construct an objective function with the yield and raw material input ratio as variables, wherein the value of the objective function is positively correlated with the value of the yield and negatively correlated with the value of the raw material input ratio; a second determination module, configured to determine the value of the production data when a preset condition is met according to the nonlinear regression model and the objective function.
[0016] According to some further embodiments of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory coupled to the processor, for storing instructions, which, when executed by the processor, causes the processor to execute the method for determining production data of soy sauce of any embodiment of the present disclosure.
[0017] According to some further embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the program is executed by a processor, the method for determining the production data of soy sauce according to any embodiment of the present disclosure is implemented.
[0018] According to some further embodiments of the present disclosure, a computer program product is provided, comprising instructions, which, when executed by a processor, cause the processor to execute the method for determining production data of soy sauce according to any embodiment of the present disclosure.
[0019] In the embodiment of the present disclosure, a machine learning method is used to determine a nonlinear regression model of the production data and the index according to the value of the production data in the historical production process of the soy sauce and the value of the index of the produced soy sauce, and then construct an objective function with the yield rate and the raw material input ratio as variables, and determine the value of the production data under the condition of meeting the preset conditions according to the nonlinear regression model and the objective function. Since the nonlinear regression model represents the relationship between the production data and the index, the yield rate can be determined by the nonlinear regression model for any production data, and then the value of the objective function is determined. Since the value of the objective function is positively correlated with the value of the yield rate and negatively correlated with the value of the raw material input ratio, the value of the production data with a higher yield rate and a lower raw material input ratio can be determined by combining the nonlinear regression model and the objective function. In addition, the method of the present disclosure does not require human participation, and can improve the efficiency and accuracy of determining the production data of soy sauce.
[0020] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 A schematic flow chart showing a method for determining production data of soy sauce according to some embodiments of the present disclosure.
[0023] Figure 2 A schematic flow chart showing a method for determining production data of soy sauce according to other embodiments of the present disclosure.
[0024] Figure 3 A schematic diagram showing the structure of a device for determining production data of soy sauce according to some embodiments of the present disclosure.
[0025] Figure 4 A schematic diagram showing the structure of an electronic device according to some embodiments of the present disclosure.
[0026] Figure 5 A schematic diagram showing the structure of an electronic device according to some other embodiments of the present disclosure. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present disclosure and its application or use. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0028] In the soy sauce production process, the production data is mainly regulated by the staff based on their experience, which has the problem of untimely and inaccurate regulation. Therefore, the present disclosure proposes a method for determining the production data of soy sauce, which can improve the efficiency and accuracy of determining the production data of soy sauce. Figures 1-2 Some embodiments of the method for determining production data of soy sauce disclosed in the present invention are described.
[0029] Figure 1 Flow charts of some embodiments of the method for determining the production data of soy sauce disclosed in the present invention. Figure 1 As shown, the method of this embodiment includes: steps S102 to S106.
[0030] In step S102, a nonlinear regression model of the production data and the index is determined according to the values of the production data in the historical production process of the soy sauce and the values of the index of the produced soy sauce.
[0031] In some embodiments, the production data includes at least one of raw material data, environmental data, equipment data, and process data.
[0032] For example, raw material data includes: one or more of raw material properties, feed amount, and feed stability. Raw materials include soybeans (or soy beans), wheat, and koji seeds. Soybean properties include one or more of crude protein content, moisture content, particle size, and thickness. Wheat properties include one or more of crude protein content, moisture content, and total sugar content.
[0033] For example, the environmental data includes at least one of: season information, temperature, and humidity. For example, the equipment data includes at least one of: production line identification, equipment identification, equipment type, equipment model, and equipment operating condition information.
[0034] For example, the process data includes process parameters in at least one of the processes of cooking, koji making, yellowing and fermentation. For example, one or more of the control parameters of the steam equipment such as the pressure, delivery flow rate, frequency, etc. of the cooking equipment in the cooking process. For example, one or more of the control parameters of the koji material temperature, koji material humidity, moisture, frequency, koji loosening operation, time, etc. in the koji making process. For example, one or more of the control parameters of the brine moisture, temperature, flow, etc. in the yellowing process. For example, one or more of the control parameters of the brine addition amount, time, temperature, etc. in the fermentation process.
[0035] The production process of soy sauce involves a lot of production data, which is not limited to the examples given. In some embodiments, all data related to the production process of soy sauce are collected, and the required production data is determined by a feature engineering method. Then, the production data is extracted from the historical production process of soy sauce. Thereby improving the efficiency and accuracy of the subsequent determination of the nonlinear regression model.
[0036] The indicators of soy sauce include yield, which can be used to measure the utilization rate of soy protein. Soy sauce is graded according to the amino acid content. The process from a soybean to a drop of soy sauce is the process of protein decomposition into amino acids. The higher the yield, the higher the utilization rate of soy protein. The indicators of soy sauce can also include quality indicators. Quality indicators include at least one of total acidity, amino acid nitrogen content, total nitrogen content, reducing sugar content and alcohol content. Quality indicators can be used to evaluate the quality of soy sauce crude oil.
[0037] In some embodiments, the nonlinear regression model is trained using the values of the corresponding production data in the historical production process of soy sauce and the values of the indicators of the produced soy sauce to determine the parameters of the nonlinear regression model.
[0038] The nonlinear regression model can be trained using the values of historical production data and the values of soy sauce indicators to fit the relationship between production data and indicators, thereby obtaining a trained nonlinear regression model. For example, the nonlinear regression model is a random forest model, which is not limited to the examples given. Different decision trees (or random forests) can be constructed for different indicators, which are used to represent the relationship between production data and different indicators. Different decision trees (or random forests) correspond to the same input features, namely production data, but correspond to different output features, namely indicators. Any set of values of production data can be subsequently input into different decision trees to obtain different values of indicators.
[0039] For example, for each indicator y i , train a random forest model:
[0040]
[0041] in, is the predicted value of the ith indicator, f i is the corresponding random forest model, and x is the input feature, i.e., production data.
[0042] For example, when applying the random forest model, for new production data x new , use each trained random forest model to make predictions and get the prediction results of multiple indicators:
[0043]
[0044] in, is the set of prediction results.
[0045] In some embodiments, a nonlinear regression model is constructed for each raw material type and each mash type among multiple raw material types and multiple mash types; for the nonlinear regression model corresponding to each raw material type and each mash type, the nonlinear regression model is trained using the values of the corresponding production data in the historical production process of soy sauce and the values of the indicators of the produced soy sauce to determine the parameters of the nonlinear regression model.
[0046] For example, a random forest model is constructed for each type of raw materials and each type of mash among multiple types of raw materials and multiple types of mash; for the random forest model corresponding to each type of raw materials and each type of mash, the random forest model is trained using the values of the corresponding production data in the historical production process of soy sauce and the values of the indicators of the produced soy sauce to determine the parameters of the random forest model.
[0047] Since the types of raw materials and mash are optional in the soy sauce production process, different types of raw materials and mash will have different effects on the relationship between production data and indicators. Therefore, a random forest model can be built for each raw material type and each mash type, and the random forest model can be trained. For example, 12 random forest models can be built for 3 soybean types and 4 mash types. In subsequent applications, the corresponding random forest model can be used for different raw material types and mash types to improve accuracy.
[0048] In step S104, an objective function is constructed with the yield rate and the raw material input ratio as variables.
[0049] The value of the objective function is positively correlated with the value of the yield rate and negatively correlated with the value of the raw material input ratio. For example, the raw material input ratio is the ratio of the raw material input amount to the equipment capacity. For example, the raw material input ratio is the ratio of the soybean input amount to the equipment capacity.
[0050] In some embodiments, the objective function is determined by a weighted summation of the yield and the feedstock input ratio.
[0051] For example, the objective function can be expressed as follows:
[0052] f(x)=w 1 Yield (x)-w 2 ·Raw material input ratio (x 原料 , x 容量 )
[0053] Among them, x includes various production data, x 原料 , x 容量 Respectively represent the raw material input and equipment capacity, w 1 and w 2 are the weights of the yield rate and the raw material input ratio, respectively, and are both positive numbers. Since the nonlinear regression model includes a model that represents the relationship between production data and yield rate, that is, the yield rate (x) can be directly obtained through the nonlinear regression model.
[0054] In step S106, the value of the production data is determined when the preset conditions are met according to the nonlinear regression model and the objective function.
[0055] According to the nonlinear regression model, the value of the yield can be determined for any value of the production data, and then the value of the objective function can be determined. The higher the value of the yield, the lower the value of the raw material input ratio, and the higher the value of the objective function. For example, the preset condition includes the value of the objective function reaching the maximum. For example, when the value of the production data is determined by an iterative algorithm, the preset condition includes reaching the iteration stop condition (for example, a preset number of iterations), and the value of the objective function can be increased by the iterative algorithm.
[0056] In some embodiments, when the soy sauce index includes yield and one or more quality indexes, the preset condition may further include that the one or more quality indexes meet the quality requirements. For example, the one or more quality indexes reach corresponding thresholds.
[0057] In some embodiments, when a random forest model is constructed for each of a plurality of raw material types and a plurality of mash types, for each raw material type and each mash type, the value of the production data is determined under preset conditions based on the random forest model and objective function corresponding to the raw material type and the mash type.
[0058] In the case of different types of raw materials and mash, the value of production data can be determined separately to improve the accuracy of production data determination.
[0059] The method of the above embodiment adopts a machine learning method, and determines the nonlinear regression model of the production data and the index according to the value of the production data in the historical production process of soy sauce and the value of the index of the produced soy sauce, and then constructs the objective function with the yield rate and the raw material input ratio as variables, and determines the value of the production data under the condition of meeting the preset conditions according to the nonlinear regression model and the objective function. Since the nonlinear regression model represents the relationship between the production data and the index, the nonlinear regression model can be used to determine the yield rate for any production data, and then determine the value of the objective function. Since the value of the objective function is positively correlated with the value of the yield rate and negatively correlated with the value of the raw material input ratio, the value of the production data with a higher yield rate and a lower raw material input ratio can be determined by combining the nonlinear regression model and the objective function. In addition, the method of the above embodiment does not require manual participation, and can improve the efficiency and accuracy of determining the production data of soy sauce.
[0060] The following describes, in conjunction with some embodiments, how to determine the value of production data when preset conditions are met based on a nonlinear regression model and an objective function.
[0061] In some embodiments, based on a genetic algorithm, according to a nonlinear regression model and an objective function, the value of production data is determined when preset conditions are met, wherein the objective function serves as a fitness function in the genetic algorithm.
[0062] For example, in each iteration of the genetic algorithm, the value of the fitness function (fitness) is determined according to the value of the production data corresponding to each individual in the current population and the nonlinear regression model; whether the iteration stop condition is reached is determined according to the value of the fitness function, and if the iteration stop condition is not reached, selection operations, crossover operations, and mutation operations are performed according to the value of the fitness function to obtain the value of each individual in the next generation population and its corresponding production data, and the above process is repeated until the iteration stop condition is reached and the value of the production data is determined. For example, the iteration stop condition is that the value of the fitness function reaches the maximum or reaches a preset number of iterations.
[0063] For example, in each iteration of the genetic algorithm, the value of the production data corresponding to each individual in the current population is input into the nonlinear regression model to determine the value of the fitness function corresponding to each individual in the current population.
[0064] In some embodiments, when the soy sauce index includes yield and one or more quality indexes, selection operation, crossover operation and mutation operation are performed according to the value of fitness function and the value of quality index corresponding to each individual in the current population to obtain the value of each individual and the corresponding production data in the next generation population. The value of production data corresponding to each individual in the next generation population makes the value of quality index meet the quality requirements.
[0065] For example, a primary population is randomly generated, and the primary population may include N individuals (N is an integer greater than 0). The value of the production data corresponding to each individual is randomly generated, and each individual corresponds to a set of production data values. In order to improve the diversity of the primary population, the Latin Hypercube Sampling method can be used to generate the primary population to ensure uniform distribution in the high-dimensional space. For example, the primary population can be expressed as: X 0 ={x 1 ,x 2 ,…,x N}.
[0066] The fitness function can be represented by the objective function f(x), and the fitness function can be expressed as Fitness(x)=f(x). In each iteration, the fitness of each individual (the value of the fitness function) can be determined according to the fitness function. A preset number of individuals are selected according to the fitness of each individual. For example, the selection operation adopts tournament selection, which can effectively improve the accuracy and efficiency of the selection. For example, set the tournament size k to 4, randomly select 4 individuals each time, and select the individual with the highest fitness as the parent. The selection probability can be expressed as:
[0067]
[0068] Among them, x i represents the i-th individual, and N is the total number of individuals.
[0069] Further, a crossover operation is performed based on the selected individuals to generate new individuals. For example, for high-dimensional parameter space, a uniform crossover method and / or a multi-point crossover method can be used to improve the effect of crossover. The uniform crossover method randomly selects genes from parent 1 or parent 2 on each gene to generate new individuals. Multi-point crossover performs crossover at multiple positions to generate new individuals. The generation of new individuals (offspring, next generation individuals) using the uniform crossover method can be expressed by the following formula:
[0070]
[0071] Among them, p c is the crossover probability, random is a random number, x parent1 [i] and x parent2 [i] represents the values of production data corresponding to parent generation 1 and parent generation 2 respectively.
[0072] During the execution of the multi-point crossover method, multiple crossover points c are selected 1 ,c 2 ,…,c m , the generated new individuals can be expressed by the following formula:
[0073]
[0074] Among them, p c is the crossover probability, random is a random number, x parent1 [i] and x parent2 [i] represents the values of production data corresponding to parent generation 1 and parent generation 2 respectively.
[0075] The feed amount in the raw material data, the temperature, pressure, and humidity (fluctuations within a specific time period) in the process data have a greater impact on the results. In these parameters, multi-point crossover deep fusion of excellent parent genes is used to explore better fitness. The remaining equipment data uses uniform crossover, traversing the parent generation according to p c Decide whether to cross.
[0076] After obtaining new individuals based on the crossover operation, mutation operations can be performed on the new individuals. For example, non-uniform mutation methods and / or adaptive mutation methods can be used to adapt to high-dimensional parameter spaces. The non-uniform mutation method maintains a larger mutation in the early stage, and can focus on mutating the values of production data with higher fluctuations corresponding to the individuals, and gradually reduce the mutation amplitude as the evolution proceeds. The adaptive mutation method adjusts the mutation rate according to the fitness of the current population. The mutated individuals can be expressed by the following formula:
[0077] x mutated =x original +random·δ(t)
[0078] Among them, δ(t) is the variation amplitude over time, random is the random disturbance, and x original is the value of the production data before mutation.
[0079] Finally, the survivors are selected for the mutated individuals. For example, the elite retention strategy is adopted when selecting survivors to retain the k individuals with the highest fitness to ensure that the optimal solution will not be lost during the evolution process. The selected survivors as individuals in the next generation population can be represented as X next ={x 1 ,x 2 ,…,x k}.
[0080] In the case where the soy sauce index includes yield and one or more quality indexes, a parent generation whose one or more quality indexes meet the quality requirements can be selected during the above selection operation; and / or when selecting survivors for the mutated individuals, one or more quality indexes corresponding to the selected survivors meet the quality requirements. The value of the production data finally determined can make the value of the objective function higher, obtain a higher yield and a lower raw material input ratio, and ensure that the quality requirements are met.
[0081] After determining the individuals in the next generation population, start again from the step of determining the fitness of each individual, and repeat the above process until the iteration stop condition is reached. The value of the production data of the individual with the highest fitness is used as the final value of the production data.
[0082] The method of the above embodiment adopts a genetic algorithm to determine the value of production data under the condition of satisfying preset conditions according to a nonlinear regression model and an objective function. It can search for the global optimal solution in a high-dimensional parameter space, thereby improving the efficiency and accuracy of determining the value of production data.
[0083] In order to further effectively find the global optimal solution and improve the accuracy of production data determination, the present disclosure also proposes a method for optimizing the hyperparameters of the genetic algorithm and the nonlinear regression model using the Bayesian optimization algorithm, which is described below in conjunction with some embodiments.
[0084] In some embodiments, during each iteration of the genetic algorithm, the value of the fitness function is determined according to the nonlinear regression model; when the iteration stop condition is not met, the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model are updated based on the Bayesian optimization algorithm according to the value of the fitness function, wherein the preset conditions include the iteration stop condition, and the updated hyperparameters of the nonlinear regression model are used for the next iteration process; when the iteration stop condition is met, the value of the production data is determined.
[0085] For example, in each iteration of the genetic algorithm, the value of the production data corresponding to each individual in the current population is input into the nonlinear regression model to determine the value of the fitness function corresponding to each individual in the current population.
[0086] For example, the hyperparameters of the genetic algorithm include population size, crossover rate, mutation rate, etc. When the nonlinear regression model is a random forest, the hyperparameters of the random forest are the number of trees, the maximum depth, etc., which can be determined according to the actual model used and are not limited to the examples given. The following describes how to update the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model based on the Bayesian optimization algorithm in conjunction with some embodiments.
[0087] The range of hyperparameters of genetic algorithms and nonlinear regression models can be initialized based on the Bayesian optimization algorithm, providing initial bounds, which can provide more reasonable initial parameters for the genetic algorithm, thereby improving its performance.
[0088] In some embodiments, an initialization range of a hyperparameter of a genetic algorithm is determined based on a Bayesian optimization algorithm; a primary population is randomly generated according to the initialization range, wherein values of a preset number of groups of production data are randomly selected as values of production data corresponding to multiple individuals in the primary population.
[0089] For example, the initialization range may include the size of the initial population, based on which the initial population is generated.
[0090] During the execution of the genetic algorithm, the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model can be updated based on the Bayesian optimization algorithm.
[0091] In some embodiments, a proxy model in a Bayesian optimization algorithm corresponding to a fitness function is constructed; the parameters of the proxy model are updated according to the value of the fitness function; and the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model are updated according to the updated proxy model and the acquisition function, wherein the acquisition function is a desired improvement function.
[0092] For example, the surrogate model is a Gaussian Process Regression (GPR) model used to fit the target function f(x). This model can provide the predicted mean and uncertainty, and its mathematical formula can be expressed as:
[0093]
[0094] Among them, μ(x) is the mean function, σ(x) is the covariance function (kernel function), and ∈ is the noise term of the standard normal distribution.
[0095] The Gaussian process regression (GPR) model is updated by using the value (or fitness) of the objective function evaluated by the genetic algorithm. The mean function and covariance function of the Gaussian process regression model are adjusted according to the value of the new objective function to improve the fitting accuracy. This process includes retraining the Gaussian process regression model.
[0096] In the Bayesian optimization algorithm, the acquisition function is used to select the next sampling point x. * For example, the acquisition function is Expected Improvement (EI), and its formula is:
[0097]
[0098] Among them, f * is the historical optimal value of the objective function, is the predicted value of the surrogate model for the current parameter set.
[0099] The acquisition function is optimized on the updated Gaussian process regression model to determine the next parameter (hyperparameter for genetic algorithm or nonlinear regression model) configuration that is most likely to improve the value of the objective function. This step can be implemented using numerical optimization methods such as gradient descent.
[0100] The next set of parameter configurations is selected based on the optimized acquisition function and passed to the genetic algorithm and nonlinear regression model for subsequent execution. In this way, Bayesian optimization gradually improves the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model to find the optimal solution globally. In each iteration, Bayesian optimization updates its proxy model, and the genetic algorithm and nonlinear regression model evolve based on the current optimal parameter configuration, and the optimization results gradually approach the global optimal solution.
[0101] In some embodiments, when the iteration stopping condition is not met, selection operations, crossover operations, and mutation operations are performed based on the updated hyperparameters of the genetic algorithm and the value of the fitness function corresponding to each individual in the current population to obtain the value of each individual in the next generation population and its corresponding production data.
[0102] The hyperparameters of the genetic algorithm are optimized and updated based on the Bayesian optimization algorithm, and the updated hyperparameters can be used to perform selection, crossover and mutation. The process of the genetic algorithm is specifically described in the above embodiment, which will not be repeated here.
[0103] After the next generation population is obtained, the next round of iteration can be entered. In the next round of iteration, the fitness of each individual can be determined based on the hyperparameters of the updated nonlinear regression model.
[0104] Alternatively, in each round of iteration, crossover operations and mutation operations may be performed first. After the mutation operation, the hyperparameters of the genetic algorithm and the nonlinear regression model may be updated according to the Bayesian optimization method. In the next round of iteration, calculations may be performed based on the updated hyperparameters of the genetic algorithm and the nonlinear regression model. The parameters of the genetic algorithm may be adjusted and optimized more quickly, thereby improving the adaptability and efficiency of the algorithm.
[0105] In some embodiments, when the indicators of soy sauce include yield and one or more quality indicators, the value of the production data corresponding to each individual in the current population is input into a nonlinear regression model to determine the value of the quality indicator corresponding to each individual in the current population; selection operations, crossover operations and mutation operations are performed based on the updated hyperparameters of the genetic algorithm, the value of the fitness function corresponding to each individual in the current population, and the value of the quality indicator to obtain the value of each individual in the next generation population and its corresponding production data.
[0106] In the process of executing the above selection operation, one or more quality indicators of the parent generation that meet the quality requirements can be selected; and / or when selecting survivors for the mutated individuals, one or more quality indicators corresponding to the selected survivors meet the quality requirements, which will not be repeated here.
[0107] The method of the above embodiment, in combination with Bayesian optimization, genetic algorithm and nonlinear regression model, realizes effective optimization of multiple production data in soy sauce production. Based on Bayesian optimization, the hyperparameters of genetic algorithm and nonlinear regression model are optimized, and the accuracy of genetic algorithm and nonlinear regression model can be improved. The genetic algorithm further improves the accuracy of the determination of production data through the global search mechanism. The overall scheme can effectively improve the accurate information of the value of the production data, thereby improving the yield of soy sauce and reducing the raw material input ratio.
[0108] Combine the following Figure 2 Other embodiments of the method for determining production data of the soy sauce disclosed in the present invention are described.
[0109] Figure 2 Flow charts of other embodiments of the method for determining the production data of soy sauce disclosed in the present invention. Figure 2 As shown, the method of this embodiment includes: steps S202 to S228.
[0110] Steps S202 to S208 are the process of determining a nonlinear regression model, and steps S210 to S228 are the process of determining the value of production data using a genetic algorithm.
[0111] In step S202, all data in the historical production process of soy sauce are obtained, and training samples are determined based on a feature engineering algorithm.
[0112] The training samples include the values of the production data as the input feature and the values of the indicators of the soy sauce as the output feature selected from all the data.
[0113] In step S204, the nonlinear regression model is trained according to the training samples to obtain a trained nonlinear regression model.
[0114] In step S206, the nonlinear regression model is tested to obtain the accuracy, and it is determined whether the accuracy reaches the preset accuracy. If so, step S208 is executed, otherwise, the process returns to step S202 to redetermine the training sample.
[0115] The training samples can be re-determined by eliminating abnormal data, performing business logic analysis, etc.
[0116] In step S208, the nonlinear regression model is output.
[0117] In step S210, a search range of production data is determined.
[0118] Genetic algorithms can be used to generate populations within the search range of production data.
[0119] In step S212, the population is initialized.
[0120] In step S214, an objective function is constructed and used as a fitness function in the genetic algorithm.
[0121] The execution order of step S214 is not limited to after step S212, and the objective function may be determined after the nonlinear regression model is determined.
[0122] In step S216, the fitness (value of the fitness function) of each individual in the current population is determined, and it is determined whether the iteration stop condition is met. If so, step S228 is executed, otherwise step S218 is executed.
[0123] In step S218, the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model are updated based on the Bayesian optimization algorithm.
[0124] In step S220, a selection operation is performed.
[0125] In step S222, a crossover operation is performed.
[0126] In step S224, a mutation operation is performed.
[0127] In step S226, the value of each individual in the next generation population and its corresponding production data is determined, and the process returns to step S216 and starts again.
[0128] The order of step S218 and steps S220 to S226 can be exchanged, that is, step S218 is executed after step S226.
[0129] In step S228, the value of the production data corresponding to the individual with the highest fitness is output.
[0130] The Bayesian optimization algorithm and the genetic algorithm can refer to the methods of the aforementioned embodiments, which will not be described in detail here.
[0131] The present disclosure also provides a device for determining production data of soy sauce. Figure 3 Give a description.
[0132] Figure 3 Figure 1 is a structural diagram of some embodiments of the device disclosed herein. Figure 3 As shown, the device 30 of this embodiment includes: a first determining module 310 , a constructing module 320 , and a second determining module 330 .
[0133] The first determination module 310 is configured to determine a nonlinear regression model of production data and indicators based on the values of production data in the historical production process of soy sauce and the values of indicators of the produced soy sauce, wherein the production data includes at least one of raw material input data, environmental data, equipment data, and process data, and the indicators include yield.
[0134] The construction module 320 is configured to construct an objective function with the yield rate and the raw material input ratio as variables, wherein the value of the objective function is positively correlated with the value of the yield rate and negatively correlated with the value of the raw material input ratio.
[0135] The second determination module 330 is configured to determine the value of the production data when a preset condition is met according to the nonlinear regression model and the objective function.
[0136] In some embodiments, the second determination module 330 is configured to determine the value of the production data when a preset condition is met based on a genetic algorithm, according to a nonlinear regression model and an objective function, wherein the objective function serves as a fitness function in the genetic algorithm.
[0137] In some embodiments, the second determination module 330 is configured to determine the value of the fitness function according to the nonlinear regression model during each iteration of the genetic algorithm; when the iteration stop condition is not met, the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model are updated based on the Bayesian optimization algorithm according to the value of the fitness function, wherein the preset conditions include the iteration stop condition, and the updated hyperparameters of the nonlinear regression model are used for the next iteration process; when the iteration stop condition is met, the value of the production data is determined.
[0138] In some embodiments, the second determination module 330 is configured to input the value of the production data corresponding to each individual in the current population into the nonlinear regression model during each iteration of the genetic algorithm to determine the value of the fitness function corresponding to each individual in the current population.
[0139] In some embodiments, the second determination module 330 is configured to perform selection operations, crossover operations, and mutation operations based on the updated hyperparameters of the genetic algorithm and the value of the fitness function corresponding to each individual in the current population, to obtain the value of each individual in the next generation population and its corresponding production data, when the iteration stopping condition is not met.
[0140] In some embodiments, the indicator also includes a quality indicator, and the quality indicator includes at least one of total acidity, amino acid nitrogen content, total nitrogen content, reducing sugar content and alcohol content. The second determination module 330 is configured to input the value of the production data corresponding to each individual in the current population into a nonlinear regression model to determine the value of the quality indicator corresponding to each individual in the current population; according to the updated hyperparameters of the genetic algorithm, the value of the fitness function corresponding to each individual in the current population and the value of the quality indicator, selection operations, crossover operations and mutation operations are performed to obtain the value of each individual in the next generation population and its corresponding production data.
[0141] In some embodiments, the second determination module 330 is configured to construct a proxy model in the Bayesian optimization algorithm corresponding to the fitness function, wherein the proxy model is a Gaussian process regression model; update the parameters of the proxy model according to the value of the fitness function; and update the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model according to the updated proxy model and the acquisition function, wherein the acquisition function is the expected improvement function.
[0142] In some embodiments, the second determination module 330 is configured to determine the initialization range of the hyperparameters of the genetic algorithm based on the Bayesian optimization algorithm; according to the initialization range, a primary population is randomly generated, wherein a preset number of sets of production data values are randomly selected as the production data values corresponding to multiple individuals in the primary population.
[0143] In some embodiments, the nonlinear regression model includes a random forest model, and the first determination module 310 is configured to construct a random forest model for each raw material type and each mash type among multiple raw material types and multiple mash types; for the random forest model corresponding to each raw material type and each mash type, the random forest model is trained using the values of the corresponding production data in the historical production process of soy sauce and the values of the indicators of the produced soy sauce to determine the parameters of the random forest model; the second determination module 330 is configured to determine, for each raw material type and each mash type, the value of the production data under the condition of meeting preset conditions according to the random forest model and the objective function corresponding to the raw material type and the mash type.
[0144] In some embodiments, the raw material input ratio is the ratio of the raw material input amount to the equipment capacity, and the construction module 320 is configured to determine the objective function by weighted summation of the yield rate and the raw material input ratio.
[0145] The present disclosure also provides an electronic device, Figure 4 as well as Figure 5 Give a description.
[0146] Figure 4 FIG. 1 is a structural diagram of some embodiments of the electronic device disclosed in the present invention. Figure 4 As shown, the electronic device 40 of this embodiment includes: a memory 410 and a processor 420 coupled to the memory 410, and the processor 420 is configured to execute the method for determining the production data of soy sauce in any of some embodiments of the present disclosure based on instructions stored in the memory 410.
[0147] The memory 410 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, a database, and other programs.
[0148] Figure 5 FIG. 1 is a structural diagram of some other embodiments of the electronic device disclosed in the present invention. Figure 5 As shown, the electronic device 50 of this embodiment includes: a memory 510 and a processor 520, which are similar to the memory 410 and the processor 420 respectively. It can also include an input and output interface 530, a network interface 540, a storage interface 550, etc. These interfaces 530, 540, 550 and the memory 510 and the processor 520 can be connected, for example, through a bus 560. Among them, the input and output interface 530 provides a connection interface for input and output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 540 provides a connection interface for various networked devices, for example, it can be connected to a database server or a cloud storage server. The storage interface 550 provides a connection interface for external storage devices such as SD cards and USB flash drives.
[0149] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0150] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0151] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0152] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0153] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A method for determining production data of soy sauce, comprising: Determine a nonlinear regression model of the production data and the index according to the value of the production data in the historical production process of the soy sauce and the value of the index of the produced soy sauce, wherein the production data includes at least one of raw material data, environmental data, equipment data, and process data, and the index includes yield; Constructing an objective function with the yield and the raw material input ratio as variables, wherein the value of the objective function is positively correlated with the value of the yield and negatively correlated with the value of the raw material input ratio; According to the nonlinear regression model and the objective function, the value of the production data is determined when a preset condition is met.
2. The determination method according to claim 1, wherein: Determining, according to the nonlinear regression model and the objective function, the value of the production data when a preset condition is met comprises: Based on the genetic algorithm, according to the nonlinear regression model and the objective function, the value of the production data is determined when the preset conditions are met, wherein the objective function serves as the fitness function in the genetic algorithm.
3. The determination method according to claim 2, wherein: The determining, based on the genetic algorithm and according to the nonlinear regression model and the objective function, the value of the production data when the preset conditions are met comprises: In each iteration of the genetic algorithm, determining the value of the fitness function according to the nonlinear regression model; When the iteration stop condition is not reached, the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model are updated based on the Bayesian optimization algorithm according to the value of the fitness function, wherein the preset condition includes the iteration stop condition, and the updated hyperparameters of the nonlinear regression model are used for the next iteration process; When the iteration stop condition is reached, the value of the production data is determined.
4. The determination method according to claim 3, wherein: In each iteration of the genetic algorithm, determining the value of the fitness function according to the nonlinear regression model includes: In each iteration of the genetic algorithm, the value of the production data corresponding to each individual in the current population is input into the nonlinear regression model to determine the value of the fitness function corresponding to each individual in the current population.
5. The determination method according to claim 4, wherein: The determining, based on the genetic algorithm, according to the nonlinear regression model and the objective function, the value of the production data when the preset condition is met also includes: When the iteration stopping condition is not met, selection operation, crossover operation and mutation operation are performed according to the updated hyperparameters of the genetic algorithm and the value of the fitness function corresponding to each individual in the current population to obtain the value of each individual in the next generation population and its corresponding production data.
6. The determination method according to claim 5, wherein: The index also includes a quality index, and the quality index includes at least one of total acidity, amino acid nitrogen content, total nitrogen content, reducing sugar content and alcohol content. The selection operation, crossover operation and mutation operation are performed according to the updated hyperparameters of the genetic algorithm and the value of the fitness function corresponding to each individual in the current population, and the value of each individual in the next generation population and its corresponding production data is obtained, including: Inputting the value of the production data corresponding to each individual in the current population into the nonlinear regression model to determine the value of the quality index corresponding to each individual in the current population; According to the updated hyperparameters of the genetic algorithm, the value of the fitness function corresponding to each individual in the current population and the value of the quality indicator, selection operations, crossover operations and mutation operations are performed to obtain the value of each individual in the next generation population and its corresponding production data.
7. The determination method according to claim 3, wherein: The updating of the hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model based on the Bayesian optimization algorithm according to the value of the fitness function comprises: Constructing a proxy model in the Bayesian optimization algorithm corresponding to the fitness function, wherein the proxy model is a Gaussian process regression model; According to the value of the fitness function, updating the parameters of the proxy model; The hyperparameters of the genetic algorithm and the hyperparameters of the nonlinear regression model are updated according to the updated proxy model and acquisition function, wherein the acquisition function is an expected improvement function.
8. The determination method according to claim 3, wherein: The determining, based on the genetic algorithm, according to the nonlinear regression model and the objective function, the value of the production data when the preset condition is met also includes: Determining the initialization range of the hyperparameters of the genetic algorithm based on a Bayesian optimization algorithm; A primary population is randomly generated according to the initialization range, wherein a preset number of sets of production data values are randomly selected as the production data values corresponding to a plurality of individuals in the primary population.
9. The determination method according to claim 1, wherein: The nonlinear regression model includes a random forest model. The nonlinear regression model for determining the production data and the index according to the value of the production data in the historical production process of the soy sauce and the value of the index of the produced soy sauce includes: For each of the multiple raw material types and the multiple mash types, a random forest model is constructed; For the random forest model corresponding to each type of raw material and each type of mash, the random forest model is trained using the values of the corresponding production data in the historical production process of the soy sauce and the values of the indicators of the produced soy sauce to determine the parameters of the random forest model; Determining, according to the nonlinear regression model and the objective function, the value of the production data when a preset condition is met comprises: For each raw material type and each mash type, the value of the production data is determined when a preset condition is met according to the random forest model corresponding to the raw material type and the mash type and the objective function.
10. The determination method according to any one of claims 1 to 9, wherein: The raw material input ratio is the ratio of the raw material input amount to the equipment capacity, and the objective function constructed with the yield and the raw material input ratio as variables includes: The objective function is determined by taking a weighted sum of the yield and the raw material input ratio.
11. A device for determining production data of soy sauce, comprising: A first determination module is configured to determine a nonlinear regression model of the production data and the index according to the value of the production data in the historical production process of the soy sauce and the value of the index of the produced soy sauce, wherein the production data includes at least one of raw material input data, environmental data, equipment data, and process data, and the index includes a yield; A construction module is configured to construct an objective function with the yield and the raw material input ratio as variables, wherein the value of the objective function is positively correlated with the value of the yield and negatively correlated with the value of the raw material input ratio; The second determination module is configured to determine the value of the production data when a preset condition is met according to the nonlinear regression model and the objective function.
12. An electronic device comprising: processor; as well as A memory coupled to the processor is used to store instructions, and when the instructions are executed by the processor, the processor executes the method for determining the production data of soy sauce according to any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method for determining the production data of soy sauce according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising instructions, which, when executed by a processor, cause the processor to execute the method for determining production data of soy sauce according to any one of claims 1 to 10.
Citation Information
Patent Citations
Industrial process energy efficiency identification and diagnosis method based on multivariate nonlinear regression
CN110210000A
Grain processing scheme optimization method, device and equipment and storage medium
CN110210684A
Method for predicting soy sauce yield according to fermentation process parameters of Cantonese soy sauce
CN114897218A
Reservoir dam environment influence evaluation method and device, electronic equipment and storage medium
CN115130887A
Automatic assembly mixed flow production line layout optimization method and device based on digital twinning
CN117148806A