Training method, device, equipment and storage medium for corrosion inhibition efficiency prediction model
By screening and extracting the target feature descriptors and common factors of benzimidazole corrosion inhibitors, a corrosion inhibition efficiency prediction model is constructed, which solves the problems of insufficient model parameters and difficult to explain in the existing technology, and achieves high Precision of corrosion inhibition efficiency prediction.
Patent Information
- Application Number
- CN202110202367.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-23
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-02-23
AI Technical Summary
In the prior art, when predicting the relationship between the molecular structure of organic corrosion inhibitors and corrosion inhibitory properties, insufficient model parameters lead to insufficient fit, and nonlinear modeling methods are difficult to explain the relationship between feature descriptors and corrosion inhibitory efficiency.
By obtaining sample data of benzimidazole corrosion inhibitors, target feature descriptors with a greater impact on corrosion inhibition efficiency were screened out, and common factors were extracted, and corrosion inhibition efficiency prediction model was constructed based on these common factors.
The prediction accuracy of corrosion inhibition efficiency is significantly improved, and the common factor can describe most important information about corrosion inhibitor molecules, simplifying the model training process and improving prediction efficiency.
Smart Images

Figure CN114974462B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of molecular structure-activity relationship research, and specifically to a training method, device, equipment and storage medium for a corrosion inhibition efficiency prediction model. Background Art
[0002] In the oil and gas industry, adding corrosion inhibitors to corrosive media can greatly reduce the rate of metal corrosion; the magnitude of its corrosion inhibition effect is usually expressed in terms of inhibition efficiency (IE).
[0003] At present, the research on the relationship between the molecular structure and corrosion inhibition performance of organic corrosion inhibitors is basically based on the calculation method of molecular structure. Modeling is carried out for the characteristic parameters of several or a dozen chemical molecules to construct the relationship between the molecular structure parameters of the corrosion inhibitor and IE. Summary of the invention
[0004] The embodiment of the present application provides a training method, device, equipment and storage medium for a corrosion inhibition efficiency prediction model, and the technical solution is as follows:
[0005] On the one hand, an embodiment of the present application provides a method for training a corrosion inhibition efficiency prediction model, the method comprising:
[0006] Acquire sample data, wherein the sample data includes a sample molecular structure of a sample benzimidazole corrosion inhibitor molecule and a sample corrosion inhibition efficiency, wherein the sample corrosion inhibition efficiency is obtained through experimental measurement;
[0007] Select n target feature descriptors from the candidate feature descriptors of the sample molecular structure, where n is a positive integer;
[0008] Extracting m common factors from the n target feature descriptors;
[0009] A corrosion inhibition efficiency prediction model is constructed and trained based on the m common factors and sample data.
[0010] On the other hand, an embodiment of the present application provides a training device for a corrosion inhibition efficiency prediction model, the device comprising:
[0011] A sample acquisition module, used to acquire sample data, wherein the sample data includes a sample molecular structure of a sample benzimidazole corrosion inhibitor molecule and a sample corrosion inhibition efficiency, wherein the sample corrosion inhibition efficiency is obtained through experimental measurement;
[0012] A screening module, used to screen out n target feature descriptors from the candidate feature descriptors of the sample molecular structure, where n is a positive integer;
[0013] An extraction module, used for extracting m common factors from the n target feature descriptors;
[0014] The model determination module is used to construct and train a corrosion inhibition efficiency prediction model based on the m common factors and sample data.
[0015] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the training method of the corrosion inhibition efficiency prediction model as described in the above aspects.
[0016] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the training method of the corrosion inhibition efficiency prediction model as described in the above aspects.
[0017] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the training method of the corrosion inhibition efficiency prediction model provided in the above aspect or various optional implementations of the above aspect.
[0018] The beneficial effects of the technical solution provided by the embodiments of the present application include at least:
[0019] In an embodiment of the present application, in order to improve the prediction accuracy of the corrosion inhibition efficiency of the corrosion inhibitor, the molecular characteristics of the corrosion inhibitor molecules are represented by feature descriptors, and target feature descriptors that have a greater impact on the corrosion inhibition efficiency are screened out from the candidate feature descriptors of the corrosion inhibitor molecules. The common factors affecting the corrosion inhibition effect are extracted according to the determined target feature descriptors, and a corrosion inhibition efficiency prediction model is constructed based on the common factors. Since the common factors can describe most of the important information of the corrosion inhibitor molecules, constructing a corrosion inhibition efficiency prediction model based on the common factors significantly improves the prediction accuracy of the corrosion inhibition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flow chart of a method for training a corrosion inhibition efficiency prediction model provided by an exemplary embodiment of the present application;
[0021] Figure 2 It is a corresponding diagram between the molecular structure of the benzimidazole corrosion inhibitor and the experimental IE value provided by the exemplary embodiment of the present application;
[0022] Figure 3is a flow chart of a method for training a corrosion inhibition efficiency prediction model provided by another exemplary embodiment of the present application;
[0023] Figure 4 It is a scatter plot of predicted IE values and experimental IE values of 20 corrosion inhibitor molecules predicted by a corrosion inhibition efficiency prediction model shown in an exemplary embodiment of the present application;
[0024] Figure 5 A structural block diagram of a training device for a corrosion inhibition efficiency prediction model provided by an exemplary embodiment of the present application is shown;
[0025] Figure 6 A schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0027] In the related art, the method of modeling the corrosion inhibition efficiency prediction model based on collinearity often leads to underfitting of the relationship between molecular structure parameters and IE due to insufficient model construction parameters.
[0028] The nonlinear modeling method, namely the support vector regression method based on the radial basis kernel function, performs principal component analysis and compression on multiple chemical parameters of the molecule. However, due to the unclear relationship between the characteristic descriptor of the molecular structure and the principal component, the relationship between its characteristic descriptor and IE cannot be explained.
[0029] The present application provides a training method for a corrosion inhibition efficiency prediction model. The method can be applied to a computer device with data processing, which can be a personal computer, a portable computer, a workstation, or a server, etc., which has strong data processing capabilities. The present application does not limit the specific device type, and for the convenience of description, the following embodiments are described by taking the application of the training method of the corrosion inhibition efficiency prediction model to a computer device as an example.
[0030] Please refer to Figure 1 , which shows a flow chart of a method for training a corrosion inhibition efficiency prediction model provided by an exemplary embodiment of the present application, the method may include the following steps:
[0031] Step 101, obtaining sample data, wherein the sample data includes sample molecular structures and sample corrosion inhibition efficiencies of sample benzimidazole corrosion inhibitor molecules, and the sample corrosion inhibition efficiencies are obtained through experimental measurements.
[0032] Corrosion inhibition efficiency is an important evaluation index of corrosion inhibitors. By predicting the corrosion inhibition efficiency, the quality of the corrosion inhibitor can be evaluated. The higher the corrosion inhibition efficiency value, the better the corrosion inhibition performance of the corrosion inhibitor, and vice versa. The molecular structure and corrosion inhibition efficiency of the corrosion inhibitor can be obtained by querying the Internet and consulting relevant literature, or by experimental measurement. The specific method of obtaining data is not limited in this embodiment.
[0033] In an illustrative example, the sample data acquired by the computer device is as follows: Figure 2 , which contains 20 sample molecules of benzimidazole corrosion inhibitors and the corresponding sample corrosion inhibition efficiency. Since the corrosion inhibition efficiency of benzimidazole corrosion inhibitors is affected by a variety of molecular characteristic factors, such as the energy, charge, stereo conformation and topological characteristics of the molecule, in order to improve the accuracy of the prediction model, before using computer equipment and software for training, it is necessary to obtain the molecular structure and experimental corrosion inhibition efficiency of all benzimidazole corrosion inhibitors in the sample, and optimize the molecular structure of the corrosion inhibitor through software, and calculate the feature descriptor used to characterize the molecular structure characteristics of the corrosion inhibitor.
[0034] In order to improve the prediction accuracy of the corrosion inhibition efficiency prediction model of corrosion inhibitors, the corrosion inhibitor molecules are structurally characterized from the aspects of energy, charge, stereo conformation and topological characteristics, including the bond energy, valence energy, electrostatic potential, electron layer, information content and other characteristic descriptors that can characterize the molecular structure. However, due to the large number of characteristic descriptors of corrosion inhibitor molecules, not all characteristic descriptors can affect the corrosion inhibition efficiency. Therefore, it is necessary to screen out the characteristic descriptors that can affect the corrosion inhibition efficiency from all characteristic descriptors. By studying all characteristic descriptors and screening them, candidate characteristic descriptors that affect the corrosion inhibition efficiency are found.
[0035] Step 102: select n target feature descriptors from the candidate feature descriptors of the sample molecular structure, where n is a positive integer.
[0036] Since there are still a large number of candidate feature descriptors after screening, including those with greater and lesser impact on corrosion inhibition efficiency, if the candidate feature descriptors are directly used as training sets for model training, the training process will be slow and the prediction efficiency will be reduced. Therefore, it is necessary to further screen the candidate feature descriptors and select n target feature descriptors with greater impact on corrosion inhibition efficiency from a large number of candidate feature descriptors.
[0037] In one possible implementation, a computer device calculates 253 feature descriptors for characterizing molecular structure characteristics based on the input molecular structures of 20 sample corrosion inhibitors, but not all of these 253 feature descriptors will have an impact on the corrosion inhibition efficiency. Therefore, after screening out the feature descriptors that can affect the corrosion inhibition efficiency, 151 candidate feature descriptors are obtained. The 151 candidate feature descriptors are further screened according to the impact of the candidate feature descriptors on the corrosion inhibition efficiency in the same dimension, and 56 target feature descriptors are obtained after screening.
[0038] Step 103: extract m common factors from the n target feature descriptors, where the common factors are based on linear combinations of the target feature descriptors.
[0039] Due to the large number of target feature descriptors, directly using n target feature descriptors to build a model and train the model can improve the prediction accuracy to a certain extent, but the improvement effect is not significant. On the contrary, the training time of the model is increased due to the large training set of the model, which reduces the prediction efficiency of the model. Therefore, it is also necessary to linearly combine the n target feature descriptors based on the determined n target feature descriptors and extract m common factors through factor analysis. Among them, each common factor is determined based on the linear combination of n target feature descriptors. Each extracted common factor represents a spatial dimension, and each dimension is different. Based on m common factors, most of the important information of the corrosion inhibitor molecule can be described. The target feature descriptors with high correlation are clustered together by dimensionality reduction, and the corrosion inhibition efficiency is predicted based on the common factors, thereby reducing the number of target feature descriptors that need to be analyzed and reducing the complexity of problem analysis.
[0040] In a possible implementation, comprehensive indicators such as eigenvalues, variance contribution rates, and cumulative variance contribution rates of 56 target feature descriptors are evaluated by factor analysis, and ultimately 8 common factors are extracted based on the 56 target feature descriptors.
[0041] Step 104: construct and train a corrosion inhibition efficiency prediction model based on the m common factors and sample data.
[0042] According to the extracted m common factors, the m common factors are used as input features for predicting the corrosion inhibition efficiency, the corrosion inhibition efficiency of the corrosion inhibitor molecules is predicted, and the model is trained and optimized based on the acquired sample data.
[0043] In a possible implementation, the eight common factors obtained by factor analysis are used as the basis for predicting corrosion inhibition efficiency and a corrosion inhibition efficiency prediction model is constructed. In order to further improve the prediction accuracy of the model, the model needs to be trained and optimized. Based on the acquired sample data, the sample data is input into the constructed corrosion inhibition efficiency prediction model for training and the model parameters are optimized according to the accuracy of the model.
[0044] When it is necessary to predict the corrosion inhibition efficiency of other benzimidazole corrosion inhibitors, the experimenter only needs to determine the common factors used in the prediction model and input them into the corrosion inhibition efficiency prediction model, which will ultimately output the predicted corrosion inhibition efficiency of the corresponding corrosion inhibitor molecule.
[0045] To summarize, in the embodiments of the present application, in order to improve the prediction accuracy of the corrosion inhibition efficiency of the corrosion inhibitor, the molecular characteristics of the corrosion inhibitor molecules are represented by feature descriptors, and target feature descriptors that have a greater impact on the corrosion inhibition efficiency are screened out from the candidate feature descriptors of the corrosion inhibitor molecules. Thereby, the common factors affecting the corrosion inhibition effect are extracted according to the determined target feature descriptors, and a corrosion inhibition efficiency prediction model is constructed based on the common factors. Since the common factors can describe most of the important information of the corrosion inhibitor molecules, the corrosion inhibition efficiency prediction model constructed based on the common factors significantly improves the prediction accuracy of the corrosion inhibition efficiency.
[0046] Please refer to Figure 3 , which shows a flow chart of a method for training a corrosion inhibition efficiency prediction model provided by another exemplary embodiment of the present application, the method may include the following steps:
[0047] Step 301 : acquiring sample data, wherein the sample data includes sample molecular structures and sample corrosion inhibition efficiencies of benzimidazole corrosion inhibitor molecules, and the sample corrosion inhibition efficiencies are obtained through experimental measurements.
[0048] In order to construct a predictive model for corrosion inhibitor molecules, the experimenters first need to obtain the chemical formula of the corrosion inhibitor molecules and the experimentally measured corrosion inhibition efficiency, and then use chemical structure drawing software to draw their 2D structure based on the molecular formula of the corrosion inhibitor molecules.
[0049] After the 2D structure is drawn, the 2D structure of the corrosion inhibitor molecule is further imported into the 3D simulation software to obtain its 3D structure. Based on the molecular mechanics method, the structure of each molecule is optimized to obtain its lowest energy and most stable 3D structure.
[0050] The optimized 3D molecular structure is calculated using material calculation software to obtain all the feature descriptors of the corrosion inhibitor molecules. Since all the feature descriptors used to characterize the molecular characteristics are not suitable for describing the corrosion inhibition efficiency of the corrosion inhibitor, it is necessary to remove the feature descriptors that cannot be used to characterize the corrosion inhibition efficiency. After screening, N candidate feature descriptors corresponding to the sample molecular structure are obtained.
[0051] In a possible implementation, the experimenter uses the ChemDraw chemical structure drawing module of the ChemOffice software to draw the 2D molecular structure of the sample benzimidazole corrosion inhibitor molecule, and imports the drawn 2D molecular structure diagram into the Chem3D molecular model and simulation module to generate a 3D model of the molecular structure;
[0052] Furthermore, the molecular mechanics method is used to optimize the structure of each molecule in the sample to obtain its lowest energy and most stable 3D structure. The optimized 3D molecular structure is calculated using material studio software to obtain all the characteristic descriptors of the molecule.
[0053] Since not all feature descriptors obtained by calculation will affect the corrosion inhibition efficiency of the corrosion inhibitor, it is necessary to screen all feature descriptors, remove feature descriptors that have no effect on the corrosion inhibition efficiency, and obtain N candidate feature descriptors.
[0054] In a possible implementation, the experimenters calculated 253 feature descriptors by using material studio software, and after screening and removing the feature descriptors that have no effect on the corrosion inhibition efficiency, 151 candidate feature descriptors were obtained.
[0055] Since the N candidate feature descriptors obtained above are feature descriptions based on different dimensions of chemical molecules, they have dimensional differences. For example, ionization energy, electron affinity, and electronegativity belong to the electronic energy characteristic attributes of corrosion inhibitor molecules, and hydrogen bonds and van der Waals forces belong to the molecular force characteristic attributes. The dimensions of different dimensions are different, so it is also necessary to use a normalization formula to standardize the N candidate feature descriptors obtained to eliminate the impact of dimensional differences and obtain the standardized N candidate feature descriptors. The normalization formula is:
[0056]
[0057] Among them, i is the i-th candidate feature descriptor; j is the j-th sample; X ij is the value of the i-th candidate feature descriptor of the j-th sample; is the average value of the i-th candidate feature descriptor in all samples; S i is the standard deviation of the ith eigenvalues across all samples.
[0058] Step 302 , evaluating the candidate feature descriptors based on the maximum relevance minimum redundancy algorithm, and determining the mutual information of different candidate feature descriptors, where the mutual information is used to characterize that a feature descriptor contains at least information related to it that can be provided by other feature descriptors.
[0059] The candidate feature descriptors include a large number of candidate feature descriptors that cannot characterize the corrosion efficiency of the corrosion inhibitor, including candidate feature descriptors of the same dimension and different dimensions. Each candidate feature descriptor may have certain correlation and redundancy. In order to better reflect the characteristic relationship between different feature descriptors of the corrosion inhibitor molecule and eliminate the information redundancy caused by the linear correlation between different candidate feature descriptors, the maximum relevance minimum redundancy algorithm (maximum relevance minimum redundancy, mRMR) is used to screen the candidate feature descriptors. The mRMR algorithm is a feature selection method based on the maximum dependency between feature descriptors and sample data. Usually, the selection of the optimal subset can be performed by calculating the mutual information between different candidate feature descriptor subsets and categories as an evaluation criterion. Among them, mutual information is used to characterize that a feature descriptor contains at least information related to it that can be provided by other feature descriptors. By using the mRMR algorithm to evaluate the mutual information between all candidate feature descriptors, the correlation between different candidate feature descriptors is determined, and candidate feature descriptors that are not related to corrosion efficiency are removed.
[0060] Step 303: Based on the mutual information of the candidate feature descriptors, the candidate feature descriptors are classified and corresponding scores are calculated. The scores are used to characterize the contribution of the candidate feature descriptors to the corrosion inhibition efficiency.
[0061] Based on the mutual information of candidate feature descriptors, the correlation between all candidate feature descriptors is determined and classified. The importance of candidate feature descriptors is judged by calculating the scores of candidate feature descriptors in different categories. The scores of candidate feature descriptors are used to characterize the contribution of candidate feature descriptors to the corrosion inhibition efficiency. The higher the score of the candidate feature descriptor, the higher its contribution to the corrosion inhibition efficiency.
[0062] Step 304 , sorting the candidate feature descriptors based on their scores, screening the candidate feature descriptors whose scores exceed a threshold, and obtaining n target feature descriptors.
[0063] The scores of the candidate feature descriptors are sorted from high to low. Since there are many candidate feature descriptors obtained after standardization, including many candidate feature descriptors that have no effect or low effect on the corrosion inhibition efficiency, it is necessary to screen the candidate feature descriptors by setting a threshold to find the candidate feature descriptors that have a greater impact on the corrosion inhibition efficiency, and finally determine n target feature descriptors with scores greater than the set threshold.
[0064] In a possible implementation, 151 candidate feature descriptors are de-redundanted and the corresponding scores are calculated by using Weak software and mRMR algorithm. The candidate feature descriptors after de-redundancy are sorted from high to low according to their scores. Since there are many candidate feature descriptors, it is necessary to screen out the candidate feature descriptors that have a greater impact on the corrosion inhibition efficiency. Therefore, the score setting threshold of the candidate feature descriptor is set to 0 in the mRMR algorithm, that is, the candidate feature descriptors with a score threshold greater than 0 are screened out, and 56 non-redundant target feature descriptors are obtained. Since the mRMR algorithm outputs a large number of feature descriptors, and the lower the ranking of the feature descriptors, the lower the score, and the lower the impact on the corrosion inhibition efficiency of the corrosion inhibitor, directly using 56 feature descriptors for model training can improve the prediction accuracy to a certain extent, but the improvement effect is not significant. On the contrary, the training time of the model is increased due to the large training set of the model, which reduces the prediction efficiency of the model. The output mRMR list is shown in Table 1 (only the top 20 target feature descriptors are listed in the table and arranged according to the scores).
[0065] Table 1 List of target feature descriptors screened by mRMR algorithm
[0066]
[0067]
[0068] As can be seen from Table 1, most of the features closely related to IE are energy properties, including bond energy, valence energy, highest occupied molecular orbital (HOMO) energy, etc. and electrostatic properties, including van der Waals force, electrostatic potential, etc., which have a greater impact on IE. In addition, chiral centers, the number of hydrogen bond donors / acceptors, etc. are also closely related to IE.
[0069] Step 305: construct a correlation matrix based on the n target feature descriptors and analyze it, and determine the common factor variance and cumulative variance by using the maximum variance method based on the correlation matrix with eigenvalues greater than 1.
[0070] Factor analysis is used to extract common factors. Starting from studying the dependencies within the correlation matrix, some target feature descriptors with overlapping information and intricate relationships are reduced to linear combinations of a few unrelated target feature descriptors. The mathematical representation of factor analysis is a matrix: X = AF + B, that is,
[0071]
[0072] Among them, A is the covariance of X and F, and is also the correlation matrix of X and F, indicating the degree of dependence or correlation of X on F. The larger the absolute value of A, the greater the load of the common factor F on X, that is, the greater the correlation between F and X. X represents the target feature descriptor matrix, F represents the common factor, ε represents the unique factor, ε and F are independent of each other, and each component ε is independent of each other.
[0073] Since the purpose of extracting common factors through factor analysis is to reduce the dimension of data and simplify the complexity of processing problems without losing important information, when constructing the correlation matrix, the eigenvalue selection criterion requires selecting correlation matrices with eigenvalues greater than 1 and discarding correlation matrices with eigenvalues less than 1. Because the variance of each common factor is 1, this criterion believes that the common factor corresponding to each retained correlation matrix can at least explain the variance of one target feature descriptor, otherwise the purpose of simplifying the data cannot be achieved. When the eigenvalue is less than 1, it means that this common factor can only explain itself or even cannot completely explain itself, that is, the information contained in the common factor is not enough to explain the information of all target feature descriptors; when the eigenvalue of the constructed correlation matrix is greater than 1, it means that the common factor contains more information and can be used to explain the information of all target feature descriptors to a certain extent.
[0074] Optionally, the importance of common factors can also be analyzed by the scree plot criterion. The horizontal axis of the scree plot represents the number of components of the common factor, that is, the number of target feature descriptors, and the vertical axis represents the size of the eigenvalue. According to the characteristics of the scree plot curve, the common factors with eigenvalues greater than 1 are selected and subsequent judgments are performed.
[0075] The correlation matrix selected based on the eigenvalue criterion is analyzed by principal component analysis, and the variance and cumulative variance of the corresponding common factors are obtained by increasing the number of components of the common factors in turn. The variance is the eigenvalue of the correlation matrix, which is used to characterize the contribution or explanatory power of the common factors composed of the corresponding number of target feature descriptors to all target feature descriptors. The higher the value, the more information the corresponding common factor contains, and the higher the contribution to all target feature descriptors. The cumulative variance is the sum of the eigenvalues of the first few common factors extracted. When the principal component contains more target feature descriptors, the corresponding cumulative variance value is correspondingly higher.
[0076] Step 306: extract m common factors whose variance exceeds a threshold.
[0077] Based on 56 non-redundant variables, factor analysis was performed using principal component analysis. The common factors were extracted by gradually increasing the number of target feature descriptors in the principal component and calculating the corresponding variance and cumulative variance, as shown in Table 2.
[0078] Table 2 Common factors extracted by principal component analysis
[0079]
[0080]
[0081] It can be seen from Table 2 that when the main component contains 1 to 8 target feature descriptors, the variance of the corresponding common factor (i.e., eigenvalue) is greater than 1, and when the main component contains 8 target feature descriptors, the corresponding variance value is 1.86, and the corresponding cumulative variance contribution exceeds 95%, reaching 96.65%, with less information loss and better extraction effect. When the main component increases to 9 or more target feature descriptors, the variance is less than 1, and the value shows a rapidly decreasing trend. When the main component increases to 19 target feature descriptors, the cumulative variance contribution rate reaches 100%.
[0082] Usually, after extracting common factors, it is impossible to make an effective explanation for the common factors. At this time, it is often necessary to rotate the correlation matrix. Rotation is to make the common factors easier to explain by changing the position of the coordinate axis. After rotation, the variance ratio of the target feature descriptors in each principal component will be redistributed, making their load coefficients closer to 1 or 0, which can better explain the data. The rotated common factors do not change the degree of fit of the data, making their structure simpler. Table 3 shows the variance of each target feature descriptor in some common factors. The load coefficients extracted after rotation are standardized, and the values are between 0 and 1, which is convenient for comparative analysis. It can be seen from Table 3 that the variances extracted from different target feature descriptors are all greater than 0.8, that is, the extracted 8 common factors can explain more than 82% of the variance of the original 56 target feature descriptors, indicating that most of the information in the original variables can be extracted by factor analysis, and the loss of information is very small, and the effect of factor analysis is good.
[0083] Table 3 Variance of some common factors extracted by principal component analysis
[0084]
[0085] Step 307: construct a support vector machine model based on the radial basis kernel function based on the m common factors.
[0086] Based on the determined m common factors, a radial basis kernel function (RBF) support vector machine (SVM) model is further used to construct a corrosion inhibition efficiency prediction model, and the m common factors are used as input features to predict the corrosion inhibition efficiency of the corrosion inhibitor molecules.
[0087] Among them, for the constructed corrosion inhibition efficiency prediction model, the prediction accuracy of the corrosion inhibition efficiency is evaluated by calculating the values of the Pearson correlation coefficient (R), root mean square error (RMSE) and mean absolute error (MAE), and the formula is as follows:
[0088]
[0089]
[0090]
[0091] Where p represents the number of samples in the training set and the test set, y i and are the experimentally determined and predicted corrosion inhibition efficiencies, respectively. and Then y i and The average value of .
[0092] The single use of correlation table and correlation diagram can reflect the mutual relationship between two variables and their correlation direction, but it cannot accurately indicate the degree of correlation between the two variables. The correlation coefficient is a statistical indicator used to reflect the closeness of the correlation between variables. The correlation coefficient is calculated according to the product difference method. It is also based on the deviation of the two variables from their respective average values. The degree of correlation between the two variables is reflected by multiplying the two deviations. The linear single correlation coefficient is focused on. The larger the R value, the stronger the correlation between the variables, and vice versa. It should be noted that the Pearson correlation coefficient is not the only correlation coefficient, but the most common correlation coefficient. This embodiment can also use the covariance matrix row representation. The specific implementation method is not introduced in detail in this embodiment.
[0093] The root mean square error is the square root of the ratio of the sum of the squares of the deviations between the observed value and the true value to the number of observations. It is used to measure the deviation between the observed value and the true value. The mean absolute error is the average of the absolute errors, which can better reflect the actual situation of the predicted value error. The smaller the RMSE value and MAE value, the more accurate the predicted value of the prediction model is and the higher the reliability of the prediction model is.
[0094] Step 308, using the sample data as model input and the sample corrosion inhibition efficiency as supervision, a corrosion inhibition efficiency prediction model is trained.
[0095] Based on the constructed corrosion inhibition efficiency prediction model, the model needs to be trained and parameters optimized. Since the sample data in this embodiment is 20 benzimidazole corrosion inhibitor molecules and the sample size is small, the Leave-One-Out (LOO) method is used to perform model training and parameter optimization on the constructed corrosion inhibition efficiency prediction model, that is, for the 20 benzimidazole corrosion inhibitor molecules, 19 of them are used as training sets and the remaining 1 is used as a test set. Then the next one is selected as the test set, and the remaining 19 are used as training sets, and so on. A total of 20 iterative trainings can be performed. This can maximize the use of existing sample data and fully iteratively optimize the model parameters. During training, the sample data is used as the model input, the m common factors of the sample data are used as the input features of the model, and the sample corrosion inhibition efficiency is used as supervision to train the corrosion inhibition efficiency prediction model.
[0096] In addition, for the constructed support vector machine model, this embodiment uses the grid search method (Grid Search) to automatically optimize the penalty coefficient C and parameter γ of the support vector machine model. Among them, the penalty coefficient C is the tolerance for errors. The higher the C, the more intolerable the errors are, and the easier it is to overfit. The smaller the C, the easier it is to cause data underfitting. Too large or too small a penalty coefficient C will cause the generalization ability of the model to deteriorate. Parameter γ, as a parameter of the radial basis kernel function, implicitly determines the distribution of the data after being mapped to the new feature space. The larger the γ, the fewer the support vectors, the smaller the γ value, the more support vectors, and the number of support vectors directly affects the speed of training and prediction of the corrosion inhibition efficiency prediction model.
[0097] By using the grid search method, the parameters C and γ of the support vector machine model based on the radial basis kernel function were obtained to be 8 and 0.125 respectively. Under these parameters, the corrosion inhibition efficiency prediction model constructed has the best prediction speed and prediction accuracy.
[0098] Table 4 shows the leave-one-out prediction values and experimental values of 20 benzimidazole corrosion inhibitors based on the target prediction model. Figure 4 The scatter plot of the predicted IE values and experimental IE values of 20 corrosion inhibitor molecules predicted by the corrosion inhibition efficiency prediction model is given.
[0099] Table 4 Leave-one-out prediction values and experimental values of 20 benzimidazole corrosion inhibitors based on the target prediction model
[0100]
[0101]
[0102] By comparison Figure 4It can be seen from Table 4 that the prediction model of IE of benzimidazole corrosion inhibitor established by support vector machine based on radial basis kernel function has a lower RMSE than the results reported in the literature, which is only 3.08 (the average of 20 absolute errors in Table 4), while the RMSE reported in the literature is 4.45. The scatter plot of IE prediction value determined by the corrosion inhibition efficiency prediction model is approximately fitted to a linear correlation curve, indicating that the prediction model provided in this embodiment significantly improves the prediction accuracy of IE of current benzimidazole corrosion inhibitors.
[0103] In this embodiment, in order to improve the prediction accuracy of the corrosion inhibition efficiency of the corrosion inhibitor, the molecular characteristics of the corrosion inhibitor molecules are represented by feature descriptors, and the target feature descriptors that have a greater impact on the corrosion inhibition efficiency are screened out from the candidate feature descriptors according to the mutual information and scores of the feature descriptors. Then, the common factors that can best explain the original information of all target feature descriptors are extracted from the target feature descriptors through a factor analysis method. Finally, a corrosion inhibition efficiency prediction model is constructed based on the extracted common factors, and the corrosion inhibition efficiency prediction model is trained and optimized by using the leave-one-out method. Since the target corrosion inhibition efficiency prediction model uses the extracted common factors as input features, and the common factors retain most of the original information of the target feature descriptors, the prediction accuracy of the constructed predicted corrosion efficiency is significantly improved.
[0104] Figure 5 : is a structural block diagram of a training device for a corrosion inhibition efficiency prediction model provided by an exemplary embodiment of the present application, the device comprising:
[0105] The sample acquisition module 501 is used to acquire sample data, wherein the sample data includes the sample molecular structure of the sample benzimidazole corrosion inhibitor molecule and the sample corrosion inhibition efficiency, wherein the sample corrosion inhibition efficiency is obtained through experimental measurement;
[0106] A screening module 502 is used to screen out n target feature descriptors from the candidate feature descriptors of the sample molecular structure, where n is a positive integer;
[0107] An extraction module 503, used to extract m common factors from the n target feature descriptors;
[0108] The model determination module 504 is used to construct and train a corrosion inhibition efficiency prediction model based on the m common factors and sample data.
[0109] Optionally, the screening module 502 includes:
[0110] A mutual information determination unit, used to evaluate the candidate feature descriptors based on a maximum relevance minimum redundancy algorithm to determine the mutual information of different candidate feature descriptors, wherein the mutual information is used to characterize that one feature descriptor contains at least information related to it that can be provided by other feature descriptors;
[0111] A score calculation unit, used for classifying the candidate feature descriptors and calculating corresponding scores based on the mutual information of the candidate feature descriptors, wherein the scores are used to characterize the contribution of the candidate feature descriptors to the corrosion inhibition efficiency;
[0112] The first selection unit is used to sort the candidate feature descriptors based on the scores, screen the candidate feature descriptors whose scores exceed a threshold, and obtain n target feature descriptors.
[0113] The extraction module 503 further includes:
[0114] A first determination unit is used to construct a correlation matrix based on the n target feature descriptors and perform analysis, and determine the common factor variance and cumulative variance by a maximum variance method based on the correlation matrix with an eigenvalue greater than 1;
[0115] The extraction unit is used to extract the m common factors whose variance exceeds a threshold.
[0116] Optionally, the model determination module 504 includes:
[0117] A model building unit, used for building a support vector machine model based on a radial basis kernel function based on the m common factors;
[0118] The model training unit is used to train the corrosion inhibition efficiency prediction model using the sample data as model input and the sample corrosion inhibition efficiency as supervision.
[0119] Optionally, the model training unit is further used to construct a training set and a test set according to the acquired sample data, and iteratively optimize the corrosion inhibition efficiency prediction model.
[0120] Optionally, the sample acquisition module 501 includes:
[0121] A first acquisition unit is used to acquire the 2D molecular structure of the sample benzimidazole corrosion inhibitor molecule;
[0122] A structure optimization unit, used for converting the 2D molecular structure into a 3D molecular structure, and performing structural optimization on the 3D molecular structure based on molecular mechanics to obtain the sample molecular structure;
[0123] The calculation unit is used to calculate the sample molecular structure using material calculation software to obtain N candidate feature descriptors corresponding to the sample molecular structure.
[0124] Optionally, the computing unit is used to perform standardization processing on the candidate feature descriptors in each of the sample molecular structures;
[0125] The first acquisition unit is used to acquire the sample benzimidazole corrosion inhibitor molecules and the experimentally measured corrosion inhibition efficiencies of the corresponding samples.
[0126] Optionally, the candidate corrosion inhibition efficiency prediction model is a support vector machine model based on a polynomial kernel function.
[0127] It should be noted that the training device for the corrosion inhibition efficiency prediction model provided in the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the implementation process is detailed in the method embodiment, which will not be described in detail here.
[0128] Please refer to Figure 6 , which shows a schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application. Specifically, the computer device 600 includes a central processing unit (CPU) 601, a system memory 604 including a random access memory 602 and a read-only memory 603, and a system bus 605 connecting the system memory 604 and the central processing unit 601. The computer device 600 also includes a basic input / output system (I / O system) 606 that helps transmit information between various devices in the computer, and a large-capacity storage device 607 for storing an operating system 613, application programs 614 and other program modules 615.
[0129] The basic input / output system 606 includes a display 608 for displaying information and an input device 606 such as a mouse and a keyboard for user inputting information. The display 608 and the input device 606 are connected to the central processing unit 601 through an input / output controller 610 connected to the system bus 605. The basic input / output system 606 may also include an input / output controller 610 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 610 also provides output to a display screen, a printer, or other types of output devices.
[0130] The mass storage device 607 is connected to the central processing unit 601 through a mass storage controller (not shown) connected to the system bus 605. The mass storage device 607 and its associated computer readable media provide non-volatile storage for the computer device 600. That is, the mass storage device 607 may include a computer readable medium (not shown) such as a hard disk or drive.
[0131] Without loss of generality, computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include random access memory (RAM), read-only memory (ROM), flash memory or other solid-state storage technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, cassette, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that computer storage media are not limited to the above. The above-mentioned system memory 604 and mass storage device 607 can be collectively referred to as memory.
[0132] The memory stores one or more programs, and the one or more programs are configured to be executed by one or more central processing units 601. The one or more programs contain instructions for implementing the above-mentioned methods. The central processing unit 601 executes the one or more programs to implement the methods provided by the above-mentioned various method embodiments.
[0133] According to various embodiments of the present application, the computer device 600 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 600 can be connected to the network 612 through the network interface unit 611 connected to the system bus 605, or the network interface unit 611 can be used to connect to other types of networks or remote computer systems (not shown).
[0134] The memory also includes one or more programs, which are stored in the memory. The one or more programs include steps executed by the computer device in the method provided in the embodiment of the present application.
[0135] An embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set. The at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the training method of the corrosion inhibition efficiency prediction model provided in the above embodiment.
[0136] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the training method of the corrosion inhibition efficiency prediction model provided in the above aspect or various optional implementations of the above aspect.
[0137] Those skilled in the art can understand that all or part of the steps in the information processing method of the above embodiment can be completed by hardware, or by a program to instruct the relevant hardware to complete, and the program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc. The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for constructing a corrosion inhibition efficiency prediction model, characterized in that: The method comprises: Acquire sample data, wherein the sample data includes a sample molecular structure of a sample benzimidazole corrosion inhibitor molecule and a sample corrosion inhibition efficiency, wherein the sample corrosion inhibition efficiency is obtained through experimental measurement; Evaluate the candidate feature descriptors of the sample molecular structure based on the maximum relevance minimum redundancy algorithm to determine the mutual information of different candidate feature descriptors, wherein the mutual information is used to characterize that one feature descriptor contains at least information related to it that can be provided by other feature descriptors; Based on the mutual information of the candidate feature descriptors, classifying the candidate feature descriptors and calculating corresponding scores, wherein the scores are used to characterize the contribution of the candidate feature descriptors to the corrosion inhibition efficiency; Sorting the candidate feature descriptors based on the scores thereof, screening the candidate feature descriptors whose scores exceed a threshold, and obtaining n target feature descriptors; n is a positive integer; Extracting m common factors from the n target feature descriptors, wherein the common factors are based on linear combinations of the target feature descriptors; Constructing and training a corrosion inhibition efficiency prediction model based on the m common factors and the sample data; The step of extracting m common factors from the n target feature descriptors includes: Based on the n target feature descriptors, a correlation matrix is constructed and analyzed, and based on the correlation matrix with eigenvalues greater than 1, common factor variance and cumulative variance are determined by a maximum variance method; The m common factors whose variances exceed a threshold are extracted.
2. The method according to claim 1, characterized in that The method of constructing and training a corrosion inhibition efficiency prediction model based on the m common factors and the sample data includes: Based on the m common factors, construct a support vector machine model based on a radial basis kernel function; The corrosion inhibition efficiency prediction model is trained by taking the sample data as model input and the sample corrosion inhibition efficiency as supervision.
3. The method according to claim 2, characterized in that The method of using the sample data as model input and the sample corrosion inhibition efficiency as supervision to train the corrosion inhibition efficiency prediction model includes: The corrosion inhibition efficiency prediction model is cross-validated by using the leave-one-out method, a training set and a test set are constructed according to the acquired sample data, and the corrosion inhibition efficiency prediction model is iteratively optimized.
4. The method according to any one of claims 1 to 2, characterized in that: The obtaining of sample data comprises: Obtaining the 2D molecular structure of the sample benzimidazole corrosion inhibitor molecule; Converting the 2D molecular structure into a 3D molecular structure, and optimizing the 3D molecular structure based on molecular mechanics to obtain the sample molecular structure; Calculating the sample molecular structure using material calculation software to obtain N candidate feature descriptors corresponding to the sample molecular structure; The sample benzimidazole corrosion inhibitor molecules and the experimentally measured corrosion inhibition efficiencies of the corresponding samples are obtained.
5. The method according to claim 4, characterized in that After calculating the sample molecular structure using material calculation software to obtain N candidate feature descriptors corresponding to the sample molecular structure, the method further includes: The candidate feature descriptors in each of the sample molecular structures are standardized.
6. The method according to any one of claims 1 to 2, characterized in that: The corrosion inhibition efficiency prediction model is a support vector machine model based on radial basis kernel function.
7. A device for constructing a corrosion inhibition efficiency prediction model, characterized in that: The device comprises: A sample acquisition module, used to acquire sample data, wherein the sample data includes a sample molecular structure of a sample benzimidazole corrosion inhibitor molecule and a sample corrosion inhibition efficiency, wherein the sample corrosion inhibition efficiency is obtained through experimental measurement; A screening module is used to evaluate the candidate feature descriptors of the sample molecular structure based on the maximum relevance minimum redundancy algorithm, determine the mutual information of different candidate feature descriptors, and the mutual information is used to characterize that one feature descriptor contains at least information related to it that can be provided by other feature descriptors; based on the mutual information of the candidate feature descriptors, classify the candidate feature descriptors and calculate corresponding scores, and the scores are used to characterize the contribution of the candidate feature descriptors to the corrosion inhibition efficiency; sort the candidate feature descriptors based on the scores, screen the candidate feature descriptors whose scores exceed a threshold, and obtain n target feature descriptors; n is a positive integer; An extraction module, used for extracting m common factors from the n target feature descriptors; A model determination module, used for constructing and training a corrosion inhibition efficiency prediction model based on the m common factors and sample data; The extraction module further includes: A first determination unit is used to construct a correlation matrix based on the n target feature descriptors and perform analysis, and determine the common factor variance and cumulative variance by a maximum variance method based on the correlation matrix with an eigenvalue greater than 1; The extraction unit is used to extract the m common factors whose variance exceeds a threshold.
8. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the training method of the corrosion inhibition efficiency prediction model as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the training method of the corrosion inhibition efficiency prediction model as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for predicting photocatalytic degradation rate of sulfonamide antibiotics
CN106124659A