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.