Generalized zero-shot composite fault diagnosis method, device and system based on counterfactual reasoning

By proposing a generalized zero-sample composite fault diagnosis method based on counterfactual reasoning, this method utilizes generative adversarial networks to decouple fault features and generate counterfactual features. Combining causal theory and supervised learning, it solves the problem of low accuracy in composite fault diagnosis of existing models and achieves high-precision diagnosis of both single and composite faults.

CN120448953BActive Publication Date: 2026-02-03HEFEI GENERAL MACHINERY RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510287310.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2026-02-03
Estimated Expiration
2045-03-12

AI Technical Summary

Technical Problem

Existing composite fault diagnosis models ignore causal relationships when learning the correlation between the original vibration signal and the fault category label, resulting in a lack of interpretability. Furthermore, the accuracy of single fault identification is higher than that of composite fault identification, which affects the final accuracy of composite fault classification.

Method used

A generalized zero-shot composite fault diagnosis method based on counterfactual reasoning is adopted. By using generative adversarial networks to decouple fault features and generate counterfactual data, a structural causal model is constructed in combination with causal theory. Traditional zero-shot learning and supervised learning methods are used to diagnose single and composite faults respectively.

Benefits of technology

It improves the diagnostic accuracy of the model, solves the offset problem between visible and invisible classes, achieves a balance between accuracy for single and compound faults, and enhances the interpretability and classification accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448953B_ABST
    Figure CN120448953B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of fault prediction and computer big data processing, and particularly relates to a generalized zero-shot composite fault diagnosis method, device and system based on counterfactual reasoning. The generalized zero-shot composite fault diagnosis method based on counterfactual reasoning proposed by the present application constructs a two-stage generalized zero-shot composite fault diagnosis model based on counterfactual reasoning. The model firstly points out the internal causal components of fault data from the perspective of causality theory, and then constructs a structural causal model to describe the decoupling and generation of fault features under the guidance of counterfactual reasoning. On this basis, the model improves the generative model by strengthening the discriminator in the first stage to realize the binary classification of single fault and composite fault. In the second stage, the supervised training of the classifier is used to predict the single fault category, and a traditional zero-shot learning method is designed to classify the composite fault. The present application greatly improves the diagnosis accuracy of the model and solves the problem of model diagnosis deviation on visible and invisible classes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of fault prediction and computer big data processing technology, and in particular to a method, apparatus and system for generalized zero-sample composite fault diagnosis based on counterfactual reasoning. Background Technology

[0002] Bearings are core components in complex industrial systems; their failures can shorten equipment lifespan, impact industrial production, and even trigger major safety accidents. Therefore, timely diagnosis and repair of damaged bearings are crucial for ensuring the normal operation of machinery. Composite faults refer to multiple single faults occurring simultaneously within a single bearing, resulting in highly coupled features that are difficult to identify. Thus, composite fault diagnosis has always been a challenge in bearing fault diagnosis. In learning-based fault diagnosis methods, collecting samples of all types of composite faults for model training is impractical due to the exponential growth of composite fault patterns. However, in real-world industrial scenarios, bearings experience both single and composite faults. This necessitates that diagnostic systems utilize relatively easily obtainable single fault samples to train models, enabling the models to effectively identify both single and composite faults simultaneously. This represents a significant challenge in the field of composite fault diagnosis.

[0003] The rapid development of zero-shot learning technology in recent years has become a powerful tool for solving the aforementioned problems. Zero-shot learning is a novel machine learning method that effectively addresses the problem of data scarcity. Its basic idea is to utilize data from known categories, aided by prior knowledge of unseen categories (i.e., the semantic attributes of category labels), to train a learning model to classify unseen categories. Therefore, using a fault diagnosis method based on zero-shot learning only requires a single fault (i.e., the known category) as training data, supplemented by prior semantics of composite faults (i.e., the unseen category), ultimately allowing the model to be transferred to the task of diagnosing composite faults.

[0004] Zero-shot learning (ZSP) is still in its early stages of application in the field of complex fault diagnosis. Its main types include attribute-based ZSP, embedding-based ZSP, and generative model-based ZSP. Attribute-based ZSP methods allow an attribute classifier to learn the mapping between a single fault and an attribute, and then use the attribute classifier to infer the category of the complex fault based on the attribute prediction using Bayes' theorem. Embedding-based ZSP methods fit the mapping relationship between samples and attributes through various training functions, thereby obtaining a predictive model that can transfer from single faults to complex faults. Generative model-based ZSP methods, given prior semantics, combine noise to generate complex fault samples to train the classifier, transforming ZSP into traditional supervised learning. Furthermore, for the generalized ZSP task of complex fault diagnosis, in our previous work, we input the prior semantics constructed by the semantic-feature embedding module into a contrastive embedding generative adversarial network to generate pseudo-complex fault samples, assisting single fault samples in training an adaptive smoothing module, enabling it to predict the categories of both single and complex faults.

[0005] However, the above-mentioned composite fault diagnosis method based on zero-shot learning still has the following two problems that need to be improved:

[0006] 1) Existing composite fault diagnosis models learn the correlation between the original vibration signal and the fault category label, but ignore the causal relationship. This may lead to statistical correlation, but does not conform to objective causal laws, so the model lacks interpretability.

[0007] 2) Existing methods sometimes achieve higher accuracy in identifying single faults than in identifying composite faults. This is because the model lacks composite fault samples and generates composite fault features solely from prior composite fault semantics. This leads to a bias in the distribution of composite fault features towards the known data distribution of single faults, affecting the final classification accuracy of composite faults. Summary of the Invention

[0008] To overcome the shortcomings of existing zero-shot learning-based composite fault diagnosis methods in terms of low accuracy in diagnosing composite faults, this invention proposes a generalized zero-shot composite fault diagnosis method based on counterfactual reasoning. Based on counterfactual reasoning, a generative adversarial network is designed to decouple fault features and generate counterfactual information, thereby addressing the problem of pseudo-composite faults biased towards single fault distributions in an interpretable manner. Then, for separate single and composite faults, their respective advantageous methods are used to fully realize the generalized zero-shot composite fault diagnosis task.

[0009] This invention proposes a generalized zero-shot composite fault diagnosis method based on counterfactual reasoning. First, a first-order training model is trained on a labeled single-fault dataset. The first-order training model includes: a feature extractor that extracts fault features from input samples; a semantic alignment network that extracts semantic features from input samples and maps these semantic features to a fault feature space; and a generative adversarial network that combines fault features and semantic features to output reconstructed features. During the training phase, a single fault category is identified based on the reconstructed features and semantic features. During the testing phase, a classifier is set up at the backend of the generative adversarial network to construct a first-order test model, which identifies whether the fault is a single fault or a composite fault based on the reconstructed features.

[0010] The generative adversarial network of the first-order training model outputs reconstructed features based on the non-causal features and semantic features obtained by encoding; the generative adversarial network of the first-order training model outputs reconstructed features based on random noise and semantic features, thus forming the second-order training model; the second-order training model is trained on a labeled single fault dataset, and then a feature extractor is extracted from the second-order training model and combined with a classifier to form a single fault diagnosis model for diagnosing a single fault type; the feature extractor, semantic alignment network and generative adversarial network are extracted from the second-order training model and combined with a classifier to form a composite fault diagnosis model for diagnosing composite fault types.

[0011] The sample to be diagnosed is first input into the first-order test model. If it is identified as a single fault, the single fault type is diagnosed through the single fault diagnosis model; if the sample to be diagnosed is a compound fault, the compound fault type is diagnosed through the compound fault diagnosis model.

[0012] The preferred method for training a first-order training model is as follows:

[0013] Single fault training samples are extracted from a labeled single fault dataset and input into a first-order training model. The first-order training model determines the single fault type based on the reconstructed features output by the generative adversarial network at the end. The loss function is then calculated to update the first-order training model.

[0014] When the number of updates to the first-order training model reaches a set value, the first-order training model is replaced so that it can determine whether the input sample is a single fault or a compound fault based on the reconstructed features.

[0015] Repeat the above steps until the first-order test model converges.

[0016] Preferably, the end of the first-order training model includes a discriminator and a comparator. The discriminator determines whether the input sample is a single fault based on the reconstructed features and semantic features. The comparator extracts hidden layer features from the discriminator and matches them with the semantic features.

[0017] During the training of the first-order training model, a pre-trained classifier is used to determine a single fault type based on fault features, in order to calculate the feature loss and update the feature extractor; during training, semantic alignment loss L is also incorporated. SCont Feature alignment loss L Dist The semantic alignment network is updated by summing the results; the encoder and generator in the generative adversarial network are updated by combining the generative adversarial loss; and the discriminative loss (LD) is combined with the discriminative loss. dc And comparison loss LC dc The sum updates the discriminator and comparator.

[0018] The preferred training methods for single fault diagnosis models and composite fault diagnosis models are as follows:

[0019] First, single fault test samples and compound fault test samples are classified using a first-order test model; the true single fault type of the single fault test sample is obtained as the label; for the compound fault test sample, the fault combination is obtained through semantic parsing as the compound fault label.

[0020] A second-order training model is constructed and trained using a labeled single-fault dataset.

[0021] When the number of updates to the second-order training model reaches a set value, a single fault diagnosis model and a composite fault diagnosis model are constructed.

[0022] Validate the single fault diagnosis model on labeled single fault test samples, and validate the accuracy of the composite fault diagnosis model on labeled composite fault test samples.

[0023] Repeat the training of the second-order training model and the validation of the single fault diagnosis model and the composite fault diagnosis model until the single fault diagnosis model and the composite fault diagnosis model converge.

[0024] The preferred method for constructing a composite fault diagnosis model is as follows:

[0025] The composite fault test samples were processed using a second-order training model to obtain the third dataset {(reconstructed features)}. Fault f u ), composite fault label y u};

[0026] Let the third classifier be used on the third dataset. The model is trained until convergence. Then, a feature extractor, semantic alignment network, and generator are extracted from the second-order trained model and combined with a third classifier to form a composite fault diagnosis model.

[0027] Preferably, the method for obtaining composite fault labels for composite fault samples through semantic parsing is as follows:

[0028] First, obtain the prior semantics of a single fault sample of the same type;

[0029] Extract the semantics of composite fault samples and extract the combination of single fault types corresponding to the prior semantics contained therein as composite fault labels.

[0030] Preferred:

[0031]

[0032] Where, τ a The temperature coefficient represents the semantic alignment loss, where s is the semantic feature of the input sample; s + The semantic features of positive samples Let M be the semantic features of the m-th negative sample; M is the number of negative samples. This represents the approximate fault features obtained by mapping semantic features to the fault feature space. The expectation of the L2 norm of the difference between the fault characteristic f and the fault characteristic f.

[0033] Preferred:

[0034]

[0035] Where, τ d This represents the temperature coefficient of the contrast loss of the hidden layer of the discriminator D, where d is a hidden layer feature; d + To calculate LD dc Hidden layer features of positive samples at time, d q - Indicates the calculation of LD dc The hidden layer features of the q-th negative sample at time t; Q is the value used to calculate the LD. dc The number of negative samples at time; s d + To calculate LC dc The semantic features of positive samples at that time. To calculate LD dc The semantic features of the nth negative sample at time n, where N is the number of samples used to calculate LC. dc The number of negative samples at that time.

[0036] This invention proposes a generalized zero-sample composite fault diagnosis system based on counterfactual reasoning, comprising:

[0037] The input module is used to acquire the sample to be diagnosed.

[0038] The classification module stores a first-order test model internally. The classification module is connected to the input module and uses the first-order test model to identify whether the sample to be diagnosed has a single fault or a compound fault.

[0039] The single fault identification module stores a single fault diagnosis model internally. The single fault identification module is connected to the input module and the classification module respectively. The single fault diagnosis model is used to diagnose the single fault type of the sample to be diagnosed that is determined to be a single fault by the classification module.

[0040] The composite fault identification module stores a composite fault diagnosis model internally. The composite fault identification module is connected to the input module and the classification module respectively. The composite fault diagnosis model is used to diagnose the composite fault type of the sample to be diagnosed that is determined to be a composite fault by the classification module.

[0041] The output module is connected to both the single fault identification module and the composite fault identification module; the output module is used to output the fault diagnosis results of the sample to be diagnosed.

[0042] The present invention proposes a storage medium storing a computer program, which, when executed, is used to implement the generalized zero-sample composite fault diagnosis method based on counterfactual reasoning.

[0043] The advantages of this invention are:

[0044] (1) The present invention proposes a generalized zero-shot composite fault diagnosis method based on counterfactual reasoning, which constructs a two-stage generalized zero-shot composite fault diagnosis model based on counterfactual reasoning. This model first identifies the inherent causal components of fault data from a causal theory perspective, and then constructs a structural causal model to describe the decoupling and generation of fault features guided by counterfactual reasoning. Based on this, the proposed model improves the generative model by strengthening the discriminator in the first stage to achieve binary classification of single and composite faults. In the second stage, supervised training of the classifier is used to predict the single fault category, while a traditional zero-shot learning method is designed to classify composite faults. This invention significantly improves the diagnostic accuracy of the model and solves the problem of model bias in visible and invisible classes.

[0045] (2) In the first stage, under the theoretical framework of counterfactual reasoning, the fault features are decoupled and counterfactual fault features are generated, and on this basis, accurate binary classification boundaries for single faults and compound faults are obtained; in the second stage, compound fault identification based on traditional zero-shot learning and single fault identification based on supervised learning are carried out respectively; a balance between the accuracy of single fault diagnosis and compound fault diagnosis is achieved.

[0046] (3) This invention constructs a structural causal model for composite fault diagnosis to describe the generation and reasoning process of counterfactual fault features. It designs a generative adversarial network to decouple non-causal features from fault features and combines composite fault semantics to generate counterfactual fault features that can fit the distribution of real data, providing a high-quality classification boundary for the classifier, balancing the classification accuracy of single faults and composite faults, and improving the interpretability and accuracy of the model.

[0047] (4) In the model training process, the present invention introduces a comparator into the generative adversarial network to enhance the discriminator’s hierarchical attention to fault semantics, thereby constraining the generative adversarial module to better decouple causal and non-causal fault feature subsets from fault features, thereby improving the generation quality of counterfactual fault features.

[0048] (5) This invention proposes a generalized zero-sample composite fault diagnosis model based on counterfactual reasoning from the perspective of counterfactual generation and reasoning. This model is trained under supervised training on single fault data and can be generalized to the diagnosis tasks of single and composite faults. The proposed model generates counterfactual fault features by decoupling and intervening in fault features, realizing the model's focus on causal features-labels and alleviating the prediction gap between single and composite faults.

[0049] (6) This invention significantly reduces equipment maintenance costs in scenarios where composite fault samples are scarce. The generalized zero-sample composite fault diagnosis system and storage medium based on counterfactual reasoning proposed in this invention provide a carrier for the generalized zero-sample composite fault diagnosis method based on counterfactual reasoning proposed in this invention, facilitating the application of this diagnostic method. Attached Figure Description

[0050] Figure 1 Here is a flowchart of a generalized zero-sample composite fault diagnosis method based on counterfactual reasoning;

[0051] Figure 2 This is a diagram of the structure of a first-order training model;

[0052] Figure 3 This is a diagram of the first-order test model structure.

[0053] Figure 4 This is a diagram of the structure of a second-order training model;

[0054] Figure 5 This is a structural diagram of the fault diagnosis model;

[0055] Figure 6 Test accuracy under different numbers of training samples;

[0056] Figure 7Let be the confusion matrix of the classification results; where (a) corresponds to experimental task A, (b) corresponds to experimental task B, (c) corresponds to experimental task C, and (d) corresponds to experimental task D.

[0057] Figure 8 The results of the ablation analysis of the model;

[0058] Figure 9 To compare the experimental results. Detailed Implementation

[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0060] Reference Figure 1 The training method for the generalized zero-sample composite fault diagnosis model based on counterfactual reasoning proposed in this embodiment includes the following steps S1-S9.

[0061] S1. First, construct a single fault dataset. The single fault dataset is used to store vibration signals labeled with a single fault type. It is also called a labeled single fault dataset.

[0062] S2. Construct a first-order training model, including: a feature extractor, a semantic alignment network, an encoder E, a generator G, a discriminator D, and a comparator C; the encoder E and the generator G constitute a generative adversarial network.

[0063] Reference Figure 2 The feature extractor is used to extract fault features f from the vibration signal of the input sample x. The semantic alignment network generates semantic features s based on the semantics a of the input sample x, and maps the semantic features s to the fault feature space to form approximate fault features. Encoder E generates non-causal feature z based on fault feature f and semantic feature s, and generator G obtains reconstructed features based on z and s. Identify network D based on Identification with s Is it the output of the generator G or the output of the feature extractor? The comparator C extracts hidden layer features d from the discriminator network D, matches them with s, and outputs the matching value.

[0064] The semantics of vibration signals are extracted using preset rules to obtain semantics 'a'. Specifically, the characteristics of vibration signals in different dimensions can be observed, and then statistical features are extracted to form the semantics of the vibration signals. In practice, prior semantics can be extracted for different vibration signals first, so that for the same vibration signal, the prior semantics can be directly called as its semantics 'a'. For example, in the following embodiment, 28 statistical features of vibration signals are first defined, and then for each type of single fault sample, its 28 statistical features are extracted to form prior semantics.

[0065] S3. Extract single-fault training samples from the labeled single-fault dataset and input them into the first-order training model, and calculate the feature loss L for each sample. c semantic loss L s Generate adversarial loss L VAEGAN and identification loss L dc According to the feature loss L c Update the feature extractor based on the semantic loss L s Update the semantic alignment network based on the generative adversarial loss L. VAEGAN Update the encoder E and generator G networks according to the discrimination loss L. dc Update discriminator D and comparator C.

[0066]

[0067] Among them, y i It is the actual label corresponding to the fault signal; p i The fault label y is obtained by inputting the feature f into an existing classifier. i The corresponding predicted probability; n is the number of fault categories;

[0068] L s =L SCont +L Dist

[0069]

[0070] Among them, L SCont τ represents the semantic alignment loss. a The temperature coefficient representing the semantic alignment loss is s, where s is the semantic feature of the input sample; in calculating L... SCont At that time, a sample is randomly selected from the single fault training samples as a positive sample, and single fault training samples belonging to a different category from the positive sample are used as negative samples; + It is to calculate L SCont The semantic features s of the specified positive samples, It is to calculate L SCont The semantic features s of the m-th negative sample specified at time; M is the semantic feature s of the calculation L SCont The number of negative samples at that time;

[0071] L Dist Indicates feature alignment loss; Representing approximate fault characteristics The expectation of the L2 norm of the difference between the fault characteristic f and the fault characteristic f;

[0072]

[0073] Where KL represents the Kullback-Leibler divergence, p(z|s) is the prior distribution with distribution N(0,1), λ is the set penalty coefficient, and f′ is the sum of f and λ. Random sampling; E[*] represents the expectation of the * distribution; E E(f,s) [*] represents the expected value of * calculated from the data distribution output by E(f,s); D(f,s) represents the output of the discriminator when the inputs are f and s, i.e., the probability that f is identified as an extracted feature; This indicates that the discriminator is at input. The output at time s, i.e. The probability of being identified as a feature to be extracted; Represents the gradient. This represents the gradient of the discriminator D when the inputs are f′ and s;

[0074] L dc =LD dc +LC dc

[0075]

[0076] Where, τ d This represents the temperature coefficient of the contrast loss of the hidden layer in the discriminator D, where d is the hidden layer feature. T It is the transpose of d;

[0077] LD dc To identify the loss; in calculating LD dc At that time, a sample is randomly selected from the single fault training samples as a positive sample, and single fault training samples belonging to a different category from the positive sample are used as negative samples; d + Indicates the calculation of LD dc The hidden layer features d and d' of the specified positive samples. q - Indicates the calculation of LD dc The hidden layer feature d of the specified q-th negative sample; Q is the value used to calculate the LD. dc The number of negative samples at that time;

[0078] LC dc To compare losses; in calculating LC dcAt that time, a sample is randomly selected from the single fault training samples as a positive sample, and single fault training samples belonging to a different category from the positive sample are used as negative samples; d + To calculate LC dc The semantic features s of the specified positive sample. To calculate LC dc The semantic features s of the nth negative sample specified at time; N is the number of samples used to calculate LC. dc The number of negative samples at that time;

[0079] C(d,s d + This indicates that comparator C operates on inputs d and s. d + Output at time To represent comparator C with inputs d and Output at that time.

[0080] Specifically, in step S3, N1 single-fault training samples are extracted from the single-fault dataset, and their set is denoted as X0 = {(x1,y1), (x2,y2), (x3,y3), ..., (x...}. k ,y k ), ..., (x N1 ,y N1 The set of labels for N1 single-fault training samples is denoted as Y1 = {y}; k |1≤k≤N1};y k ∈Y, where Y represents a set of single fault labels;

[0081] Let L be calculated SCont When drawing positive samples x i1 If ∈X0, then the set of negative samples is denoted as {x}. m |1≤m≤M},x m ∈X0, and y m ∈Y1-y i1 ;y i1 For x i1 The fault label, y m For x m Fault labels;

[0082] Let LD be calculated dc When drawing positive samples x i2 If ∈X0, then the set of negative samples is denoted as {x}. q |1≤q≤Q},x q ∈X0, and y q ∈Y1-y i2 ;y i2 For x i2 Fault label; y q For xq Fault labels;

[0083] Let LC be calculated dc When drawing positive samples x i3 If ∈X0, then the set of negative samples is denoted as {x}. n |1≤n≤N},x n ∈X0, and y n ∈Y1-y i3 ;y i3 For x i3 Fault label; y n For x n The fault label.

[0084] S4. Repeat step S3 above until the number of updates of the first-order training model reaches the set first threshold. Then, extract the feature extractor, semantic alignment network, encoder E and generator G from the first-order training model and combine them with the first classifier to form the first-order test model.

[0085] Reference Figure 3 In the first-order test model, the feature extractor is used to extract the fault features f of the input sample x, and the semantic alignment network generates semantic features s based on the semantics a of the vibration signal x, and maps the semantic features s to the fault feature space to form approximate fault features. Encoder E generates non-causal feature z based on fault feature f and semantic feature s, and generator G obtains reconstructed features based on z and s. The first classifier is based on reconstructed features. Determine whether the input sample is a single fault feature sample or a composite fault feature sample.

[0086] Specifically, in step S4, the first classifier first enters the dataset. The model is trained first, and then a first-order test model is introduced. That is, the construction of the first-order test model in step S4 can be divided into the following steps:

[0087] S41. Process the samples extracted from the single fault dataset using a first-order training model to extract the reconstructed features output by the generator G. The dataset consists of a single fault label y for each sample.

[0088] S42, Let the first classifier in the dataset The training continues until convergence, and the loss function can specifically be cross-entropy loss.

[0089] S43. Extract the feature extractor, semantic alignment network, encoder E and generator G from the first-order training model and combine them with the first classifier to form a first-order test model.

[0090] S5. Input the mixed unlabeled single fault samples and unlabeled composite fault samples into the first-order test model, and determine whether the classification accuracy of the first-order test model has converged; if not, return to step S3; if yes, proceed to step S6.

[0091] Unlabeled single fault samples can be obtained from a single fault dataset X S Obtain unlabeled composite fault samples from the composite fault dataset X U get.

[0092] The condition for the first-order test model to converge in classification accuracy is: the range of the most recent k1 classification accuracies is less than the set floating error value.

[0093] S6. Based on the first-order training model, replace the non-causal feature z of the generator G input with random noise to form a second-order training model.

[0094] Reference Figure 4 In the second-order training model, the feature extractor is used to extract the fault features f of the input sample x, and the semantic alignment network generates semantic features s based on the semantics a of the vibration signal x, and maps the semantic features s to the fault feature space to form approximate fault features. The generator G obtains reconstructed features based on random noise z and semantic features s. Identify network D based on Identification with s Is it the output of the generator G or the output of the feature extractor? The comparator C extracts hidden layer features d from the discriminator network D, matches them with s, and outputs the matching value.

[0095] S7. Train the second-order training model using a labeled single-fault dataset. Specifically, extract training samples from the labeled single-fault dataset and input them into the second-order training model. Calculate the feature loss L during training. c semantic loss L s Generate adversarial loss L VAEGAN and identification loss L dc According to the feature loss L c Update the feature extractor based on the semantic loss L s Update the semantic alignment network based on the generative adversarial loss L. VAEGAN Update encoder E and production network G, based on discrimination loss L. dc Update discriminator D and comparator C;

[0096] It is worth noting that the generator G in the second-order training model takes random noise z and semantic features s as input; therefore, the generative adversarial loss L in S7... VAEGAN The following formula is used for calculation:

[0097]

[0098] Where KL represents the Kullback-Leibler divergence, p(z|s) is the prior distribution with distribution N(0,1), λ is the set penalty coefficient, and f′ is the sum of f and λ. Random sampling; E[*] represents the expectation of the * distribution; E z [*] represents the expected value of * calculated from the data distribution of the random noise z output; D(f,s) represents the output of the discriminator when the inputs are f and s, that is, the probability that f is identified as the extracted feature; This indicates that the discriminator is at input. The output at time s, i.e. The probability of being identified as a feature to be extracted; Represents the gradient. This represents the gradient of the discriminator D when the inputs are f′ and s.

[0099] S8. Repeat step S7 until the number of training iterations of the second-order training model reaches the set second threshold. Then, extract the feature extractor and the second classifier from the second-order training model to form a single fault diagnosis model, and extract the semantic alignment network, feature extractor, generator G and third classifier from the second-order training model to form a composite fault diagnosis model.

[0100] Reference Figure 5 In a single fault diagnosis model, the feature extractor extracts the fault features f of the input sample. s The second classifier is based on the fault feature f s Determine a single fault type;

[0101] In the composite fault diagnosis model, the feature extractor extracts the fault features f of the input sample. u The semantic alignment module is based on the composite fault semantics of the input sample. j Output semantic features s j The generator G is based on semantic features s j Reconstructing features from random noise z-output The second classifier is based on fault characteristics f u and reconstructed features Determine the composite fault type of the input sample.

[0102] S9. Obtain samples identified as single fault types by the first-order test model as single fault test samples, and obtain samples identified as composite fault types by the first-order test model as composite fault test samples.

[0103] Input a single fault test sample into a single fault diagnosis model; calculate the accuracy of the single fault diagnosis model by combining the true label of the single fault test sample; determine whether the accuracy of the single fault diagnosis model has converged; if yes, fix the single fault diagnosis model; if no, return to step S7.

[0104] For the composite fault test samples, semantics are extracted according to the set rules, and the semantics are parsed to obtain composite fault labels; then the composite fault test samples are input into the composite fault diagnosis model; the accuracy of the composite fault diagnosis model is calculated by combining the true labels of the composite fault test samples; it is determined whether the accuracy of the composite fault diagnosis model has converged; if yes, the composite fault diagnosis model is fixed; otherwise, the process returns to step S7.

[0105] Specifically, in this implementation method, the prior semantics of various single fault samples are first obtained. Then, statistical features are extracted for composite fault test samples to construct composite fault semantics. The composite fault semantics are decomposed into a superposition of prior semantics. The combination of single fault types corresponding to the prior semantics that form the composite fault semantics is obtained as the composite fault type corresponding to the composite fault semantics. That is, the composite fault type is the composite fault label of the composite fault test sample.

[0106] In step S8, both the second and third classifiers need to be trained.

[0107] After the second-order training model reaches the second threshold in step S8, a single fault diagnosis model is constructed by combining the following steps:

[0108] S81. The samples extracted from the single fault dataset are processed using a second-order training model to extract the reconstructed features output by the generator G. The second dataset is formed by the fault label y of the sample.

[0109] S82, Let the second classifier be used in the second dataset. The training continues until convergence, and the loss function can specifically be cross-entropy loss.

[0110] S83. The feature extractor and the second classifier are combined from the second-order training model to form a single fault diagnosis model.

[0111] After the second-order training model in step S8 has reached the set number of training iterations, a composite fault diagnosis model is constructed by combining the following steps:

[0112] S84. Filter composite fault samples using a first-order test model. Extract the semantics of the composite fault samples according to set rules, denoted as composite fault semantics. Decompose the composite fault semantics to obtain combinations of single fault semantics obtained through linear superposition. Use the combination of single fault types corresponding to the single fault semantics as the composite fault label for the composite fault semantics, thus obtaining the composite fault test sample {(composite fault sample x)}. u Composite fault semantics a j ); Composite fault type y u};

[0113] S85. The second-order training model is used to process the composite fault test samples to obtain the third dataset. in, In the second-order training model, the generator G is used for composite fault samples x. u The output reconstructed features, f u For the feature extractor in the second-order training model targeting composite fault samples x u Output fault characteristics;

[0114] S86, Let the third classifier be used in the third dataset. The training continues until convergence, and the loss function can specifically be cross-entropy loss.

[0115] S87. Extract the semantic alignment network, feature extractor, generator G and third classifier from the second-order training model to form a composite fault diagnosis model.

[0116] As can be seen, the generalized zero-sample composite fault diagnosis model based on counterfactual reasoning proposed in this invention includes two stages and three sub-models:

[0117] Sub-model 1 is the first-order test model in the first stage, used to perform binary classification on the samples to be diagnosed, to determine whether they are a single fault category or a compound fault category.

[0118] Sub-models 2 and 3 constitute the second stage;

[0119] Sub-model 2 is a single fault diagnosis model, used to diagnose a single fault type in a single fault sample;

[0120] Sub-model 3 is a composite fault diagnosis model, used to diagnose the composite fault types of composite fault samples.

[0121] The generalized zero-sample composite fault diagnosis method based on counterfactual reasoning proposed in this invention includes the following steps:

[0122] St1, first obtain the first-order test model, the single fault diagnosis model, and the composite fault diagnosis model;

[0123] St2, input the sample to be diagnosed into the first-order test model and determine whether the sample to be diagnosed is a single fault sample or a compound fault sample.

[0124] If the sample to be diagnosed is a single fault, the fault type is diagnosed through the single fault diagnosis model.

[0125] If the sample to be diagnosed is a composite fault, the fault type is diagnosed through the composite fault diagnosis model.

[0126] The above method is verified in conjunction with specific embodiments below.

[0127] In this embodiment, an experimental platform was built and experiments were designed to collect vibration signal data of faulty bearings. The experimental platform includes an AC variable frequency motor and a shaft system consisting of a front bearing, bearing housing, radial load bearing, and the faulty bearing. An accelerometer is mounted on the bearing housing, with a sampling frequency of 51.2 kHz, a load of 0 HP, and a rotational speed of 1500 rpm; the sampling duration for each type of fault sample is 10 seconds. The collected data comes from healthy bearings, three types of single faults, and four types of composite faults. Healthy bearings are identified as H. The three types of single faults are inner ring fault (IF), outer ring fault (OF), and roller fault (BF). The four types of composite faults are inner ring & outer ring fault (IOF), inner ring & roller fault (IBF), outer ring & roller fault (OBF), and inner ring & outer ring & roller fault (IOBF).

[0128] In this embodiment, a step size of 500 and a window length of 2048 were used to obtain 1000 samples of various fault types.

[0129] In this embodiment, Sacc (classification accuracy for visible classes, i.e., single fault classes) and Uacc (classification accuracy for invisible classes, i.e., composite fault classes) are used to evaluate the model's prediction accuracy for single and composite faults, respectively, and the harmonic mean accuracy Hacc is used to balance the model's performance in classifying single and composite faults.

[0130]

[0131] As shown in Table 1, this embodiment sets up 4 groups of experiments. As the number of training samples for each type increases from 100 to 400, the number of test samples for each type remains at 400.

[0132] In this embodiment, when training the model of the present invention, in the first stage, the first-order training model is trained 50 times per round, that is, the first threshold is set to 50. In the second stage, the second-order training model is trained 125 times per round, that is, the second threshold is set to 125.

[0133] Table 1: Experimental Task Settings

[0134]

[0135] That is, Task A means that the training dataset contains four types of single fault samples: H, IF, OF, and BF, with 100 samples in each type; the test dataset contains eight types of fault samples: H, IF, OF, BF, IOF, IBF, OBF, and IOBF, with 400 samples in each type. Experiments B, C, and D follow the same pattern.

[0136] During model training, the labeled single fault datasets in steps S3 and S7 are the training datasets, and the unlabeled single fault samples and unlabeled composite fault samples in step S5 come from the test set; in step S9, the samples in the test set are classified using a first-order test model to obtain single fault test samples and composite fault test samples.

[0137] To balance the randomness of the results, each experiment was run 5 times and the average was taken. Figure 6 The average results of each group of experiments are presented, from Figure 6 It can be observed that as the number of training samples increases, the classification accuracy of the model gradually improves, with the Hacc consistently exceeding 70%. Furthermore, when the number of training samples reaches 400, the harmonic mean accuracy reaches 87.4%. In this method, the accuracy of single fault prediction depends on the appropriateness of the binary classification of single and compound faults in the first-order test model. Experimental results show that the single fault classification accuracy consistently remains around 90%, indicating that the first-order test model can effectively identify the boundary between single and compound faults. In addition, compound faults rely on the model proposed in the second stage to achieve zero-shot learning training and testing, achieving a best accuracy of 83.14% in the experiments. Therefore, this invention can effectively distinguish between single and compound faults and achieve high accuracy under their respective advantages, relaxing the model's requirements on the types of test samples and improving the model's generalization ability.

[0138] In this embodiment, a confusion matrix of the classification results for the four tasks is also plotted to illustrate the test results in detail, as shown below. Figure 7 As shown in the diagram, the vertical axis of the matrix represents the true category, and the horizontal axis represents the predicted category. Taking the confusion matrix of the classification results for Task D as an example, the diagnostic method performs well in predicting single faults, with only a slight probability of misidentifying healthy and single faults as composite faults. The method performs slightly worse in predicting composite faults, with a 0.17 probability of misidentifying IOF-type faults as IF faults. This is due to the binary classification prediction loss of the first-stage model. Furthermore, there is a 0.27 probability of misidentifying IOBF-type faults as IOF-type faults, which is due to the prediction loss of the second-stage model. This may be because the existing model structure cannot avoid the most complex composite fault, IOBF, which is coupled with three types of faults, from being confused with other composite fault classes.

[0139] To verify the improvement effect of the model structure and counterfactual reasoning method of this invention on the baseline model VAEGAN (Generative Adversarial Network) in the generalized zero-shot composite diagnostic task, this embodiment tests the baseline model VAEGAN, VAEGAN+Ldc, and the model of this invention on experimental task D. The experimental results are as follows: Figure 8 As shown.

[0140] The baseline model VAEGAN performs binary classification of single faults and compound faults during the first stage of training. In the second stage, it combines the classification results from the first stage to diagnose the specific fault type of the sample, namely the specific single fault type and the specific compound fault type.

[0141] VAEGAN+Ldc adds a discriminator and a comparator during training, compared to the baseline model VAEGAN.

[0142] from Figure 8 As can be seen, the baseline model has a Hacc of 62.69%, with a significantly higher accuracy in identifying single faults than in identifying compound faults. This is due to the inherent domain drift problem in generalized zero-shot learning. The Hacc of VAEGAN+Ldc is improved by 14.76%, which is attributed to the strong supervision effect of the discriminator D in the decoupling generation of VAEs. The proposed model shows a significant improvement over both models, with a particularly significant improvement in the accuracy of compound fault prediction. This is attributed to the ability to distinguish between single and compound faults under the action of counterfactual reasoning, and to achieve accurate prediction under their respective advantageous diagnostic methods. As a result, the proposed model performs best in the generalized zero-shot compound fault diagnosis task, with a maximum Hacc of 87.40%.

[0143] To verify the performance advantages of the model of this invention, this embodiment compares the diagnostic method of this invention with four existing GZSL models: ZSML, LDS-IFD, CE-GZSL, and PREE. Table 2 provides a detailed description of the four existing models. To ensure a fair comparison, the training and test sets for each model are identical, and the same features and semantics are used for training and testing. Each experiment is repeated five times, and the average value is taken. The experimental results are as follows: Figure 9 As shown.

[0144] Table 2: Model Description

[0145]

[0146] In the four sets of experiments, the test accuracy of each model increased with the increase in the number of training samples. Specifically, ZSML had the lowest prediction accuracy. Analysis of the model and experiments showed that ZSML relies on a large number of meta-tasks to adjust the model parameters, but only four health / single fault types were available for training in this experiment, which severely limited ZSML's performance. Although LDS-IFD showed a slight improvement over ZSML, the results were still not good, because the number of training samples limited the dimension of fault semantics. CE-GZSL performed relatively well on the four tasks because the model uses instance-level contrastive supervision and class-level contrastive supervision to train the embedding space, which alleviated the domain drift problem to some extent. PREE performed the best among the four existing models, with the highest accuracy reaching 76.42%. This was due to the improved feature extraction method and the use of SAMC-loss to adjust intra-class consistency and inter-class differences, thereby improving the quality of feature representation.

[0147] In comparison, the model of this invention outperforms four existing models in all four sets of experiments. For example, in experimental task D, the prediction accuracy is 10.98% higher than that of the PREE model. It can be seen that the model of this invention can better diagnose compound fault categories and better balance the diagnosis results of single faults and compound faults compared with existing models. While further improving the model's diagnostic accuracy, it also solves the problem of model drift in the visible class domain.

[0148] Of course, those skilled in the art will recognize that the present invention is not limited to the details of the exemplary embodiments described above, but also includes the same or similar structures that can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0149] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

[0150] The technologies, shapes, and structures not described in detail in this invention are all known technologies.

Claims

1. A generalized zero-sample composite fault diagnosis method based on counterfactual reasoning, characterized in that, First, a first-order training model is trained on a labeled single-fault dataset. The first-order training model includes: a feature extractor that extracts fault features from the input samples, a semantic alignment network that extracts semantic features from the input samples and maps the semantic features to the fault feature space, and a generative adversarial network consisting of an encoder and a generator. The encoder generates non-causal features based on the fault features and semantic features, and the generator obtains reconstructed features based on the non-causal features and semantic features. During the training phase, a single fault category is identified based on the reconstructed features and semantic features. During the testing phase, a classifier is set up at the back end of the generative adversarial network to build a first-order test model, which identifies whether it is a single fault or a compound fault based on the reconstructed features. The generative adversarial network of the first-order training model reconstructs features based on the non-causal features and semantic features obtained by encoding. Based on the first-order training model, the generator of the generative adversarial network reconstructs features based on random noise and semantic features to form a second-order training model. The second-order training model is trained on a labeled single fault dataset. Then, a feature extractor is extracted from the second-order training model and combined with a classifier to form a single fault diagnosis model for diagnosing a single fault type. A feature extractor, a semantic alignment network, and a generative adversarial network are extracted from the second-order training model and combined with a classifier to form a composite fault diagnosis model for diagnosing composite fault types. The sample to be diagnosed is first input into the first-order test model. If it is identified as a single fault, the single fault type is diagnosed through the single fault diagnosis model; if the sample to be diagnosed is a compound fault, the compound fault type is diagnosed through the compound fault diagnosis model. A single fault dataset is used to store vibration signals of bearings labeled with a single fault type; it is also known as a labeled single fault dataset.

2. The generalized zero-sample composite fault diagnosis method based on counterfactual reasoning as described in claim 1, characterized in that, The training method for the first-order training model is as follows: Single fault training samples are extracted from a labeled single fault dataset and input into a first-order training model. The first-order training model determines the single fault type based on the reconstructed features output by the generative adversarial network at the end. The loss function is then calculated to update the first-order training model. When the number of updates to the first-order training model reaches a set value, the first-order training model is replaced so that it can determine whether the input sample is a single fault or a compound fault based on the reconstructed features. Repeat the above steps until the first-order test model converges.

3. The generalized zero-sample composite fault diagnosis method based on counterfactual reasoning as described in claim 2, characterized in that, The end of the first-order training model includes a discriminator and a comparator. The discriminator determines whether the input sample is a single fault based on the reconstructed features and semantic features. The comparator extracts hidden layer features from the discriminator and matches them with semantic features; During the training of the first-order training model, a pre-trained classifier is used to determine a single fault type based on fault features in order to calculate feature loss and update the feature extractor. During training, semantic alignment loss is also incorporated. Feature alignment loss The summation update the semantic alignment network; the generative adversarial loss is combined to update the encoder and generator in the generative adversarial network; and the discriminative loss is combined. And comparison loss The sum updates the discriminator and comparator.

4. The generalized zero-sample composite fault diagnosis method based on counterfactual reasoning as described in claim 3, characterized in that, The training methods for single fault diagnosis models and composite fault diagnosis models are as follows: First, single fault test samples and compound fault test samples are classified using a first-order test model; the true single fault type of the single fault test sample is obtained as the label; for the compound fault test sample, the fault combination is obtained through semantic parsing as the compound fault label. A second-order training model is constructed and trained using a labeled single-fault dataset. When the number of updates to the second-order training model reaches a set value, a single fault diagnosis model and a composite fault diagnosis model are constructed. Validate the single fault diagnosis model on labeled single fault test samples, and validate the accuracy of the composite fault diagnosis model on labeled composite fault test samples. Repeat the training of the second-order training model and the validation of the single fault diagnosis model and the composite fault diagnosis model until the single fault diagnosis model and the composite fault diagnosis model converge.

5. The generalized zero-sample composite fault diagnosis method based on counterfactual reasoning as described in claim 4, characterized in that, The method for constructing a composite fault diagnosis model is as follows: The third dataset is obtained by processing the composite fault test samples using a second-order training model. ), composite fault label }; Let the third classifier be used in the third dataset { ), The model is trained until convergence. Then, a feature extractor, semantic alignment network, and generator are extracted from the second-order trained model and combined with a third classifier to form a composite fault diagnosis model.

6. The generalized zero-sample composite fault diagnosis method based on counterfactual reasoning as described in claim 4, characterized in that, The method for obtaining composite fault labels for composite fault samples through semantic parsing is as follows: First, obtain the prior semantics of a single fault sample of the same type; Extract the semantics of composite fault samples and extract the combination of single fault types corresponding to the prior semantics contained therein as composite fault labels.

7. The generalized zero-sample composite fault diagnosis method based on counterfactual reasoning as described in claim 3, characterized in that: in, τ a The temperature coefficient represents the semantic alignment loss, where s is the semantic feature of the input sample; s + The semantic features of positive samples Let M be the semantic features of the m-th negative sample; M is the number of negative samples. This represents the approximate fault features obtained by mapping semantic features to the fault feature space. The expectation of the L2 norm of the difference between the fault characteristic f and the fault characteristic f.

8. The generalized zero-sample composite fault diagnosis method based on counterfactual reasoning as described in claim 3, characterized in that: in, τ d This represents the temperature coefficient of the contrast loss of the hidden layer of the discriminator D, where d is a hidden layer feature; d + For calculation Hidden layer features of positive samples at time, d q - Indicates calculation The hidden layer features of the q-th negative sample at time t; Q is the value used to calculate... The number of negative samples at that time; For calculation The semantic features of positive samples at that time. For calculation The semantic features of the nth negative sample at time n, where N is the number of calculations. The number of negative samples at that time.

9. A system applicable to the generalized zero-sample composite fault diagnosis method based on counterfactual reasoning as described in any one of claims 1-8, characterized in that, include: The input module is used to acquire the sample to be diagnosed. The classification module internally stores a first-order test model; The classification module is connected to the input module and uses a first-order test model to identify whether the sample to be diagnosed is a single fault or a compound fault. A single fault identification module, which internally stores a single fault diagnosis model; The single fault identification module is connected to the input module and the classification module respectively. The single fault diagnosis model is used to diagnose the single fault type of the sample to be diagnosed that is determined to be a single fault by the classification module. The composite fault identification module stores a composite fault diagnosis model internally. The composite fault identification module is connected to the input module and the classification module respectively. The composite fault diagnosis model is used to diagnose the composite fault type of the sample to be diagnosed that is determined to be a composite fault by the classification module. The output module is connected to both the single fault identification module and the composite fault identification module; the output module is used to output the fault diagnosis results of the sample to be diagnosed.

10. A storage medium, characterized in that, The system contains a computer program that, when executed, implements the generalized zero-sample composite fault diagnosis method based on counterfactual reasoning as described in any one of claims 1-8.