Prediction method for memory effect of natural gas hydrate
Through machine learning algorithms and high-pressure automatic nucleation time measurement device, a natural gas hydrate memory effect prediction model is built, which solves the randomness and uncertainty of the nucleation time of natural gas hydrate, and realizes efficient and accurate prediction and intelligent regulation, improving the controllability and efficiency of industrial applications.
Patent Information
- Application Number
- CN202510780007.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-08-26
AI Technical Summary
The prior art is difficult to accurately predict the randomness and uncertainty of the nucleation time of natural gas hydrate, especially in complex operating conditions, the unpredictability and dynamic nature of system behavior have increased significantly, affecting the efficiency and controllability of industrial applications.
The prediction model is constructed using machine learning algorithms, combined with the high-voltage automatic nucleation time measurement device to collect data, trained through support vector regression, random forest, XGBoost and polynomial regression algorithms, and developed Python and PyQt5 visualization platforms for prediction, realizing intelligent modeling and prediction of natural gas hydrate memory effects.
It improves the prediction accuracy and stability of the nucleation time of natural gas hydrate, reduces experimental dependence and energy consumption costs, has good engineering applicability and scalability, and provides technical support for the intelligent development of natural gas hydrates.
Smart Images

Figure CN120544734A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent modeling and prediction of natural gas hydrates, and specifically to a method for predicting the memory effect of natural gas hydrates. The method is suitable for quantitative modeling and predictive judgment of the behavioral characteristics during the phase transition process of hydrates, and can also be extended to thermodynamic process control and system optimization in related fields such as energy storage and carbon sequestration. Background Art
[0002] Natural gas hydrates are a new, highly efficient energy storage and transportation medium, widely used in energy extraction, gas separation, and low-carbon energy technologies. In recent years, with the continued advancement of deep-sea oil and gas development technology, the commercial utilization prospects of natural gas hydrates have become increasingly prominent.
[0003] However, during the formation and dissociation of natural gas hydrates, a significant "memory effect" often occurs. This means that after a system undergoes a phase transition, its subsequent transformation behavior is significantly affected. This effect can cause nonlinear perturbations in key parameters such as nucleation rate, phase transition temperature window, and hysteresis time, significantly increasing the uncertainty of the system's behavior.
[0004] Among them, nucleation time is one of the important kinetic parameters describing the hydrate nucleation process. Specifically, it refers to the time interval from satisfying the nucleation thermodynamic conditions to the actual observation of stable and detectable crystal nucleus formation after the system enters a supercooled or supersaturated state.
[0005] Because gas hydrate nucleation is an inherently stochastic process, under identical experimental conditions, the nucleation time often exhibits strong randomness and uncertainty. The precise moment at which hydrate nucleation begins is difficult to predict. Even under rigorous experimental control, the observed nucleation time exhibits significant fluctuations and is highly dynamic. This randomness and uncertainty pose significant challenges to industrial hydrate storage and transportation, energy management, and process efficiency optimization, particularly under complex operating conditions such as temperature fluctuations, pressure disturbances, and repeated loading, further exacerbating the unpredictable and dynamic nature of system behavior.
[0006] Currently, mainstream research methods rely primarily on experimental observations. However, these traditional experimental methods struggle to effectively handle problems involving high dimensions, multiple variables, nonlinear coupling, and randomness. In particular, they lack effective prediction tools for the randomness and volatility of nucleation time. Therefore, industrial practice urgently requires a technical approach that can accurately predict the natural gas hydrate transformation process, particularly nucleation time.
[0007] To address the above challenges, the present invention proposes a prediction method for the memory effect of natural gas hydrates to achieve accurate modeling and intelligent prediction of its transformation behavior, especially the nucleation time, thereby providing key technical support for the design of the next generation of efficient and controllable energy systems. Summary of the Invention
[0008] The purpose of the present invention is to provide a method for predicting the memory effect of natural gas hydrates to solve the above-mentioned problems and achieve accurate prediction of the memory effect behavior of hydrates during phase transition and intelligent control support of key characteristic parameters.
[0009] To achieve the above object, the present invention adopts the following technical solutions:
[0010] Step S1: Collecting experimental data related to natural gas hydrates. The data covers multiple key variable characteristics that affect the memory effect, including synthesis temperature, dissociation pressure, synthesis pressure, number of synthesis-decomposition cycles, decomposition temperature, and other variable characteristics that affect the memory effect. The nucleation time of the hydrate is used as the dependent variable to construct a training data set to provide reliable data support for subsequent modeling.
[0011] Step S2: preprocessing the experimental data to obtain preprocessed experimental data;
[0012] Step S3: Build a prediction model based on the machine learning algorithm, and combine cross-validation and hyperparameter optimization to improve model performance and generalization ability;
[0013] Step S4: Develop a visual interactive platform based on Python and PyQt5 to support users to input experimental conditions and select models. The system will visually output the predicted memory effect value and automatically determine whether there is nucleation-promoting behavior based on the predicted results.
[0014] Furthermore, step S1 specifically includes: using a high-pressure automatic nucleation time measurement device to collect experimental data. This device is based on the scientific principle that the nucleation behavior of gas hydrates under supercooling conditions has random characteristics. It can program the cooling of trace water samples in a high-pressure gas environment through automatic temperature and pressure control, thereby realizing highly sensitive monitoring of nucleation temperature and accurate recording of nucleation time. Its core principle is: linearly cool the water sample under pressure control. When gas hydrates are formed in the sample, the scattering rate of the hydrate to light increases significantly, resulting in a sharp drop in the light intensity passing through the sample. The system automatically determines the occurrence of the nucleation event based on this and records the corresponding time point. The device is then heated to a set value higher than the equilibrium decomposition temperature to fully dissociate the formed hydrates. After completing one cycle, cooling is resumed, thereby realizing automatic repeated collection of multiple nucleation events and obtaining statistically significant experimental data.
[0015] Furthermore, the step S2 specifically includes missing value filling, outlier removal and standardization processing, as follows:
[0016] A. Missing value processing: Use the mean filling method to fill in the missing numerical features to ensure the consistency of data dimensions and avoid interference with subsequent model training due to data gaps.
[0017] B. Outlier elimination: Identify and eliminate outliers or unreasonable observations in experimental data, and make judgments based on the Z-value rule to improve data quality and model stability. The Z-value rule judgment formula is:
[0018]
[0019] Among them, x i is the sample value, μ is the sample mean of the feature, and σ is the sample standard deviation. i When |>3, the sample point is considered an outlier and is removed from the data set.
[0020] C. Feature normalization: To eliminate the influence of different dimensions on the model results, the experimental data is normalized. Preferably, the Z-Score normalization method is used to normalize the numerical variables. The processing formula is as follows:
[0021]
[0022] in, is the mean of the original data, is the standard deviation. After standardization, the data follows a distribution with a mean of 0 and a standard deviation of 1.
[0023] Furthermore, step S3 specifically includes training the data based on support vector regression (SVR), random forest (RF), XGBoost and polynomial regression algorithms, and improving the prediction performance by adjusting model hyperparameters and ten-fold cross validation.
[0024] Furthermore, the implementation steps of the support vector regression machine are:
[0025] The SVR algorithm is based on statistical learning theory and the principle of structural risk minimization. It constructs an optimal regression function in a high-dimensional feature space to minimize prediction errors while ensuring generalization ability. Unlike traditional linear regression methods, SVR introduces an insensitive loss function ε-insensitive loss, which does not calculate the error within the range where the deviation between the predicted value and the true value is less than ε, and only penalizes the excess, thereby improving the robustness and sparsity of the model. Specifically, let the training sample set be where x i ∈R d is the input feature, y i ∈R is the target value of the memory effect. SVR implements regression model learning by constructing the following optimization problem:
[0026]
[0027] Under the constraints:
[0028]
[0029] Among them, w is the weight vector, b is the bias term, φ(·) is the nonlinear mapping function, ε is the insensitive interval width, C is the penalty coefficient, ξ i and is a slack variable. The above problem is converted into a dual form by introducing Lagrange multipliers to obtain the final decision function:
[0030]
[0031] Where K(x i ,x j )=φ(x i ) T φ(x j ) is a kernel function, and common forms include linear kernel function, polynomial kernel function, Gaussian radial basis function (RBF) and Sigmoid function, which can effectively deal with the nonlinear relationship of input features.
[0032] Further, the implementation steps of random forest are:
[0033] A. Data Subsetting: Several subsets are generated from the original training set through random sampling with replacement. Each subset is used to train a regression tree. Due to the specificity of the sampling method, some samples may be selected multiple times, while others may not be selected. These samples are called out-of-bag data and can be used to evaluate the generalization ability of the model.
[0034] B. Feature subset selection: When constructing each splitting node of each tree, a portion of features is randomly selected from all features as candidates to avoid using the same feature partitioning criteria for all trees, further improving the diversity and generalization performance of the model.
[0035] C. Node Splitting and Evaluation: For each splitting node, the splitting effect of each candidate feature is evaluated based on metrics such as information gain, Gini index, or mean squared error. The optimal feature and split point are then selected to complete the node split. This strategy results in a compact tree structure while maintaining strong expressiveness.
[0036] D. Tree growth and termination condition setting: Recursively construct the regression tree according to the set parameters such as maximum depth, minimum number of sample splits, and minimum number of leaf node samples until the termination condition is met, thus obtaining a complete tree structure.
[0037] In the integration stage, for regression tasks, random forest generates the final regression prediction value by taking a weighted average (generally an equal-weighted average) of the prediction results of all subtrees.
[0038] Further, the implementation steps of XGBoost are:
[0039] Given a training dataset where x i ∈R m is the eigenvector, y i ∈R is the target variable, and XGBoost constructs the final prediction model by stacking K regression trees where f k represents the prediction function of the kth tree. The objective function of model training is defined as Where l(·) is a differentiable loss function (such as square loss, cross entropy loss), Ω(f k )=γT+0.5λ||w|| 2 is the regularization term, T is the number of leaf nodes in the tree, w is the weight of the leaf node, γ and λ are hyperparameters that control the complexity of the model, which are used to penalize the structural scale and weight amplitude of the tree respectively.
[0040] Further, the implementation steps of polynomial regression are:
[0041] Polynomial regression is an extended linear regression method that models the nonlinear relationship between input and output variables by raising the original input variables to higher-order powers. This method assumes that the target variable can be expressed as a linear combination of polynomial functions of the input variables, thereby introducing nonlinear expression capabilities while maintaining linear solvability. Its mathematical expression is as follows:
[0042]
[0043] Where x is the input variable, is the predicted output, β0,β1,…,β d is the regression coefficient, and d is the highest order of the polynomial. For multidimensional input variables, a multivariate polynomial feature matrix can be constructed by cross-term expansion. In the model construction process, the original features are first expanded to a high order and a polynomial feature matrix is constructed. In order to avoid overfitting due to high-order terms, the present invention further introduces a regularization strategy (such as Ridge Regression) to constrain the model complexity. Its optimization objective function is:
[0044]
[0045] Where λ is the regularization coefficient, which is used to balance the weight between the training error and the parameter norm of the model. By adjusting λ, the stability and fitting ability of the regression model can be effectively controlled.
[0046] Furthermore, the hyperparameter tuning involves ten-fold cross validation implementation steps:
[0047] During the model building phase, in order to improve the generalization ability and prediction accuracy of the model, the training set is first subjected to a ten-fold cross-validation process, thereby effectively avoiding the model's dependence on specific data partitions and improving robustness and stability. On this basis, the automated parameter adjustment framework Optuna is used to perform a combined search and performance optimization of the model's key hyperparameters. This optimization process sets the objective function and uses the determination coefficient R obtained in the cross-validation 2 As the evaluation criteria, candidate parameter combinations are iteratively generated and their performance is evaluated, and finally the optimal hyperparameter configuration is selected. Optuna supports dynamic distributed sampling and mid-test pruning mechanisms during the search process, which can quickly approach the optimal solution under limited computing resources and improve optimization efficiency. After selecting the optimal parameter combination, the model is finally trained and verified on an independent test set to calculate its R 2 and RMSE (root mean square error) indicators to comprehensively measure the model's fitting ability and prediction error level. These two evaluation values can be obtained by the experimental value (y i ), average experimental value Predicted value and the number of observations in the data set (n), the calculation equation is as follows:
[0048]
[0049] The above process ensures that the model has good generalization performance and engineering application value in the task of predicting the memory effect of natural gas hydrate.
[0050] Further: the step S4 specifically includes:
[0051] A. Model and Normalizer Loading: The system first loads the trained machine learning model file and the corresponding normalizer object to ensure that the input data distribution is consistent with the data distribution during the training phase.
[0052] B. Experimental condition input and model selection: A graphical user interface built with Python and PyQt5 receives user-entered experimental condition parameters, including synthesis temperature, dissociation pressure, synthesis pressure, decomposition temperature, and cycle number, and supports users to select a specific prediction model in the interface;
[0053] C. Input data standardization: The system automatically standardizes input variables to ensure that the dimension and distribution of the input data remain consistent with those in the model training phase, thereby improving prediction accuracy and model compatibility.
[0054] D. Memory Effect Prediction and Judgment Feedback: The system uses the user-selected prediction model to perform inference calculations on the standardized input data and output a nucleation time prediction. To intelligently determine memory effects, after inputting the current experimental conditions (including the set number of cycles), the system simultaneously constructs a set of baseline conditions with only the number of cycles set to 1, and then predicts the nucleation time for each. The system then calculates the memory effect percentage using the following formula:
[0055] Memory effect (%) = [(base state nucleation time - current state nucleation time) ÷ base state nucleation time] × 100%.
[0056] The baseline nucleation time is the nucleation time predicted by the model under the input condition of a cycle number of 1, and the current state nucleation time is the nucleation time predicted by the model under the user-set cycle number.
[0057] This invention systematically introduces machine learning methods into the study of the memory effect of natural gas hydrates for the first time, and constructs a complete closed-loop system from experimental data acquisition, model training and optimization to prediction output and human-computer interaction. This method exhibits high fit and stability on the test set, and can accurately predict the memory effect under different experimental conditions, effectively characterizing the historical dependence behavior during the hydrate transformation process, and filling the gap in the traditional theoretical model in predicting the memory effect. This method not only improves the prediction efficiency and accuracy of key parameters such as the memory effect, significantly reduces experimental dependence and energy consumption costs, but also has good scalability and engineering applicability, providing an innovative technical path and intelligent auxiliary tools for the intelligent development, nucleation control and process optimization of natural gas hydrates, and has important scientific research value and prospects for industrial promotion. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flow chart of a method for predicting the memory effect of natural gas hydrates according to the present invention.
[0059] Figure 2 This is a distribution diagram of nucleation time observation values and predicted values of a random forest model on a training set and a test set in a method for predicting the memory effect of natural gas hydrates according to the present invention.
[0060] Figure 3 This is a diagram of the software operation interface based on machine learning training. DETAILED DESCRIPTION
[0061] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope of the present invention and its application.
[0062] In one embodiment, the present invention provides a method for predicting the memory effect of natural gas hydrates, comprising the following steps:
[0063] Step A: Collect experimental data, including multiple variable characteristics that affect the memory effect, such as synthesis temperature, dissociation pressure, synthesis pressure, decomposition temperature, and number of synthesis-decomposition cycles, and construct a training dataset with nucleation time as the dependent variable;
[0064] Step B: Preprocess the collected experimental data, including missing value filling, outlier removal and standardization, to obtain standardized samples for subsequent modeling;
[0065] Step C: Build a memory effect prediction model based on machine learning algorithms such as support vector regression (SVR), random forest (RF), XGBoost, and polynomial regression. Improve model performance through cross-validation and automated hyperparameter optimization (such as Optuna) to achieve accurate fitting of nucleation time and enhance generalization capabilities.
[0066] Step D: Develop a graphical visualization interactive platform based on Python and PyQt5, which supports users to input experimental conditions and select prediction models. The system automatically performs data preprocessing and model inference, outputs memory effect prediction results, and determines whether there is any nucleation-promoting behavior, thereby realizing intelligent identification of the hydrate memory effect and auxiliary decision-making.
[0067] As a preferred embodiment of this invention, the specific experimental steps of step A are as follows:
[0068] 1. Sample loading: Pour approximately 130–170 μL of high-purity water into a custom-made glass sample tube or glass tank and place it into the high-pressure reaction chamber of the high-pressure automatic nucleation time measurement device.
[0069] 2. Connect the gas line and pressurize: Connect the sample chamber to the gas high-pressure pipeline through the Swagelok high-pressure connector, introduce the target gas (such as methane or a methane-propane mixture), use a high-pressure pump to increase the system pressure to the set value (such as 12-15 MPa), and then isolate the gas source to maintain a stable pressure.
[0070] 3. Temperature control setting: Start the cooling circulation system and Peltier temperature control module, set the cooling rate (typically 0.025K / s), and accurately control the sample temperature through the thermocouple feedback system.
[0071] 4. Start the experimental cycle: Cool the sample in a high-pressure atmosphere until it reaches a supercooled state. Use a photoelectric sensor to monitor the sample's light transmittance in real time. A rapid decrease in transmittance indicates hydrate formation, and the corresponding formation temperature and nucleation time are recorded.
[0072] 5. Temperature dissociation: Then raise the temperature to about 10–15 K above the equilibrium dissociation temperature of the hydrate and maintain it for a period of time (e.g., 300 seconds) to ensure that the hydrate is completely decomposed, providing the initial state for the next round of experiments.
[0073] 6. Repeat the experimental cycle: The above synthesis-dissociation process can be automatically repeated many times (usually more than 100 times), collecting a large amount of nucleation time data to form a statistically significant data set.
[0074] 7. Data output: Finally, a data set containing multiple control variables and nucleation time response values is obtained, providing basic support for subsequent machine learning modeling and memory effect analysis.
[0075] As a preference of this embodiment, the specific experimental steps of step B are as follows:
[0076] 1. Missing value processing: Use the mean filling method to fill in the missing numerical features to ensure the consistency of data dimensions and avoid interference with subsequent model training due to data gaps.
[0077] 2. Outlier elimination: Identify and eliminate outliers or unreasonable observations in experimental data, and make judgments based on the Z-value rule to improve data quality and model stability. The Z-value rule judgment formula is:
[0078]
[0079] Among them, x i is the sample value, μ is the sample mean of the feature, and σ is the sample standard deviation. i When |>3, the sample point is considered an outlier and is removed from the data set.
[0080] 3. Feature normalization: In order to eliminate the influence of different dimensions on the model results, the experimental data is normalized. Preferably, the Z-Score normalization method is used to normalize the numerical variables. The processing formula is as follows:
[0081]
[0082] in, is the mean of the original data, is the standard deviation. After standardization, the data follows a distribution with a mean of 0 and a standard deviation of 1.
[0083] In this embodiment, five variables, namely synthesis temperature, decomposition temperature, synthesis pressure, decomposition pressure, and synthesis-decomposition cycle number, were selected for standardization. Statistical analysis showed that the mean of synthesis temperature was 275.43 and the standard deviation was 9.47; the mean of decomposition temperature was 304.17 and the standard deviation was 7.92; the mean of synthesis pressure and decomposition pressure were both 8.89 and the standard deviation was 2.66; the mean of cycle number was 59.05 and the standard deviation was 38.12. After Z-Score standardization, the above variables were converted to a normal distribution with a mean of 0 and a standard deviation of 1, ensuring that each feature was input into the model on a unified scale.
[0084] As a preferred embodiment of this invention, the specific experimental steps of step C are as follows:
[0085] During the model building phase, in order to improve the prediction accuracy and the adaptability of the model to unknown data, the training set is first subjected to a ten-fold cross-validation. The specific method is: the training data is evenly divided into ten subsets, one of the subsets is selected as the validation set in each round, and the remaining nine subsets are used for training. After repeating ten times, the average value of the performance indicators of each round is calculated as the evaluation result. This method can effectively reduce the model's dependence on specific data divisions and enhance the robustness and stability of the model. On the basis of cross-validation, the automatic parameter adjustment framework Optuna is used to perform a combined optimization of the key hyperparameters of each model. The optimization process is based on the determination coefficient (R 2 ) as the objective function, the parameter space is intelligently searched through the Parzen estimator algorithm of the tree structure in Bayesian optimization, and the experimental pruning mechanism is combined to terminate the combination with poor performance early, thereby improving the search efficiency. The optimal hyperparameter combination is finally selected to retrain the model and evaluate it on an independent test set. The main performance indicators used include the coefficient of determination (R 2 ) and root mean square error (RMSE).
[0086] Specifically, the random forest model demonstrated optimal performance when configured with 20 trees, unlimited maximum tree depth, 7 maximum features, 2 minimum split samples, 1 minimum leaf sample, and sampling with replacement (bootstrap set to True). The model achieved a coefficient of determination of 0.9859 and a root mean square error of 263.9372 on the training set, and a coefficient of determination of 0.9751 and a root mean square error of 354.9986 on the test set, demonstrating excellent fitting accuracy and generalization. The optimal hyperparameters for the extreme gradient boosting (XGBoost) model were: 193 trees, 5 maximum tree depth, 0.17 learning rate, 1 minimum child node weight, 0.81 sample subsampling rate, 0.44 column sampling rate, and 0.12 pruning threshold. With these parameters, the model achieved a coefficient of determination of 0.8706 and a root mean square error of 808.8831 on the test set, demonstrating good overall prediction performance. The support vector regression model uses a polynomial kernel function, with optimal hyperparameters: a penalty coefficient of 200, an error tolerance band width of 0.1, a kernel function parameter of 0.93, and a polynomial order of 3. The model achieved a coefficient of determination of 0.7987 and a root mean square error of 1008.7665 on the test set. The polynomial regression model also demonstrated good fit when the polynomial order was set to 3, with a coefficient of determination of 0.8939 and a root mean square error of 732.3117 on the test set, demonstrating good nonlinear expression and interpretability.
[0087] As a preference of this embodiment, the specific experimental steps of step D are as follows:
[0088] 1. Model and Normalizer Loading: Upon system startup, the joblib module in Python is first called to load the trained machine learning model file and its corresponding normalizer object. By loading the .pkl format model and normalizer files, the user input data is guaranteed to be consistent with the data distribution during the model training phase, thereby improving the accuracy and stability of the model predictions.
[0089] 2. Experimental Condition Input and Model Selection: Developed in PyQt5, the graphical user interface allows users to enter experimental parameters, including synthesis temperature, synthesis pressure, dissociation temperature, dissociation pressure, and the number of synthesis-decomposition cycles. Furthermore, users can select the desired prediction model, such as support vector regression, random forest, XGBoost, or polynomial regression. The system supports flexible call and switching between different models.
[0090] 3. Input data standardization: After receiving the experimental parameters input by the user, the system automatically organizes them into feature vectors to be predicted and calls the aforementioned loaded normalizer object to perform normalization conversion to maintain the consistency of the input variables in numerical scale and distribution, avoiding interference of scale differences on model prediction.
[0091] 4. Memory effect prediction and judgment feedback: In this embodiment, the output of the model is the predicted value of the nucleation time of natural gas hydrate. The system achieves quantitative judgment of the memory effect by constructing two sets of input samples, the first of which is the experimental conditions set by the user (including the specified number of cycles), and the second is the baseline state with the number of cycles set to 1 under the condition that other conditions remain unchanged. The two sets of data are input into the selected model for prediction, and two nucleation time prediction values are obtained, which are used to calculate the memory effect percentage. The calculation formula is as follows:
[0092] Memory effect (%) = [(base state nucleation time - current state nucleation time) ÷ base state nucleation time] × 100%.
[0093] The baseline nucleation time is the model-predicted nucleation time under the same experimental conditions, with the number of synthesis-decomposition cycles set to 1. The current nucleation time is the model-predicted nucleation time under the set number of cycles. The system determines whether a memory effect exists based on these calculations: if the percentage is greater than 0, a memory effect is present, and the software displays the message "Nucleation promoted, memory effect present." If the percentage is less than or equal to 0, the software displays the message "Nucleation not promoted."
[0094] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. For those skilled in the art of the present invention, without departing from the concept of the present invention, they may make several substitutions or modifications to the described embodiments, and these substitutions or modifications should be considered to fall within the scope of protection of the present invention.
Claims
1. A method for predicting the memory effect of natural gas hydrate, characterized in that: The steps include: Step S1: collecting experimental data, including multiple variable characteristics that affect the memory effect, such as synthesis temperature, dissociation pressure, synthesis pressure, number of synthesis-decomposition cycles, and decomposition temperature, and constructing a training data set with nucleation time as the dependent variable; Step S2: preprocessing the experimental data to complete missing value filling, outlier removal and standardization to obtain standardized samples; Step S3: Build a prediction model based on support vector regression, random forest, XGBoost or polynomial regression algorithm, and improve the prediction performance by adjusting the model's hyperparameters; Step S4: A graphical visualization interface is constructed based on Python and PyQt5, allowing the user to input experimental conditions and select a prediction model. The system outputs a predicted value of nucleation time based on the model, and determines whether there is a memory effect that promotes nucleation.
2. The method for predicting the natural gas hydrate memory effect according to claim 1, wherein: The experimental data in step S1 is collected by an automatic high-pressure nucleation time measurement system. The system performs multiple cycles of hydrate synthesis and dissociation experiments on the sample under set pressure and cooling rate conditions, and monitors the changes in the sample transmittance in real time through a photoelectric sensor. When a sudden drop in transmittance is detected, hydrate formation is determined and the corresponding time is recorded as the nucleation time, thereby obtaining a data set containing multiple control variables and response variables.
3. The method for predicting the natural gas hydrate memory effect according to claim 1, wherein: The preprocessing of the experimental data in step S2 includes the following operations: Step S21: Process the missing values in the experimental data. For data with a small missing ratio, use the mean interpolation method to fill it to ensure the consistency of data dimensions and avoid affecting the stability of model training due to missing values. Step S22: Use the Z-score method to detect and remove outliers in the experimental data, calculate the sample Z value and set the threshold |Z|>3 as the discrimination criterion to identify and remove abnormal observation points, thereby improving data quality and model robustness; Step S23: Standardize the numerical feature data after missing value filling and outlier removal, preferably using the Z-Score standardization method to convert the sample features into a distribution with a mean of 0 and a standard deviation of 1; Step S24: Through the above processing, a standardized sample data set with unified structure and consistent dimensions is obtained for subsequent training and evaluation of the prediction model.
4. The method for predicting the natural gas hydrate memory effect according to claim 1, wherein: In step S3, the model is constructed based on multiple machine learning algorithms such as support vector regression, random forest, extreme gradient boosting and polynomial regression. During the modeling process, ten-fold cross-validation is used to improve the generalization ability and robustness of the model, and the Optuna automatic parameter tuning framework is used to perform combinatorial search and performance optimization on the key hyperparameters of each model. The optimization process uses the determination coefficient obtained in cross-validation as the objective function, and searches and screens the optimal hyperparameter combination through dynamic distribution sampling and mid-test pruning mechanism. After obtaining the optimal parameter configuration, each model is finally trained separately, and the determination coefficient and root mean square error of the model are evaluated on an independent test set to comprehensively measure the fitting accuracy and prediction performance of the model.
5. The method for predicting the memory effect of natural gas hydrate according to claim 4, characterized in that: The hyperparameter optimization ranges of the support vector regression, random forest, extreme gradient boosting and polynomial regression models specifically include: the hyperparameter range of the random forest model includes: the number of decision trees is 5 to 500, the maximum tree depth is 1 to 20 or no limit is set, the maximum number of features is 1 to 10, the minimum number of split samples is 2, the minimum number of leaf node samples is 1, and whether to perform sampling with replacement is yes or no; the hyperparameter range of the extreme gradient boosting model includes: the number of decision trees is 100 to 1000, the maximum tree depth is 3 to 10, the learning rate is 0.01 to 0.3, the maximum The weight of the small child node is 1 to 10, the sample subsampling ratio is 0.5 to 1.0, the feature column sampling ratio is 0.3 to 1.0, and the pruning regularization parameter is 0.0 to 1.0; the hyperparameter range of the support vector regression model includes: penalty coefficient 0.01 to 10000, error tolerance bandwidth 0.0001 to 10, kernel function parameter 0.00001 to 10, kernel function type includes radial basis kernel function or polynomial kernel function, where the order of the polynomial kernel function is 2 to 5; the hyperparameter of the polynomial regression model is the polynomial order, and the value range is 2 to 5.
6. The method for predicting the natural gas hydrate memory effect according to claim 1, wherein: The step S4 includes inputting experimental parameters and selecting a prediction model through a graphical visualization interface. The system loads the trained model and its normalizer, normalizes the user input data, and outputs a nucleation time prediction value.
7. A natural gas hydrate memory effect prediction system, comprising a memory and a processor, characterized in that: The memory is used to store program instructions; the processor is used to call the program instructions, and when the program instructions are executed, the natural gas hydrate memory effect prediction method according to any one of claims 1 to 6 is implemented.
8. A computer program product comprising a computer program, characterized in that: When the computer program is executed by a processor, it is used to implement the steps of the natural gas hydrate memory effect prediction method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it is used to implement the steps of the natural gas hydrate memory effect according to any one of claims 1 to 6.
Citation Information
Cited By
Electronic-grade anhydrous hydrogen fluoride arsenic removal data analysis system based on decision tree model
CN120913679A