Fault diagnosis method, device, electronic equipment and storage medium

Through the combination of extractor and classifier, the field differences and category imbalance of training data in equipment fault diagnosis are solved, accurate fault diagnosis is achieved, and prediction effect is improved.

CN115062685BActive Publication Date: 2024-12-06SHENZHEN RES INST OF BEIJING UNIV OF POSTS & TELECOMM +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210475187.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2024-12-06
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

In the prior art, the equipment fault diagnosis model has poor prediction effect due to field differences in training data and unbalanced data categories, making it difficult to accurately diagnose equipment faults.

Method used

Feature extractor is used to extract the features of the source domain and target domain data, combine the tag classifier and domain classifier, and establish a fault diagnosis model through oversampling and domain adaptive methods to solve the problem of field differences in training data and data category imbalance.

Benefits of technology

Through the decoupling idea, combining oversampling and domain adaptive methods can accurately diagnose equipment failures, improving the accuracy and reliability of predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115062685B_ABST
    Figure CN115062685B_ABST
Patent Text Reader

Abstract

The present invention discloses a fault diagnosis method, device, electronic device and storage medium, which include: using a feature extractor to extract source domain features of source domain data and target domain features of target domain data; determining a first label classification loss of a label classifier based on the source domain features and determining a domain classification loss of a domain classifier based on the source domain features and the target domain features; updating the feature extractor, the label classifier and the domain classifier based on the first label classification loss and the domain classification loss; oversampling the source domain data into class-balanced data and initializing the label classifier, and using a feature extractor module to extract feature information of the class-balanced data; determining a second label classification loss of the label classifier based on the feature information; updating the label classifier based on the second label classification loss to obtain a trained label classifier module; and establishing a fault diagnosis model based on the feature extractor, the label classifier module and the domain classifier to determine the fault classification of the first device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of analysis, and in particular to a fault diagnosis method, device, electronic equipment and storage medium. Background Art

[0002] Currently, there are many methods for fault diagnosis using machine learning and deep learning models. These methods generally input the sensor signals of the equipment into the machine learning model or neural network for training, and then use the trained model to classify the fault conditions.

[0003] In practical applications, it is often impossible to directly obtain labeled data for the device under the same working conditions that can be used for model training. Generally, the model can only be established through labeled data of the device under other working conditions or other similar devices. However, there are often distribution differences between the labeled data obtained in this way and the data of the device under diagnosis, resulting in poor results in predicting the data of the device under diagnosis based on the model.

[0004] In addition, when collecting working data of the equipment to be diagnosed, since the equipment to be diagnosed is generally in normal working condition and the probability of failure is relatively low, the amount of normal data and fault data collected is quite different, and there is an imbalance in data categories. The imbalance in training data categories will cause the artificial intelligence model to have deviations when predicting the fault category, making the prediction result biased towards the normal category. Therefore, there is an urgent need for an intelligent fault diagnosis method that can overcome the above-mentioned defects of training data. Summary of the invention

[0005] In order to solve the technical problem that the equipment fault cannot be accurately diagnosed due to the inability to properly train the training data in the prior art, the present invention provides a fault diagnosis method, comprising the following steps:

[0006] Using a feature extractor to extract source domain features of source domain data and target domain features of target domain data;

[0007] determining a first label classification loss of a label classifier based on the source domain features, and determining a domain classification loss of a domain classifier based on the source domain features and the target domain features;

[0008] updating the feature extractor, the label classifier, and the domain classifier based on the first label classification loss and the domain classification loss;

[0009] Oversampling the source domain data into class-balanced data and initializing the label classifier, and using the updated feature extractor module to extract feature information of the class-balanced data;

[0010] Determine a second label classification loss of the initialized label classifier based on the feature information;

[0011] Updating the initialized label classifier based on the second label classification loss to obtain a trained label classifier module;

[0012] A fault diagnosis model is established based on the updated feature extractor, the trained label classifier module, and the updated domain classifier to determine a fault classification of the first device.

[0013] In some embodiments, the method further comprises:

[0014] Target domain data from the first device and source domain data from the second device are acquired.

[0015] In some embodiments, determining a first label classification loss of a label classifier based on the source domain feature includes:

[0016] Inputting the source domain feature into the label classifier to obtain a first label classification probability;

[0017] The first label classification loss is determined based on the first label classification probability.

[0018] In some embodiments, the label classifier stores the following label classification probability calculation formula:

[0019]

[0020] in, is the first label classification probability, C is the total number of fault categories, c is the fault category, is the output of the label classifier for the source domain sample i in category c.

[0021] In some embodiments, determining the first label classification loss based on the first label classification probability includes:

[0022] The first label classification loss is determined based on the first label classification probability according to the following expression:

[0023]

[0024] Among them, L ce is the first label classification loss, N is the number of samples i, y ic As a symbolic function, when sample i belongs to category c, y ic Take 1, when sample i does not belong to category c, y ic Take 0.

[0025] In some embodiments, determining the domain classification loss of a domain classifier based on the source domain features and the target domain features includes:

[0026] The source domain features and the target domain features are input into the domain classifier, and the domain classification probability is obtained based on the following expression:

[0027] p d =1 / (1+e -x ),

[0028] Among them, p d is the domain classification probability, and x is the output of the domain classifier;

[0029] The domain classification loss is determined based on the domain classification probability.

[0030] In some embodiments, determining the domain classification loss based on the domain classification probability comprises:

[0031] The domain classification loss is determined based on the domain classification probability according to the following expression:

[0032] L d =-(y d *log(p d )+(1-y d )*log(1-p d )),

[0033] Among them, L d is the domain classification loss, y d is the domain true label, the source domain data is marked as 1, and the target domain data is marked as 0.

[0034] In some embodiments, determining a second label classification loss of the initialized label classifier based on the feature information includes:

[0035] Inputting the feature information into the initialized label classifier module to obtain a second label classification probability;

[0036] The second label classification loss is determined based on the second label classification probability.

[0037] The present invention also provides a fault diagnosis device, which comprises:

[0038] An extraction module, used for extracting source domain features of source domain data and target domain features of target domain data using a feature extractor;

[0039] A first determination module is used to determine a first label classification loss of a label classifier based on the source domain feature, and to determine a domain classification loss of a domain classifier based on the source domain feature and the target domain feature;

[0040] A first updating module, configured to update the feature extractor, the label classifier, and the domain classifier based on the first label classification loss and the domain classification loss;

[0041] An oversampling module, used to oversample the source domain data into class-balanced data and initialize the label classifier, and use the updated feature extractor module to extract feature information of the class-balanced data;

[0042] A second determination module, used to determine a second label classification loss of the initialized label classifier based on the feature information;

[0043] A second updating module, used to update the initialized label classifier based on the second label classification loss to obtain a trained label classifier module;

[0044] The third determination module is used to establish a fault diagnosis model based on the updated feature extractor, the trained label classifier module and the updated domain classifier to determine the fault classification of the first device.

[0045] The present invention further provides an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the fault diagnosis method as described above is executed.

[0046] The present invention also provides a storage medium, the computer program stored in the storage medium can be executed by one or more processors and can be used to implement the fault diagnosis method as described above.

[0047] Compared with the prior art, one or more embodiments of the above scheme may have the following advantages or beneficial effects:

[0048] The present invention comprehensively considers the problems of domain differences and data category imbalance in training data, combines oversampling and domain adaptation methods using a decoupling approach, and properly trains the training data, which can accurately diagnose equipment failures. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The scope of the present disclosure may be better understood by reading the following detailed description of exemplary embodiments in conjunction with the accompanying drawings. The drawings included are:

[0050] Figure 1 A flow chart of a fault diagnosis method according to an embodiment of the present invention is shown;

[0051] Figure 2 A flow chart of a fault diagnosis method according to an embodiment of the present invention is shown;

[0052] Figure 3 A flow chart of a fault diagnosis method according to an embodiment of the present invention is shown;

[0053] Figure 4 A flow chart of a fault diagnosis method according to an embodiment of the present invention is shown;

[0054] Figure 5 A flow chart of a fault diagnosis method according to an embodiment of the present invention is shown;

[0055] Figure 6 A schematic diagram of the structure of a fault diagnosis device according to an embodiment of the present invention is shown;

[0056] Figure 7 A schematic diagram of the structure of a fault diagnosis electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.

[0058] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0059] If similar descriptions of "first / second / third" appear in the application documents, the following description is added. In the following description, the terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.

[0061] Embodiment 1

[0062] In response to the technical problem of the inability to accurately diagnose equipment failures due to the inability to obtain suitable training data in the prior art, one solution is to use some constraints to enhance the robustness of the domain adaptation method. However, this solution can only solve the problem that the device to be diagnosed is different from similar devices, that is, it can only consider the domain adaptation problem, and cannot consider the situation where device differences and unbalanced categories of collected data coexist. Another solution is to simply combine resampling or cost-sensitive methods with domain adaptation and apply them. However, this solution does not consider the impact of resampling or cost-sensitive methods on the domain invariant features extracted by the domain adaptation method, and therefore reduces the effectiveness of fault diagnosis.

[0063] Based on the problems existing in the related art, this embodiment provides a fault diagnosis method, which is applied to an electronic device, which may be a computer, a mobile terminal, etc. The functions implemented by the fault diagnosis method provided by the embodiment of the present invention can be implemented by calling a program code by a processor of the electronic device, wherein the program code can be stored in a computer storage medium. Figure 1 A schematic diagram of a fault diagnosis method according to an embodiment of the present invention is shown in FIG. Figure 1 As shown, the following steps are included.

[0064] S10: Use a feature extractor to extract source domain features of source domain data and target domain features of target domain data.

[0065] Specifically, the feature extractor is a convolutional neural network composed of multiple one-dimensional convolutional layers and one-dimensional maximum pooling layers. The input data is convolved in the convolutional layer and dimensionally reduced in the maximum pooling layer to extract effective features.

[0066] Optionally, before step S10, the method may further include: acquiring target domain data from the first device and source domain data from the second device.

[0067] The first device may be a device to be diagnosed, and the second device may be a device for training a model.

[0068] S20: Determine a first label classification loss of a label classifier based on the source domain features, and determine a domain classification loss of a domain classifier based on the source domain features and the target domain features.

[0069] Specifically, the label classifier is a fully connected neural network composed of multiple fully connected layers stacked together. The data is mapped into an output vector with a length of the number of categories through the fully connected neural network; the domain classifier is a fully connected neural network composed of a gradient reversal layer and multiple fully connected layers stacked together. During feature extraction, the data is mapped into an output value with a length of 1 through the fully connected neural network.

[0070] In some embodiments, determining a first label classification loss of a label classifier based on the source domain feature includes:

[0071] Inputting the source domain feature into the label classifier to obtain a first label classification probability;

[0072] The first label classification loss is determined based on the first label classification probability.

[0073] Specifically, the label classifier stores the following label classification probability calculation formula:

[0074]

[0075] in, is the first label classification probability, C is the total number of fault categories, c is the fault category, is the output of the label classifier for the source domain sample i in category c;

[0076] The first label classification loss is determined based on the first label classification probability according to the following expression:

[0077]

[0078] Among them, L ce is the first label classification loss, N is the number of samples i, y ic As a symbolic function, when sample i belongs to category c, y ic Take 1, when sample i does not belong to category c, y ic Take 0.

[0079] In some embodiments, determining the domain classification loss of a domain classifier based on the source domain features and the target domain features includes:

[0080] The source domain features and the target domain features are input into the domain classifier, and the domain classification probability is obtained based on the following expression:

[0081] p d =1 / (1+e -x ),

[0082] Among them, p d is the domain classification probability, and x is the output of the domain classifier;

[0083] The domain classification loss is determined based on the domain classification probability according to the following expression:

[0084] L d =-(y d *log(p d )+(1-y d)*log(1-p d )),

[0085] Among them, L d is the domain classification loss, y d is the domain true label, the source domain data is marked as 1, and the target domain data is marked as 0.

[0086] S30: updating the feature extractor, the label classifier, and the domain classifier based on the first label classification loss and the domain classification loss.

[0087] S40: Oversampling the source domain data into class-balanced data and initializing the label classifier, and using the updated feature extractor module to extract feature information of the class-balanced data.

[0088] S50: Determine a second label classification loss of the initialized label classifier based on the feature information.

[0089] In some embodiments, step S50 includes:

[0090] Inputting the feature information into the initialized label classifier module to obtain a second label classification probability;

[0091] The second label classification loss is determined based on the second label classification probability.

[0092] S60: Update the initialized label classifier based on the second label classification loss to obtain a trained label classifier module.

[0093] S70: Establishing a fault diagnosis model based on the updated feature extractor, the trained label classifier module, and the updated domain classifier to determine a fault classification of the first device.

[0094] Based on this, the fault diagnosis method disclosed in the present invention comprehensively considers the problems of domain differences and data category imbalance in training data, uses a decoupling idea to combine oversampling and domain adaptation methods, and properly trains the training data to accurately diagnose equipment faults.

[0095] Embodiment 2

[0096] like Figure 2As shown, the present invention discloses a method for fault diagnosis of industrial equipment under variable working conditions based on a decoupled deep domain adaptive model, which uses a two-stage decoupled training method for model training: in the first stage, the original category imbalanced data of different working conditions are used to learn and extract domain invariant features to solve the distribution difference problem; in the second stage, the label classifier part of the model is relearned using oversampled data of the source domain to solve the prediction deviation caused by the data imbalance problem. The method includes the following seven steps.

[0097] Step 1: Build a feature extractor module to extract domain-invariant features of source domain data and target domain data.

[0098] It should be noted that when extracting domain-invariant features of source domain data and target domain data, the feature extractor module is shared by the two domains (target domain and source domain), that is, the source domain data and the target domain data output domain-invariant features through the same feature extractor module.

[0099] Specifically, the feature extractor module is mainly composed of a stack of one-dimensional convolutional layers and one-dimensional pooling layers to ensure that the module has strong feature extraction capabilities.

[0100] Step 2: Build a label classifier module, input the domain-invariant features of the source domain data extracted in step 1 into the label classifier, output the label classification probability and calculate the label classification loss.

[0101] In step 2, the label classifier module is mainly composed of multiple fully connected layers stacked together, and the softmax layer is used to output the label classification probability. The calculation formula of the softmax layer is:

[0102]

[0103] in, is the first label classification probability, C is the total number of fault categories, c is the fault category, is the output of the label classifier for the source domain sample i in category c.

[0104] The label classification loss is calculated using the cross entropy classification loss method, and its calculation formula is:

[0105]

[0106] Among them, L ce is the first label classification loss, N is the number of samples i, y ic As a symbolic function, when sample i belongs to category c, y ic Take 1, when sample i does not belong to category c, y ic Take 0.

[0107] Specifically, the label classification loss is used to train and update the feature extractor module and the label classifier module to minimize the classification loss of the source domain data.

[0108] Step 3: Build a domain classifier module, annotate the domain-invariant features extracted in step 1 to obtain domain labels, input the domain-invariant features and their domain labels into the domain classifier module, output the domain classification results and calculate the domain classification loss. The domain label indicates whether the domain-invariant feature comes from the source domain or the target domain.

[0109] Specifically, the domain classifier module consists of a gradient reversal layer and multiple fully connected layers, and uses a softmax layer to output the domain classification probability. The structure of the gradient reversal layer is that the output remains unchanged during forward propagation, and the gradient becomes the opposite number after passing through the gradient reversal layer during gradient backpropagation.

[0110] It should be noted that the calculation method of the domain classifier loss is the same as in step 2, both using cross entropy classification loss.

[0111] Step 4: If Figure 3 As shown in the figure, the model is trained in the first stage, the source domain data and the target domain data are input, and the label classification loss and the domain classification loss are calculated through the feature extractor module, the label classifier module and the domain classifier module, and the loss is used to update the module. It should be noted that this stage of training requires multiple iterations.

[0112] Specifically, the feature extractor module is updated using the label classification loss and the domain classification loss; the label classifier is updated using the label classification loss; and the domain classifier module is updated using the domain classification loss.

[0113] Among them, when using the gradient back propagation of the domain classifier loss, the original gradient is used to update the domain classifier, the goal is to minimize the classification loss of the domain classifier, so that the domain classifier classification is more accurate; the reverse gradient is used to update the feature extractor to maximize the classification loss of the domain classifier, so that the domain classifier cannot distinguish whether the input feature comes from the source domain or the target domain. Through training, the model is continuously improved, thereby improving the effect of the feature extractor module in extracting domain-invariant features.

[0114] Step 5: If Figure 4 As shown, the source domain data is oversampled to convert the source domain data into category-balanced data.

[0115] Specifically, the source domain data is synthetically oversampled using a synthetic oversampling algorithm such as SMOTE or SMOTE. The steps of the SMOTE algorithm are as follows:

[0116] Determine the source domain data x s The attributes and parameters of, the sampling rate R%, and the number of nearest neighbors k to be found for each minority class sample;

[0117] Determine the number of samples N required for each minority class sample based on the sampling rate R% syn , where N syn = (int)R / 100;

[0118] For each minority class sample Calculate the Euclidean distance from it to all other samples in this fault category;

[0119] Determine the sample based on the Euclidean distance The k nearest neighbor samples x i1 -x ik ;

[0120] Randomly select one of the k nearest neighbors x ij , synthesize new samples Until the total number of new samples reaches N syn , where random(0,1) is a random function that randomly generates a value from 0 to 1 each time;

[0121] Returns a set of the original sample set and the synthetic sample set, that is, the source domain category balanced data.

[0122] Step 6: Perform the second stage of model training, fix the model parameters of the feature extractor module and the domain classifier module, initialize the model parameters of the label classifier, input the oversampled source domain data (i.e., class-balanced data) into the feature extractor module and the label classifier module, output the classification results and calculate the label classification loss, and use the label classification loss to update the label classifier module in a gradient descent manner. It should be noted that this stage of training also requires multiple iterations.

[0123] Specifically, the model parameters of the label classifier are initialized by random initialization. The label classifier module is trained and updated using the label classification loss to minimize the classification loss of the source domain oversampled data. Since the oversampled data of the source domain no longer generates output through the domain classifier module, its loss does not affect the feature extractor module and the domain classifier module, that is, the oversampling method does not interfere with the extraction of domain invariant features, thus forming a two-stage decoupled training of domain adaptation and oversampling.

[0124] Step 7: If Figure 5 As shown, the trained model is used to classify the faults of the data to be diagnosed in the target domain.

[0125] Specifically, the training process from step 4 to step 6 of the method can be implemented as follows.

[0126] In step 4, the forward propagation process of model training is first performed. The source domain data and the target domain data are input into the feature extractor module to extract the domain-invariant features of the source domain data and the target domain data; the domain-invariant features of the source domain data are input into the label classifier to output the prediction results of the source domain. Combined with the true label of the source domain, the label classification loss L is calculated. y ; Perform domain labeling on the features of the source domain and the target domain.

[0127] Specifically, the source domain feature is labeled as 0, and the target domain feature is labeled as 1. Input domain classifier, output domain classification result, and calculate domain classification loss L in combination with domain true label d ;

[0128] Calculate L y and L d The gradient of L is used for gradient back propagation. y Minimize the target to update the label classifier and feature extractor, with L d Minimize the target domain classifier and maximize L by gradient reversal d , update the feature extractor.

[0129] Specifically, the formulas of each loss function are as follows:

[0130]

[0131] Among them, L ce is the first label classification loss, N is the number of samples i, y ic As a symbolic function, when sample i belongs to category c, y ic Take 1, when sample i does not belong to category c, y ic Take 0.

[0132] L d =-(y d *log(p d )+(1-y d )*log(1-p d )),

[0133] Among them, L d is the domain classification loss, p d is the domain classification probability, y d is the domain true label, the source domain data is marked as 1, and the target domain data is marked as 0.

[0134] L stage1 =L y -λL d ,

[0135] Among them, L stage1is the loss function, and λ is the trade-off coefficient, which is set based on experience to balance the relative size relationship between the two losses.

[0136] Repeat the forward propagation process and the back propagation process many times until the model basically converges, that is, the model is basically inconvenient.

[0137] Then, step five is performed to synthetically oversample the source domain data to obtain source domain oversampled data.

[0138] In step 6, the model parameters of the feature extractor module and the domain classifier module are fixed first, and the model parameters of the label classifier are initialized using the random initialization method. Then the forward propagation process of model training is performed: the source domain oversampled data is input into the feature extractor module to extract the domain invariant features of the source domain oversampled data; the domain invariant features of the source domain oversampled data are input into the label classifier, the prediction results of the source domain oversampled data are output, and the label classification loss L is calculated in combination with the true labels of the source domain oversampled data. y .

[0139] Then through L y Calculate the gradient and perform gradient back propagation. y Minimize the target to update the label classifier. The loss function formula in step 6 is as follows:

[0140] L stage2 =L y .

[0141] Among them, L stage2 is the loss function.

[0142] Based on this, the present invention proposes a method for fault diagnosis of industrial equipment under variable operating conditions based on a decoupled deep domain adaptive model. The method is a two-stage training method. The first stage is to learn the domain invariant features extracted by the domain adaptive method. The second stage is to relearn the label classifier using oversampled data. It can simultaneously consider the imbalance problem of actual fault diagnosis data and the distribution difference problem of variable operating condition data, decouple the extraction of domain invariant features and the relearning of the classifier, and avoid the negative impact between the two methods.

[0143] Embodiment 3

[0144] The invention also provides a fault diagnosis device. Figure 6 FIG. 1 is a schematic diagram of a fault diagnosis device provided by an embodiment of the present invention. Figure 6 As shown, the fault diagnosis device 600 includes the following modules.

[0145] The extraction module 601 is used to extract source domain features of source domain data and target domain features of target domain data using a feature extractor.

[0146] The first determination module 602 is configured to determine a first label classification loss of a label classifier based on the source domain features, and determine a domain classification loss of a domain classifier based on the source domain features and the target domain features.

[0147] The first updating module 603 is used to update the feature extractor, the label classifier and the domain classifier based on the first label classification loss and the domain classification loss.

[0148] The oversampling module 604 is used to oversample the source domain data into class-balanced data and initialize the label classifier, and use the updated feature extractor module to extract feature information of the class-balanced data.

[0149] The second determination module 605 is used to determine a second label classification loss of the initialized label classifier based on the feature information.

[0150] The second updating module 606 is used to update the initialized label classifier based on the second label classification loss to obtain a trained label classifier module.

[0151] The third determination module 607 is used to establish a fault diagnosis model based on the updated feature extractor, the trained label classifier module and the updated domain classifier to determine the fault classification of the first device.

[0152] Based on this, the fault diagnosis device disclosed in the present invention comprehensively considers the problems of domain differences and data category imbalance in training data, uses a decoupling idea to combine oversampling and domain adaptation methods, and properly trains the training data to accurately diagnose equipment faults.

[0153] It should be noted that, in the embodiment of the present invention, if the above-mentioned fault diagnosis method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM, ReadOnly Memory), a magnetic disk or an optical disk. In this way, the embodiment of the present invention is not limited to any specific combination of hardware and software.

[0154] Embodiment 4

[0155] An embodiment of the present invention further provides an electronic device. Figure 7 The following is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 7 As shown, the electronic device 700 includes: a processor 701 , at least one communication bus 702 , a user interface 703 , at least one external communication interface 704 , and a memory 705 .

[0156] The communication bus 702 may be configured to implement connection and communication between these components.

[0157] The user interface 703 may include a display screen, and the external communication interface 704 may include a standard wired interface and a wireless interface. The processor 701 is configured to execute the program of the fault diagnosis method stored in the memory to implement the steps of the fault diagnosis method provided in the above embodiment.

[0158] Embodiment 5

[0159] An embodiment of the present invention further provides a storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps in the fault diagnosis method provided in the above embodiment.

[0160] The description of the above electronic device and storage medium embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the computer device and storage medium embodiments of the present invention, please refer to the description of the method embodiments of the present invention for understanding.

[0161] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present invention, please refer to the description of the method embodiments of the present invention for understanding.

[0162] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present invention, the size of the serial number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. The serial numbers of the above-mentioned embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.

[0163] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0164] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0165] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0166] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0167] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read Only Memory), disks or optical disks, etc. Various media that can store program codes.

[0168] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product, which is stored in a storage medium and includes several instructions for a controller to execute all or part of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.

[0169] The above is only an embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A fault diagnosis method, characterized in that: The method is a method for fault diagnosis of industrial equipment under variable working conditions based on a decoupled deep domain adaptive model, and uses a two-stage decoupled training method for model training: in the first stage, the original category non-balanced data of different working conditions are used to learn and extract domain invariant features to solve the distribution difference problem; The second stage uses the oversampled data of the source domain to relearn the label classifier part of the model to solve the prediction bias caused by data imbalance, including: Using a feature extractor to extract source domain features of source domain data and target domain features of target domain data; determining a first label classification loss of a label classifier based on the source domain features, and determining a domain classification loss of a domain classifier based on the source domain features and the target domain features; The determining a first label classification loss of a label classifier based on the source domain feature comprises: Inputting the source domain feature into the label classifier to obtain a first label classification probability; determining the first label classification loss based on the first label classification probability; The determining the domain classification loss of a domain classifier based on the source domain feature and the target domain feature includes: Inputting the source domain features and the target domain features into the domain classifier to obtain domain classification probability; determining the domain classification loss based on the domain classification probability; updating the feature extractor, the label classifier, and the domain classifier based on the first label classification loss and the domain classification loss; Oversampling the source domain data into class-balanced data and initializing the label classifier, and using the updated feature extractor module to extract feature information of the class-balanced data; Determine a second label classification loss of the initialized label classifier based on the feature information; Updating the initialized label classifier based on the second label classification loss to obtain a trained label classifier module; A fault diagnosis model is established based on the updated feature extractor, the trained label classifier module, and the updated domain classifier to determine a fault classification of the first device.

2. The method according to claim 1, characterized in that The method further comprises: Target domain data from the first device and source domain data from the second device are acquired.

3. The fault diagnosis method according to claim 1, characterized in that: The label classifier stores the following label classification probability calculation formula: in, is the first label classification probability, C is the total number of fault categories, c is the fault category, is the output of the label classifier for the source domain sample i in category c.

4. The fault diagnosis method according to claim 3, characterized in that: The determining the first label classification loss based on the first label classification probability includes: The first label classification loss is determined based on the first label classification probability according to the following expression: Among them, L ce is the first label classification loss, N is the number of samples i, y ic As a symbolic function, when sample i belongs to category c, y ic Take 1, when sample i does not belong to category c, y ic Take 0, is the first label classification probability.

5. The fault diagnosis method according to claim 1, characterized in that: The domain classification probability is obtained based on the following expression: p d =1 / (1+e -x ), Among them, p d is the domain classification probability, and x is the output of the domain classifier.

6. The fault diagnosis method according to claim 5, characterized in that: The determining the domain classification loss based on the domain classification probability comprises: The domain classification loss is determined based on the domain classification probability according to the following expression: L d =-(y d *log(p d )+(1-y d )*log(1-p d )), Among them, L d is the domain classification loss, y d is the domain true label, the source domain data is marked as 1, and the target domain data is marked as 0.

7. The fault diagnosis method according to claim 6, characterized in that: The determining a second label classification loss of the initialized label classifier based on the feature information includes: Inputting the feature information into the initialized label classifier module to obtain a second label classification probability; The second label classification loss is determined based on the second label classification probability.

8. A fault diagnosis device, characterized in that: The device is applicable to a method for fault diagnosis of industrial equipment under variable working conditions based on a decoupled deep domain adaptive model, and uses a two-stage decoupled training method for model training: in the first stage, original category non-balanced data of different working conditions are used to learn and extract domain invariant features to solve the distribution difference problem; The second stage uses the oversampled data of the source domain to relearn the label classifier part of the model to solve the prediction bias caused by data imbalance, including: An extraction module, used for extracting source domain features of source domain data and target domain features of target domain data using a feature extractor; A first determination module is used to determine a first label classification loss of a label classifier based on the source domain feature, and to determine a domain classification loss of a domain classifier based on the source domain feature and the target domain feature; The first determination module is further used to input the source domain feature into the label classifier to obtain a first label classification probability; and determine the first label classification loss based on the first label classification probability; The first determination module is further used to input the source domain feature and the target domain feature into the domain classifier to obtain a domain classification probability; and determine the domain classification loss based on the domain classification probability; a first updating module, configured to update the feature extractor, the label classifier and the domain classifier based on the first label classification loss and the domain classification loss; an oversampling module, configured to oversample the source domain data into class-balanced data and initialize the label classifier, and use the updated feature extractor module to extract feature information of the class-balanced data; A second determination module, used to determine a second label classification loss of the initialized label classifier based on the feature information; A second updating module, used to update the initialized label classifier based on the second label classification loss to obtain a trained label classifier module; The third determination module is used to establish a fault diagnosis model based on the updated feature extractor, the trained label classifier module and the updated domain classifier to determine the fault classification of the first device.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is executed.

10. A storage medium, characterized in that: The computer program stored in the storage medium can be executed by one or more processors and can be used to implement the method according to any one of claims 1 to 7.