Disperse dye adsorption performance prediction method based on Python artificial neural network model
By building an ANN model in the Python language, the problem of limited flexibility of MATLAB in the field of deep learning is solved, accurate prediction of disperse dye adsorption performance is achieved, prediction efficiency and accuracy are improved, and a more flexible and efficient tool is provided. , providing a scientific and efficient method for the study of adsorption materials.
Patent Information
- Application Number
- CN202410675459.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-23
AI Technical Summary
The existing MATLAB has limited flexibility and openness in the field of deep learning, which limits the accurate prediction ability of artificial neural networks under complex adsorption conditions, and lacks an accurate dye adsorption performance prediction model based on the Python language.
The artificial neural network model was constructed using Python language. By collecting and preprocessing the structural characteristic parameters of UiO-66 material and experimental parameters for adsorbing disperse dyes, the ANN model was established, and the Levenberg–Marquardt algorithm and ReLU activation function were used for training and optimization to achieve Accurate prediction of adsorption capacity.
It significantly improves the accuracy and efficiency of predicting the adsorption performance of disperse dyes, breaks through the limitations of MATLAB in ANN research, provides a more flexible and efficient tool, saves time and economic costs, and improves the scientificity and accuracy of selecting adsorption materials. Efficiency.
Smart Images

Figure CN118538336A
Abstract
Description
Technical Field
[0001] The invention relates to the field of environmental engineering, and in particular to a method for predicting the adsorption performance of disperse dyes based on a Python artificial neural network model. Background Art
[0002] In the study of dye adsorption performance prediction, the application of artificial neural network (ANN) has attracted increasing attention because it can efficiently and accurately predict dye adsorption performance by learning patterns and features in a large amount of experimental data, providing strong support for research and application in fields such as materials science and environmental engineering. MATLAB has always been one of the main tools for traditional scientific computing and neural network modeling. Using MATLAB to build ANN models for application in the field of dye adsorption, predicting the adsorption amount of adsorbents on adsorbates, etc., can greatly save resources and improve prediction efficiency. However, the flexibility and openness of MATLAB in the field of deep learning are relatively limited, which limits the accurate prediction of ANN under complex adsorption conditions.
[0003] In recent years, Python has gradually emerged as the first choice for scientists and engineers in neural network modeling with its powerful open source ecosystem, cross-platform, readability and flexibility. Compared with MATLAB, Python's advantage lies in its rich open source ecosystem, including libraries such as NumPy, Pandas, and Scikit-learn, which provide a wealth of tools and resources for the construction, training and evaluation of neural networks. Its cross-platform nature enables the code to run on different operating systems, while its concise and clear syntax improves the readability and maintainability of the code. Python also supports a variety of popular machine learning frameworks, such as TensorFlow and PyTorch, which provide flexibility and efficiency, help build complex neural network structures, and better meet the needs of dye adsorption performance prediction. Unfortunately, there is currently no ANN model based on Python that can achieve accurate prediction in the field of dye adsorption. Summary of the invention
[0004] Based on the above technical problems, the purpose of the present invention is to provide a method for predicting the adsorption performance of disperse dyes based on a Python artificial neural network model, using real batch adsorption experimental data for fitting analysis, accurately predicting the adsorption amount of materials under different characteristic conditions, and guiding and optimizing the preparation of adsorbents and adsorption conditions.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A method for predicting the adsorption performance of disperse dyes based on a Python artificial neural network model comprises the following steps:
[0007] S1. Dataset collection: Collect structural characteristic parameters of UiO-66 materials, experimental parameters of disperse dye adsorption, and adsorption data to build a comprehensive data set for model training;
[0008] S2, data preprocessing: The data collected in step S1 are subjected to Spearman correlation coefficient analysis, key feature variables are selected as input variables, and then the data is cleaned and standardized, and the data set is randomly divided into a training set and a test set in proportion;
[0009] S3. Model establishment and training: An artificial neural network prediction model was established using Python language, and the data set was imported into the model for training. The adsorption amount of disperse dyes by UiO-66 was predicted, and the prediction performance of the model was evaluated with the help of evaluation indicators.
[0010] S4. Verification and optimization: Compare the model results based on Python implementation with the actual adsorption experimental data to evaluate the accuracy and generalization ability, use the feedback information to optimize the model, and adjust the neural network structure or model parameters.
[0011] In step S1, the structural characteristic parameters of the UiO-66 material include the specific surface area, average pore size, pore volume and median pore width of the UiO-66 obtained when the stirring time is 0-180 min, the experimental parameters for adsorbing disperse dyes include the initial disperse dye solution concentration of 0-300 mg / L and the adsorption temperature of 15-35°C, and the adsorption amount data is the adsorption amount of disperse dyes obtained by UiO-66 with different structural parameters under different adsorption experimental parameters. 300 sets of data are collated and obtained as the only source data.
[0012] In step S2, the data cleaning process includes processing missing values and detecting and processing outliers. Data standardization uses the following formula:
[0013]
[0014] In the above formula, z is the standardized data, x is the original data, μ is the mean of the original data, and σ is the standard deviation of the original data. The disperse dye adsorption database is then randomly divided according to a ratio of 7:3, where 70% of the data is divided into a training set and 30% of the data is divided into a test set.
[0015] In step S3, the ANN model structure built in Python language consists of an input layer, a hidden layer and an output layer, and the corresponding numbers of neuron nodes are 5, 17 and 1 respectively. The optimization algorithm selects the Levenberg–Marquardt algorithm, the learning rate is 0.001, the regularization coefficient is 0.001, and the ReLU activation function is used between the input layer, the output layer and the hidden layer. The evaluation indicators of the model include the determination coefficient R 2 , mean square error MSE and root mean square error RMSE, determination coefficient R 2 The formula is:
[0016]
[0017] The formula for mean square error MSE is:
[0018]
[0019] The formula for the root mean square error RMSE is:
[0020]
[0021] In the formula, N represents the total number of samples, y prd,i Represents the predicted value, y exp,i represents the true value, y m Represents the average of the true values.
[0022] The beneficial effects of the present invention are:
[0023] 1. The present invention proposes for the first time an artificial neural network method based on Python language in the field of disperse dye adsorption, which solves the problem of limited flexibility and openness of deep learning in this field; innovatively builds an ANN model based on Python, and significantly improves the accuracy and efficiency of disperse dye adsorption performance prediction; it not only breaks through the limitations of MATLAB in ANN research, but also provides a more flexible and efficient tool.
[0024] 2. The present invention makes full use of an appropriate amount of real experimental sample data for model training and analysis, and determines the experimental conditions that enable UiO-66 to achieve the maximum adsorption amount, which greatly saves time and economic costs. This innovative method provides a reliable means for the research of adsorption materials in the future, making the selection of adsorption materials more scientific and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a model network structure diagram of the ANN of the present invention for predicting the adsorption capacity of UiO-66 for disperse dyes;
[0026] Figure 2The model network training flow chart of the ANN of the present invention for predicting the adsorption capacity of UiO-66 for disperse dyes;
[0027] Figure 3 The model data preprocessing flow chart of the ANN of the present invention for predicting the adsorption capacity of UiO-66 for disperse dyes;
[0028] Figure 4 This is a fitting diagram of the predicted data and real data of the adsorption amount of disperse dyes based on the ANN model of Python in the present invention;
[0029] Figure 5 This is the prediction chart of the adsorption amount of disperse dyes based on the ANN model of MATLAB. DETAILED DESCRIPTION
[0030] The following describes in detail a specific implementation of a disperse dye adsorption performance prediction method based on a Python artificial neural network model in conjunction with the accompanying drawings. Please note that these examples are only used to illustrate the present invention and should not be construed as limiting the scope of the present invention.
[0031] The ANN, Artificial Neural Network, referred to in the present invention is a machine learning model.
[0032] The data ANN network structure diagram, training flow chart and data preprocessing flow chart provided by the present invention are respectively as follows: Figure 1 , Figure 2 , Figure 3 As shown:
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below.
[0034] Example 1
[0035] S1. Dataset collection: The structural characteristic parameters of UiO-66 material obtained with a stirring time of 0-180 min, such as specific surface area, average pore size, pore volume and median pore width, experimental parameters such as the initial disperse dye solution concentration of 0-300 mg / L and adsorption temperature of 15-35 °C for adsorbing disperse dyes, and the adsorption amount of disperse dyes by UiO-66 under the corresponding structural characteristic parameters and adsorption experimental parameters were collected. 300 sets of data were obtained as the only source data to construct a comprehensive data set for model training.
[0036] S2. Data preprocessing: The data collected in step S1 are analyzed by Spearman correlation coefficient, and key feature variables are selected as input variables. Missing values are processed, and outliers are detected and processed for data cleaning. Then, the data is standardized using formula (1):
[0037]
[0038] In the above formula, z is the standardized data, x is the original data, μ is the mean of the original data, and σ is the standard deviation of the original data. The disperse dye adsorption database is then randomly divided in a ratio of 7:3, where 70% of the data is divided into a training set and 30% of the data is divided into a test set.
[0039] S3. Model establishment and training: The artificial neural network prediction model was established using Python. The model structure consists of an input layer, a hidden layer, and an output layer. The corresponding numbers of neuron nodes are 5, 17, and 1, respectively. The optimization algorithm uses the Levenberg–Marquardt algorithm, with a learning rate of 0.001 and a regularization coefficient of 0.001. The ReLU activation function is used between the input layer, the output layer, and the hidden layer. Then the data set is imported into the model for training, and the adsorption amount of disperse dyes by UiO-66 is predicted. With the help of the determination coefficient R 2 , mean square error MSE and root mean square error RMSE, the evaluation indicators of the model are used to evaluate the predictive effectiveness of the model, among which the determination coefficient R 2 The formula is:
[0040]
[0041] The formula for mean square error MSE is:
[0042]
[0043] The formula for the root mean square error RMSE is:
[0044]
[0045] In the formula, N represents the total number of samples, y prd,i Represents the predicted value, y exp,i represents the true value, y m Represents the average of the true values.
[0046] S4. Verification and optimization: Compare the model results based on Python implementation with the actual adsorption experimental data to evaluate the accuracy and generalization ability, use the feedback information to optimize the model, and adjust the neural network structure or model parameters.
[0047] The structure diagram, training flow chart and data preprocessing flow chart of the ANN model obtained in Example 1 are respectively shown in the attached manual. Figure 1 , 2 As shown in Figure 3, it can be seen that the model framework structure obtained in Example 1 is simple and the training process is clear and simple. The model is used to predict the adsorption of disperse blue dye by UiO-66. The MSE, RMSE and R 2 The predicted data and the real data are shown in the figure. Figure 4 As shown, the prediction results are accurate.
[0048] Comparative Example 1
[0049] In this comparative example, the technical scheme is the same as that of Example 1, except that:
[0050] In step S3, MATLAB was used to build an ANN model, which consisted of an input layer, a hidden layer, and an output layer, with the corresponding numbers of neuron nodes being 5, 17, and 1, respectively. The optimization algorithm selected was the Levenberg–Marquardt algorithm, with a learning rate of 0.001 and a regularization coefficient of 0.001. The ReLU activation function was used between the input layer, the output layer, and the hidden layer; the evaluation indicators included the determination coefficient R 2 , mean square error (MSE) and root mean square error (RMSE).
[0051] In step S4, the adsorption amount of disperse dye is predicted based on the model implemented in MATLAB, and the method and data used are completely consistent with those in Example 1.
[0052] Under the same conditions, the MSE, RMSE and R of the ANN model based on MATLAB for the prediction of UiO-66 adsorption of disperse blue dye were 2 They are 0.0068, 0.0823 and 0.9347 respectively. The fitting diagram of predicted data and real data is shown in Figure 5 As shown in the figure, it can be seen that although the artificial neural network built with MATLAB can also achieve satisfactory results in predicting the adsorption performance of disperse dyes, its prediction accuracy is still far behind that of the ANN model based on Python. The model based on Python showed lower MSE, RMSE and higher R 2 The value of , indicating that it is more excellent in predicting the adsorption performance of UiO-66 for disperse dyes. This not only narrows the gap between research methods, but also highlights the significant advantages of Python-based artificial neural network models in the field of adsorption performance prediction, providing a strong reference for future research.
[0053] In addition, the ANN model obtained in Example 1 uses Python language, which fully reflects the convenience and richness brought by the open source system during the construction process, and the code is more concise than the MATLAB model obtained in Comparative Example 1. The model obtained in Example 1 also shows strong generalization ability.
[0054] In summary, the present invention proposes an artificial neural network method based on for the first time in the field of disperse dye adsorption, which solves the problem of limited flexibility and openness of deep learning in this field; innovatively builds an ANN model based on Python, and significantly improves the accuracy and efficiency of disperse dye adsorption performance prediction; not only breaks through the limitations of MATLAB in ANN research, but also provides a more flexible and efficient tool. The present invention determines the experimental conditions for UiO-66 to achieve the maximum adsorption amount by making full use of an appropriate amount of real experimental sample data for model training and analysis, which greatly saves time and economic costs. This innovative method provides a reliable means for the future research of adsorption materials, making the selection of adsorption materials more scientific and efficient.
[0055] It should be emphasized that the above embodiments are only used to illustrate the technical solution of the present invention, rather than to limit the solution. Although the preferred embodiments have been described in detail, technical practitioners in this field should understand that adjustments or equivalent substitutions to the technical solution are feasible, as long as they do not deviate from the scope of the technical solution of the present invention, and should be included in the claims of the present invention.
Claims
1. A method for predicting the adsorption performance of disperse dyes based on a Python artificial neural network model, characterized in that: The following steps are involved: S1. Dataset collection: Collect structural characteristic parameters of UiO-66 materials, experimental parameters of disperse dye adsorption, and adsorption amount data to build a comprehensive data set for model training; S2, data preprocessing: The data collected in step S1 are subjected to Spearman correlation coefficient analysis, key feature variables are selected as input variables, and then the data is cleaned and standardized, and the data set is randomly divided into a training set and a test set in proportion; S3. Model establishment and training: An artificial neural network prediction model was established using Python language, and the data set was imported into the model for training. The adsorption amount of disperse dyes by UiO-66 was predicted, and the prediction performance of the model was evaluated with the help of evaluation indicators. S4. Verification and optimization: Compare the model results based on Python implementation with the actual adsorption experimental data to evaluate the accuracy and generalization ability, use the feedback information to optimize the model, and adjust the neural network structure or model parameters.
2. A disperse dye adsorption performance prediction method based on Python artificial neural network model according to claim 1, characterized in that: In the step S1, the structural characteristic parameters of the UiO-66 material include the specific surface area, average pore size, pore volume and median pore width of the UiO-66 obtained when the stirring time is 0-180 min, the experimental parameters for adsorbing disperse dyes include the initial disperse dye solution concentration of 0-300 mg / L and the adsorption temperature of 15-35°C, and the adsorption amount data is the adsorption amount of disperse dyes obtained by UiO-66 with different structural parameters under different adsorption experimental parameters. 300 sets of data are collated and obtained as the only source data.
3. The method for predicting the adsorption performance of disperse dyes based on a Python artificial neural network model according to claim 1, characterized in that: In step S2, the data cleaning process includes processing missing values and detecting and processing outliers. Data standardization uses the following formula: In the above formula, z is the standardized data, x is the original data, μ is the mean of the original data, and σ is the standard deviation of the original data. The disperse dye adsorption database is then randomly divided according to a ratio of 7:3, where 70% of the data is divided into a training set and 30% of the data is divided into a test set.
4. The method for predicting the adsorption performance of disperse dyes based on a Python artificial neural network model according to claim 1, characterized in that: In step S3, the ANN model structure built in Python language consists of an input layer, a hidden layer and an output layer, and the corresponding numbers of neuron nodes are 5, 17 and 1 respectively. The optimization algorithm selects the Levenberg–Marquardt algorithm, the learning rate is 0.001, the regularization coefficient is 0.001, and the ReLU activation function is used between the input layer, the output layer and the hidden layer. The evaluation indicators of the model include the determination coefficient R 2 , mean square error MSE and root mean square error RMSE, determination coefficient R 2 The formula is: The formula for mean square error (MSE) is: The formula for the root mean square error RMSE is: In the formula, N represents the total number of samples, y prd,i represents the predicted value, y exp,i represents the true value, y m Represents the average of the true values.
