Method for predicting dehydration rate of polyether demulsifier based on machine learning
The random forest model constructed through machine learning solves the problems of complexity in the development of traditional polyether demulsifiers and inaccurate molecular simulation predictions, and achieves efficient and safe prediction of the dehydration rate of polyether demulsifiers, which is suitable for offshore oilfield water treatment.
Patent Information
- Application Number
- CN202610037686.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-13
- Publication Date
- 2026-04-24
AI Technical Summary
The development of traditional polyether demulsifiers is complex and dangerous. Existing molecular simulation tools cannot accurately predict the dehydration rate under complex oil conditions, and are time-consuming and labor-intensive, making it difficult to meet the high efficiency and safety requirements of offshore oilfield water treatment.
A machine learning approach was adopted, using a random forest regression model and a random forest bag error score to construct a model for predicting the dehydration rate of polyether demulsifier. By using a training set and test set of commonly used parameters in oilfields, the model hyperparameters were optimized and unimportant features were reduced to achieve efficient prediction of the dehydration rate.
It improves the efficiency and safety of predicting the dehydration rate of polyether demulsifiers, reduces computational resources and time, adapts to the crude oil needs of different oil fields, simplifies synthesis experiments, and reduces the risk of environmental pollution.
Smart Images

Figure CN121922253A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chemical engineering and machine learning, and in particular to a machine learning-based method for predicting the dehydration rate of polyether demulsifiers. Background Technology
[0002] The development of traditional polyether demulsifiers has certain limitations. The synthesis process is complex, requiring high temperature and pressure conditions, vacuuming, and nitrogen purging, which is characterized by long operation time and certain risks. The preparation of existing polyether demulsifiers mostly relies on experimental trial and error, requiring repeated adjustments to parameters such as ethylene oxide content and molecular weight to configure the polyether demulsifier and experimental verification of the dehydration effect, which is time-consuming and costly.
[0003] Currently, the mainstream international intelligent tool is the molecular simulation method. While current molecular simulation tools can accurately predict the dehydration rate of demulsifiers in simple oil models, they fail to effectively predict the dehydration rate under complex oil conditions, exhibiting significant limitations. In addition, while molecular dynamics simulations and mesoscopic molecular dynamics simulations for predicting the dehydration rate of polyether demulsifiers are safe, environmentally friendly, and save considerable material resources, their models are too large and complex, requiring substantial computational resources and time. Furthermore, this method demands high model accuracy, as many substances in oils are difficult to pinpoint precisely at the molecular level, making modeling challenging and hindering the rapid fulfillment of dehydration rate prediction needs.
[0004] As offshore oilfield water treatment conditions become increasingly complex, the reliance on oilfield chemical agents has significantly increased, leading to more prominent technical challenges. Current experimental evaluation systems face dual constraints of efficiency and quality when addressing complex engineering needs. The demand for in-depth data mining and analysis is growing, necessitating the deep analysis of data within the same operational context. This requires fully utilizing artificial intelligence technologies such as machine learning to analyze and evaluate oil, gas, and water treatment experimental data through new technologies and methods, thereby achieving a digital and intelligent transformation. Summary of the Invention
[0005] To improve upon traditional experimental or molecular dynamics simulation-based methods for evaluating the dehydration rate of polyether demulsifiers, this invention aims to propose a machine learning-based method for predicting the dehydration rate of polyether demulsifiers that is highly efficient, safe, and environmentally friendly.
[0006] To achieve the above objectives, the technical solution of the present invention is as follows: a method for predicting the dehydration rate of polyether demulsifiers based on machine learning, comprising the following steps: Step 1: The experiment collected parameters of commonly used polyether demulsifiers in oil fields as a sample dataset, including RSN value, number of branches, ethylene oxide content, molecular weight, dehydration time and dehydration rate parameters, of which the dehydration rate was used as the label data; Step 2: Randomly divide the sample dataset into training and test sets, construct and train a random forest regression model, use the RSN value, number of branches, ethylene oxide content, molecular weight and dehydration time of the training set as input features to predict the dehydration rate, optimize the model hyperparameters through cross-validation, and evaluate the model performance based on the good fit between the prediction results of the test set and the actual dehydration rate. Step 3: Use the feature importance score of the out-of-bag error of the random forest to rank and evaluate the importance of the input feature factors, and measure the contribution of each feature to the model performance. Step 4: Based on the contribution of feature ranking to the dehydration rate prediction, reduce features with abnormally low contribution, repeat steps 2-4, and predict the dehydration rate again until an appropriate fit is achieved for the dehydration rate of the polyether demulsifier. Step 5: Deploy the trained model into the actual demulsifier process.
[0007] Furthermore, in step 2, the dehydration rate is predicted using a random forest model, and the correlation coefficient between the predicted results on the test set and the actual dehydration rate must satisfy r≥0.85.
[0008] Furthermore, step 3 includes: during model training, evaluating the importance of RSN value, number of branches, ethylene oxide content, molecular weight, and dehydration time to model performance by using the change in out-of-bag error, quantifying the contribution of each input feature to the prediction of dehydration rate and model performance, and inversely guiding the design of demulsifier molecular structure.
[0009] Furthermore, in step 3, the change in out-of-bag error is used to evaluate the importance of RSN value, branch number, ethylene oxide content, molecular weight, and dehydration time to model performance, including: For each tree, the prediction accuracy is calculated using the unselected samples; the unselected samples are referred to as OOB samples. For a certain feature, randomly shuffle the value of that feature in all OOB samples, while keeping other features unchanged. For each tree, the prediction accuracy is calculated again using the OOB samples with shuffled features; Calculate the difference between the two accuracies, and average the difference across all trees to use as a measure of the importance of the feature.
[0010] Furthermore, in step 4, when the importance score of a certain parameter feature is less than or equal to zero, the feature is removed, and then the dehydration rate of the polyether demulsifier is predicted again until an appropriate fit is achieved for the dehydration rate of the polyether demulsifier.
[0011] Compared with existing technologies, the machine learning-based method for predicting the dehydration rate of polyether demulsifiers described in this invention has the following advantages: Compared with traditional molecular simulation prediction methods for the dehydration performance of polyether demulsifiers, the method described in this invention has the advantages of high efficiency, low computational resource requirements, short time, and simple modeling.
[0012] (1) This invention proposes a machine learning method that overcomes the limitations of manual dehydration rate evaluation, which is cumbersome and consumes a lot of manpower and resources. This greatly improves experimental efficiency, makes dehydration rate prediction faster, and provides more possibilities for the development of demulsifiers. (2) In addition to reducing the environmental pollution caused by the synthesis of traditional polyether demulsifiers, the method of the present invention also takes into account the limitations of computing resources, and has a better effect on improving work efficiency. (3) The method described in this invention can train a special model for crude oil from different oil fields. In the laboratory research and development stage, the model can predict the demulsifier performance of different molecular structures (number of branches, molecular weight, ethylene oxide content) and reduce the number of synthesis experiments. Attached Figure Description
[0013] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 Flowchart for predicting the dehydration rate of polyether demulsifiers using random forests; Figure 2 This is a graph showing the error as the number of decisions changes; Figure 3 A cross-plot showing the actual dehydration rate and the model-predicted dehydration rate for the test set. Figure 4 A feature importance score plot for input parameters. Detailed Implementation
[0014] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0015] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0016] like Figures 1-4 As shown, this invention discloses a machine learning-based method for predicting the dehydration rate of polyether demulsifiers. Specifically, it involves a method based on a random forest model that predicts the dehydration rate of polyether demulsifiers by inputting their inherent parameters. This method trains the random forest algorithm using sample experimental data to optimize the model's interpretability and prediction accuracy, and is applied to demulsifier formulation design and process parameter optimization in scenarios such as oilfield development and crude oil dehydration. The method includes the following steps: Step 1, Sample Data Preparation: The experiment collected parameters of commonly used polyether demulsifiers in oil fields as the sample dataset, including RSN values (correlation activity coefficient, used to quantify the hydrophilic-lipophilic balance characteristics of polyethers), branch number, ethylene oxide content (hereinafter referred to as EO content), molecular weight, dehydration time, and dehydration rate parameters. Abnormal samples were removed to ensure data accuracy and stability; among them, the dehydration rate was used as label data. Step 2: Randomly divide the sample dataset into a training set and a test set, with the training set accounting for 80%. Construct and train a random forest regression model, using the RSN value, number of branches, EO content, molecular weight, and dehydration time of the training set as input features to predict the dehydration rate. Optimize the model's hyperparameters through multiple sample partitions for cross-validation. Evaluate the model performance based on the good fit between the predicted results and the actual dehydration rate on the test set. For the sample dataset D={(x1,y1),…,(x... n ,y n )}, where x is the input vector and y represents the sample category.
[0017] Among them, the correlation coefficient between the prediction results of the test set and the actual dehydration rate should satisfy r≥0.85 when the dehydration rate is predicted by the random forest model.
[0018] Step 3: The importance of input feature factors is ranked and evaluated using the feature importance score of the out-of-bag error in a random forest model, measuring the contribution of each feature to model performance. Specifically, during model training, the change in out-of-bag error is used to evaluate the importance of RSN value, branch number, EO content, molecular weight, and dehydration time to model performance, quantifying the contribution of each input feature to dehydration rate prediction and model performance, and providing inverse guidance for the design of the demulsifier molecular structure. The specific process is as follows: (1) For each tree, calculate its prediction accuracy using the out-of-bag (OOB) samples that were not selected; (2) For a certain feature, randomly shuffle the value of that feature in all OOB samples, and keep other features unchanged; (3) For each tree, calculate its prediction accuracy again using the OOB samples with shuffled features; (4) Calculate the difference between the two accuracy rates, and average the difference across all trees to use as a measure of the importance of the feature.
[0019] Step 4: Based on the contribution of feature ranking to the dehydration rate prediction, eliminate features with abnormally low contribution. Features with abnormally low contribution refer to feature factors with an importance score less than or equal to zero. When the importance score of a certain parameter feature is less than or equal to zero, the feature is removed. Then, repeat steps 2-4 to predict the dehydration rate again until a proper fit is achieved for the dehydration rate of the polyether demulsifier. When r ≥ 0.85, it is considered that the prediction result of the test set and the dehydration rate of the polyether demulsifier have achieved a proper fit.
[0020] Step 5: Deploy the trained model into the actual demulsifier process. This model can efficiently predict the current dehydration rate index and optimize the formulation parameters in real time, thereby improving the configuration efficiency of high dehydration rate demulsifiers.
[0021] The method described in this invention collects a dataset of polyether demulsifier samples, constructs a random forest regression model, optimizes the model hyperparameters through cross-validation, and evaluates the model performance based on the goodness of fit between the predicted results and the actual dehydration rate. The trained model can be deployed to the actual demulsifier process to predict the dehydration rate and optimize the formulation parameters in real time. Compared with the traditional demulsifier synthesis method that obtains patterns through trial and error, the method described in this invention has certain high efficiency, environmental friendliness, and safety.
[0022] This invention utilizes data-driven modeling, combining the high accuracy of the random forest algorithm with the interpretability of attribute weights to construct a composite model. The model is rapidly deployed via a programming platform, providing timely feedback on dehydration rate predictions to guide the optimization of demulsifier formulations (e.g., EO content, RSN value) and processes (e.g., temperature, dosage). This method requires minimal computational resources, is quick, simple to model, and highly efficient. This invention overcomes the shortcomings of traditional polyether R&D evaluation methods, providing a new approach and achieving intelligent prediction for demulsifier evaluation.
[0023] The technical solution of the present invention will be further described below with reference to specific embodiments.
[0024] Example 1 Using propylene glycol as the initiator and potassium hydroxide as the catalyst, polyether demulsifiers with different ethylene oxide contents were synthesized by adding ethylene oxide and propylene oxide in different sequences. One demulsifier, with two branches, was named BP. A certain amount of toluene (2.6 v%) in ethylene glycol dimethyl ether was prepared as the RSN value determination solution. 1 g of sample was dissolved in 30 mL of the RSN value determination solution, and the mixture was titrated with deionized water until the solution became turbid. The volume of deionized water consumed was the RSN value of the copolymer. Three measurements were taken, and the average value was used to determine the RSN value.
[0025] Using glycerol as an initiator and potassium hydroxide as a catalyst, polyether demulsifiers with different ethylene oxide contents were synthesized by adding ethylene oxide and propylene oxide in different sequences. The demulsifier with 3 branches was named GP. A certain amount of toluene (2.6 v%) in ethylene glycol dimethyl ether was prepared as the RSN value determination solution. 1 g of sample was dissolved in 30 mL of the RSN value determination solution, and the mixture was titrated with deionized water until the solution became turbid. The volume of deionized water consumed was the RSN value of the copolymer. Three measurements were taken, and the average value was used to determine the RSN value.
[0026] Using ethylenediamine as the initiator and potassium hydroxide as the catalyst, polyether demulsifiers with different ethylene oxide contents were synthesized by adding ethylene oxide and propylene oxide in different sequences. One demulsifier with 4 branches was named ED. A certain amount of toluene (2.6 v%) in ethylene glycol dimethyl ether was prepared as the RSN value determination solution. 1 g of sample was dissolved in 30 mL of the RSN value determination solution, and the mixture was titrated with deionized water until the solution became turbid. The volume of deionized water consumed was the RSN value of the copolymer. Three measurements were taken, and the average value was used to determine the RSN value.
[0027] Step 1: Collect sample datasets, including RSN values, branch number, EO content, molecular weight, dehydration time, and dehydration rate of the three groups of demulsifiers; Step 2: Perform stratified sampling on the data, divide the sample dataset into training and test sets, normalize the data, and optimize the model hyperparameters through cross-validation by multiple sample divisions. Step 3: Use the change in out-of-bag error of random forest to evaluate the importance of feature factors and measure the contribution of each feature to the model performance, including the importance of RSN value, number of branches, EO content, molecular weight, and dehydration time to the model performance. Step 4: Since the importance of dehydration time is negative, and the model performance is evaluated based on the goodness of fit between the predicted results and the actual dehydration rate on the test set, resulting in r < 0.85, the dehydration time data is removed. Steps 2-4 are repeated to measure the contribution of each remaining feature to the model performance. The contribution value for each feature is shown in [reference needed]. Figure 4 ;Depend on Figure 4 It can be seen that the contribution to the model performance, from largest to smallest, is EO content, number of branches, molecular weight, and RSN value; the dehydration rate is predicted again to achieve an appropriate fit for the dehydration rate of the polyether demulsifier in this oilfield. Step 5, the error curve as the number of decisions changes, and the intersection of the actual dehydration rate of the test set and the model-predicted dehydration rate are referenced. Figure 2 , Figure 3 ;Depend on Figure 2 It can be seen that the error as the number of decisions changes has gradually converged. Figure 3The correlation coefficient r between the actual dehydration rate and the model-predicted dehydration rate on the test set was 0.86.
[0028] The results of the linear fitting curve calculated by machine learning in Example 1 and the error analysis results show that the method has certain feasibility.
[0029] The method described in this invention can improve the efficiency of the polyether demulsifier dehydration rate evaluation process. As a basic model for predicting the dehydration rate of polyether demulsifiers, it still has certain scalability. After obtaining higher quality and larger datasets, more accurate predictions can be made through model training, providing support for future demulsifier evaluation and on-site oil-water problem solving in the Bohai Oilfield and other oilfields. This method has a certain degree of safety and operability, reduces workload, and brings certain economic benefits.
[0030] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A machine learning-based method for predicting the dehydration rate of polyether demulsifiers, characterized in that, Includes the following steps: Step 1: The experiment collected parameters of commonly used polyether demulsifiers in oil fields as a sample dataset, including RSN value, number of branches, ethylene oxide content, molecular weight, dehydration time and dehydration rate parameters, of which the dehydration rate was used as the label data; Step 2: Randomly divide the sample dataset into training and test sets, construct and train a random forest regression model, use the RSN value, number of branches, ethylene oxide content, molecular weight and dehydration time of the training set as input features to predict the dehydration rate, optimize the model hyperparameters through cross-validation, and evaluate the model performance based on the good fit between the prediction results of the test set and the actual dehydration rate. Step 3: Use the feature importance score of the out-of-bag error of the random forest to rank and evaluate the importance of the input feature factors, and measure the contribution of each feature to the model performance. Step 4: Based on the contribution of feature ranking to the dehydration rate prediction, reduce features with abnormally low contribution, repeat steps 2-4, and predict the dehydration rate again until an appropriate fit is achieved for the dehydration rate of the polyether demulsifier. Step 5: Deploy the trained model into the actual demulsifier process.
2. The method for predicting the dehydration rate of polyether demulsifier based on machine learning according to claim 1, characterized in that: In step 2, the dehydration rate is predicted using a random forest model, and the correlation coefficient between the predicted results on the test set and the actual dehydration rate must satisfy r≥0.
85.
3. The method for predicting the dehydration rate of polyether demulsifier based on machine learning according to claim 1, characterized in that, Step 3 includes: during model training, the change in out-of-bag error is used to evaluate the importance of RSN value, number of branches, ethylene oxide content, molecular weight, and dehydration time to model performance, quantify the contribution of each input feature to the prediction of dehydration rate and model performance, and guide the design of demulsifier molecular structure in reverse.
4. The method for predicting the dehydration rate of polyether demulsifier based on machine learning according to claim 3, characterized in that: In step 3, the change in out-of-bag error is used to evaluate the importance of RSN value, branch number, ethylene oxide content, molecular weight, and dehydration time to model performance, including: For each tree, the prediction accuracy is calculated using the unselected samples; the unselected samples are referred to as OOB samples. For a certain feature, randomly shuffle the value of that feature in all OOB samples, while keeping other features unchanged. For each tree, the prediction accuracy is calculated again using the OOB samples with shuffled features; Calculate the difference between the two accuracies, and average the difference across all trees to use as a measure of the importance of the feature.
5. The method for predicting the dehydration rate of polyether demulsifier based on machine learning according to claim 1, characterized in that: In step 4, when the importance score of a certain parameter feature is less than or equal to zero, the feature is removed, and then the dehydration rate of the polyether demulsifier is predicted again until an appropriate fit is achieved for the dehydration rate of the polyether demulsifier.