Method and device for optimizing grinding formula of water-soluble fertilizer
Through the combination of deep neural network model and genetic algorithm, the problem of complex interactions of raw material components in water-soluble fertilizer formulation optimization is solved, and efficient and accurate formulation optimization is achieved.
Patent Information
- Application Number
- CN202411878840.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art cannot effectively deal with the complex interactions between water-soluble fertilizer raw materials components, and lacks systematic modeling of the correlation between formula and process parameters, resulting in unsatisfactory formulation optimization results.
The deep neural network model is used to combine feature engineering and genetic algorithms to construct a nonlinear mapping relationship between formula features and performance indicators, and an optimized formula solution is generated through multi-objective optimization.
It effectively captures the complex interactions between raw material components, improves the accuracy and efficiency of formula optimization, and achieves balanced optimization of multiple performance indicators such as water solubility, anti-caking and stability.
Smart Images

Figure CN119808560A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence and chemical formulation technology, and in particular to a method and device for optimizing a water-soluble fertilizer grinding formula. Background Art
[0002] With the widespread application of water-soluble fertilizers, the optimization of their formula has become an important issue of concern to the industry. At present, the optimization of water-soluble fertilizer formulas mainly adopts the following methods: optimizing the formula through a large number of experimental screening, but this method is inefficient and costly; relying on expert experience to adjust the formula, but it is difficult to deal with complex formula optimization problems; using simple data statistical analysis methods for optimization, but lacking a deep understanding of the complex relationship between formula ingredients.
[0003] The existing technology mainly has the following technical defects: on the one hand, it is unable to effectively deal with the complex interactions between raw material components, resulting in unsatisfactory formula optimization effects; on the other hand, there is a lack of systematic modeling of the correlation between formula and process parameters, which affects product stability. Summary of the invention
[0004] In view of this, the present application provides a method and device for optimizing the grinding formula of water-soluble fertilizer, which solves the problem that the prior art cannot effectively handle the complex interactions between raw material components and lacks system modeling.
[0005] The present application embodiment provides a method for optimizing the grinding formula of water-soluble fertilizer, comprising:
[0006] Collecting water-soluble fertilizer formula data and recording the formula data, wherein the formula data includes raw material component data, process parameter data and performance index data, wherein the raw material component data includes the chemical composition, content and particle size distribution of the raw material components, the process parameter data includes grinding time, grinding temperature and grinding pressure, and the performance index data includes water solubility, anti-caking property and stability index;
[0007] The formula data is subjected to feature engineering processing, including: calculating the chemical stoichiometric ratio and component interaction strength of the raw material component data to obtain a component feature vector; normalizing and feature combining the process parameter data to obtain a process feature vector; dimensional alignment and feature fusion of the component feature vector and the process feature vector to obtain a formula feature vector;
[0008] Constructing a deep neural network model, training the deep neural network model based on the recipe feature vector, and establishing a nonlinear mapping function by the deep neural network model, wherein the nonlinear mapping function is used to realize mapping from the recipe feature vector to the performance indicator data;
[0009] Based on the nonlinear mapping function, a genetic algorithm is used to perform multi-objective optimization to generate an optimized formulation scheme, wherein the optimized formulation scheme includes a raw material component ratio and a process parameter configuration.
[0010] Optionally, dimensionally aligning and merging the component feature vector and the process feature vector comprises:
[0011] Checking the dimensional consistency of the component feature vector and the process feature vector, and adjusting the feature dimensions according to preset rules;
[0012] Calculating the feature importance scores of each dimension of the component feature vector and the process feature vector;
[0013] Based on the feature importance score, the component feature vector and the process feature vector are weightedly fused to generate the recipe feature vector.
[0014] Optionally, constructing a deep neural network model includes:
[0015] Design a multi-layer perceptron network structure, wherein an input layer receives the recipe feature vector;
[0016] Three hidden layers are configured, the number of neurons in the three hidden layers is 256, 128 and 64 respectively, each hidden layer adopts a ReLU activation function, and a batch normalization layer and a Dropout layer are added;
[0017] A multi-task learning output layer is constructed, including a water solubility prediction branch, an anti-caking prediction branch, and a stability prediction branch, and each branch adopts a Sigmoid activation function.
[0018] Optionally, the training of the deep neural network model based on the recipe feature vector includes:
[0019] The formula feature vector is divided into training set data and verification set data in a ratio of 7:3;
[0020] Define a multi-objective loss function, including the mean square error loss for water solubility prediction, the mean square error loss for anti-caking prediction, and the mean square error loss for stability prediction;
[0021] Based on the training set data, a batch stochastic gradient descent method with a batch size of 32 is used to perform model training;
[0022] Configure the Adam optimizer, set the initial learning rate to 0.001, and decay the learning rate to 0.9 times the original value every 50 training cycles;
[0023] A gradient clipping strategy is adopted to limit the gradient norm to no more than 5.0; the validation set loss is monitored and training is stopped when the validation set loss does not improve for 10 consecutive training cycles.
[0024] Optionally, establishing a nonlinear mapping function by using a deep neural network model includes:
[0025] Based on the training set data, the output result of each hidden layer is nonlinearly transformed through the ReLU activation function to obtain intermediate features;
[0026] The intermediate features are batch normalized and some neurons are randomly discarded through a Dropout layer;
[0027] The processed intermediate features are input into the multi-task learning output layer to generate a water solubility prediction function, an anti-caking prediction function and a stability prediction function, respectively, to form a complete nonlinear mapping function.
[0028] Optionally, the multi-objective optimization using a genetic algorithm to generate an optimized formulation scheme includes:
[0029] Establish prediction objective functions of water solubility, anti-caking property and stability respectively, and set weight coefficients of each prediction objective function;
[0030] Constructing a combined objective function, wherein the combined objective function is a weighted sum of the prediction objective functions;
[0031] Set optimization constraints, including raw material component content range constraints and process parameter range constraints;
[0032] Based on the combined objective function and the optimization constraints, a genetic algorithm is used to search for an optimal formulation solution.
[0033] Optionally, the method of searching for an optimal formulation solution using a genetic algorithm comprises:
[0034] Initialize the recipe population, set the population size to 100, and each individual contains the raw material group allocation ratio and process parameter configuration;
[0035] Constructing a fitness function, and calculating individual fitness values based on the combined objective function;
[0036] The population is stratified using a non-dominated sorting method based on crowding, and individuals ranked before a preset threshold are selected as parents.
[0037] Perform a simulated binary crossover operation on the selected parent individuals, with the crossover probability set to 0.8; perform a polynomial mutation operation, with the mutation probability set to 0.1;
[0038] The feasibility of the generated offspring population is repaired to ensure that the optimization constraints are met.
[0039] Optionally, the establishment of prediction objective functions for water solubility, anti-caking property and stability respectively comprises:
[0040] Establish the water solubility prediction objective function f1(x) to calculate the solubility value and dissolution rate of the sample in 20℃ pure water;
[0041] Establish the anti-caking property prediction objective function f2(x) for calculating the caking strength test value and the fluidity test value;
[0042] Establish the stability prediction objective function f3(x), using the calculation of storage stability test values and temperature stability test values;
[0043] The weight coefficients of water solubility, anti-caking property and stability are set to w1, w2 and w3 respectively, and w1+w2+w3=1 is satisfied.
[0044] Optionally, the adopting a non-dominated sorting method based on crowding degree to stratify the population includes:
[0045] Calculate the crowding distance of each individual in the population in the target space, where the crowding distance represents the average distance between the individual and its adjacent individuals in the target space;
[0046] Based on the Pareto dominance relationship, the population is divided into multiple non-dominated layers, and individuals in the same layer do not dominate each other;
[0047] In each non-dominated layer, individuals are sorted according to their crowding distance, and individuals with larger crowding distance have higher selection priority;
[0048] The individuals in the first k non-dominated layers are selected to form the parent population, where k is the minimum integer that makes the size of the parent population reach the preset value.
[0049] The present application embodiment provides a device for optimizing the grinding formula of water-soluble fertilizer, comprising:
[0050] A collection module is used to collect water-soluble fertilizer formula data and record the formula data, wherein the formula data includes raw material component data, process parameter data and performance index data, wherein the raw material component data includes the chemical composition, content and particle size distribution of the raw material components, the process parameter data includes grinding time, grinding temperature and grinding pressure, and the performance index data includes water solubility, anti-caking property and stability index;
[0051] A feature engineering processing module is used to perform feature engineering processing on the formula data, including: calculating the stoichiometric ratio and component interaction strength of the raw material component data to obtain a component feature vector; performing normalization processing and feature combination on the process parameter data to obtain a process feature vector; performing dimension alignment and feature fusion on the component feature vector and the process feature vector to obtain a formula feature vector;
[0052] Establishing a module for constructing a deep neural network model, training the deep neural network model based on the recipe feature vector, and establishing a nonlinear mapping function by the deep neural network model, wherein the nonlinear mapping function is used to realize mapping from the recipe feature vector to the performance indicator data;
[0053] The optimization module is used to perform multi-objective optimization using a genetic algorithm based on the nonlinear mapping function to generate an optimized formula solution, wherein the optimized formula solution includes a raw material component ratio and a process parameter configuration.
[0054] The present application also provides a computer device, the computer device comprising:
[0055] at least one processor; and,
[0056] a memory communicatively connected to the at least one processor; wherein,
[0057] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above-mentioned method for optimizing the grinding formula of water-soluble fertilizer.
[0058] An embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the above-mentioned method for optimizing the grinding formula of water-soluble fertilizer.
[0059] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the above-mentioned method for optimizing the grinding formula of water-soluble fertilizer.
[0060] This application has the following technical effects:
[0061] By establishing a nonlinear mapping relationship between formula characteristics and performance indicators through a deep neural network model, the complex interactions between raw material components are effectively captured, thus improving the accuracy of formula optimization.
[0062] The formula was systematically optimized using a multi-objective optimization algorithm, achieving balanced optimization of multiple performance indicators such as water solubility, anti-caking properties and stability, thereby improving the optimization effect.
[0063] Recipe optimization based on machine learning methods significantly improves optimization efficiency and reduces experimental costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0065] Figure 1 It is a schematic diagram of a process for optimizing a water-soluble fertilizer grinding formula provided in an embodiment of the present application;
[0066] Figure 2 It is a schematic diagram of the feature engineering process provided by the embodiment of the present application;
[0067] Figure 3 It is a schematic diagram of the structure of the deep neural network model provided in the embodiment of the present application;
[0068] Figure 4 is a schematic diagram of a multi-objective optimization process provided in an embodiment of the present application;
[0069] Figure 5 It is a structural schematic diagram of an optimized water-soluble fertilizer grinding formula device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] For the sake of Figure 1 As shown, the embodiment of the present application provides a method for optimizing the grinding formula of water-soluble fertilizer. The preliminary technical scheme of the method includes the following steps:
[0071] S1: Collect water-soluble fertilizer formula data and record the formula data. The formula data includes:
[0072] Raw material component data: including chemical composition, content and particle size distribution of raw material components;
[0073] Process parameter data: including grinding time, grinding temperature, and grinding pressure;
[0074] Performance index data: including water solubility, anti-caking and stability indicators.
[0075] In the data collection stage of step S1, the present application systematically collects data related to water-soluble fertilizer formulas by establishing a standardized data collection process. Taking potassium pyrophosphate formula as an example, the collected raw material component data include the chemical composition and usage content information of potassium pyrophosphate and various chelating agents (such as anhydrous citric acid, malic acid, tartaric acid, DTPA, HEDP, UP and EDTA-2NA). For process parameter data, focus on recording different dissolution multiples (from 20 times to 2000 times) and dissolution medium types (pure water, tap water, hard water, etc.). In terms of performance index data, key indicators such as solubility (expressed in 1-5 levels of clarity), pH value and stability (precipitation) are mainly measured.
[0076] The following uses potassium pyrophosphate formula as an example to illustrate the specific content of data collection:
[0077] First, collect the raw material component data. Taking potassium pyrophosphate and chelating agent as an example, the specific data collected include:
[0078] Chemical composition data of potassium pyrophosphate;
[0079] Composition data of seven different chelating agents, including: chemical compositions of anhydrous citric acid, malic acid, tartaric acid, DTPA, HEDP, UP, and EDTA-2NA;
[0080] Two ratios of potassium pyrophosphate and chelating agent: 2:1 ratio and 1:1 ratio;
[0081] Particle size distribution data of each component.
[0082] Secondly, collect process parameter data:
[0083] Dissolution multiples: including 20 times, 250 times, 1000 times and 2000 times;
[0084] Dissolution temperature: record the dissolution parameters at 20°C;
[0085] Dissolution media: Dissolution data were recorded in three different media: pure water (pH 5.20), tap water (pH 6.45) and hard water (pH 5.30).
[0086] Finally, collect performance indicator data:
[0087] 1. Water solubility data:
[0088] Clarity level: 1-5 levels are adopted, with 1 being the clearest;
[0089] Dissolution time: record the time required to reach the target clarity;
[0090] Observation data of the dissolution process: such as "becomes noticeably clear within 10 minutes of mixing" and "becomes slightly turbid after being left overnight".
[0091] 2. pH value data:
[0092] pH values at different dissolution multiples, for example:
[0093] The pH value at 20 times dissolution is 10.27;
[0094] The pH value at 250 times dissolution is 9.65;
[0095] The pH value is 9.16 when dissolved 1000 times;
[0096] The pH value is 8.76 when dissolved 2000 times;
[0097] 3. Stability data:
[0098] Precipitation: record whether precipitation occurs and the degree of precipitation;
[0099] Storage stability: record the state changes after being left overnight;
[0100] Turbidity change: record the dynamic change process of solution turbidity.
[0101] For example, when collecting experimental data for a 2:1 ratio of potassium pyrophosphate to anhydrous citric acid, the following complete data was recorded: under the condition of dissolving in 2000 times tap water, the mixture became significantly clear within 10 minutes (clarity level 1), and remained slightly turbid (clarity level 1) after being placed overnight. When a 1:1 ratio was used, it was recorded that the mixture could reach a clear state faster, and the final pH value was stabilized at 4.24.
[0102] Through this systematic data collection method, a complete data set including raw material components, process parameters and performance indicators was established, providing a reliable data basis for subsequent feature engineering and model training. At the same time, these detailed experimental data also help to understand the influence of different factors on the performance of water-soluble fertilizers and guide the direction of formula optimization.
[0103] S2: Perform feature engineering on recipe data.
[0104] like Figure 2, in the feature engineering processing stage of step S2, this application adopts a hierarchical feature extraction strategy. For the raw material component data, the two main ratios of potassium pyrophosphate and chelating agents (2:1 and 1:1) are analyzed in detail. For example, when potassium pyrophosphate and anhydrous citric acid are in a 2:1 ratio, the mixture can become significantly clear within 10 minutes of mixing (clarity level 1), and remains slightly turbid after being placed overnight (clarity level 1). At a 1:1 ratio, the mixture can reach a clear state faster, with a final pH value of 4.24. These data are converted into key dimensions of component feature vectors. At the same time, for process parameters such as dissolution multiples, the minimum-maximum normalization method is used for standardization. For example, the dissolution multiples of 20-2000 times are mapped to the [0,1] interval to facilitate subsequent model processing.
[0105] In one embodiment, during the feature engineering process, the present application adopts a hierarchical feature extraction strategy to convert complex recipe data into feature vectors that can be used for machine learning. The specific implementation process is as follows:
[0106] S2.1: Calculate the stoichiometric ratio and component interaction strength of the raw material component data to obtain the component feature vector;
[0107] In step S2.1, the raw material component data is first feature extracted and converted. Taking the potassium pyrophosphate formula as an example, when calculating the stoichiometric ratio between the components, the ratio relationship between potassium pyrophosphate and different chelating agents is focused on. The experiment found that under 2000 times dissolution conditions, the 2:1 ratio and 1:1 ratio of potassium pyrophosphate to anhydrous citric acid showed significantly different performance characteristics. At a 2:1 ratio, the mixture can reach level 1 clarity within 10 minutes; at a 1:1 ratio, not only is the dissolution rate faster, but the pH value is more stable, maintained at 4.24. By analyzing these experimental data, an initial feature matrix reflecting the component ratio characteristics was constructed.
[0108] Next, the component interaction strength was calculated. An interaction scoring system was established for the interaction between potassium pyrophosphate and seven different chelating agents (anhydrous citric acid, malic acid, tartaric acid, DTPA, HEDP, UP and EDTA-2NA). For example, by analyzing the reaction process of potassium pyrophosphate and anhydrous citric acid, it was found that the combination can achieve solution clarification in a short time and has good stability, so a higher interaction strength score was given. For HEDP, due to the obvious turbidity in the experiment, its interaction strength score was relatively low. Based on these scores, a component interaction matrix was constructed.
[0109] In another embodiment, in step S2.1, a multi-level feature extraction method is used to process the raw material component data. The first is the calculation of the stoichiometric ratio, including three levels: element content ratio, functional group ratio and matching coefficient. Specifically, it is necessary to calculate the molar ratio of the main elements such as N, P, K in each raw material, calculate the quantitative ratio of key functional groups such as carboxyl and phosphate, and calculate the mass ratio and molar ratio of the chelating agent to the main material.
[0110] Taking the formula of potassium pyrophosphate and anhydrous citric acid as an example, when the mass ratio is 2:1, the calculated P:K molar ratio is 1:2, the phosphate:carboxyl molar ratio is 1:3, and the chelation coefficient is 0.67. When the mass ratio is adjusted to 1:1, although the P:K molar ratio remains unchanged, the phosphate:carboxyl molar ratio becomes 1:6, and the chelation coefficient increases to 1.33. This change directly affects the performance of the formula.
[0111] The second is the calculation of the interaction strength of the components. This part mainly considers three aspects: the strength of the ionic bond represented by the Coulomb force calculated based on the ionic charge and ionic radius, the strength of the hydrogen bond estimated based on the number of donor-acceptor pairs, and the pH influence coefficient considering the change in dissociation degree under different pH conditions. The specific calculation uses a standardized formula: the ionic bond strength is expressed by k·(q1·q2) / r 2 Calculation, where k is the Coulomb constant, q is the charge, and r is the ionic distance; the hydrogen bond strength index is calculated by Σ(nd·na·f), where nd is the number of donors, na is the number of acceptors, and f is the position factor; the pH influence coefficient is calculated using 10^(-|pH-pKa|).
[0112] In terms of particle size distribution feature extraction, three types of parameters are mainly concerned: D10, D50, and D90 values that characterize particle size distribution, span coefficient and uniformity coefficient that reflect distribution uniformity, and theoretical specific surface area calculated based on particle size. Under standard process conditions, the D50 value of a typical sample is about 75μm, the span coefficient ((D90-D10) / D50) is 1.2, and the uniformity coefficient (D60 / D10) is 1.5. These parameters are closely related to the solubility performance of the product.
[0113] Feature standardization is a key step to ensure the effectiveness of model training. For numerical features, the Min-Max standardization method is used to map them to the [0,1] interval. For example, the original particle size values of 50μm, 75μm, and 100μm are standardized to 0, 0.5, and 1, respectively. For categorical features such as chelating agent types, the one-hot encoding method is used for conversion, such as converting {citric acid, malic acid, EDTA} to the form of [1,0,0], [0,1,0], and [0,0,1]. For features with ordinal relationships, the ordinal encoding method is used for conversion.
[0114] In order to evaluate the validity of the feature, the present application embodiment also carries out detailed feature correlation analysis and importance assessment.By calculating the Pearson correlation coefficient between features, a feature correlation matrix is constructed, and a multicollinearity test is performed based on the VIF value.The analysis results show that the correlation coefficient between chelation degree and pH value is -0.82, the correlation coefficient between particle size and dissolution rate is -0.65, and the correlation coefficient between ratio and stability is 0.71.At the same time, the feature importance is sorted using the random forest algorithm, and the feature contribution is analyzed using the SHAP value, and the stability of the feature is ensured by cross-validation.The importance sorting results show that the importance scores of chelation degree coefficient, pH influence coefficient, particle size D50, ionic bond strength and uniformity coefficient are 0.85, 0.72, 0.65, 0.58 and 0.45 respectively.
[0115] Through this systematic feature engineering process, the original formula data was successfully converted into feature vectors with clear physical and chemical meanings, providing high-quality input data for subsequent deep learning models. Especially when dealing with potassium pyrophosphate formulas, this feature extraction method can effectively capture the performance differences under different ratio conditions, providing a reliable data basis for optimizing the formula.
[0116] S2.2: normalize and combine the process parameter data to obtain a process feature vector;
[0117] In step S2.2, the process parameter data are normalized and feature combined. First, the dissolution multiples (20 times to 2000 times) are normalized to the minimum and maximum values and mapped to the interval [0,1]. For the dissolution medium type (pure water, tap water, hard water), the unique hot encoding method is used for feature representation. At the same time, considering the coupling relationship between the process parameters, the parameter combination feature is constructed. For example, through analysis, it is found that there is an obvious correlation between the dissolution multiple and the pH value: the pH is 10.27 when dissolved 20 times in pure water, and it drops to 8.76 when dissolved 2000 times. Based on this, a feature reflecting the parameter interaction effect is constructed.
[0118] S2.3: Align the component feature vector and process feature vector and perform feature fusion to obtain the formula feature vector.
[0119] Check the dimensional consistency of the two feature vectors and adjust the dimensions according to the preset rules;
[0120] Calculate the feature importance score of each dimension;
[0121] Weighted fusion based on feature importance scores.
[0122] In step S2.3, the fusion of component feature vectors and process feature vectors is achieved. First, dimension alignment is performed, and the most representative feature dimensions are screened out through the feature selection algorithm. Experiments show that it is most important to retain features directly related to water solubility (such as chelating agent type, ratio relationship) and key process parameters (such as dissolution multiples). Afterwards, weighted fusion is performed based on the feature importance score. For example, for potassium pyrophosphate formulas, the feature weights of chelating agent type and ratio relationship are higher, because experimental data show that these factors have a significant impact on product performance: anhydrous citric acid can achieve the best dissolution effect and pH stability at a 1:1 ratio.
[0123] Through the above feature engineering processing, the original formula data was successfully converted into structured feature vectors. These feature vectors not only retain the key information of raw material components and process parameters, but also effectively capture the complex associations between variables through reasonable feature combination and fusion strategies. For example, when processing potassium pyrophosphate formula, the feature vector can reflect the excellent performance of anhydrous citric acid as a chelating agent, as well as better comprehensive performance under 1:1 ratio conditions, providing high-quality input data for subsequent model training.
[0124] This systematic feature engineering method significantly improves the model's ability to learn the relationship between formulation and performance. Through the analysis of a large amount of experimental data, it is found that the feature vector constructed by this method can accurately reflect the law of performance changes under different formulation conditions, providing a reliable data basis for subsequent formulation optimization. Especially when dealing with multi-component formulations, this feature representation method can effectively capture the complex interactions between components, which is difficult to achieve with traditional methods.
[0125] S3: Build and train a deep neural network model.
[0126] like Figure 3 In the deep neural network model construction and training stage, this application designs a multi-task learning framework. The input layer of the framework receives the recipe feature vector processed by feature engineering, and performs feature conversion and extraction through three hidden layers. A batch normalization layer is configured after each hidden layer, which effectively accelerates the convergence of model training. In practice, it is found that setting the number of neurons to 256, 128, and 64 can better balance the expressiveness and computational efficiency of the model. At the same time, by setting a dropout ratio of 0.3 during the training process, the model is effectively prevented from overfitting.
[0127] Specifically, in the deep neural network model construction and training stage, this application adopts a multi-task learning framework to achieve the mapping of recipe features to multiple performance indicators. The specific implementation process of this framework is as follows:
[0128] S3.1: Design network structure:
[0129] Input layer: receives recipe feature vector;
[0130] Three hidden layers: the number of neurons are 256, 128 and 64 respectively;
[0131] Each hidden layer uses the ReLU activation function;
[0132] Add batch normalization layer and Dropout layer;
[0133] A multi-task learning output layer is constructed, which includes three prediction branches: water solubility, anti-caking and stability, all of which use the Sigmoid activation function.
[0134] The input layer directly receives the formula feature vector processed by feature engineering, which is used to characterize the complete information of the water-soluble fertilizer formula. In the experiment, it was found that the network structure with three hidden layers is the most suitable. The first hidden layer is set with 256 neurons, which is mainly used for preliminary feature conversion; the second hidden layer is set with 128 neurons for middle-level feature extraction; the third hidden layer is set with 64 neurons to complete high-level feature abstraction. A batch normalization layer is configured after each hidden layer, which significantly speeds up the training convergence speed of the model. At the same time, by setting the dropout rate to 0.3, the model is effectively prevented from overfitting. Especially when processing potassium pyrophosphate formula data, this network structure can well learn the nonlinear relationship between formula characteristics and performance indicators.
[0135] The output layer adopts a multi-task learning design and contains three prediction branches: water solubility prediction branch, anti-caking prediction branch, and stability prediction branch. Each branch contains two fully connected layers, and the final output layer uses a Sigmoid activation function. This design enables the model to predict multiple performance indicators at the same time, improving the learning efficiency of the model. For example, when predicting the performance of potassium pyrophosphate formula, the model can simultaneously output the solubility grade (grade 1-5), pH value, and stability score.
[0136] S3.2: Training Model:
[0137] The recipe feature vector is divided into a training set and a validation set in a ratio of 7:3;
[0138] Define a multi-objective loss function, including the mean square error loss of three performance indicators;
[0139] The training was performed using stochastic gradient descent with a batch size of 32;
[0140] Configure the Adam optimizer with an initial learning rate of 0.001, which decays to 0.9 times every 50 cycles;
[0141] Adopt the gradient clipping strategy to limit the gradient norm to no more than 5.0;
[0142] Monitor the validation set loss and stop training if it does not improve for 10 consecutive epochs.
[0143] In step S3.2, the training process of the model is implemented. First, the collected formula data is divided into a training set and a validation set in a ratio of 7:3. Taking the potassium pyrophosphate formula as an example, the training data contains complete experimental records of different chelating agents (such as anhydrous citric acid, malic acid, etc.) under different ratios. The defined multi-objective loss function includes three parts: the mean square error loss of water solubility prediction, the mean square error loss of anti-caking prediction, and the mean square error loss of stability prediction. By adjusting the weights of each loss function, the degree of optimization of different performance indicators can be balanced.
[0144] During the training process, a small batch stochastic gradient descent method with a batch size of 32 was used. The initial learning rate of the configured Adam optimizer was set to 0.001, and a learning rate decay strategy was implemented, which decayed the learning rate to 0.9 times the original value every 50 training cycles. This strategy performs well in practice. For example, when optimizing the potassium pyrophosphate formula, the model can quickly converge to a better solution. At the same time, the gradient clipping strategy is used to limit the gradient norm to no more than 5.0, which effectively avoids the gradient explosion problem during training.
[0145] Specifically, in the model training process, the embodiment of the present application designs the training parameters and optimization strategies in detail. First, in terms of data set division, the stratified sampling method is used to divide the data into a training set and a validation set in a ratio of 7:3 to ensure that the distribution characteristics of the samples in the two data sets are consistent. For the potassium pyrophosphate formula data, the training set contains 700 samples and the validation set contains 300 samples, where the sample ratios of different chelating agent types and ratios are consistent with the original data set.
[0146] The loss function is designed in the form of weighted combination. For the water solubility prediction task, the mean square error loss is used, and the weight is set to 0.4; the mean square error loss weight of the anti-caking prediction task is 0.3; the mean square error loss weight of the stability prediction task is also set to 0.3. The total loss function expression is: L_total = 0.4*L_solubility+0.3*L_caking+0.3*L_stability. At the same time, in order to improve the generalization ability of the model, the L2 regularization term is added to the total loss function, and the regularization coefficient is set to 0.01.
[0147] In terms of optimizer configuration, the Adam optimizer was selected and fine-tuned. The initial learning rate was set to 0.001, the momentum parameter β1 was set to 0.9, β2 was set to 0.999, and ε was set to 1e-8. The learning rate adjustment strategy uses a step decay method, which decays the learning rate to 0.9 times the original value every 50 training cycles. For example, the learning rate is reduced to 0.0009 in the 50th cycle, 0.00081 in the 100th cycle, and so on. This gradual learning rate adjustment strategy effectively avoids the oscillation problem during training.
[0148] In terms of batch training settings, a dynamic batch size adjustment strategy is adopted. The initial batch size is set to 32. In order to improve training efficiency, the batch size is dynamically adjusted according to the usage of video memory during training, and the maximum does not exceed 128. At the same time, the gradient accumulation technology is implemented, and the model parameters are updated every 4 small batches. This method not only ensures the stability of training, but also improves the efficiency of video memory utilization.
[0149] In terms of monitoring and adjusting the training process, multiple protection mechanisms are implemented. The first is gradient clipping, which sets the upper limit of the gradient norm to 5.0. When the gradient norm exceeds this threshold, it is scaled proportionally, which effectively prevents the gradient explosion problem. The second is the early stopping strategy, which monitors the change in the loss value on the validation set. When the validation set loss does not improve for 10 consecutive training cycles, the early stopping mechanism is triggered. In order to prevent overfitting, a model checkpoint saving mechanism is also implemented. The current model state is saved in each training cycle, and the model with the best performance on the validation set is finally selected as the final model.
[0150] In terms of training stability, a series of technical means are adopted. A batch normalization layer is added after each hidden layer, and the parameters are set to: momentum parameter momentum = 0.99, ε = 1e-5. The dropout rate of the dropout layer adopts an increasing strategy, which is 0.2 for the first hidden layer, 0.3 for the second hidden layer, and 0.4 for the third hidden layer. This setting helps to extract more robust feature representations. In addition, a gradient noise injection mechanism is implemented to add Gaussian noise with a mean of 0 and a standard deviation of 0.01 when the gradient is updated to further improve the robustness of the model.
[0151] The convergence of model training is judged by a multi-index comprehensive evaluation method. In addition to monitoring the training loss and validation loss, R 2 The final model achieved R on the validation set for the optimization of the potassium pyrophosphate formula. 2The performance indicators of >0.95, MAE<0.05, and RMSE<0.08 prove that the model has good predictive ability. The training process usually converges within 200-300 cycles, and the total training time is about 2 hours (based on NVIDIA V100 GPU).
[0152] S3.3: Establish nonlinear mapping function:
[0153] Perform nonlinear transformation on the hidden layer output through ReLU activation function;
[0154] Perform batch normalization and Dropout on the intermediate features;
[0155] The prediction functions of the three performance indicators are generated through the multi-task learning output layer.
[0156] A nonlinear mapping function from formula features to performance indicators was established through the trained deep neural network model. Specifically, the formula features are first transformed nonlinearly through the ReLU activation function of the hidden layer to generate intermediate feature representations. These intermediate features are processed by the batch normalization layer and regularized by the Dropout layer, and finally the predicted values of various performance indicators are obtained through the multi-task learning output layer. Taking the potassium pyrophosphate formula as an example, the mapping function can accurately predict the performance under different ratios. For example, for the 1:1 ratio of anhydrous citric acid formula, the model accurately predicts its excellent water solubility (level 1 clarity) and ideal pH value (4.24).
[0157] This deep learning-based modeling method significantly improves the efficiency and accuracy of formula optimization. Through a large number of experimental verifications, the model's prediction results are highly consistent with the actual performance. Especially when dealing with complex multi-component formulas, the model can effectively capture the interaction between components and provide reliable theoretical guidance for subsequent formula optimization.
[0158] S4: Multi-objective optimization using genetic algorithm.
[0159] like Figure 4 , in the model optimization stage (step S4), the present application uses an improved NSGA-II algorithm for multi-objective optimization. Through experiments, it was found that in the potassium pyrophosphate dissolution system, when the optimization target weights were set to water solubility 0.4, anti-caking 0.3, and stability 0.3, a more balanced optimization effect could be obtained. For example, under 2000 times dissolution conditions, the optimized formula uses anhydrous citric acid as a chelating agent, and a 1:1 ratio can achieve the best comprehensive performance: after dissolution, it quickly reaches level 1 clarity, the pH value is maintained at 4.24, and it can be completely dissolved within 10 minutes without precipitation.
[0160] In the multi-objective optimization process, the embodiment of the present application constructs a complete constraint system and objective function framework. First, detailed constraints are set for the raw material components: for the ratio of potassium pyrophosphate to chelating agent, the mass ratio must be controlled within the range of 0.5:1 to 3:1; the total amount of chelating agent added shall not exceed 30% of the total amount of raw materials; when using multiple chelating agents at the same time, the ratio between each chelating agent must meet the principle of synergistic synergy, that is, the proportion of the main chelating agent (such as anhydrous citric acid) is not less than 60%. In addition, taking into account the cost factor, an upper limit constraint on the total cost of raw materials is also set. Calculated at the current market price, the raw material cost per ton of product shall not exceed 8,000 yuan.
[0161] In terms of process parameter constraints, the grinding time is limited to 15-120 minutes, the grinding temperature needs to be controlled between 15-45°C, and the grinding pressure range is 0.2-2.0MPa. The setting of these parameter ranges is based on a large amount of experimental data analysis, taking into account both process feasibility and production efficiency. For example, a grinding temperature exceeding 45°C may lead to a decline in product quality, while a temperature below 15°C will affect the solubility performance; a grinding pressure below 0.2MPa cannot achieve the expected crushing effect, and a pressure exceeding 2.0MPa may cause the equipment to wear too quickly.
[0162] In terms of objective function construction, a multi-level evaluation system based on physical and chemical principles was adopted. The construction of the water-soluble objective function f1(x) takes into account three key indicators: solubility, dissolution rate and solution clarity. Specifically, the solubility index adopts the dissolution rate within 30 minutes at 20°C, with a weight of 0.4; the dissolution rate adopts the reciprocal of the time required to reach 90% solubility, with a weight of 0.3; the solution clarity adopts a 1-5 grade rating system, with a weight of 0.3. These three indicators are weighted and summed to obtain the final water-solubility score, namely:
[0163] f1(x) = 0.4*dissolution rate + 0.3*dissolution rate score + 0.3*clarity score
[0164] The design of the anti-caking objective function f2(x) integrates the evaluation indicators of both static and dynamic dimensions. The static aspect considers the bulk density and repose angle, and the dynamic aspect considers the compressive strength and looseness. The specific calculation formula is:
[0165] f2(x) = 0.3*bucking density score + 0.2*angle of repose score + 0.3*compressive strength score + 0.2*looseness score
[0166] Among them, the bulk density target value is set at 0.85-0.95g / cm 3, the repose angle is controlled within the range of 30-35°, the compressive strength is not less than 1.2MPa, and the looseness requirement is greater than 95%. Each indicator is scored according to its proximity to the target value, with a full score of 100.
[0167] The stability objective function f3(x) focuses on the performance of the product under different environmental conditions. This function includes the evaluation of temperature stability, humidity stability and storage stability. Temperature stability is evaluated by high temperature (45°C) and low temperature (-10°C) cycle tests; humidity stability is measured by moisture absorption under 75% relative humidity; storage stability is evaluated by the performance attenuation rate at room temperature for 30 days. The specific calculation formula is:
[0168] f3(x) = 0.4*temperature stability score + 0.3*humidity stability score + 0.3*storage stability score
[0169] These three objective functions are combined into the final optimization objective function through weight coefficients:
[0170] F(x)=w1*f1(x)+w2*f2(x)+w3*f3(x)
[0171] The weight coefficient can be flexibly adjusted according to specific application requirements. In the optimization of potassium pyrophosphate formula, based on market demand and production practice, w1=0.4, w2=w3=0.3 are set to balance the three performance indicators of water solubility, anti-caking and stability.
[0172] In order to handle multiple constraints, the present application embodiment adopts the penalty function method to convert the constrained optimization problem into an unconstrained optimization problem. For solutions that violate the constraints, their fitness values are reduced by adding penalty terms. The penalty function design adopts an adaptive strategy to dynamically adjust the penalty coefficient according to the degree of constraint violation. For example, when the amount of chelating agent in a certain formula exceeds the limit, its fitness value will be penalized according to the square of the excess amount to ensure that the search process converges to the feasible solution area.
[0173] In the actual optimization process, in order to improve the convergence efficiency of the algorithm, a knowledge-based initial population generation strategy is also introduced. By analyzing the historical formula data, the formula features with better performance are extracted to guide the generation of the initial population. For example, for the potassium pyrophosphate formula, the initial population contains at least 30% of individuals using anhydrous citric acid as the main chelating agent, and the ratio parameters of these individuals fluctuate around the historical optimal value, thereby increasing the probability of the algorithm finding the global optimal solution.
[0174] S4 includes:
[0175] S4.1: Establish the objective function:
[0176] Water solubility prediction objective function f1(x): calculate the solubility and dissolution rate of the sample in pure water at 20°C;
[0177] Anti-caking prediction objective function f2(x): calculate the caking strength and fluidity test values;
[0178] Stability prediction objective function f3(x): calculates storage stability and temperature stability test values;
[0179] The weight coefficients w1, w2, and w3 are set to satisfy w1+w2+w3=1.
[0180] Taking potassium pyrophosphate formulation optimization as a specific example, the construction process of the objective function is explained in detail:
[0181] First, establish the water solubility prediction objective function f1(x). This function comprehensively considers the two indicators of the sample's solubility and dissolution rate in 20°C pure water. For the potassium pyrophosphate formula, a scoring standard is constructed based on experimental data: the solubility adopts a 1-5 rating system, where level 1 represents the clearest. For example, when potassium pyrophosphate and anhydrous citric acid are mixed in a 1:1 ratio, they can quickly reach level 1 clarity under 2000 times dissolution conditions, and f1(x) achieves the optimal value at this time. In contrast, when HEDP is used as a chelating agent, obvious turbidity (level 4) occurs, and the corresponding f1(x) value is lower.
[0182] Secondly, the anti-caking prediction objective function f2(x) is constructed. This function is constructed based on two indicators: the caking strength test and the fluidity test. In the experiment, it was found that the anti-caking property of the potassium pyrophosphate formula is closely related to the ratio relationship and the dissolution conditions. For example, under the dissolution condition of 2000 times tap water, when potassium pyrophosphate and anhydrous citric acid are mixed in a 2:1 ratio, although the initial dissolution effect is good, it will become slightly turbid after being placed overnight, affecting the fluidity. When a 1:1 ratio is used, the sample has better stability and fluidity, and the value of f2(x) is higher at this time.
[0183] Secondly, the stability prediction objective function f3(x) is established. This function combines the two dimensions of storage stability and temperature stability for evaluation. Through experimental data analysis, the stability performance of the samples varies significantly under different dissolution multiples and pH conditions. For example, when dissolved 20 times in pure water, the pH value reaches 10.27 and the sample remains clear; while under 1000 times dissolution in tap water, the pH value drops to 7.79, and turbidity and precipitation occur. These data are used to construct f3(x) to accurately evaluate the stability performance of the formula.
[0184] When determining the weight coefficients of the objective function, w1=0.4, w2=0.3, and w3=0.3 are set based on a large amount of experimental data and actual application requirements. The reason why water solubility is given a higher weight is that experimental data show that water solubility is the most critical factor affecting product quality. For example, the formula of potassium pyrophosphate and anhydrous citric acid in a 1:1 ratio has excellent water solubility (quickly reaches level 1 clarity) and has a moderate pH value (4.24). This performance combination is the most popular in practical applications.
[0185] Through the design of this multi-objective function, the formulation optimization problem was successfully transformed into a quantifiable optimization model. For example, when the optimization goal is to improve water solubility and stability, the model can give priority to anhydrous citric acid as a chelating agent and recommend a 1:1 ratio while maintaining good anti-caking properties. This objective function system constructed based on experimental data provides a reliable evaluation criterion for subsequent genetic algorithm optimization.
[0186] S4.2: Execute optimization algorithm:
[0187] Initialize the recipe population with a population size of 100;
[0188] Construct a fitness function;
[0189] The non-dominated sorting method based on crowding is used to stratify the population:
[0190] Calculate the crowding distance of individuals in the target space;
[0191] Divide the non-dominated layer based on the Pareto dominance relationship;
[0192] Sort within each layer according to crowding distance;
[0193] Select the first k non-dominated individuals as parents;
[0194] Perform simulated binary crossover (probability 0.8) and polynomial mutation (probability 0.1) operations;
[0195] Perform feasibility repair on the offspring population.
[0196] In step S4.2, the present application adopts the improved NSGA-II algorithm for multi-objective optimization. Still taking the optimization of potassium pyrophosphate formula as an example, the implementation process of the optimization algorithm is described in detail.
[0197] First, the formula population is initialized, and the population size is set to 100 individuals, each of which contains complete formula information. In the optimization of potassium pyrophosphate formula, the individual encoding includes parameters such as chelating agent type selection (such as seven chelating agents such as anhydrous citric acid and malic acid), ratio relationship (2:1 or 1:1), and dissolution multiple. For example, a typical individual can be expressed as: select anhydrous citric acid as a chelating agent, use a 1:1 ratio, and use it under 2000 times dissolution conditions. The initial population is generated by randomly combining these parameters and ensuring that all individuals meet the formula constraints.
[0198] When constructing the fitness function, the three goals of water solubility, anti-caking and stability are comprehensively considered. Taking the potassium pyrophosphate formula as an example, when anhydrous citric acid is used as a chelating agent and the ratio is 1:1, the formula performs well in all three goals: it quickly reaches level 1 clarity after dissolution, the pH value is stable at 4.24, and it has good anti-caking properties. Such a formula individual will obtain a higher fitness value, increasing its probability of being retained during the evolution process.
[0199] When stratifying the population, a non-dominated sorting method based on crowding is used. First, the crowding distance of each individual in the population in the target space is calculated. For example, for two similar potassium pyrophosphate formulas, if they both use anhydrous citric acid but have slightly different ratios, the system will calculate their distances in the three target dimensions of water solubility, anti-caking, and stability. Individuals with larger crowding distances (i.e., formulas with larger performance differences from other individuals) will receive higher retention priorities, which helps maintain the diversity of the population.
[0200] When performing non-dominated sorting, the population is divided into multiple levels based on the Pareto dominance relationship. Taking potassium pyrophosphate formula optimization as an example, the first-level non-dominated solution set may include formulas using different chelating agents such as anhydrous citric acid and EDTA-2NA, each of which has advantages in certain performance indicators. For example, the anhydrous citric acid formula performs best in water solubility, while the EDTA-2NA formula may be better in stability. This hierarchical approach ensures the diversity of excellent formulas.
[0201] Next, the genetic operator operation is performed. In the crossover operation, the simulated binary crossover method is used, and the crossover probability is set to 0.8. For example, two parent formulations may use anhydrous citric acid and malic acid as chelating agents respectively. Through crossover, a child formulation that inherits the excellent properties of both chelating agents may be generated. In the mutation operation, polynomial mutation is used, and the mutation probability is set to 0.1. Mutation may change parameters such as chelating agent type, ratio relationship or dissolution conditions, which helps to expand the search space.
[0202] Finally, the feasibility of the generated offspring population is repaired to ensure that all formulas meet the actual constraints. For example, for the potassium pyrophosphate formula, it is necessary to ensure that the chelating agent ratio is within a reasonable range, the solubility multiple is between 20-2000 times, and the pH value meets the application requirements. Practice has shown that this constraint repair mechanism is crucial for generating practical optimized formulas. Through multiple rounds of iterative optimization, the algorithm eventually converges to a set of Pareto optimal solutions, providing multiple optional optimization formula solutions for different application scenarios.
[0203] S4.3: Generate optimized formulation solution:
[0204] Including the proportion of raw material components;
[0205] Including process parameter configuration.
[0206] For different application scenarios, the method of the present application can also flexibly adjust the optimization strategy. For example, for the 15# dissolution system, experiments show that DTPA and EDTA-2NA work best at a ratio of 2:1. At this time, the weight coefficient of the objective function can be adjusted accordingly to make the optimization result more in line with actual needs. In practical applications, through the analysis of a large amount of experimental data, it is found that the method proposed in this application can significantly improve the efficiency of water-soluble fertilizer formula optimization. Traditional methods may require hundreds of experiments to find a suitable formula, while using the method of this application, it usually only takes dozens of experiments to find a formula with equivalent or better performance.
[0207] In addition, this application also verified the influence of different process parameters on the performance of the formula through experiments. For example, in the test of the pH value of potassium pyrophosphate dissolution, it was found that the dissolution multiple significantly affected the final pH value: the pH value was 10.27 when dissolved 20 times in pure water, and the pH value decreased to 8.76 when it increased to 2000 times. These experimental data were used for model training, which improved the reliability of the optimization results.
[0208] This application not only improves the optimization efficiency by applying machine learning technology to the field of water-soluble fertilizer formula optimization, but also provides new research ideas for formula development. Especially when dealing with multi-component formulas, the method of this application can effectively capture the complex interactions between components, which is difficult to achieve with traditional optimization methods. By establishing a nonlinear mapping relationship between formula characteristics and performance indicators, the formula optimization process is made more accurate and efficient.
[0209] For example,
[0210] In the data collection stage, the present embodiment first collected information related to the potassium pyrophosphate formula from the experimental data. These data cover the raw material component information, including the use of potassium pyrophosphate and various chelating agents (such as anhydrous citric acid, malic acid, etc.); process parameter information, including different dissolution multiples (from 20 times to 2000 times) and dissolution medium types; and performance index data, mainly including key indicators such as solubility (expressed in 1-5 levels of clarity), pH value and stability (precipitation).
[0211] In the feature engineering stage, the embodiment of the present application first processed the raw material component data. The two main ratios of potassium pyrophosphate and chelating agent (2: 1 and 1: 1) were analyzed in detail, while the characteristic differences of seven different chelating agents were considered. Subsequently, the process parameters were standardized, the dissolution multiples of 20-2000 times were normalized, and the dissolution medium type (pure water, tap water, hard water) was encoded as a feature. Finally, the embodiment of the present application integrates these processed features into a unified feature vector to prepare for subsequent model training.
[0212] Feature engineering implementation code:
[0213] import numpy as np
[0214] import pandas as pd
[0215] from sklearn.preprocessing import MinMaxScaler
[0216] from sklearn.decomposition import PCA
[0217] from sklearn.feature_selection import SelectKBest
[0218] from sklearn.feature_selection import f_regression
[0219] class FeatureEngineering:
[0220] def __init__(self):
[0221] self.scaler = MinMaxScaler()
[0222] self.pca=PCA(n_components=0.95)
[0223] self.feature_selector=SelectKBest(score_func=f_regression,k=10)
[0224] def process_component_features(self,component_data):
[0225] """Step 2.1: Processing raw material composition data"""
[0226] # Calculate the stoichiometric ratio
[0227] element_ratios=self._calculate_element_ratios(component_data)
[0228] #Build the interaction matrix
[0229] interaction_matrix=self._build_interaction_matrix(component_data)
[0230] #Generate component feature vector
[0231] component_features=np.concatenate([element_ratios,interaction_matrix.flatten()])component_features=self.pca.fit_transform(component_features.reshape(1,-1))return component_features
[0232] def process_process_parameters(self,process_data):
[0233] """Step 2.2: Handling process parameters"""
[0234] #Normalization
[0235] normalized_params=self.scaler.fit_transform(process_data)
[0236] #Build combined features
[0237] combined_features=self._create_combined_features(normalized_params)
[0238] #Feature selection
[0239] process_features=self.feature_selector.fit_transform(
[0240] combined_features,
[0241] self._get_target_variable() )
[0243] return process_features
[0244] def integrate_features(self,component_features,process_features):
[0245] """Step 2.3: Feature Integration"""
[0246] # Dimension Alignment
[0247] aligned_features=self._align_dimensions(component_features,process_features)#Feature fusion
[0248] final_features=self._feature_fusion(aligned_features)
[0249] return final_features
[0250] def_calculate_element_ratios(self,component_data):
[0251] """Calculate element ratio"""
[0252] # Implement element ratio calculation logic
[0253] pass def_build_interaction_matrix(self,component_data):
[0254] """Build the interaction matrix"""
[0255] # Implement the interaction matrix construction logic
[0256] pass
[0257] def_create_combined_features(self,normalized_params):
[0258] """Create a composite feature"""
[0259] # Implement feature combination logic
[0260] pass
[0261] def_align_dimensions(self,component_features,process_features):
[0262] """Dimension Alignment"""
[0263] # Implement dimension alignment logic
[0264] pass
[0265] def_feature_fusion(self,aligned_features):
[0266] """Feature Fusion"""
[0267] # Implement feature fusion logic
[0268] pass
[0269] In the model training stage, the embodiment of the present application constructs a multi-task learning network. The network extracts the common features of the formula through the shared layer, and then sets three prediction branches respectively, which are used to predict solubility, pH value and stability. During the training process, the embodiment of the present application adopts a weighted loss function, in which the weights of solubility, pH value and stability are set to 0.4, 0.3 and 0.3 respectively to reflect the importance of different performance indicators.
[0270] Deep learning training code:
[0271] import torch
[0272] import torch.nn as nn
[0273] import torch.optim as optim
[0274] class MultiTaskNet(nn.Module):
[0275] def__init__(self, input_dim):
[0276] super(MultiTaskNet,self).__init__()
[0277] # Shared feature extraction layer
[0278] self.shared_layers=nn.Sequential(
[0279] nn.Linear(input_dim,256),
[0280] nn.ReLU(),
[0281] nn.BatchNorm1d(256),
[0282] nn.Dropout(0.3),
[0283] nn.Linear(256,128),
[0284] nn.ReLU(),
[0285] nn.BatchNorm1d(128),
[0286] nn.Dropout(0.3),
[0287] nn.Linear(128,64),
[0288] nn.ReLU(),
[0289] nn.BatchNorm1d(64),
[0290] nn.Dropout(0.3) )
[0292] # Water solubility prediction branch
[0293] self.solubility_branch=nn.Sequential(
[0294] nn.Linear(64,32),
[0295] nn.ReLU(),
[0296] nn.Linear(32,1),
[0297] nn.Sigmoid() )
[0299] # Anti-caking property prediction branch
[0300] self.caking_branch = nn.Sequential(
[0301] nn.Linear(64, 32),
[0302] nn.ReLU(),
[0303] nn.Linear(32, 1),
[0304] nn.Sigmoid() )
[0306] # Stability prediction branch
[0307] self.stability_branch = nn.Sequential(
[0308] nn.Linear(64, 32),
[0309] nn.ReLU(),
[0310] nn.Linear(32, 1),
[0311] nn.Sigmoid() )
[0313] def forward(self, x):
[0314] shared_features = self.shared_layers(x)
[0315] solubility = self.solubility_branch(shared_features)
[0316] caking = self.caking_branch(shared_features)
[0317] stability = self.stability_branch(shared_features)
[0318] return solubility, caking, stability
[0319] class ModelTrainer:
[0320] def __init__(self, input_dim):
[0321] self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') self.model = MultiTaskNet(input_dim).to(self.device)
[0322] self.optimizer = optim.Adam(
[0323] self.model.parameters(),
[0324] lr = 0.001,
[0325] betas=(0.9, 0.999) )
[0327] self.scheduler = optim.lr_scheduler.StepLR(
[0328] self.optimizer,
[0329] step_size = 50,
[0330] gamma = 0.9 )
[0332] def compute_loss(self, pred, target, weights):
[0333] """计算多任务加权损失"""
[0334] solubility_loss = nn.MSELoss()(pred[0], target[0]) * weights[0] caking_loss = nn.MSELoss()(pred[1], target[1]) * weights[1] stability_loss = nn.MSELoss()(pred[2], target[2]) * weights[2]
[0335] #添加L2正则化
[0336] l2_reg = 0.0
[0337] for param in self.model.parameters():
[0338] l2_reg += torch.norm(param, p = 2)
[0339] total_loss = solubility_loss + caking_loss + stability_loss + 0.01 * l2_reg return total_loss
[0340] def train(self, train_loader, val_loader, epochs = 200):
[0341] best_val_loss = float('inf')
[0342] patience = 10
[0343] counter = 0
[0344] for epoch in range(epochs):
[0345] # Training phase
[0346] self.model.train()
[0347] for batch_x, batch_y in train_loader:
[0348] batch_x = batch_x.to(self.device)
[0349] batch_y = [y.to(self.device) for y in batch_y]
[0350] self.optimizer.zero_grad()
[0351] pred = self.model(batch_x)
[0352] loss = self.compute_loss(pred, batch_y, [0.4, 0.3, 0.3])
[0353] loss.backward()
[0354] torch.nn.utils.clip_grad_norm_(self.model.parameters(), 5.0)
[0355] self.optimizer.step()
[0356] # Validation stage
[0357] val_loss = self.validate(val_loader)
[0358] self.scheduler.step()
[0359] # Early stopping check
[0360] if val_loss < best_val_loss:
[0361] best_val_loss = val_loss
[0362] torch.save(self.model.state_dict(), 'best_model.pth')
[0363] counter = 0
[0364] else:
[0365] counter += 1
[0366] if counter >= patience:
[0367] print(f'Early stopping at epoch {epoch}')
[0368] break
[0369] def validate(self, val_loader):
[0370] """Validation set evaluation"""
[0371] self.model.eval()
[0372] total_loss = 0
[0373] with torch.no_grad():
[0374] for batch_x, batch_y in val_loader:
[0375] batch_x=batch_x.to(self.device)
[0376] batch_y=[y.to(self.device)for y in batch_y]
[0377] pred = self.model(batch_x)
[0378] loss=self.compute_loss(pred,batch_y,[0.4,0.3,0.3])
[0379] total_loss += loss.item()
[0380] return total_loss / len(val_loader)
[0381] In the formulation optimization stage, the embodiment of the present application clearly states that the main goal of optimization is to improve solubility and pursue level 1 clarity. At the same time, multiple constraints are set, including that the pH value needs to be controlled within the range of 4.0-7.0 to ensure that no precipitation occurs and that cost requirements are met. By executing the optimization algorithm, the embodiment of the present application obtains a better formulation: using anhydrous citric acid as a chelating agent, using a 1:1 ratio, setting a dissolution multiple of 2000 times, it is expected to achieve level 1 clarity, and a pH value of 4.24.
[0382] Multi-target implementation code (example):
[0383] import numpy as np
[0384] from deap import base,creator,tools,algorithms
[0385] import torch
[0386] class FormulaOptimizer:
[0387] def__init__(self,trained_model,constraints):
[0388] self.model = trained_model
[0389] self.constraints=constraints
[0390] self.setup_optimization()
[0391] def setup_optimization(self):
[0392] """Configure the optimization algorithm"""
[0393] creator.create("FitnessMulti", base.Fitness, weights=(1.0, 1.0, 1.0))
[0394] creator.create("Individual", list, fitness=creator.FitnessMulti)
[0395] self.toolbox = base.Toolbox()
[0396] # Initialize the individual generator
[0397] self.toolbox.register("attr_float", self.generate_valid_component)
[0398] self.toolbox.register("individual", tools.initRepeat, creator.Individual,
[0399] self.toolbox.attr_float, n=self.constraints['n_components'])
[0400] self.toolbox.register("population", tools.initRepeat, list, self.toolbox.individual) # Register genetic operators
[0401] self.toolbox.register("evaluate", self.evaluate_formula)
[0402] self.toolbox.register("mate", tools.cxTwoPoint)
[0403] self.toolbox.register("mutate",tools.mutGaussian,mu=0,sigma=1,indpb=0.1)self.toolbox.register("select",tools.selNSGA2)
[0404] def generate_valid_component(self):
[0405] """Generate recipe components that satisfy the constraints"""
[0406] while True:
[0407] x=np.random.uniform(self.constraints['min_values'],
[0408] self.constraints['max_values'])
[0409] if self.check_constraints(x):
[0410] return x def check_constraints(self,x):
[0411] """Check if the recipe satisfies the constraints"""
[0412] # Check content range constraints
[0413] if not all(self.constraints['min_values']<=x<=self.constraints['max_values']):return False
[0414] # Check the ratio constraints
[0415] if not self.check_ratio_constraints(x):
[0416] return False
[0417] # Check cost constraints
[0418] if self.calculate_cost(x)>self.constraints['budget']:
[0419] return False
[0420] return True def evaluate_formula(self,individual):
[0421] """Evaluate multiple performance indicators of the formulation"""
[0422] #Convert to model input format
[0423] x=torch.tensor(individual,dtype=torch.float32)
[0424] #Use the trained model to predict performance
[0425] with torch.no_grad():
[0426] solubility,caking,stability=self.model(x)
[0427] # Calculate the objective function value
[0428] f1=solubility.item()*self.constraints['weights'][0]
[0429] f2=caking.item()*self.constraints['weights'][1]
[0430] f3=stability.item()*self.constraints['weights'][2]
[0431] return f1,f2,f3
[0432] def optimize(self,n_generations=1000):
[0433] """Perform multi-objective optimization"""
[0434] # Initialize the population
[0435] pop=self.toolbox.population(n=100)
[0436] #NSGA-II algorithm main loop
[0437] for gen in range(n_generations):
[0438] # Select parents
[0439] offspring = self.toolbox.select(pop, len(pop))
[0440] offspring = list(map(self.toolbox.clone, offspring))
[0441] # Crossover
[0442] for child1, child2 in zip(offspring[::2], offspring[1::2]): if np.random.random() < 0.8:
[0443] self.toolbox.mate(child1, child2)
[0444] del child1.fitness.values
[0445] del child2.fitness.values
[0446] # Mutation
[0447] for mutant in offspring:
[0448] if np.random.random() < 0.1:
[0449] self.toolbox.mutate(mutant)
[0450] del mutant.fitness.values
[0451] # Evaluate new individuals
[0452] invalid_ind = [ind for ind in offspring if not ind.fitness.valid] fitnesses = map(self.toolbox.evaluate, invalid_ind)
[0453] for ind, fit in zip(invalid_ind, fitnesses):
[0454] ind.fitness.values = fit
[0455] # Environmental selection
[0456] pop=self.toolbox.select(pop+offspring,len(pop))
[0457] #Local Search
[0458] self.local_search(pop)
[0459] return self.select_best_formulas(pop)
[0460] def local_search(self,population):
[0461] """Local Search Optimization"""
[0462] for ind in population:
[0463] #Search in a small area around the individual
[0464] for_in range(10):
[0465] new_ind=self.toolbox.clone(ind)
[0466] self.toolbox.mutate(new_ind)
[0467] if self.check_constraints(new_ind):
[0468] new_fitness=self.evaluate_formula(new_ind)
[0469] if sum(new_fitness)>sum(ind.fitness.values):
[0470] ind[:] = new_ind
[0471] ind.fitness.values=new_fitness
[0472] def select_best_formulas(self,population):
[0473] """Select the best formula"""
[0474] #Get the Pareto front solution
[0475] pareto_front=tools.sortNondominated(population,len(population),
[0476] first_front_only=True)[0]
[0477] #Calculate the comprehensive score
[0478] scores=[]
[0479] for ind in pareto_front:
[0480] score=sum(ind.fitness.values)
[0481] scores.append((ind,score))
[0482] #Return the recipe with the highest score
[0483] best_formulas=sorted(scores,key=lambda x:x[1],reverse=True)[:5]
[0484] return best_formulas
[0485] In the final experimental verification stage, the embodiment of the present application experimentally verified the optimized formula. The experimental results showed that the formula could quickly reach level 1 clarity after dissolution, the pH value was consistent with the predicted value of 4.24, and it could be completely dissolved within 10 minutes without precipitation. Based on these experimental data, the embodiment of the present application further optimized the model by adding new experimental data to the training set and adjusting the model parameters to further improve the accuracy of the prediction.
[0486] The sample code is as follows:
[0487] import numpy as np
[0488] from deap import base,creator,tools,algorithms
[0489] import torch
[0490] class FormulaOptimizer:
[0491] def __init__(self, trained_model, constraints):
[0492] self.model = trained_model
[0493] self.constraints = constraints
[0494] self.setup_optimization()
[0495] def setup_optimization(self):
[0496] """Configure the optimization algorithm"""
[0497] creator.create("FitnessMulti", base.Fitness, weights=(1.0, 1.0, 1.0))
[0498] creator.create("Individual", list, fitness=creator.FitnessMulti)
[0499] self.toolbox = base.Toolbox()
[0500] # Initialize the individual generator
[0501] self.toolbox.register("attr_float", self.generate_valid_component)
[0502] self.toolbox.register("individual", tools.initRepeat, creator.Individual,
[0503] self.toolbox.attr_float, n=self.constraints['n_components'])
[0504] self.toolbox.register("population", tools.initRepeat, list, self.toolbox.individual) # Register genetic operators
[0505] self.toolbox.register("evaluate",self.evaluate_formula)
[0506] self.toolbox.register("mate",tools.cxTwoPoint)
[0507] self.toolbox.register("mutate",tools.mutGaussian,mu=0,sigma=1,indpb=0.1)self.toolbox.register("select",tools.selNSGA2)
[0508] def generate_valid_component(self):
[0509] """Generate recipe components that satisfy the constraints"""
[0510] while True:
[0511] x=np.random.uniform(self.constraints['min_values'],
[0512] self.constraints['max_values'])
[0513] if self.check_constraints(x):
[0514] return x def check_constraints(self,x):
[0515] """Check if the recipe satisfies the constraints"""
[0516] # Check content range constraints
[0517] if not all(self.constraints['min_values']<=x<=self.constraints['max_values']):return False
[0518] # Check the ratio constraints
[0519] if not self.check_ratio_constraints(x):
[0520] return False
[0521] # Check cost constraints
[0522] if self.calculate_cost(x)>self.constraints['budget']:
[0523] return False
[0524] return True def evaluate_formula(self,individual):
[0525] """Evaluate multiple performance indicators of the formulation"""
[0526] #Convert to model input format
[0527] x=torch.tensor(individual,dtype=torch.float32)
[0528] #Use the trained model to predict performance
[0529] with torch.no_grad():
[0530] solubility,caking,stability=self.model(x)
[0531] # Calculate the objective function value
[0532] f1=solubility.item()*self.constraints['weights'][0]
[0533] f2=caking.item()*self.constraints['weights'][1]
[0534] f3=stability.item()*self.constraints['weights'][2]
[0535] return f1,f2,f3
[0536] def optimize(self,n_generations=1000):
[0537] """Perform multi-objective optimization"""
[0538] # Initialize the population
[0539] pop=self.toolbox.population(n=100)
[0540] #NSGA-II algorithm main loop
[0541] for gen in range(n_generations):
[0542] #Select the parent
[0543] offspring=self.toolbox.select(pop,len(pop))
[0544] offspring=list(map(self.toolbox.clone,offspring))
[0545] #cross
[0546] for child1,child2 in zip(offspring[::2],offspring[1::2]):ifnp.random.random()<0.8:
[0547] self.toolbox.mate(child1,child2)
[0548] del child1.fitness.values
[0549] del child2.fitness.values
[0550] #Mutations
[0551] for mutant in offspring:
[0552] if np.random.random()<0.1:
[0553] self.toolbox.mutate(mutant)
[0554] del mutant.fitness.values
[0555] #Evaluate new individuals
[0556] invalid_ind = [ind for ind in offspring if not ind.fitness.valid] fitnesses = map(self.toolbox.evaluate, invalid_ind)
[0557] for ind, fit in zip(invalid_ind, fitnesses):
[0558] ind.fitness.values = fit
[0559] # Environmental selection
[0560] pop = self.toolbox.select(pop + offspring, len(pop))
[0561] # Local search
[0562] self.local_search(pop)
[0563] return self.select_best_formulas(pop)
[0564] def local_search(self, population):
[0565] """Local search optimization"""
[0566] for ind in population:
[0567] # Search in a small range around the individual
[0568] for _ in range(10):
[0569] new_ind = self.toolbox.clone(ind)
[0570] self.toolbox.mutate(new_ind)
[0571] if self.check_constraints(new_ind):
[0572] new_fitness = self.evaluate_formula(new_ind)
[0573] if sum(new_fitness)>sum(ind.fitness.values):
[0574] ind[:] = new_ind
[0575] ind.fitness.values=new_fitness
[0576] def select_best_formulas(self,population):
[0577] """Select the best formula"""
[0578] #Get the Pareto front solution
[0579] pareto_front=tools.sortNondominated(population,len(population),
[0580] first_front_only=True)[0]
[0581] #Calculate the comprehensive score
[0582] scores=[]
[0583] for ind in pareto_front:
[0584] score=sum(ind.fitness.values)
[0585] scores.append((ind,score))
[0586] #Return the recipe with the highest score
[0587] best_formulas=sorted(scores,key=lambda x:x[1],reverse=True)[:5]
[0588] return best_formulas
[0589] This example fully demonstrates the application value of the technical solution proposed in the embodiment of the present application in the actual optimization of water-soluble fertilizer formula. By applying the machine learning method to the formula optimization problem, the embodiment of the present application successfully learned the formula-performance relationship from the experimental data and found a formula with excellent performance. In particular, the use of anhydrous citric acid as a chelating agent and the 1:1 ratio showed excellent comprehensive performance in the experimental verification, confirming the effectiveness of the method.
[0590] Experimental results using the optimized formula:
[0591] Table 1 Reaction of potassium pyrophosphate / 15# with chelating agent
[0592]
[0593]
[0594] Note: The (1-5) in the table represent the clarity from high to low, with (1) being the clearest.
[0595] In general, for the potassium pyrophosphate dissolution system, at 2:1, anhydrous citric acid has the best effect in alleviating the turbidity phenomenon of low-multiple dissolution in the presence of calcium and magnesium ions in water. Malic acid is second in short-term effect, but the effect is not very good after being left overnight. DTPA itself dissolves slowly and EDTA-2Na has average effect. At 1:1, citric acid and EDTA-2Na have the best effect.
[0596] In the 15# dissolving system, at 2:1, DTPA and EDTA-2Na have the best effect, followed by tartaric acid.
[0597] Table 2 Potassium pyrophosphate dissolution pH value and whether it is clear
[0598]
[0599] Note: 1. Unmarked items are for clarification
[0600] 2. Dissolve potassium pyrophosphate in 2000 times tap water without adding citric acid. Leave it alone overnight. It becomes turbid but does not settle. The pH value is 7.14.
[0601] In order to fully verify the effectiveness of the optimization method proposed in this application, a systematic control experimental plan was designed. Taking the optimization of potassium pyrophosphate formula as an example, three control groups were selected for comparison: the traditional empirical formula group (Group A), the single-target optimization formula group (Group B) and the formula group optimized by the method of this application (Group C). Each group of formulas was repeated in 10 batches, and the experimental results are as follows:
[0602] Table 3 Comparison of performance indicators of three groups of formulas (n = 10, Mean ± SD)
[0603]
[0604] The statistical analysis results show that the formula optimized by the method of this application (Group C) is significantly better than the traditional empirical formula (Group A) and the single-objective optimization formula (Group B) in all performance indicators. The specific analysis is as follows:
[0605] 1. Analysis of water solubility index:
[0606] The solubility of group C reached 98.7%, significantly higher than 92.3% of group A (P<0.01) and 95.6% of group B (P<0.05). The dissolution time was reduced to 4.2 minutes, 50.6% shorter than that of group A (P<0.01). The clarity was improved to level 1.2, which was significantly improved compared with level 2.8 of group A (P<0.01). Variance analysis showed that the stability of group C in various water-soluble indicators was also significantly better than that of the other two groups, with the coefficient of variation being less than 5%.
[0607] 2. Analysis of anti-caking index:
[0608] The bulk density, repose angle and compressive strength of group C all reached the ideal range. The bulk density was 0.91g / cm 3 In the optimal range (0.85-0.95g / cm 3 ), and the angle of repose of 32.1° was better than the industry standard (<35°). Using two-way ANOVA, the results showed that there were significant differences in the effects of the formula group (F=45.32, P<0.01) and the test batch (F=1.24, P>0.05) on anti-caking properties, confirming the repeatability of the optimized formula.
[0609] 3. Stability index analysis:
[0610] The three groups of formulas were subjected to accelerated aging test (45℃, 75%RH, 30 days). The comprehensive stability score of group C (92.6±2.1) was significantly higher than that of group A (84.1±3.5) and group B (87.7±2.8). Kaplan-Meier curve analysis showed that group C had the lowest performance decay rate during the storage period (P<0.01). Multiple regression analysis showed that the optimized chelating agent ratio was the key factor to improve stability (β=0.68, P<0.01).
[0611] 4.Batch-to-batch stability analysis:
[0612] Assess process stability by calculating the batch-to-batch coefficient of variation (CV):
[0613] Group A: CV range 7.2%-12.5%
[0614] Group B: CV range 5.8%-9.4%
[0615] Group C: CV range 3.1%-6.2%
[0616] The results showed that group C had the best batch reproducibility (P<0.01).
[0617] 5. Cost-Benefit Analysis:
[0618] Although the raw material cost of Group C was slightly higher than that of Group A (increased by about 8%), considering the improvement in product performance and production efficiency, the unit output value increased by 23%, and the payback period was about 4 months.
[0619] 6. Principal Component Analysis (PCA):
[0620] The principal component analysis was performed on all performance indicators of the three groups of formulas, and the cumulative explanation rate of the first two principal components reached 87.3%. In the PCA score graph, the sample points of group C were the most concentrated and clearly separated from the other two groups, further confirming the stability and uniqueness of the optimized formula.
[0621] Through the above-mentioned systematic control experiments and statistical analysis, the optimization method proposed in this application has been fully verified to have significant advantages in improving product performance and process stability. In particular, the comprehensive improvement in the three key indicators of water solubility, anti-caking and stability provides reliable data support for the promotion and application of this method in industrial production.
[0622] The present application also provides a device for optimizing the grinding formula of water-soluble fertilizer. Figure 5 As shown, the device includes a collection module, a feature engineering processing module, a building module and an optimization module. Through the coordinated work of these functional modules, the intelligent optimization of the water-soluble fertilizer formula is achieved.
[0623] in:
[0624] Collection module: used to collect and record recipe data;
[0625] Feature engineering processing module: used to perform feature engineering processing on recipe data;
[0626] Building modules: used to build and train deep neural network models;
[0627] Optimization module: used to execute genetic algorithms for multi-objective optimization.
[0628] The acquisition module is mainly responsible for the collection and management of formula data. In the specific implementation, this module includes a data acquisition unit and a data preprocessing unit. The data acquisition unit designs a standardized data acquisition template for standardizing the recording of raw material components, process parameters and performance index data. For example, when collecting potassium pyrophosphate formula data, the performance data of different chelating agents (such as anhydrous citric acid, malic acid, etc.) in different ratios are systematically recorded. The data preprocessing unit is responsible for data cleaning and preliminary processing, including outlier detection and missing value processing.
[0629] The feature engineering processing module is responsible for data feature extraction and conversion. This module includes a component feature extraction unit, a process feature extraction unit, and a feature fusion unit. The component feature extraction unit specifically processes raw material component data, such as calculating the physicochemical interaction strength between potassium pyrophosphate and chelating agents. In practice, it has been found that this unit is particularly effective in capturing component interaction features under different ratios (2:1 and 1:1). The process feature extraction unit is responsible for processing process parameter data, such as normalizing different dissolution multiples from 20 to 2000 times, and constructing combined features of process parameters.
[0630] The building module is the core part of the device, which is responsible for the construction and training of the deep neural network model. This module includes a model building unit, a training management unit, and a mapping function generation unit. The model building unit implements the construction of a multi-layer perceptron network structure, including the configuration of three hidden layers (with 256, 128, and 64 neurons, respectively), and the addition of batch normalization layers and dropout layers. The training management unit is responsible for the scheduling and monitoring of the model training process, including the implementation of training strategies such as learning rate adjustment and gradient clipping. In practical applications, the unit can automatically adjust the learning rate, and when the validation set loss has not improved for 10 consecutive training cycles, stop training in time to avoid overfitting.
[0631] The optimization module uses an improved genetic algorithm to achieve multi-objective optimization. The module includes an objective function construction unit, a population management unit, and a solution generation unit. The objective function construction unit is responsible for establishing three prediction objective functions of water solubility, anti-caking and stability, and setting weight coefficients according to actual needs. For example, when optimizing the potassium pyrophosphate formula, the optimal formula with anhydrous citric acid as a chelating agent was successfully found by setting the weights of water solubility, anti-caking and stability to 0.4, 0.3 and 0.3 respectively. The population management unit implements a non-dominated sorting algorithm based on crowding, and effectively maintains the diversity of the population by calculating the crowding distance of individuals in the target space.
[0632] The device of the present application also realizes the functions of formula verification and iterative optimization. By experimentally verifying the optimized formula, collecting experimental data and feeding it back to the establishment module, the model performance is continuously improved. For example, during the verification process, it was found that the optimized potassium pyrophosphate formula can not only quickly reach level 1 clarity under 2000 times dissolution conditions, but also stabilize the pH value at 4.24. These data are used for further optimization of the model to form a virtuous circle.
[0633] The various functional modules of the device can be integrated in the same computing device or deployed in a distributed manner on different computing nodes. In practical applications, the appropriate deployment method can be selected according to specific needs. For example, deep neural network training with high computing resource requirements can be deployed on a server equipped with a GPU, while functions such as data collection can be deployed on ordinary computing devices.
[0634] In addition, the modules of the device communicate with each other through standardized data interfaces, ensuring the smoothness and reliability of data flow. For example, the feature engineering processing module and the establishment module transmit data through a unified feature vector format, and the optimization module outputs the optimization results in a predefined formula format. This modular design not only improves the maintainability of the system, but also facilitates the expansion and optimization of subsequent functions.
[0635] The feasibility and effectiveness of the method of this application have been verified through the actual application of the device. The experimental results show that the device can effectively handle the complex problems in the optimization of water-soluble fertilizer formulas and significantly improve the efficiency of formula development. Especially when dealing with multi-component formulas, the device shows obvious advantages and can quickly find an optimized formula solution that meets multiple performance index requirements.
Claims
1. A method for optimizing a water-soluble fertilizer grinding formula, characterized in that: The method comprises: Collecting water-soluble fertilizer formula data and recording the formula data, wherein the formula data includes raw material component data, process parameter data and performance index data, wherein the raw material component data includes the chemical composition, content and particle size distribution of the raw material components, the process parameter data includes grinding time, grinding temperature and grinding pressure, and the performance index data includes water solubility, anti-caking property and stability index; The formula data is subjected to feature engineering processing, including: calculating the chemical stoichiometric ratio and component interaction strength of the raw material component data to obtain a component feature vector; normalizing and feature combining the process parameter data to obtain a process feature vector; dimensional alignment and feature fusion of the component feature vector and the process feature vector to obtain a formula feature vector; Constructing a deep neural network model, training the deep neural network model based on the recipe feature vector, and establishing a nonlinear mapping function by the deep neural network model, wherein the nonlinear mapping function is used to realize mapping from the recipe feature vector to the performance indicator data; Based on the nonlinear mapping function, a genetic algorithm is used to perform multi-objective optimization to generate an optimized formulation scheme, wherein the optimized formulation scheme includes a raw material component ratio and a process parameter configuration.
2. The method according to claim 1, characterized in that: The dimension alignment and feature fusion of the component feature vector and the process feature vector include: Checking the dimensional consistency of the component feature vector and the process feature vector, and adjusting the feature dimensions according to preset rules; Calculating the feature importance scores of each dimension of the component feature vector and the process feature vector; Based on the feature importance score, the component feature vector and the process feature vector are weightedly fused to generate the recipe feature vector.
3. The method according to claim 1, characterized in that The construction of a deep neural network model includes: Design a multi-layer perceptron network structure, wherein an input layer receives the recipe feature vector; Three hidden layers are configured, the number of neurons in the three hidden layers is 256, 128 and 64 respectively, each hidden layer adopts a ReLU activation function, and a batch normalization layer and a Dropout layer are added; A multi-task learning output layer is constructed, including a water solubility prediction branch, an anti-caking prediction branch, and a stability prediction branch, and each branch adopts a Sigmoid activation function.
4. The method according to claim 3, characterized in that The step of training the deep neural network model based on the recipe feature vector comprises: The formula feature vector is divided into training set data and verification set data in a ratio of 7:3; Define a multi-objective loss function, including the mean square error loss for water solubility prediction, the mean square error loss for anti-caking prediction, and the mean square error loss for stability prediction; Based on the training set data, a batch stochastic gradient descent method with a batch size of 32 is used to perform model training; Configure the Adam optimizer, set the initial learning rate to 0.001, and decay the learning rate to 0.9 times the original value every 50 training cycles; A gradient clipping strategy is adopted to limit the gradient norm to no more than 5.0; the validation set loss is monitored and training is stopped when the validation set loss does not improve for 10 consecutive training cycles.
5. The method according to claim 4, characterized in that The nonlinear mapping function is established by the deep neural network model, including: Based on the training set data, the output result of each hidden layer is nonlinearly transformed through the ReLU activation function to obtain intermediate features; The intermediate features are batch normalized and some neurons are randomly discarded through a Dropout layer; The processed intermediate features are input into the multi-task learning output layer to generate a water solubility prediction function, an anti-caking prediction function and a stability prediction function, respectively, to form a complete nonlinear mapping function.
6. The method according to claim 1, characterized in that The multi-objective optimization using genetic algorithm to generate an optimized formulation scheme includes: Establish prediction objective functions of water solubility, anti-caking property and stability respectively, and set weight coefficients of each prediction objective function; Constructing a combined objective function, wherein the combined objective function is a weighted sum of the prediction objective functions; Set optimization constraints, including raw material component content range constraints and process parameter range constraints; Based on the combined objective function and the optimization constraints, a genetic algorithm is used to search for an optimal formulation solution.
7. The method according to claim 6, characterized in that The method of using a genetic algorithm to search for an optimal formulation solution comprises: Initialize the recipe population, set the population size to 100, and each individual contains the raw material group allocation ratio and process parameter configuration; Constructing a fitness function, and calculating individual fitness values based on the combined objective function; The population is stratified using a non-dominated sorting method based on crowding, and individuals ranked before a preset threshold are selected as parents. Perform a simulated binary crossover operation on the selected parent individuals, with the crossover probability set to 0.8; perform a polynomial mutation operation, with the mutation probability set to 0.1; The feasibility of the generated offspring population is repaired to ensure that the optimization constraints are met.
8. The method according to claim 6, characterized in that The prediction objective functions of water solubility, anti-caking property and stability are established respectively, including: Establish the water solubility prediction objective function f1(x) to calculate the solubility value and dissolution rate of the sample in 20℃ pure water; Establish the anti-caking property prediction objective function f2(x) for calculating the caking strength test value and the fluidity test value; Establish the stability prediction objective function f3(x), using the calculation of storage stability test values and temperature stability test values; The weight coefficients of water solubility, anti-caking property and stability are set to w1, w2 and w3 respectively, and w1+w2+w3=1 is satisfied.
9. The method according to claim 7, characterized in that: The method of adopting the non-dominated sorting method based on crowding degree to stratify the population includes: Calculate the crowding distance of each individual in the population in the target space, where the crowding distance represents the average distance between the individual and its adjacent individuals in the target space; Based on the Pareto dominance relationship, the population is divided into multiple non-dominated layers, and individuals in the same layer do not dominate each other; In each non-dominated layer, individuals are sorted according to their crowding distance, and individuals with larger crowding distance have higher selection priority; The individuals in the first k non-dominated layers are selected to form the parent population, where k is the minimum integer that makes the size of the parent population reach the preset value.
10. A device for optimizing the grinding formula of water-soluble fertilizer, characterized in that: include: A collection module is used to collect water-soluble fertilizer formula data and record the formula data, wherein the formula data includes raw material component data, process parameter data and performance index data, wherein the raw material component data includes the chemical composition, content and particle size distribution of the raw material components, the process parameter data includes grinding time, grinding temperature and grinding pressure, and the performance index data includes water solubility, anti-caking property and stability index; A feature engineering processing module is used to perform feature engineering processing on the formula data, including: calculating the stoichiometric ratio and component interaction strength of the raw material component data to obtain a component feature vector; performing normalization processing and feature combination on the process parameter data to obtain a process feature vector; performing dimension alignment and feature fusion on the component feature vector and the process feature vector to obtain a formula feature vector; Establishing a module for constructing a deep neural network model, training the deep neural network model based on the recipe feature vector, and establishing a nonlinear mapping function by the deep neural network model, wherein the nonlinear mapping function is used to realize mapping from the recipe feature vector to the performance indicator data; The optimization module is used to perform multi-objective optimization using a genetic algorithm based on the nonlinear mapping function to generate an optimized formula solution, wherein the optimized formula solution includes a raw material component ratio and a process parameter configuration.
Citation Information
Cited By
Hydrothermal carbon-based organic fertilizer formula optimization method
CN121393694A
A method for optimizing a hydrothermal carbon-based organic fertilizer formula
CN121393694B