Natural gas pipeline multi-working-condition fault diagnosis method and system based on bayesian adversarial attack and single-source domain transfer

By employing Bayesian adversarial attacks and single-source domain transfer techniques, a Bayesian generator, discriminator, and classifier are constructed to generate attack samples and expand the decision boundary. This solves the problem of insufficient model generalization in fault diagnosis under multiple operating conditions of natural gas pipelines, and achieves efficient diagnosis under multiple operating conditions.

WO2025251587A1PCT designated stage Publication Date: 2025-12-11NORTHEAST GASOLINEEUM UNIV

Patent Information

Application Number
PCT/CN2024/140473
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-04
Filing Date
2024-12-19
Publication Date
2025-12-11

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve effective fault diagnosis in natural gas pipelines under various operating conditions, especially in the absence of target domain data. Traditional methods suffer from insufficient model generalization ability and high data dependence.

Method used

We employ a method based on Bayesian adversarial attacks and single-source domain transfer. By alternating training of a Bayesian generator, discriminator, and classifier, we generate attack samples and expand the decision boundary to construct a single-source domain transfer diagnostic model. This reduces the dependence on actual operational data and improves the model's generalization performance.

Benefits of technology

Training the model on a single source domain enables it to generalize and perform tasks in multiple unknown target domains, improving the accuracy and reliability of fault diagnosis for multi-condition natural gas pipelines and enhancing the robustness and adaptability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024140473_11122025_PF_FP_ABST
    Figure CN2024140473_11122025_PF_FP_ABST
Patent Text Reader

Abstract

A natural gas pipeline multi-working-condition fault diagnosis method and system based on Bayesian adversarial attack and single-source domain transfer, relating to the technical field of mechanical fault detection and diagnosis. The core of the method is using the transfer learning technology to solve the problem of insufficient generalization ability of existing deep reasoning models when processing pipeline fault diagnosis tasks under different working conditions. The method mainly comprises the following steps: constructing an attack sample generator on the basis of a Bayesian network, wherein the attack sample generator is used for generating, by adding delicately designed tiny disturbance into an input sample, an attack sample that can cause an reasoning model to make an incorrect decision, so as to mine and analyze a defect of the reasoning model; constructing a domain discriminator on the basis of the Bayesian network, wherein the domain discriminator is used for assist in generating a high-concealment attack sample by means of adversarial learning between the domain discriminator and the generator, that is, there is almost no visible difference between the high-concealment attack sample and an original sample; and constructing a classifier on the basis of the Bayesian network, and by expanding the distance between the attack sample and an original decision boundary of the reasoning model, constraining the posterior distribution of network parameters of the reasoning model to be adjusted towards a higher score of the attack sample, thereby enhancing the adaptability and robustness of the model when facing disturbance in different domains. By means of the steps, the present invention effectively solves the problem of missing reporting and false reporting risk improvement caused by poor generalization ability of traditional deep learning models under different working conditions.
Need to check novelty before this filing date? Find Prior Art

Description

A natural gas pipeline multi-working condition fault diagnosis method and system based on Bayesian adversarial attack and single-source domain migration TECHNICAL FIELD

[0001] The present application relates to a natural gas pipeline multi-working condition fault diagnosis method and system based on Bayesian adversarial attack, relates to the fault diagnosis technology of natural gas pipeline, and belongs to the technical field of mechanical fault detection and diagnosis. BACKGROUND

[0002] Compared with other transportation modes such as highways, railways, waterways and aviation, pipeline transportation has become the preferred tool for natural gas transportation due to its low cost, low loss and large transportation capacity. However, high-pressure natural gas is flammable and explosive, and any damage or leakage of the pipeline during large-scale, long-distance and continuous transportation may cause significant economic losses and even trigger public safety accidents. At present, more than half of the pipelines in China have exceeded the specified service life and are showing serious corrosion, which poses a significant safety hazard. Therefore, in order to ensure the safety and stability of natural gas transportation, it is necessary to comprehensively monitor and monitor the performance of the pipeline and take appropriate maintenance or replacement measures in a timely manner.

[0003] Due to the significant advantages in intelligence and automation, data-driven deep learning models have recently made significant achievements in the field of fault diagnosis. Deep learning models usually assume that the training data and test data satisfy the principle of independent and identical distribution. This means that the data distribution characteristics and rules learned by the model during training should be consistent with the test data in actual application. However, due to changes in pipeline materials, working environment, operating conditions and other factors, the pipeline transportation state usually presents multi-working condition characteristics. The data under different working conditions are significantly different in statistical characteristics, resulting in certain differences in distribution characteristics. For data-driven fault diagnosis models, the difference in distribution under different working conditions means that even if the model is fully trained under a certain working condition, it may still degrade in performance under another working condition. To solve this problem, how to establish a diagnosis model with good generalization ability has very important practical engineering significance. Essentially, the simplest method is to establish multiple diagnosis models for different working conditions, but this will obviously significantly increase the workload and timeliness of diagnosis modeling, and also increase the complexity and cost of model maintenance.

[0004] Currently, using the transfer learning technology to learn and analyze multi-condition data is considered to be a relatively effective strategy. As an advanced cross-domain learning method, transfer learning can effectively utilize the knowledge of the source domain to solve problems in the new domain (target domain) by reducing the differences between different domains. The existing standard transfer learning model requires the source domain and target domain data to be obtained at the same time before training to identify and reduce the distribution difference between the two domains during the training process. However, considering that natural gas pipelines involve confidential information of oilfield energy, once leaked, it will affect national security. Protecting these sensitive information means that it is extremely difficult to obtain target domain data.

[0005] Therefore, it is necessary to provide a single-source domain generalization technology that can train a model on a single source domain and enable it to generalize and perform tasks in multiple unknown target domains. In the prior art, no one has proposed combining Bayesian adversarial attacks and single-source domain transfer to realize multi-condition fault diagnosis of natural gas pipelines. SUMMARY

[0006] The technical problem to be solved by the present application is:

[0007] In view of the deficiencies of the prior art, a natural gas pipeline multi-condition fault diagnosis method and system based on Bayesian adversarial attack and single-source domain transfer are provided to enhance the generalization performance of the diagnosis model by simulating unknown multi-condition data through pseudo-domain, reduce the dependence on actual operation data, improve the precision of the intelligent fault diagnosis model, and realize effective diagnosis of natural gas pipeline multi-condition faults.

[0008] The technical solution adopted by the present application to solve the above technical problems is:

[0009] A natural gas pipeline multi-condition fault diagnosis method based on Bayesian adversarial attack and single-source domain transfer, the method comprising the following steps:

[0010] Step 1: Collect natural gas pipeline monitoring signals and construct a training data set

[0011] Use the natural gas pipeline monitoring system to obtain the pipeline negative pressure wave monitoring signal and the sound wave monitoring signal, and use any domain signal to construct a training set Wherein is the i-th original pipeline sample, is the i-th sample label, N s is the number of samples.

[0012] Step 2: Establish a Bayesian generator to increase domain disturbance by maximizing classification error to ensure the effectiveness of the attack

[0013] In order to stabilize the training of the Bayesian generator and improve the diversity of attack samples, the Bayesian learning method is adopted to marginalize the weights of the generation network to introduce uncertainty. In order to infer the posterior distribution of the generator network parameters, sampling can be performed from the following conditional posterior distribution: p(theta g |x s , theta d , theta c ) proportional to exp(-U attack (theta d , theta c ; x s , theta g )) p(theta g |alpha g ) (1) Wherein, p(theta g |x s , theta d , theta c ) is the posterior distribution of the generator network parameters, p(theta g |alpha g ) is the prior distribution of the generator network parameters; theta g ~ p(theta g ) is the network parameter of the generator g, theta d ~ p(theta d ) is the network parameter of the discriminator d, and theta c ~ p(theta c ) is the network parameter of the classifier c; alpha g is a hyperparameter. U attack (theta d , theta c ; x s , theta g ) is the loss function of the generator, and its specific form is:

[0014] Wherein, G(x s ; theta g ) is the attack sample; J g is the number of small batches of the generator, M is the number of domain labels, and N is the number of category labels; y d,m is the domain label, and y c,n is the fault class label.

[0015] Step 3: Establish a Bayesian discriminator, and through the adversarial learning between the generator and the discriminator, ensure the concealment of the attack In order to infer the posterior distribution of the discriminator network parameters, sampling can be performed from the following conditional posterior distribution: p(theta d |x s , theta g ) proportional to exp(-U discriminate (theta g ; x s , thetad ))p(θ d |α d (3)

[0016] Where p(θ) d |x s ,θ g Let α be the posterior distribution of the discriminator network parameters. d This is a hyperparameter. U discriminate (θ g ;x s ,θ d Let ) be the loss function of the discriminator, and its specific form is:

[0017] Among them, J d This represents the number of samples in the discriminator's mini-batch.

[0018] Step 4: Build a Bayesian classifier. By expanding the decision boundary of the original classifier, it resists attacks and improves generalization.

[0019] The defense strategy designed in this invention consists of two parts. The first part is a classification loss based on cross-entropy, which first requires constructing the joint distribution p(X) of the original sample and the attack sample. s ,Y s ,X a ,Y a Then, optimize the classification loss to accurately identify each sample in the joint distribution, i.e.: p(θ) c |x s ,x a ,θ g )∝exp(-U defense (θ c ))p(θ c |α c (5) Where, p(θ) c |x s ,x a ,θ g α represents the posterior distribution of the classifier network parameters. c This is a hyperparameter. U defense (θ c ) is the loss function of the classifier, and its specific form is:

[0020] in, represent any one sample in the joint distribution. The second part is the margin discrepancy loss. The margin is defined as the minimum distance from the data point to the decision boundary. Using the margin discrepancy loss can expand the distance between the attack sample and the original decision boundary of the classifier, and constrain the posterior distribution of the classifier network parameters to adjust in the direction of higher scores for attack samples, in order to enhance the adaptability and robustness of the model when facing different distribution differences of working conditions. The regularization loss based on the margin discrepancy can be represented as:

[0021] where, and represent the transfer classifier margin and the pre-trained classifier margin related to the attack sample distribution p(X a ), respectively, and f represents the pre-trained classifier. The specific calculation formula of the margin is:

[0022] where ρ c (x a ,y a ) is the decision boundary of the classifier, and its calculation method is:

[0023] where y′ a is the correct classification label given by the classifier for the attack sample x a , and y′ a is the incorrect classification label given by the classifier for the attack sample x a . Φ ρ (ρ c (x a ,y a )) is a piecewise function used to promote the classifier to produce large positive margin values, i.e., to make the score of the correct class as high as possible compared to the scores of other classes. Its specific form is:

[0024] where ρ is the lower bound of the margin.

[0025] Step 5: Estimate the weight posterior distribution using the Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) sampling method

[0026] First, construct a network parameter optimizer based on SGHMC, and then alternately train the Bayesian generator, Bayesian discriminator, and Bayesian classifier.

[0027] Step 6: Obtain a single-source domain transfer diagnosis model to complete the pipe network fault type identification

[0028] Through steps 1-4, the single-source domain transfer diagnosis model is trained, and the model performance is evaluated through the set test data (from pipes with different operating conditions from the training data).

[0029] A natural gas pipeline multi-working condition fault diagnosis system based on Bayesian adversarial attack and single-source domain migration, the system has program modules corresponding to the steps of the technical solution, when running, the steps in the natural gas pipeline multi-working condition fault diagnosis method based on Bayesian adversarial attack and single-source domain migration are executed.

[0030] A computer readable storage medium, the computer readable storage medium stores a computer program, the computer program is configured to be called by a processor to realize the steps of the natural gas pipeline multi-working condition fault diagnosis method based on Bayesian adversarial attack and single-source domain migration.

[0031] A natural gas pipeline multi-working condition fault diagnosis device, the natural gas pipeline multi-working condition fault diagnosis includes at least one processor, and a memory connected with the at least one processor in communication, wherein the memory stores instructions executable by the at least one processor, the instructions are executed by the at least one processor to enable the at least one processor to execute the natural gas pipeline multi-working condition fault diagnosis method based on Bayesian adversarial attack and single-source domain migration, and realize the multi-working condition fault diagnosis of the natural gas pipeline.

[0032] The present application has the following beneficial technical effects:

[0033] The natural gas pipeline multi-working condition fault diagnosis method and system based on Bayesian adversarial attack and single-source domain migration provided by the present application give a single-source domain field generalization technology, which can train a model on a single source domain and make it have the ability to generalize and perform tasks in multiple unknown target domains, greatly improving the recognition accuracy and reliability of natural gas pipeline multi-working condition fault diagnosis in multi-working condition scenes. The present application gives a single-source domain based field generalization strategy in the field self-adaptive algorithm. The strategy can train a model on a single source domain in the case of missing target domain data, and make it have the ability to generalize and perform tasks in multiple unknown target domains.

[0034] The core of the single-source domain generalization algorithm is to extract general features in the source domain samples, while excluding those features that may cause the model to overfit to the specific source domain environment, so as to enhance the robustness of the model. In this process, the present application observes that the attack defense strategy and the domain generalization have essential similarity in principle, and the target is to enhance the robustness of the model when facing unknown and changing conditions. First, unknown target domain data, although sharing the same semantic information with source domain samples, has different distribution, which leads to the diagnostic model trained based on the source domain often misclassifies the target domain data. This phenomenon is similar to the situation that the original sample causes the diagnostic model to misjudge after slight disturbance in the attack scene. Therefore, the first conclusion is obtained: for the diagnostic model, the attack sample and the target domain data both violate the independent and identically distributed assumption. Further, the purpose of single-source domain generalization is to make the diagnostic model perform better in the target domain by eliminating the domain difference, while the defense strategy aims to build a robust diagnostic model that can accurately identify even when facing attacks. Accordingly, the second conclusion is obtained: the defense strategy and the single-source domain generalization both aim to enhance the generalization ability and transferability of the diagnostic model to process the data samples that violate the independent and identically distributed assumption. Therefore, in the training process of the diagnostic model, all the target domain data that are misidentified in the test stage are regarded as attack samples that appear infinitely many times, and these samples weaken the diagnostic performance of the model through domain disturbance. At the same time, the single-source domain generalization reduces the domain difference and improves the diagnostic accuracy, essentially defends this natural attack, thereby enhancing the resistance and generalization ability of the model to unknown changes. In summary, based on the attack defense idea, the present application proposes a natural gas pipeline fault diagnosis model based on Bayesian single-source domain generalization (BSDG), which is used to overcome the small sample challenge.

[0035] The contribution of the present application is that a more general and practical domain adaptation problem is considered, that is, the participation of target domain data is not required in the process of transfer learning, and a new perspective is proposed to handle this general domain generalization problem through attack and defense strategies.The present application is one of the few attempts to apply the attack and defense framework to single-source domain generalization for pipeline fault diagnosis.The algorithm constructs the domain generalization problem as a two-stage adversarial process and solves it through carefully designed attack and defense strategies.This work is expected to stimulate new ideas and open up new paths for research in the field of pipeline fault diagnosis;A Bayesian single-source domain generalization algorithm for natural gas pipeline fault diagnosis is proposed.In the Bayesian inference framework, the algorithm first uses a weight- marginalized generator and discriminator to construct diverse attack samples, aiming to simulate the uncertainty and dynamics of domain bias.Further, the algorithm introduces a defense mechanism based on margin difference, which expands the decision boundary of the source domain model and enhances the resistance to pseudo-target sample domain difference attacks, thereby providing an effective solution to the small sample problem;In order to verify the effectiveness of the proposed BSDG algorithm in small sample natural gas pipeline fault diagnosis, the present application selects a variety of advanced comparative algorithms and carries out detailed comparative analysis from the aspects of diagnosis performance, training stability and significant difference.The experimental results show that the BSDG algorithm exhibits superior performance in handling domain generalization fault diagnosis tasks.

[0036] Compared with the prior art, the present application has the following advantages and effects:

[0037] 1) Unlike traditional intelligent fault diagnosis technology based on deep learning algorithm, the present application mainly focuses on the model performance degradation problem in the multi-working-condition scene which is urgently solved in the field of pipeline fault diagnosis, and provides a targeted solution to improve the accuracy and practicality of the intelligent fault diagnosis model.

[0038] 2) Unlike the multi-working-condition fault diagnosis model constructed based on the standard transfer learning strategy, the present application introduces an attack and defense framework, simulates the weak points of the multi-working-condition target domain explanation fault diagnosis model through generated attack samples, and further designs a defense strategy to improve the model generalization performance at the key point of performance degradation, effectively improves the recognition accuracy of the model in the multi-working-condition scene, and avoids the need for a large amount of operation data.

[0039] 3) The present application establishes a generator, a discriminator and a classifier based on a Bayesian network, introduces uncertainty by marginalizing network parameters, effectively enhances the diversity of attack samples, and better simulates the multi-working-condition distribution in the real world.In addition, the Bayesian network can effectively alleviate the overfitting problem by introducing prior knowledge on the weight and updating it to the posterior distribution, which helps the classifier to adapt to new situations and data changes flexibly.

[0040] 4), considering the actual application of current intelligent fault diagnosis technology, the method has practical application value, and certain application results have been achieved. BRIEF DESCRIPTION OF DRAWINGS

[0041] Fig. 1 is a multi-condition fault diagnosis flowchart according to an embodiment of the present application; Fig. 2 is a network structure diagram of an embodiment of the present application; Fig. 3 is a loss convergence and verification accuracy diagram of an embodiment of the present application; Fig. 4 is a single-source domain field generalization flowchart based on Bayes; and Fig. 5 is a partial photo of an HD-II type console and a pipeline platform. DETAILED DESCRIPTION

[0042] The technical scheme of the present application will be further described below in combination with the accompanying drawings:

[0043] In order for those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the accompanying drawings.

[0044] Fig. 1 is a multi-condition fault diagnosis flowchart based on Bayes attack of a natural gas pipeline in the technical scheme of the present application, and the overall flowchart is realized by programming in Pytorch language.

[0045] In the attack and defense framework, the present application uses Bayes inference and margin difference as key tools, and constructs a single-source domain field generalization model for the natural gas pipeline fault diagnosis task. The BSDG framework is shown in Fig. 4, which includes two stages of attack and defense.

[0046] The present application designs an attack strategy based on Bayesian generative adversarial network (Bayesian Generative Adversarial Networks, BGAN), and the key idea is to generate attack samples with domain disturbance through BGAN, and to improve the success rate of attack by misleading the parameter update direction of the classifier network. Specifically, BGAN is composed of two parts: Bayesian generator (Bayesian Generator) and Bayesian discriminator (Bayesian Discriminator). The generator tries to generate attack samples similar to the source domain samples to deceive the discriminator, while the discriminator tries to improve its ability to identify attack samples. Through this antagonistic process, the generator successfully learns and outputs attack samples that are difficult to distinguish from the source domain samples. The basic framework of the BGAN model comes from Ian Goodfellow et al.

[0013] GAN proposed in 2014. But the optimization goal of the standard GAN is easy to fall into mode collapse, that is, the feedback given by the discriminator cannot fully guide the generator to generate diverse samples, resulting in the generator only tending to focus on generating a few samples.

[0047] To stabilize the BGAN training and improve the diversity of attack samples, the present application adopts a Bayesian learning method, that is, to introduce uncertainty by marginalizing the weights of the generator and discriminator networks. In neural networks, all weights can be characterized by a highly multimodal posterior distribution, rather than a single fixed value as is usually the case. Each mode in the network weight posterior distribution can correspond to a different generator, each with a specific data generation behavior. Therefore, unlike the standard GAN, the BGAN constructs a set of generator networks, effectively enhancing the diversity of attack samples, so that it can more comprehensively and accurately simulate unknown target domains. In addition, the set of discriminator networks can amplify the adversarial signal, further enhancing the recognition ability of the discriminator when facing complex attack scenarios.

[0048] Domain generalization mainly focuses on how to train a diagnostic model using source domain samples so that it can be generalized to any unknown target domain. According to the existing research, domain generalization is mainly divided into single-source domain generalization (SSDG) and multi-source domain generalization (MSDG) settings. In the SSDG setting, the model is trained only on a single source domain and is expected to be generalized to any unknown target domain; in the MSDG setting, the model is trained on multiple source domains and enhances the generalization ability to unknown target domains by improving the adaptability to the distribution difference of multiple source domains. However, the MSDG setting usually requires collecting samples of three or more source domains to improve the generalization performance, which is often difficult to meet in the pipeline fault diagnosis field. Therefore, the present application mainly focuses on the SSDG setting.

[0049] Single-source domain generalization: Unlike the MSDG setting, it can learn the distribution difference between multiple source domains to improve the adaptability of the model. Due to the lack of relevant information of the target domain, the existing research of the SSDG setting mostly focuses on generating diverse pseudo-target domain data using data augmentation techniques. For example, Cugu et al. changed the training set samples by applying consistent visual attention to different views of the same sample to simulate new domains. Su et al. combined global and local position scaling transformations and used saliency information to guide the enhancement process to generate more diverse and informative augmented samples. Zheng et al.

[0010] The standard data augmentation (transform or inverse) concept with learning parameters is conceptualized as a semantic transformation, and the source domain samples are further augmented using semantic transformation. Li et al. use a domain expansion subnetwork to generate multiple domains step by step to simulate various photometric and geometric transformations in unseen domains, thereby expanding the coverage of the source domain. However, existing data augmentation-based domain generalization research lacks a clear definition of pseudo-target domains, often leading to pseudo-domain samples that are too different from real samples (irrelevant) or too similar (no domain difference), thereby affecting the transfer performance and even leading to negative transfer. To solve this problem, the present invention introduces an attack and defense strategy, which defines the path of pseudo-target domain augmentation by using existing attack samples, ensuring that pseudo-domain samples retain relevance to the source domain while introducing sufficient domain differences to simulate potential target domains, thereby improving the generalization ability and transfer performance of the model.

[0050] Bayesian neural network: In a standard neural network, each weight and bias is set to a fixed value. These values are learned and adjusted through an optimization process on the training set. Unlike this, the weights and biases of a Bayesian neural network are treated as probability distributions, and the optimization goal is to estimate the posterior distribution of the weights, which enables it to estimate uncertainty, be robust to overfitting, and resist attacks. However, estimating the posterior distribution of weights is often difficult to implement directly. Current major works focus on techniques such as variational inference, local reparameterization, and Markov chain Monte Carlo. Considering the need for diversity of generated samples, the present invention uses Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) sampling to estimate the posterior distribution of weights, thereby avoiding the influence of KL divergence asymmetry bias on methods such as variational approximation.

[0051] From the analysis of the introduction, all target domain data exhibits the following characteristics: 1) the feature distribution is different from the source domain sample; 2) the semantic information is the same as the source domain sample. This means that although the target domain and the source domain are different in discriminative features, their overall trends and class spaces remain consistent. In view of this characteristic, the present application adopts an adversarial attack similar to the principle of domain adaptation as the research framework. Such attacks deceive the model into making incorrect decisions by adding carefully designed small perturbations to the input samples. The principles of adversarial attack design perturbations include: 1) concealment: the perturbation usually needs to be small enough so that the modified sample has almost no visible difference from the original sample; 2) effectiveness: the perturbation must be effective enough to make the deep learning model make an incorrect classification; 3) transferability: the perturbation should have a certain transferability, meaning that an adversarial sample effective on one model can also mislead on other models; 4) diversity: diverse perturbations can more comprehensively test the model's resistance to various attacks, helping to reveal the model's possible weaknesses and promote the development of more robust models.

[0052] Based on the above description, the present application assumes that there is a set of domains representing available source domains, representing unknown target domains. In the source domain, the sample label pairs in the sample space follow the joint distribution p(X,Y), where X and Y represent samples and labels, respectively. The purpose of domain generalization is to learn a classification model c:X→Y using all the sample label pairs in the source domain. The purpose of the classification model is to generalize to the unknown target domain In order to achieve this goal, the present application designs the BSDG algorithm under the framework of attack and defense strategy.

[0053] The implementation process of the attack strategy of BSDG is as follows. Referring to Figure 1, the natural gas pipeline multi-working condition fault diagnosis method based on Bayesian adversarial attack provided comprises the following steps:

[0054] Step 1: Collect natural gas pipeline monitoring signals and construct a training data set

[0055] Using the natural gas pipeline monitoring system, obtain the pipeline negative pressure wave monitoring signal and the sound wave monitoring signal, and use any domain signal to construct a training set Wherein is the i-th original pipeline sample, is the i-th sample label, N s is the number of samples.

[0056] Step 2: Establish a Bayesian generator to increase domain perturbations by maximizing classification errors to ensure the effectiveness of the attack

[0057] To stabilize the training of the Bayesian generator and improve the diversity of attack samples, this invention employs Bayesian learning to marginalize the weights of the generator network, introducing uncertainty. To infer the posterior distribution of the generator network parameters, samples can be taken from the following conditional posterior distribution: p(θ) g |x s ,θ d ,θ c )∝exp(-U attack (θ d ,θ c |x s ,θ g ))p(θ g |α g (1) Where, p(θ) g |x s ,θ d ,θ c Let p(θ) be the posterior distribution of the generator network parameters. g |α g ) represents the prior distribution of the generator network parameters; θ g ~p(θ) g ) represents the network parameters of the generator g, and θ represents the network parameters of the generator g. d ~p(θ) d ) represents the network parameters of the discriminator d, and θ represents the network parameters of the discriminator d. c ~p(θ) c α represents the network parameters of classifier c; g This is a hyperparameter. U attack (θ d ,θ c |x s ,θ g ) is the loss function of the generator, and its specific form is:

[0058] Wherein G(x) s ;θ g ) is an attack sample; J g y represents the number of mini-batch samples generated, M represents the number of domain labels, and N represents the number of class labels; d,m For the domain label, y c,n This is a fault-related label.

[0059] Step 3: Build a Bayesian discriminator and ensure the stealth of the attack through adversarial learning with the generator. To infer the posterior distribution of the discriminator network parameters, samples can be taken from the following conditional posterior distribution: p(θ) d |x s ,θ g )∝exp(-U discriminate (θ g ;x s ,θd ))p(θ d |α d (3) Where, p(θ) d |x s ,θ g Let α be the posterior distribution of the discriminator network parameters. d This is a hyperparameter. U discriminate (θ g ;x s ,θ d Let ) be the loss function of the discriminator, and its specific form is:

[0060] Among them, J d This represents the number of samples in the discriminator's mini-batch.

[0061] Step 4: Build a Bayesian classifier. By expanding the decision boundary of the original classifier, it resists attacks and improves generalization.

[0062] The defense strategy designed in this invention consists of two parts. The first part is a classification loss based on cross-entropy, which first requires constructing the joint distribution p(X) of the original sample and the attack sample. s ,Y s ,X a ,Y a Then, optimize the classification loss to accurately identify each sample in the joint distribution, i.e.:

[0063] p(θ c |x s ,x a ,θ g )∝exp(-U defense (θ c ))p(θ c |α c (5) Where, p(θ) c |x s ,x a ,θ g α represents the posterior distribution of the classifier network parameters. c This is a hyperparameter. U defense (θ c ) is the loss function of the classifier, and its specific form is:

[0064] in, represent any one sample in the joint distribution. The second part is the margin discrepancy loss. The margin is defined as the minimum distance from the data point to the decision boundary. Using the margin discrepancy loss can expand the distance between the attack sample and the original decision boundary of the classifier, and constrain the posterior distribution of the classifier network parameters to adjust in the direction of higher scores for attack samples, in order to enhance the adaptability and robustness of the model when facing different distribution differences of working conditions. The regularization loss based on the margin discrepancy can be represented as:

[0065] where, and represent the transfer classifier margin and the pre-trained classifier margin related to the attack sample distribution p(X a ), respectively, and f represents the pre-trained classifier. The specific calculation formula of the margin is:

[0066] where ρ c (x a ,y a ) is the decision boundary of the classifier, and its calculation method is:

[0067] where y′ a is the correct classification label given by the classifier for the attack sample x a , and y′ a is the incorrect classification label given by the classifier for the attack sample x a . Φ ρ ( ρc (x a ,y a )) is a piecewise function used to promote the classifier to produce large positive margin values, i.e., to make the score of the correct class as high as possible compared to the scores of other classes. Its specific form is:

[0068] where ρ is the lower bound of the margin.

[0069] Step 5: Estimate the weight posterior distribution using the Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) sampling method

[0070] First, construct a network parameter optimizer based on SGHMC, and then alternately train the Bayesian generator, Bayesian discriminator, and Bayesian classifier.

[0071] Step 6: Obtain a single-source domain transfer diagnosis model to complete the pipe network fault type identification

[0072] Through steps 1-5, the single-source domain transfer diagnosis model is trained, and the model performance is evaluated through the set test data (from a pipeline with different operating conditions from the training data).

[0073] In step 1, the specific process of acquiring the pipeline negative pressure wave monitoring signal and the acoustic wave monitoring signal, and constructing a training set using signals from either domain, is as follows: First, the negative pressure wave monitoring signal and the acoustic wave monitoring signal are acquired from the monitoring system respectively. Then, a sample of length 1024 is obtained through downsampling. The acquired samples are then denoised. Finally, the negative pressure wave signal and the acoustic wave signal are stored in two domains. In step 2, the hyperparameter α... g Based on cross-validation, the relationship between the network parameters of generator g, discriminator d, and classifier c is determined: the discriminator's output is used to adjust the generator's update direction, and the generator's output is used to improve the classifier's generalization performance. In step 3, the hyperparameter α... d The margin lower bound ρ is determined based on cross-validation. In step 4, the margin lower bound ρ is related to the model accuracy and is determined through multiple experiments. In step 5, a Bayesian network parameter optimizer is constructed using the stochastic gradient Hamiltonian Monte Carlo (SGHMC) method to achieve alternating optimization of the generator, discriminator, and classifier. The specific process is as follows:

[0074] Based on the previous iteration process, the parameter θ that needs to be updated now is obtained. g θ d θ c :

[0075] Then begin attacking the training loop:

[0076] Start of SGHMC J g The training iterations, starting from the source domain distribution p(X), are performed. s Sampling J in ) g Source domain samples The posterior distribution p(θ) of the parameters is updated through K iterations of SGHMC. g |x s ,θ d ),

[0077] Bundle Add to the parameter set and end the loop;

[0078] Start of SGHMC J d Training iteration:

[0079] Sampling J from the source domain distribution d Source domain samples The posterior distribution p(θ) of the parameters is updated through K iterations of SGHMC. d |x s ,θ g )

[0080] put into the parameter set end attack training loop;

[0081] start the defense training loop again:

[0082] sample J s enhanced samples from the joint field distribution p(X a , X c ) update the parameter posterior distribution p(θ c | x s , x a , θ g ) through K iterations of SGHMC

[0083] end the defense training loop;

[0084] In the above formula, alpha is the momentum attenuation coefficient of SGHMC, and eta is the learning rate; v=epsilon M -1 r is the kinetic energy term of SGHMC; 2alphaetaI represents the variance. The specific algorithm is as follows:

[0085] Embodiment

[0086] The effectiveness of the method is verified by taking natural gas pipeline fault diagnosis as an example.

[0087] 1. Experimental setup

[0088] The training data used in the application are respectively collected from the pressure sensor in the ZJ-CSDG type pipeline simulation platform and the acoustic wave sensor in the HD-II type pipeline simulation platform. The total length of the ZJ-CSDG type pipeline simulation platform is 180.2m, the flow rate is 10m 3 / h, and the sampling frequency is 1024Hz. The negative pressure wave data is collected under three working pressures, i.e. in the high pressure (High Pressure, HP) domain in the range of 0.565MPa-0.595MPa, in the medium pressure (Medium Pressure, HP) domain in the range of 0.425MPa-0.455MPa, and in the low pressure (Low Pressure, HP) domain in the range of 0.275MPa-0.305MPa. The experimental data under each pressure condition simulates four health conditions of the pipeline by adjusting the valve opening, which are large leakage (Large Leakage), medium leakage (Medium Leakage), small leakage (Small Leakage) and normal (Normal Condition).

[0089] The HD-II type pipeline simulation platform (as shown in FIG. 5) has a total length of 160 m, a pressure of 0.5 Mpa, a flow of 60 m 3 / h, and 10 leakage points. For the fault types of the pipeline, four pipeline health conditions are set, including large leakage (LL), medium leakage (ML), small leakage (SL) and normal (NC). Considering the fault sampling frequency, the length of the intercepted sample needs to contain at least one cycle of the fault frequency, so 1024 sampling points are intercepted from the original signal to form a sample.

[0090] The multi-condition fault diagnosis model is composed of a Bayesian generator, a Bayesian discriminator and a Bayesian classifier, and the network structure is as shown in FIG. 2. In the training process of the multi-condition fault diagnosis model, the total number of iterations is 5000; in each cycle, the number of discriminator training is 10, and the number of generator training is 1; the batch size is 128.

[0091] 2. Diagnosis result evaluation

[0092] In order to comprehensively evaluate the performance of the BSDG algorithm, the present application carries out experiments in the scene of multi-source domain field generalization and single-source domain field generalization.

[0093] 1) Multi-source domain field generalization diagnosis result

[0094] Table 1 shows the multi-source domain field generalization diagnosis result, and it can be found from the table that the BSDG algorithm of the present application significantly outperforms the other seven comparative algorithms. Specifically: ERM, as a comparative algorithm without any domain adaptation operation, although it may show relatively stable performance in a specific task, it does not show satisfactory diagnosis results in the domain generalization task; compared with the optimal domain adaptation algorithm CORAL, the BSDG algorithm has an accuracy improvement of 16.7%. This means that the standard distribution alignment method is difficult to generalize the ability to reduce the distribution difference to any unknown target domain; compared with the optimal domain generalization algorithm SSAA, the BSDG algorithm has an accuracy improvement of 9.7%. On the one hand, the Bayesian neural network effectively improves the diversity and authenticity of the attack samples by constructing a set containing multiple generators; on the other hand, the Bayesian neural network combined with the margin loss effectively resists the domain disturbance contained in the attack samples, expands the decision boundary of the classifier, and further reduces the distribution difference between the attack samples and the source domain samples.

[0095] The performance of the multi-working condition fault diagnosis model of the application can be proved by comparison with the performance of 7 fault diagnosis models, and the experimental results are shown in Tables 1-3. Table 1 shows the multi-source domain generalization diagnosis results. The experimental results show that compared with the optimal comparative algorithm 7, the accuracy of the algorithm of the application is improved by 9.7%. On the one hand, the Bayesian neural network effectively improves the diversity and authenticity of the attack samples by constructing a plurality of generator sets; on the other hand, the Bayesian neural network is combined with the margin loss, effectively resisting the domain disturbance contained in the attack samples, expanding the decision boundary of the classifier, and further reducing the distribution difference between the attack samples and the source domain samples.

[0096] 2) Single-source domain generalization diagnosis results

[0097] Tables 2 and 3 verify the diagnosis performance of the BSDG algorithm and the comparative algorithm in the single-source domain generalization task. Table 2 lists the transfer tasks between three different domains in NPWD. Table 3 records the transfer tasks between different domains in NPWD and AWD. Tables 2 and 3 verify the diagnosis performance of the algorithm of the application and the comparative algorithm in the single-source domain generalization task. Table 2 lists the transfer tasks between three different domains in NPWD. Table 3 records the transfer tasks between different domains in NPWD and AWD. The algorithm of the application achieves the highest accuracy in both task settings. In Table 3, the average accuracy of the BSDG algorithm is 68.56%, which is improved by 27.9% compared with the second-ranked SSAA algorithm. The experimental results show that the introduction of the Bayesian neural network better helps the generator to accurately simulate different unknown target domain features in real scenarios, and the use of the margin difference loss also makes the classifier flexible and effective in dealing with frequent distribution changes, improving the adaptability and robustness of the classifier to various domain disturbances.

[0098] Table 1 Multi-source domain generalization experimental results (%). The best result is marked in bold.

[0099] Table 2 Single-source domain generalization experimental results (negative pressure wave data). The best result is marked in bold.

[0100] Table 3 Single-source domain generalization experimental results (sound wave data and negative pressure wave data). The best result is marked in bold.

[0101] 3. Stability performance evaluation

[0102] To verify the stability of the proposed algorithm, the training loss and validation accuracy of the multi-source domain generalization task (HP+MP+LP)→AW and the single-source domain generalization task HP→LP are recorded by the present application, as shown in FIG. 3. FIG. 3(a) shows that the training loss of the proposed algorithm in the above two tasks decreases rapidly to a very small value in a stable trend. In addition, FIG. 3(b) shows that the validation accuracy of the proposed algorithm can quickly reach a high value during the training process. Therefore, it can be found that the proposed algorithm can stably generalize the diagnostic knowledge of the source domain to the unknown target domain.

[0103] 4. Significance analysis

[0104] To verify the effectiveness of the proposed algorithm in improving the domain generalization effect, the present application performs a paired sample t-test on the results of single-source domain generalization to quantitatively verify the significant improvement brought by the proposed BSDG algorithm compared with the strong contrast algorithm. Paired sample t-test is a parametric statistical method used to compare the average values of results after processing by two algorithms from the same sample group. The steps of the test include: first, calculate the difference in diagnostic results of each sample under the processing of the two algorithms; second, take the average and standard deviation of these differences; then, divide the average of the differences by the standard error to get the t value. Finally, according to the degrees of freedom, calculate the p value in the t distribution table to determine whether there is a statistically significant difference between the average values of the diagnostic results of the two algorithms. If the p value is less than the pre-set significance level, it is considered that there is a significant difference between the average values of the diagnostic results of the two algorithms. According to convention, the present application sets the significance threshold to 0.05, i.e. p≤0.05 means that the BSDG algorithm exhibits significant performance improvement, and p>0.05 means that the performance of the BSDG algorithm is similar to that of the contrast algorithm.

[0105] The experimental results in Table 1, Table 2 and Table 3 are named Case1, Case2 and Case3, respectively. The statistical results show that the performance of the BSDG algorithm is similar to that of the SSAA algorithm only in Case2, and is much better than that of the contrast algorithm in other scenarios.

[0106] Table 4 paired sample t-test significance test

[0107] 1 “+” represents that the performance of the proposed algorithm is significantly better than that of the contrast algorithm, and “-” represents that the performance is similar

[0108] The application provides a novel natural gas pipeline fault diagnosis method based on Bayesian single-source domain field generalization, first, in the non-directional attack stage, through the adversarial learning between the Bayesian generator and the Bayesian discriminator, diversified and smooth disturbance is introduced into the source domain sample, so that the approximate real pseudo target domain sample is constructed, which is used to mislead the decision result of the classifier. Further, in the model defense stage, the margin difference loss is used to expand the distance between the pseudo domain sample and the original decision boundary of the classifier, and then a new decision boundary that can contain all unknown samples is formed. Through the attack and defense strategy, the BSDG algorithm can learn the feature representation with obvious distinguishability and high transferability from the pseudo domain sample, and then effectively generalize to any unknown target domain in the real scene. The experimental results show that, compared with the current advanced method, the BSDG algorithm proposed in the present research has significant performance advantage in the application scene of multi-source domain and single-source domain field generalization.

[0109] In summary, the method proposed in the present application can not only solve the small sample problem in the field of natural gas pipeline fault diagnosis, but also has better diagnosis performance and stability than the existing comparative method, effectively reduces the false alarm and false alarm risk, and improves the pipeline fault diagnosis accuracy. The simulation experiment and practical application of the method described in the present application verify the technical effects and practicality claimed in the present application.

[0110] The simulation experiment and practical application of the method described in the present application verify the technical effects claimed in the present application.

[0111] The algorithm (method) proposed in the present application is the underlying technical kernel of the present application, and various products can be derived based on the algorithm.

[0112] Based on the algorithm (method) proposed in the present application, a natural gas pipeline multi-working-condition fault diagnosis system based on Bayesian adversarial attack and single-source domain transfer is developed by using a program language, the system has program modules corresponding to the steps of the above technical solution, and when running, the steps in the above natural gas pipeline multi-working-condition fault diagnosis method based on Bayesian adversarial attack and single-source domain transfer are executed.

[0113] The computer program of the developed system (software) is stored on a computer readable storage medium, and the computer program is configured to realize the steps of the above natural gas pipeline multi-working-condition fault diagnosis method based on Bayesian adversarial attack and single-source domain transfer when called by a processor. That is, the present application is materialized on a carrier to become a computer program product.

[0114] The natural gas pipeline multi-working condition fault diagnosis device, the seismic information processing device includes at least one processor, and a memory connected with the at least one processor in communication, wherein the memory stores instructions executable by the at least one processor, the instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned natural gas pipeline multi-working condition fault diagnosis method based on Bayesian adversarial attack and single-source domain migration, realize the multi-working condition fault diagnosis of the natural gas pipeline. The natural gas pipeline multi-working condition fault diagnosis device is the terminal product applied in the application.

[0115] Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, specially designed ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0116] Computational procedures (also referred to as programs, software, software applications, or code) in the present application include machine instructions executable by a programmable processor, and can be implemented using a high-level procedural and / or object-oriented programming language, and / or an assembly / machine language. As used in this application, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus and / or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and / or data to a programmable processor.

[0117] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present application. For example, the steps recited in the present application can be executed in parallel, executed in series, or executed in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, which are within the protection scope of the present application.

Claims

1. A natural gas pipeline multi-working condition fault diagnosis method based on Bayesian adversarial attack and single-source domain migration, characterized in that The implementation process is as follows: Step 1: Collect natural gas pipeline monitoring signals and build a training data set: The natural gas pipeline network monitoring system is used to obtain pipeline negative pressure wave monitoring signals and sound wave monitoring signals, and any domain signal is used to construct a training set wherein For the i-th original pipe sample, N is the number of samples; and s N is the number of samples; and Step 2: Establish a Bayesian generator to increase domain disturbance by maximizing classification error to ensure the effectiveness of the attack: A generator is constructed using a Bayesian network, and attack samples are generated by maximizing the class label classification loss and minimizing the domain label discrimination loss. The Bayesian learning method is used to marginalize the weights of the generation network to introduce uncertainty, which is used to stabilize the training of the Bayesian generator and improve the diversity of attack samples. The posterior distribution of the generator network parameters is inferred, and samples are drawn from the following conditional posterior distribution: p(0 g |x s , 0 d , 0 c ) ∝ exp(-U attack (0 d , 0 c |x s , 0 g )) p(0 g | a g ) (1) where p(θ g |x s ,θ d ,θ c ) is the posterior distribution of the generator network parameters, p(θ g |α g ) is the prior distribution of the generator network parameters; θ g ~ p(θ g ) is the network parameters of the generator g, θ d ~ p(θ d ) is the network parameters of the discriminator d, and θ c ~ p(θ c ) is the network parameters of the classifier c; α g is a hyperparameter. U attack (θ d ,θ c |x s ,θ g ) as the loss function of the generator, which is specifically: wherein For attack samples; J g M is the number of generator mini-batch samples, M is the number of domain labels, N is the number of class labels; y d,m For the mthdomain label, y c,n For the nthfault class label; Step 3: Establish a Bayesian discriminator through adversarial learning with the generator to ensure the concealment of the attack: A domain discriminator based on a Bayesian network is established to assist in generating attack samples with strong concealment. The posterior distribution of the discriminator network parameters is inferred, and samples are drawn from the following conditional posterior distribution: p(0 d ) |x s , 0 g ) a exp(-U discriminate (0 g ; x s , 0 d )) p(0 d | a d ) (3) where p(0 | x, 0) is the posterior distribution of the discriminator network parameters, a is a hyperparameter; U(0 | x, 0) is the loss function of the discriminator, which is specifically as follows: d s g d discriminate g s d ​​​​​​​​ where J d is the number of mini-batch samples for the discriminator. Step 4: Establish a Bayesian classifier to resist attacks and improve generalization by expanding the decision boundary of the original classifier: The defense strategy consists of two parts. The first part is the cross-entropy based classification loss. First, the joint distribution p(X s ,Y s ,X a ,Y a ) of the original sample and the attack sample needs to be constructed, and then the classification loss is optimized to accurately identify each sample in the joint distribution, that is: p(0 c |x s ,x a ,0 g ) ∝ exp(-U defense (0 c )) p(0 c |a c ) (5) Where p(θ) c |x s ,x a ,θ g α represents the posterior distribution of the classifier network parameters. c For hyperparameters; U defense (θ c ) is the loss function of the classifier, and its specific form is: wherein, The first part represents any one sample in the joint distribution; the second part is the margin difference loss; the margin is defined as the minimum distance from the data point to the decision boundary. Using the margin difference loss can expand the distance between the attack sample and the original decision boundary of the classifier, and the posterior distribution of the classifier network parameters is adjusted to a higher direction to enhance the adaptability and robustness of the model when facing different distribution differences. The defense strategy based on the margin loss is used to improve the recognition accuracy of the classifier for different working condition samples; and the regular loss based on the margin difference can be represented as: wherein and respectively represent the transfer classifier margin and the pre-trained classifier margin associated with the attack sample distribution p(X a ), f represents the pre-trained classifier; the margin is specifically calculated as follows: where p c (x a ,y a ) is the decision boundary of the classifier, which is computed as: where y' is the correct classification label given by the classifier for the attack sample x a a where y' is the incorrect classification label given by the classifier for the attack sample x a a where y' is the incorrect classification label given by the classifier for the attack sample x ρ c a a is a piecewise function used to promote the classifier to produce large positive margin values, i.e. to make the score for the correct class as high as possible compared to the scores for other classes, and has the specific form: ​​​​​ Where ρ is the lower bound of the margin; Step 5: Use the Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) method to sample and estimate the weight posterior distribution: A Bayesian network parameter optimizer is constructed using the Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) method to realize the alternating optimization of the generator, discriminator, and classifier. First, a network parameter optimizer is constructed based on SGHMC, and then the Bayesian generator, Bayesian discriminator, and Bayesian classifier are trained alternately. Step 6: Obtain a single-source domain transfer diagnosis model to complete the pipeline fault type identification: Through steps 1-5, the single-source domain transfer diagnosis model is trained, and the model performance is evaluated through the set test data, which comes from a pipeline with different operating conditions than the training data.

2. The method according to claim 1, wherein, In step 1, the pipeline negative pressure wave monitoring signal and the acoustic wave monitoring signal are obtained, and the specific process of constructing the training set using any domain signal is as follows: first, the negative pressure wave monitoring signal and the acoustic wave monitoring signal are obtained from the monitoring system, then the length of the sample is 1024 after downsampling operation, and the obtained sample is de-noised, finally the negative pressure wave signal and the acoustic wave signal are stored in two domains.

3. The method according to claim 1 or 2, characterized in that, In step 2, the hyperparameter a g According to cross-validation determination; the relationship of the network parameters of the generator g, the network parameters of the discriminator d, and the network parameters of the classifier c is that the output result of the discriminator is used to adjust the update direction of the generator, and the result of the generator is used to improve the generalization performance of the classifier.

4. The method according to claim 3, wherein, In step 3, the hyperparameter a d Determined according to cross-validation.

5. The method according to claim 4, wherein, In step 4, the lower bound of the margin ρ is related to the model accuracy, which is determined through multiple experiments.

6. The method according to claim 5, wherein, In step 5, a Bayesian network parameter optimizer is constructed using the Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) method to realize the alternating optimization of the generator, discriminator, and classifier.

7. The method according to claim 6, wherein, A Bayesian network parameter optimizer is constructed using the Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) method to realize the alternating optimization of the generator, discriminator, and classifier, and the specific process is as follows: According to the previous round of iteration process to get the current need to update the parameters θ g , θ d , θ c : Then start the attack training loop: J g starting SGHMC s from source domain distribution p(X g ) sample J The parameter posterior distribution p(0 is updated after K iterations of SGHMC g |x s ,θ d ), Put Add to the parameter set, end the loop; J of starting SGHMC d Sub-iteration training: sample J from the source domain distribution d a source domain sample The parameter posterior distribution p(0 is updated after K iterations of SGHMC d |x s ,θ g ) Put Join to the parameter set end attack training loop; Start defense training loop again: From the joint domain distribution p(X) s ,X a Sampling J in ) c One enhanced sample The parameter posterior distribution p(0 is updated after K iterations of SGHMC c |x s ,x a ,θ g ) End defense training loop; In the above equation, a is the momentum decay coefficient of SGHMC, and η is the learning rate; v = εM -1 r is the kinetic term of SGHMC; 2aηI represents the variance.

8. A natural gas pipeline multi-working condition fault diagnosis system based on Bayesian adversarial attack and single-source domain migration, characterized in that: The system has program modules corresponding to the steps of any one of claims 1-7, and when running, the steps of the above-mentioned natural gas pipeline multi-working condition fault diagnosis method based on Bayesian adversarial attack and single source domain migration are executed.

9. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program, and the computer program is configured to realize the steps of the natural gas pipeline multi-working condition fault diagnosis method based on Bayesian adversarial attack and single source domain migration in any one of claims 1-7 when called by the processor.

10. A natural gas pipeline multi-working condition fault diagnosis device, characterized in that: The natural gas pipeline multi-working condition fault diagnosis includes at least one processor and a memory connected with the at least one processor in communication, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the natural gas pipeline multi-working condition fault diagnosis method based on Bayesian adversarial attack and single source domain migration in any one of claims 1-7, and realize the multi-working condition fault diagnosis of the natural gas pipeline.

Citation Information

Patent Citations

  • Transformer fault diagnosis method based on data generation-transfer learning

    CN118070061A

  • Natural gas pipeline multi-working-condition fault diagnosis method and system based on Bayesian adversarial attack and single-source domain migration

    CN118656728A

Cited By

  • Fault diagnosis working condition domain generalization method and system based on working condition irrelevant feature representation

    CN121834479A

  • Marine environment multi-parameter coupling equipment fault diagnosis method

    CN121919434A

  • Fault diagnosis method for online whole-column missing scene reinforcement learning joint optimization

    CN122087595A

  • Cross-process analog integrated circuit parameter reverse design method, device and medium

    CN122088438A

  • Intelligent operation and maintenance platform for gas path system of gas turbine based on digital twinning

    CN122134326A