Intelligent prediction method for brittleness failure of hydrogen-doped natural gas pipeline and host equipment
By combining basic machine learning and domain-adaptive models, and utilizing adversarial neural network technology, an intelligent prediction model was established. This solved the accuracy problem of predicting brittle failure in hydrogen-blended natural gas pipelines, achieving high-precision prediction, reducing the risk of hydrogen embrittlement, and ensuring the safety of the pipeline system and the advancement of clean energy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies lack methods to accurately predict the brittle failure of hydrogen-blended natural gas pipelines, making it difficult to guarantee the accuracy of traditional prediction methods and increasing the risk of pipeline failure and safety accidents.
By employing a fusion approach based on fundamental machine learning models and domain-adaptive models, combined with adversarial neural network technology, an intelligent prediction model is established using parameters such as temperature, pressure, and hydrogen blending ratio to calculate the hydrogen embrittlement index, thereby achieving accurate prediction of brittle failure in hydrogen-blended natural gas pipelines.
It improves the accuracy and reliability of predicting brittle failure in hydrogen-blended natural gas pipelines, reduces the risk of hydrogen embrittlement, ensures the stable operation of the pipeline system, promotes the rational integration of hydrogen energy and natural gas, and drives the efficient utilization of clean energy.
Smart Images

Figure CN121859474A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydrogen embrittlement evaluation technology for hydrogen-blended natural gas pipelines, specifically to an intelligent prediction method and main equipment for brittle failure of hydrogen-blended natural gas pipelines. Background Technology
[0002] Hydrogen energy, with its abundant resources, high calorific value, and pollution-free operation, is considered an ideal clean energy source and a crucial pathway to carbon neutrality, playing a vital role in the new global energy landscape. Currently, many countries are accelerating the research and industrialization of hydrogen energy technologies. The United States, the European Union, and Japan have all issued corresponding hydrogen energy strategic plans, with Japan even proposing the concept of a "hydrogen society." The entire lifecycle of hydrogen energy technology mainly includes hydrogen production, storage, transportation, and utilization. Among these, hydrogen transportation connects upstream hydrogen production and storage with downstream end-users, making it a critical link. Currently, commonly used hydrogen transportation methods include liquid hydrogen tanker truck transportation, high-pressure hydrogen cylinder long-tube trailer transportation, and liquid hydrogen barge transportation. These methods are costly and inefficient. Given the current underdeveloped hydrogen storage and transportation infrastructure, blending hydrogen into natural gas pipelines is the potentially best way to achieve large-scale, long-distance, safe, and efficient hydrogen transportation. Compared to vehicle-mounted and ship-mounted transportation methods, using pipelines to transport hydrogen-blended natural gas can fully utilize existing operational natural gas pipelines in my country, making it easier to achieve large-scale, long-distance hydrogen transportation. In addition, the addition of hydrogen to natural gas pipelines can effectively reduce combustion pollutant emissions and improve the atmospheric environment.
[0003] Currently, natural gas pipeline transportation technology is mature, but the addition of hydrogen introduces new technical and safety challenges. After hydrogen is added to natural gas, the pipeline is exposed to a high-pressure, hydrogen-rich environment. In this environment, the risk of various hydrogen-induced damages, such as hydrogen embrittlement and hydrogen corrosion, increases, leading to accelerated deterioration of typical material mechanical properties and a greater risk of pipeline failure. In addition to the soil corrosion, stress corrosion, and acid gas corrosion faced by conventional natural gas pipelines, the significantly increased hydrogen content and localized hydrogen saturation can cause a decrease in material plasticity and decarburization of steel, resulting in irreversible degradation of the pipeline's mechanical properties. Traditional natural gas pipeline materials, such as steel, are prone to hydrogen embrittlement when exposed to hydrogen-rich environments for extended periods. This embrittlement occurs when the material absorbs hydrogen, leading to material failure and potentially serious safety accidents. Currently, assessing and preventing brittle failure of natural gas pipelines in hydrogen-rich environments has become a critical issue in the energy sector. Traditional pipeline failure prediction methods often rely on empirical formulas or single mechanical models, making accurate prediction difficult to guarantee. Therefore, there is an urgent need to develop a new method that can accurately predict the brittle failure of hydrogen-rich natural gas pipelines. Summary of the Invention
[0004] The technical problem to be solved by this invention is the lack of a method that can accurately predict the brittle failure of hydrogen-blended natural gas pipelines. The purpose is to provide an intelligent prediction method, host equipment and computer-readable storage medium for the brittle failure of hydrogen-blended natural gas pipelines, fill the gap in this field, provide a basis for the design, operation and maintenance of hydrogen-blended natural gas pipelines, reduce the risk of hydrogen embrittlement, ensure the stable operation of pipeline systems, and provide a useful reference for solving similar problems in other hydrogen energy application fields.
[0005] This invention is achieved through the following technical solution:
[0006] A smart prediction method for brittle failure of hydrogen-doped natural gas pipelines includes the following steps:
[0007] Data preparation: A slow tensile test was conducted on the natural gas pipeline to obtain data on the original length, fracture length, temperature, pressure, hydrogen doping ratio, and fracture elongation during the slow tensile test.
[0008] Hydrogen embrittlement performance parameters calculation: The hydrogen embrittlement index is calculated based on the original length, fracture length, and fracture elongation data;
[0009] Feature dataset establishment: Using temperature, pressure, and hydrogen doping ratio as input parameters for the prediction model and hydrogen embrittlement index as the output, a feature dataset for intelligent prediction of hydrogen embrittlement performance is established.
[0010] Intelligent Model Building: Establish basic machine learning models and domain-adaptive models, and combine adversarial neural network technology for domain adaptation;
[0011] Model training and evaluation: The feature dataset is divided into training and test sets to train the basic machine learning model and the domain adaptation model.
[0012] Model fusion: Integrating trained base machine learning models and domain-adaptive models into a fusion model y. final Output the final prediction result;
[0013] Model Application: Towards the Fusion Model y final Input the data to be predicted, and output the final prediction result.
[0014] As one possible design, the mathematical expression for the above-mentioned elongation at break is:
[0015]
[0016] In the formula,
[0017] L0 is the original length of the sample, in mm;
[0018] LF is the length of the specimen after fracture, in mm;
[0019] E represents the elongation at break.
[0020] As one possible design, the mathematical expression for the hydrogen embrittlement index is:
[0021]
[0022] In the formula,
[0023] E0 is the elongation at break of the sample that has not undergone hydrogen embrittlement;
[0024] E H The fracture elongation of the hydrogen-embrittled sample;
[0025] I represents the hydrogen embrittlement index.
[0026] As one possible design, the mathematical expression for the above basic machine learning model is:
[0027] y base =f ML (x)
[0028] In the formula,
[0029] f mL Basic machine learning models;
[0030] x represents the input feature parameters;
[0031] y base For output parameters.
[0032] As one possible design, the establishment of the above-mentioned basic machine learning model includes the following steps:
[0033] Choose the XGBoost gradient boosting framework and define a loss function that matches the problem;
[0034] Initialize the model and set the relevant hyperparameter types, including the learning rate and the number of decision trees;
[0035] Generate a simulated binary classification dataset and divide it into a training set and a test set;
[0036] Train the model using the training set and adjust and correct the prediction error;
[0037] Optimize hyperparameters, evaluate model performance using test sets, analyze feature importance, and complete the machine learning modeling process.
[0038] As one possible design, the mathematical expression for the objective function of XGBoost is:
[0039]
[0040] In the formula,
[0041] Θ represents the parameter set of the model;
[0042] sum_{i=1~n) is the summation of the data, that is, the accumulation of the loss for each training sample;
[0043] loss is a loss function used to measure the difference between the model's predicted value yi^ and the true value yi;
[0044] y i The true label or target value of the i-th sample in the training set;
[0045] sum_{k=1~K) represents the summation of all K basis functions in the model;
[0046] Ω(f k )) is a regularization term used to control the complexity of the model and prevent overfitting. It adds a penalty term based on the complexity of the basis function fk.
[0047] As one possible design, the mathematical expression for the aforementioned domain adaptive model is:
[0048] y DA =g DA (x)
[0049] In the formula,
[0050] g DA For domain adaptation models;
[0051] x represents the input feature parameters;
[0052] y base For output parameters.
[0053] As one possible design, the establishment of the aforementioned domain adaptive model includes the following steps:
[0054] The model is designed to share features between the source and target domains;
[0055] Through adversarial training, the model learns to resist differences in data distribution across different domains, making the learned features more adaptable.
[0056] As one possible design, the training of the above-mentioned basic machine learning model is performed according to the following formula:
[0057] minimizeL ML (f ML ,{(x,y)});
[0058] In the formula,
[0059] Minimize is the optimization objective of the objective function, which means that we want to adjust the parameters of the model to make the objective function LML reach its minimum value.
[0060] L ML Representing the loss function in Machine Learning (ML), the loss function L ML Used to measure model f ML The prediction error for a given set of data {(x,y)};
[0061] f ML f represents a machine learning model. ML It is a function that learns by adjusting parameters during training. It accepts input xx and outputs a predicted value.
[0062] The domain adaptive model is performed according to the following formula:
[0063] minimizeL DA (g DA ,{(x,y)});
[0064] minimize: indicates the optimization objective;
[0065] L DA : Represents the domain-adaptive loss function;
[0066] g DA : Represents a model used for domain adaptation;
[0067] {(x,y)}: represents the dataset;
[0068] L ML This represents the loss function of the base model.
[0069] As one possible design, the above fusion model y final The mathematical expression is:
[0070] y final =α·y base +(1-α)·y DA .
[0071] A host device, including
[0072] Memory, used to store computer programs;
[0073] A processor is used to execute the computer program to implement the intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines as described above.
[0074] A computer-readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines as described above.
[0075] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0076] This invention solves the problem that existing technologies must rely on empirical formulas or single mechanical models to predict hydrogen embrittlement performance. By inputting easily obtainable temperature, pressure, and hydrogen doping ratio, a high-precision hydrogen embrittlement index can be obtained, making the prediction of brittle failure of natural gas pipelines intelligent.
[0077] This invention establishes a domain-adaptive fusion model that combines basic machine learning models with adversarial neural network techniques, enabling more accurate prediction of the hydrogen embrittlement index of hydrogen-blended natural gas pipelines under different conditions. This method effectively reduces the errors introduced by single-model predictions, improving the reliability and accuracy of the predictions.
[0078] This invention comprehensively considers multiple variables such as temperature, pressure, and hydrogen content, and flexibly adjusts the weighting coefficients in the model to ensure that the model can find an equilibrium point under different working conditions, thus maintaining good predictive performance in various complex environments and having wide applicability.
[0079] This invention can efficiently screen and analyze pipeline material evaluation data, accurately predict the brittle failure of hydrogen-blended natural gas pipelines, provide a scientific basis for pipeline design, operation and maintenance, thereby effectively reducing the risk of hydrogen embrittlement, ensuring the stable operation of pipeline systems and avoiding safety accidents.
[0080] This invention can ensure the safety of pipelines during hydrogen-blended transportation, promote the rational integration of hydrogen energy and natural gas, drive the efficient use of clean energy, and help achieve the goal of carbon neutrality.
[0081] This invention is not only applicable to the prediction of brittle failure in hydrogen-blended natural gas pipelines, but can also provide a useful reference for other hydrogen energy application fields. This method has application potential in different stages of the entire hydrogen lifecycle, including hydrogen production, storage, and utilization, promoting the development and application of hydrogen energy technology and possessing significant theoretical and practical value. Attached Figure Description
[0082] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0083] Figure 1 This is a flowchart of the present invention;
[0084] Figure 2 This is a graph showing the accuracy of the hydrogen embrittlement index prediction in this invention. Detailed Implementation
[0085] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments and accompanying drawings. The illustrative embodiments and descriptions of this invention are for explanation only and are not intended to limit the invention. Unless otherwise specified in the embodiments, conventional conditions or conditions recommended by the manufacturer shall apply. Reagents or instruments whose manufacturers are not specified are all commercially available conventional products.
[0086] Existing technologies typically rely on empirical formulas or single mechanical models to predict hydrogen embrittlement in natural gas pipelines, resulting in inconsistent prediction accuracy. This invention provides an intelligent prediction method for the brittle failure of hydrogen-blended natural gas pipelines, filling this gap and providing a basis for the design, operation, and maintenance of such pipelines. This reduces the risk of hydrogen embrittlement, ensures the stable operation of pipeline systems, and can offer valuable reference for solving similar problems in other hydrogen energy application areas.
[0087] To verify the prediction accuracy of this invention, this invention selects slow stretching data from the literature (Huang G, Zheng J, Meng B, et al. Mechanical Properties of X70 Welded Joint in High-Pressure Natural Gas / Hydrogen Mixtures[J]. Journal of Materials Engineering and Performance, 2020, 29(3).DOI:10.1007 / s11665-020-04680-6) to carry out intelligent prediction of hydrogen embrittlement index of hydrogen-blended natural gas.
[0088] A smart prediction method for brittle failure of hydrogen-doped natural gas pipelines includes the following steps:
[0089] S1. Data preparation: Conduct a slow tensile test on the natural gas pipeline to obtain data on the original length, fracture length, temperature, pressure, hydrogen doping ratio, and fracture elongation during the slow tensile test.
[0090] Slow tensile tests were conducted on natural gas pipeline samples that had not undergone hydrogen embrittlement and those that had. The initial length, fracture length, temperature, pressure, and hydrogen doping ratio were measured. The elongation at break was calculated based on the initial length and the length after fracture. These data provide a foundation for subsequent analysis and prediction.
[0091] Preferably, step S1 further includes data processing of the acquired data. The detailed content of data processing includes handling missing values and detecting outliers in the original data, and applying smoothing techniques for noise reduction.
[0092] The present invention also generates more diverse and uncertain samples through variational autoencoders (VAEs), expanding the data volume to 520 sets.
[0093] The mathematical expression for the above-mentioned elongation at break is:
[0094]
[0095] In the formula,
[0096] L0 is the original length of the sample, in mm;
[0097] LF is the length of the specimen after fracture, in mm;
[0098] E represents the elongation at break.
[0099] S2. Calculation of hydrogen embrittlement performance parameters: The hydrogen embrittlement index is calculated based on the original length, fracture length and fracture elongation data.
[0100] The hydrogen embrittlement index can be calculated from the original length, fracture length, and fracture elongation, which can be used to assess the ability of natural gas pipelines to resist brittle fracture in a hydrogen environment.
[0101] The mathematical expression for the hydrogen embrittlement index is as follows:
[0102]
[0103] In the formula,
[0104] E0 is the elongation at break of the sample that has not undergone hydrogen embrittlement;
[0105] E H The fracture elongation of the hydrogen-embrittled sample;
[0106] I represents the hydrogen embrittlement index.
[0107] Specimens without hydrogen embrittlement are those that have not been exposed to hydrogen or have not experienced brittle fracture in a hydrogen environment; they undergo slow tensile testing under normal environmental conditions to evaluate their mechanical properties (such as elongation at break). Hydrogen-embrittled specimens are those that exhibit increased brittleness and fracture in a hydrogen environment, typically under high pressure and rich hydrogen conditions; slow tensile testing in a hydrogen environment is used to evaluate the brittleness and fracture behavior of the material under hydrogen conditions. Baseline performance data are obtained from testing non-hydrogen-embrittled specimens, and the effects of hydrogen on the brittleness of the material under different conditions are evaluated in conjunction with the testing of hydrogen-embrittled specimens.
[0108] S3. Feature Dataset Establishment: Using temperature, pressure, and hydrogen doping ratio as input parameters for the prediction model and hydrogen embrittlement index as the output result, a feature dataset for intelligent prediction of hydrogen embrittlement performance is established, as shown in Table 1.
[0109] Temperature, pressure, and hydrogen blending ratio are key factors affecting the hydrogen embrittlement performance of hydrogen-blended natural gas pipelines. Therefore, using temperature, pressure, and hydrogen blending ratio as input parameters for the prediction model and the hydrogen embrittlement index as the output, a feature dataset for intelligent prediction of hydrogen embrittlement performance was established. Since the output parameter (hydrogen embrittlement index) is calculated based on the fracture elongation of the material in a hydrogen environment, reflecting the degree of brittleness of the material, this feature dataset can reflect the main factors affecting the hydrogen embrittlement performance of pipelines, providing strong support for the establishment of intelligent models.
[0110] Table 1 shows a partial dataset for intelligent prediction of hydrogen embrittlement performance.
[0111]
[0112]
[0113] S4. Intelligent Model Establishment: Establish a basic machine learning model and a domain adaptation model, and combine adversarial neural network technology for domain adaptation.
[0114] The aforementioned basic machine learning models can be basic machine learning models, domain adaptive models, and adversarial neural network models.
[0115] 1. Basic Machine Learning Models:
[0116] Support Vector Machine (SVM): SVM is a powerful classifier, especially effective in high-dimensional spaces. It can be trained on both the source and target domains to generate a preliminary classification model. SVM performs exceptionally well in handling high-dimensional data, effectively processing complex data structures, and exhibits good performance with limited sample sizes. SVM can be applied to both regression and classification tasks, adapting to diverse data requirements.
[0117] Random Forest: Random forest is an ensemble learning method that improves the robustness and accuracy of a model by combining multiple decision trees. It is suitable for classification problems in various fields. As an ensemble method of decision trees, random forest significantly improves the stability and accuracy of predictions and reduces overfitting by constructing multiple decision trees and then averaging them.
[0118] Logistic Regression: Logistic regression is a simple and effective classification model, especially commonly used in binary classification problems. It can serve as a baseline model for domain adaptation.
[0119] 2. Domain Adaptive Model:
[0120] Deep Neural Networks (DNNs): DNNs can learn more representative features from source and target domain data through multiple layers of nonlinear transformations.
[0121] Adversarial Autoencoders (AAEs): AAEs achieve domain adaptation by aligning the latent representations of the source and target domains through adversarial training. They can help reduce distributional differences between domains.
[0122] Deep Domain Adaptive Network (DANN): DANN combines the idea of adversarial neural networks. By introducing a domain classifier during training, the model can adversarially learn domain-invariant feature representations, thereby improving its generalization ability on the target domain.
[0123] 3. Adversarial Neural Network Model:
[0124] Generative Adversarial Networks (GANs): GANs generate samples similar to the target domain through adversarial training of the generator and discriminator, thereby promoting domain adaptation. They are particularly suitable for synthesizing target domain data or aligning inter-domain distributions.
[0125] Adversarial domain adaptation networks: Through adversarial training strategies, the model learns feature representations that are effective in both the source and target domains, thereby reducing the impact of inter-domain differences on model performance.
[0126] The commonalities among the three models—basic machine learning model, domain adaptive model, and adversarial neural network model—are as follows: (1) Both the domain adaptive model and the adversarial neural network model use adversarial training strategies to improve the model's generalization ability in different domains through the game between the generator and the discriminator. (2) Both are committed to learning domain-invariant features shared between the source domain and the target domain, thereby maintaining good performance in the target domain. (3) They utilize deep learning methods to extract complex feature representations, which are very effective for processing high-dimensional and nonlinear data. (4) The ultimate goal of all three is to enhance the model's generalization ability in the target domain, even when the data distributions of the source domain and the target domain are inconsistent.
[0127] Combining basic machine learning models and domain-adaptive models can fully leverage the advantages of both to improve the accuracy of predicting brittle failure of hydrogen-blended natural gas pipelines.
[0128] The mathematical expression for the above basic machine learning model is:
[0129] y base =f ML (x)
[0130] In the formula,
[0131] f mL Basic machine learning models;
[0132] x represents the input feature parameters;
[0133] y base For output parameters.
[0134] The establishment of the above-mentioned basic machine learning model includes the following steps:
[0135] S41. Select the XGBoost gradient boosting framework and define a loss function that matches the problem;
[0136] S42. Initialize the model and set the hyperparameter types related to the model, including the learning rate and the number of decision trees;
[0137] S43. Generate a simulated binary classification dataset and divide it into a training set and a test set;
[0138] S44. Train the model using the training set and adjust and correct the prediction error;
[0139] S45. Optimize hyperparameters, evaluate model performance using the test set, analyze feature importance, and complete the machine learning modeling process.
[0140] XGBoost, mentioned in step S41 above, is a widely used gradient boosting framework that builds powerful prediction models by integrating multiple weak decision trees. XGBoost is chosen for its high computational efficiency, support for parallel processing, and strong model performance. Common loss functions for regression problems include mean squared error (MSE). Common loss functions for classification problems include the log loss of logistic regression. The loss function defines the difference between the model's predicted value and the actual value, and guides the model to improve prediction accuracy by minimizing this difference.
[0141] The ratio of the training set to the test set in step S43 above is 8:2.
[0142] The hyperparameter tuning in step S45 above is mainly performed through methods such as cross-validation. Specifically, these methods include grid search, random search, Bayesian optimization, and cross-validation. Grid search systematically searches for the optimal hyperparameter combination using a predefined parameter grid; random search randomly samples some combinations in the hyperparameter space for evaluation, which is relatively fast; Bayesian optimization uses the Bayesian method to estimate the optimal hyperparameter combination, which is highly efficient; cross-validation divides the dataset into multiple subsets, alternating between training and testing with different portions of the data to avoid model overfitting.
[0143] The analysis of feature importance in step S45 above is specifically accomplished through the model's built-in method (XGBoost's `feature_importances_` attribute), providing the degree of influence of each input feature on the final prediction result.
[0144] The mathematical expression for the objective function of XGBoost is:
[0145]
[0146] In the formula,
[0147] Θ represents the parameter set of the model;
[0148] sum_{i=1~n) is the summation of the data, that is, the accumulation of the loss for each training sample;
[0149] loss is a loss function used to measure the difference between the model's predicted value yi^ and the true value yi;
[0150] y i The true label or target value of the i-th sample in the training set;
[0151] sum_{k=1~K) represents the summation of all K basis functions in the model;
[0152] Ω(f k )) is a regularization term used to control the complexity of the model and prevent overfitting. It adds a penalty term based on the complexity of the basis function fk.
[0153] The loss function optimizes the model by minimizing the loss function, making the model's predictions as close as possible to the true values. The regularization term controls the model's complexity and avoids overfitting by penalizing the complexity of the basis functions. This part improves the model's generalization ability by increasing the cost of model complexity.
[0154] The mathematical expression for the aforementioned domain adaptive model is:
[0155] y DA =g DA (x)
[0156] In the formula,
[0157] g DA For domain adaptation models;
[0158] x represents the input feature parameters;
[0159] y base For output parameters.
[0160] Part of the code is as follows:
[0161]
[0162]
[0163] The establishment of the aforementioned domain adaptive model includes the following steps:
[0164] S46. The model is designed to share features between the source domain (training domain) and the target domain (application domain);
[0165] S47. Through adversarial training, the model learns to resist differences in data distribution between different domains, making the learned features more adaptable.
[0166] In step S46, the model shares features between the source domain (training domain) and the target domain (application domain), and enhances the model's generalization ability by extracting domain-invariant features.
[0167] In step S47, specifically, a Generative Adversarial Network (GAN) technique is used to combine a generative model and a discriminative model. The generative model attempts to generate a feature distribution similar to the target domain, while the discriminative model tries to distinguish the data distributions of the source and target domains. Through adversarial training, the model learns to resist differences in data distributions between different domains, making the learned features more adaptable across different domains.
[0168] Preferably, the above-mentioned shared features and adversarial training are performed according to the following formula:
[0169]
[0170] In the formula,
[0171] Ladv stands for adversarial loss, which is a loss function used for optimization in GAN models, reflecting the game relationship between the generator and the discriminator.
[0172] Exs represents the expectation (mathematical expectation) of the source domain data xs, where the source domain data consists of real samples.
[0173] logDs(xs) is the output of the discriminator Ds on the source domain data xs, representing the discriminator's prediction of the true sample. The discriminator's goal is to maximize this value so that it can correctly classify the true sample as "true" (usually a value close to 1).
[0174] Ext represents the expectation of the target domain data xt, which consists of fake samples generated by the generator.
[0175] Dt(G(xt)) represents the output of the discriminator Dt on the target domain data G(xt), where G(xt) is the sample generated by the generator G after inputting the target domain data xt. The goal of the discriminator is to minimize this value so that it can correctly classify the generated fake samples as "fake" (usually the value is close to 0).
[0176] 1-Dt(G(xt)) means that the goal is to maximize this value so that the generated fake samples are more difficult for the discriminator to identify as fake samples, that is, to hope that the generated samples are as close as possible to the real samples.
[0177] Part of the code is as follows:
[0178]
[0179]
[0180]
[0181] S5. Model Training and Evaluation: Using the feature dataset, the feature dataset is divided into training and testing sets to train the basic machine learning model and the domain adaptation model.
[0182] The training of the above basic machine learning model is performed according to the following formula:
[0183] minimizeL ML (f ML ,{(x,y)});
[0184] In the formula,
[0185] Minimize is the optimization objective of the objective function, which means that we want to adjust the parameters of the model to make the objective function LML reach its minimum value.
[0186] L ML Representing the loss function in Machine Learning (ML), the loss function L ML Used to measure model f ML The prediction error for a given set of data {(x,y)};
[0187] f ML f represents a machine learning model.ML It is a function that learns by adjusting parameters during training. It accepts input xx and outputs a predicted value.
[0188] Domain-adaptive models are performed according to the following formula:
[0189] minimizeL DA (g DA ,{(x,y)});
[0190] minimize: indicates the optimization objective, which is to adjust the model parameters to minimize the loss function LDA;
[0191] L DA : Represents the Domain Adaptation Loss function, which measures the performance difference of the model gDA between the source domain and the target domain. Its purpose is to minimize the distribution difference between the source domain data and the target domain data, thereby making the model more generalizable in the target domain.
[0192] g DA : This refers to the Domain Adaptation Model, which is used to deal with situations where the data distributions of the source and target domains are inconsistent. The gDA model learns to effectively transfer knowledge from the source domain to the target domain.
[0193] {(x,y)}: Represents a dataset, including data pairs from the source and target domains;
[0194] L ML This represents the loss function of the base model.
[0195] S6. Model Fusion: Integrating the trained basic machine learning model and the domain adaptive model into a fusion model y. final .
[0196] Basic machine learning models, when used alone, may exhibit poor predictive accuracy, while domain-adaptive models excel at handling data variations specific to a particular domain. Fusing these two models combines their strengths, improving overall predictive performance. Specifically, this involves fusing the two models with different weighting coefficients, testing them on existing data, evaluating the predictive accuracy of each coefficient, selecting the coefficient with the highest accuracy, and then manually adjusting the weighting coefficients based on actual conditions (such as performance on different test sets or new data distributions) or optimizing them using automated methods (such as grid search or Bayesian optimization).
[0197] Preferably, the above fusion is based on a linear weighted average method.
[0198] The above fusion model y finalThe mathematical expression is:
[0199] y final =α·y base +(1-α)·y DA .
[0200] Here, α is a weighting coefficient, representing the relative importance of the models. When α = 1, the fusion model relies entirely on the base machine learning model; when α = 0, the hybrid model relies entirely on the domain adaptive model; and when 0 < α < 1, the fusion model combines the contributions of both. By flexibly adjusting the weighting coefficients, the model can find a balance between the base model and the domain adaptive model to achieve better performance in different scenarios.
[0201] S7. Model Application: Towards the Fusion Model y final Input the data to be predicted, and output the final prediction result.
[0202] The above-mentioned data to be predicted are the temperature, pressure, and hydrogen blending ratio of the hydrogen-blended natural gas pipeline to be tested, and the prediction results of the hydrogen embrittlement index obtained by the model.
[0203] Appendix Figure 2 This represents the model accuracy of the embodiments of the present invention under different weight indices. Observation Figure 2 It can be seen that when the weight coefficient is 0, the prediction accuracy is 0.75 when only the conventional machine learning model is used for prediction; when the weight coefficient is 0.37, the prediction accuracy of the fusion model is 0.97, and the intelligent prediction model of the fusion model is significantly improved.
[0204] The present invention also provides a host device, including
[0205] Memory, used to store computer programs;
[0206] A processor is used to execute the computer program to implement the intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines as described above.
[0207] The present invention also provides a computer-readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines as described above.
[0208] Since the embodiments of the computer-readable storage medium portion correspond to the embodiments of the intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines, the embodiments of the storage medium portion are described in the description of the embodiments of the intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines, and will not be repeated here.
[0209] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A smart prediction method for brittle failure of hydrogen-blended natural gas pipelines, characterized in that, Includes the following steps: Data preparation: A slow tensile test was conducted on the natural gas pipeline to obtain data on the original length, fracture length, temperature, pressure, hydrogen doping ratio, and fracture elongation during the slow tensile test. Hydrogen embrittlement performance parameters calculation: The hydrogen embrittlement index is calculated based on the original length, fracture length, and fracture elongation data; Feature dataset establishment: Using temperature, pressure, and hydrogen doping ratio as input parameters for the prediction model and hydrogen embrittlement index as the output, a feature dataset for intelligent prediction of hydrogen embrittlement performance is established. Intelligent Model Building: Establish basic machine learning models and domain-adaptive models, and combine adversarial neural network technology for domain adaptation; Model training and evaluation: The feature dataset is divided into training and test sets to train the basic machine learning model and the domain adaptation model. Model fusion: Integrating trained base machine learning models and domain-adaptive models into a fusion model y. final ; Model Application: Towards the Fusion Model y final Input the data to be predicted, and output the final prediction result.
2. The intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines according to claim 1, characterized in that, The mathematical expression for the basic machine learning model is: y base =f ML (x) In the formula, f mL Basic machine learning models; x represents the input feature parameters; y base For output parameters.
3. The intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines according to claim 1 or 2, characterized in that, The establishment of the basic machine learning model includes the following steps: Choose the XGBoost gradient boosting framework and define a loss function that matches the problem; Initialize the model and set the relevant hyperparameter types, including the learning rate and the number of decision trees; Generate a simulated binary classification dataset and divide it into a training set and a test set; Train the model using the training set and adjust and correct the prediction error; Optimize hyperparameters, evaluate model performance using test sets, analyze feature importance, and complete the machine learning modeling process.
4. The intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines according to claim 3, characterized in that, The mathematical expression for the objective function of XGBoost is: In the formula, Θ represents the parameter set of the model; sum_{i=1~n) is the summation of the data; loss is the loss function; y i The true label or target value of the i-th sample in the training set; sum_{k=1~K) represents the summation of all K basis functions in the model; Ω(f k )) is the regularization term.
5. The intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines according to claim 1, characterized in that, The mathematical expression for the domain adaptive model is: y DA =g DA (x) In the formula, g DA For domain adaptation models; x represents the input feature parameters; y base For output parameters.
6. The intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines according to claim 1, characterized in that, The establishment of the domain adaptive model includes the following steps: The model is designed to share features between the source and target domains; Through adversarial training, the model learns to resist differences in data distribution across different domains, making the learned features more adaptable.
7. The intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines according to claim 1, characterized in that, The training of the basic machine learning model is performed according to the following formula: minimizeL ML (f ML ,{(x,y)}); In the formula, Minimize is the optimization objective of the objective function; L ML Represents the machine learning loss function; f ML This represents a machine learning model. The domain adaptive model is performed according to the following formula: minimizeL DA (g DA ,{(x,y)}); In the formula, minimize: indicates the optimization objective; L DA : Represents the domain-adaptive loss function; g DA : Represents a model used for domain adaptation; {(x,y)}: represents the dataset; L ML This represents the loss function of the base model.
8. The intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines according to claim 1, characterized in that, The fusion model y final The mathematical expression is: and final =α·y base +(1-α)·y DA 。 9. A host device, characterized in that, include Memory, used to store computer programs; A processor is configured to implement the intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines as described in any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the intelligent prediction method for brittle failure of hydrogen-blended natural gas pipelines as described in any one of claims 1 to 8.