Fault diagnosis method and device based on partial domain adaptation, storage medium and terminal

By employing a partially domain-adaptive fault diagnosis method, and utilizing a set of trained feature extractors and fault classifiers to obtain the average probability of mechanical faults, the low diagnostic accuracy caused by domain offset is resolved, achieving high-accuracy mechanical fault diagnosis.

CN114743044BActive Publication Date: 2025-11-11SHANGHAI ADVANCED RES INST CHINESE ACADEMY OF SCI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210275089.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-21
Publication Date
2025-11-11
Estimated Expiration
2042-03-21

AI Technical Summary

Technical Problem

Existing adaptive diagnostic methods for mechanical faults suffer from domain offset issues, resulting in low accuracy of diagnostic results.

Method used

A partially domain-adaptive fault diagnosis method is adopted. The feature extractor is used to extract features from the data to be detected through training. The fault probability results are obtained by using the training fault classifier group. The average probability of each fault type is calculated to determine the fault diagnosis result. The feature extractor, domain discriminator, fault classifier group and loss calculator are constructed and trained.

Benefits of technology

It improves the accuracy of mechanical fault diagnosis of the data to be tested. By partially aligning the domain space and enhancing the generalization of fault diagnosis, it is applicable to real-world environments where the target domain label space is a subset of the source domain label space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114743044B_ABST
    Figure CN114743044B_ABST
Patent Text Reader

Abstract

This invention discloses a partially domain-adaptive fault diagnosis method, apparatus, storage medium, and terminal. The method includes: extracting features from the data to be tested using a trained feature extractor to obtain multi-scale feature map data; inputting the multi-scale feature map data into each fault classifier in a trained fault classifier group to obtain the fault probability result output by each classifier; calculating the average probability of all fault types from all fault probability results; and determining the fault diagnosis result of the data to be tested based on the average probability of all fault types. This invention achieves partial domain spatial alignment by weighting the training data in the source domain subset of the training data group; and enhances the generalization of fault diagnosis by introducing multiple fault classifiers and fault capsule layers within the classifiers, thereby improving the accuracy of mechanical fault diagnosis of the data to be tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fault diagnosis technology, and in particular to fault diagnosis methods, devices, storage media, and terminals based on partial domain adaptation. Background Technology

[0002] With the rise of intelligent manufacturing and industry, intelligent machinery fault diagnosis has received increasing attention in recent years. The rapid development of deep learning has driven the field of fault diagnosis, and various deep learning-based intelligent fault diagnosis algorithms have achieved great success. In most current research, it is generally assumed that training and test data have the same distribution. However, in real factory environments, changing operating conditions, diverse noise levels, and different equipment types can all cause this assumption to fail. The inconsistency in the data distribution between the training and test sets is called the neighborhood offset problem.

[0003] To address the challenges of domain offset, domain adaptation algorithms offer a promising solution. They continuously reduce the distributional differences between the source and target domains through mapping, thereby enabling efficient transfer of knowledge from the source domain to the target domain. Existing methods typically focus on aligning the marginal distributions of the source and target domains; however, this alignment method has significant limitations, only applicable when the source and target domains share the same label space. In real-world environments, however, test datasets are unlikely to encompass all fault conditions. In most cases, the label space of the target domain is a subset of the label space of the source domain. Summary of the Invention

[0004] The technical problem to be solved by the present invention is that the existing adaptive diagnosis method for mechanical faults has a domain offset problem, which leads to low accuracy of the diagnosis results.

[0005] To address the aforementioned technical problems, this invention provides a partially domain-adaptive fault diagnosis method, comprising:

[0006] Based on the trained feature extractor, feature extraction is performed on the data to be detected to obtain multi-scale feature map data of the data to be detected.

[0007] The multi-scale feature map data of the data to be detected is input into each fault classifier in the training fault classifier group to obtain the fault probability result output by each fault classifier.

[0008] Calculate the average probability of each fault type in all the fault probability results, and determine the fault diagnosis result of the data to be detected based on the average probability of all fault types.

[0009] Preferably, the acquisition process of the training feature extractor and the training fault classifier group includes:

[0010] A primary fault diagnosis model is constructed, which includes a feature extractor, a domain discriminator, a fault classifier group, and a loss calculator.

[0011] Obtain a set of data to be trained, and group all the data to be trained in the set of data to be trained according to a preset grouping method to obtain multiple groups of data to be trained. The data to be trained in each group of data to be trained is divided into a source domain data subset and a target domain data subset.

[0012] The current basic fault diagnosis model is trained based on the dataset to be trained to obtain a stage fault diagnosis model. It is determined whether the actual training round N is less than the training round threshold. If so, the current stage fault diagnosis model is used as the basic fault diagnosis model, and the actual training round N is incremented by 1. The current basic fault diagnosis model is then retrained based on the dataset to be trained. Otherwise, the current stage fault diagnosis model is used as the training fault diagnosis model, and the feature extractor in the training fault diagnosis model is used as the training feature extractor. The fault classifier group in the training fault diagnosis model is used as the training fault classifier group.

[0013] The initial value of the actual training round N is 1, and when the actual training round N is 1, the current basic fault diagnosis model is a primary fault diagnosis model.

[0014] Preferably, training the current basic fault diagnosis model based on the dataset to be trained to obtain a stage fault diagnosis model includes:

[0015] The Mth group of training data in the dataset to be trained is taken as the input training data group;

[0016] The current temporary fault diagnosis model is trained based on the input training data group to obtain an adjusted fault diagnosis model. It is determined whether M is less than the total number of training data groups. If so, the current adjusted fault diagnosis model is used as a temporary fault diagnosis model, M is incremented by 1, and the input training data group is re-determined. Otherwise, the current adjusted fault diagnosis model is used as a stage fault diagnosis model.

[0017] The initial value of M is 1, and when M is 1, the current temporary fault diagnosis model is the basic fault diagnosis model.

[0018] Preferably, training the temporary fault diagnosis model based on the input training data set to obtain an adjusted fault diagnosis model includes:

[0019] The feature extractor in the temporary fault diagnosis model extracts features from all the training data in the input training data set to obtain multi-scale feature map data for each training data in the input training data set.

[0020] The multi-scale feature map data of all the training data in the input training data group are respectively input into the domain discriminator in the temporary fault diagnosis model to obtain the domain probability of all the training data in the input training data group.

[0021] Using the loss calculator in the temporary fault diagnosis model, based on the domain probability of each training data in the input training data group and its true domain, the domain discriminator loss of each training data in the input training data group and the average domain discriminator loss of the input training data group are calculated.

[0022] Using the loss calculator in the temporary fault diagnosis model, the average source domain outlier loss of the training data group is calculated based on the domain discriminator loss of each training data in the source domain data subset of the training data group to be input.

[0023] The multi-scale feature map data of all the training data in the input training data group are respectively input into each fault classifier in the fault classifier group of the temporary fault diagnosis model to obtain the fault probability result group of each training data in the input training data group.

[0024] Using the loss calculator in the temporary fault diagnosis model, based on the fault probability result group of each training data in the source domain data subset of the training data set to be input, the average source domain classifier loss of the training data set to be input is obtained, and based on the fault probability result group of each training data in the target domain data subset of the training data set to be input, the average target domain classifier difference loss of the training data set to be input is obtained.

[0025] Based on the average domain discriminator loss, average source domain outlier loss, average source domain classifier loss, and average target domain classifier difference loss of the input training data set, the gradients of all basic parameters in the temporary fault diagnosis model are calculated, and all basic parameters of the temporary fault diagnosis model are adjusted based on the gradients of all basic parameters in the temporary fault diagnosis model to obtain an adjusted fault diagnosis model.

[0026] Preferably, the formula for obtaining the average source domain classifier loss of the training data group based on the fault probability result group of each training data in the source domain data subset of the training data group is as follows:

[0027]

[0028] Among them, l sf Let m+ represent the average source domain classifier loss of the input training data set, where m+ is 0.9 and m- is 0.1. Let h represent the number of fault types. c || represents the probability that the training data i in the input training data group is predicted to be fault c, K is the number of training data in the source domain data set of the input training data group, and Tc represents whether fault c exists. When fault c exists, Tc = 1, and when it does not exist, Tc = 0.

[0029] Preferably, the step of calculating the average source domain outlier loss of the input training data group, based on the domain discriminator loss of each training data in the source domain data subset of the input training data group, using the loss calculator in the temporary fault diagnosis model, includes:

[0030] Based on the domain discriminator loss of each training data in the source domain data subset of the input training data group, calculate the weight of each training data in the source domain data subset of the input training data group;

[0031] The average source domain outlier loss of the training data set to be input is calculated based on the weight of each training data in the source domain subset of the training data set to be input.

[0032] The formula for calculating the weight of a single data point to be trained, based on the domain discriminator loss of a single data point in the source domain data subset of the input training data group, is as follows:

[0033]

[0034] Among them, w i The weight of the i-th data point to be trained in the source domain subset of the input training data group is represented by l. di Let represent the domain discriminator loss of the i-th data to be trained in the subset of source domain data of the input training data group, min(l di () represents the minimum value of the domain discriminator loss among all the data to be trained in the source domain subset of the input training data group.

[0035] max(l di ) represents the maximum value of the domain discriminator loss of all data to be trained in the source domain data subset of the input training data group, γ is the scaling parameter, and ε is the positive minimum value;

[0036] The formula for calculating the average source domain outlier loss of the input training data group based on the weight of each training data in the source domain subset of the input training data group is as follows:

[0037]

[0038] Among them, w i The weight of the i-th data point to be trained in the source domain subset of the input training data group is represented by l. di Let S represent the domain discriminator loss of the i-th data to be trained in the source domain data subset of the input training data group, and let S represent the number of data to be trained in the source domain data subset of the input training data group.

[0039] Preferably, constructing a primary fault diagnosis model includes:

[0040] A feature extractor is constructed to extract features from the data to be detected or the data to be trained, so as to obtain multi-scale feature map data of the data to be detected or the data to be trained.

[0041] Construct a domain discriminator to obtain the domain probability of the training data based on the multi-scale feature map data of the training data;

[0042] A fault classifier group is constructed, including multiple fault classifiers, and each fault classifier includes a primary capsule layer and multiple fault capsule layers. The fault classifiers are used to obtain the fault probability results of the training data based on the multi-scale feature map data of the training data. The fault probability results obtained by all fault classifiers for a single training data form a fault probability result group for the training data.

[0043] A loss calculator is constructed to obtain the domain discriminator loss and source domain outlier loss of the training data based on the domain probability of the training data, and to obtain the source domain classifier loss and target domain classifier difference loss of the training data based on the fault probability result group of the training data.

[0044] To address the aforementioned technical problems, the present invention provides a partially domain-adaptive fault diagnosis device, comprising a feature extraction module, a fault probability result module, and a fault diagnosis result acquisition module.

[0045] The feature extraction module is used to extract features from the data to be detected based on the trained feature extractor, so as to obtain multi-scale feature map data of the data to be detected.

[0046] The fault probability result module is used to input the multi-scale feature map data of the data to be detected into each fault classifier in the training fault classifier group to obtain the fault probability result output by each fault classifier.

[0047] The fault diagnosis result acquisition module is used to calculate the average probability of each fault type in all the fault probability results, and determine the fault diagnosis result of the data to be detected based on the average probability of all fault types.

[0048] To address the aforementioned technical problems, the present invention provides a storage medium storing a computer program that, when executed by a processor, implements a fault diagnosis method with partial domain adaptation.

[0049] To solve the above-mentioned technical problems, the present invention provides a terminal, including: a processor and a memory, wherein the memory and the processor are communicatively connected;

[0050] The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory, so that the terminal performs a partially domain-adaptive fault diagnosis method.

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

[0052] The partial domain adaptation fault diagnosis method provided in this invention achieves the diagnosis of mechanical faults in the data to be tested by training a set of trained feature extractors and trained fault classifiers that have partial domain spatial alignment effects and enhanced generalization of fault diagnosis. Furthermore, it achieves partial domain spatial alignment by weighting the training data in the subset of source domain data in the training data set. The generalization of fault diagnosis is enhanced by introducing multiple fault classifiers and fault capsule layers within the classifiers, thereby improving the accuracy of mechanical fault diagnosis in the data to be tested. This invention provides an effective solution to the practical problem in existing mechanical fault diagnosis methods where the target domain label space is a subset of the source domain label space.

[0053] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description, claims, and drawings. Attached Figure Description

[0054] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0055] Figure 1 A schematic flowchart of a domain-adaptive fault diagnosis method according to an embodiment of the present invention is shown;

[0056] Figure 2 A schematic diagram of the primary fault diagnosis model in Embodiment 1 of the present invention is shown;

[0057] Figure 3 This diagram illustrates the structure of a fault diagnosis device with partial domain adaptation according to Embodiment 2 of the present invention.

[0058] Figure 4 A schematic diagram of the terminal structure of Embodiment 4 of the present invention is shown. Detailed Implementation

[0059] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples, so that the process of how the present invention uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that, as long as there is no conflict, the various embodiments and features in the various embodiments of the present invention can be combined with each other, and the resulting technical solutions are all within the protection scope of the present invention.

[0060] With the rise of Industry 4.0, researching intelligent fault diagnosis algorithms for large machinery is of great significance. Some current research focuses on the domain offset problem caused by inconsistent distributions between training and test sets, employing domain adaptation to align the edge distributions of the source and target domains. However, this edge alignment method only applies when the source and target domains share the same label space. In real-world industrial scenarios, it is more common for the target domain label space to be a subset of the source domain label space. Effective algorithms are lacking to analyze this situation.

[0061] Example 1

[0062] To address the technical problems existing in the prior art, embodiments of the present invention provide a fault diagnosis method with partial domain adaptation.

[0063] Figure 1 A schematic flowchart of a domain-adaptive fault diagnosis method according to an embodiment of the present invention is shown; see reference. Figure 1 As shown, the fault diagnosis method for partial domain adaptation in this embodiment of the invention includes the following steps.

[0064] Step S101: Based on the trained feature extractor, perform feature extraction on the data to be detected to obtain multi-scale feature map data of the data to be detected.

[0065] Specifically, the data to be detected in this embodiment is a certain type of sample signal from machinery. That is, by processing the sample signals from large machinery, potential faults in the large machinery can be diagnosed. For example, the data to be detected could be a one-dimensional vibration signal from rotating machinery. After determining the signal to be detected, the data is input into a training feature extractor to obtain multi-scale feature map data of the data to be detected.

[0066] Step S102: Input the multi-scale feature map data of the data to be detected into each fault classifier in the training fault classifier group to obtain the fault probability results output by each fault classifier.

[0067] Specifically, the multi-scale feature map data of the data to be detected is input into the training fault classifier group to obtain the fault probability result group of the data to be detected. Further, the multi-scale feature image data of the data to be detected is input into each fault classifier in the training fault classifier group to obtain the fault probability result output by each fault classifier. All the fault probability results form the fault probability result group of the data to be detected. Since the machinery to be diagnosed may have multiple faults, the fault probability result includes the predicted probability of each fault type in the corresponding sample signal; for example, assuming that the machinery to be diagnosed may have four types of faults, the fault probability result obtained based on a sample signal includes the predicted probability of the first type of fault, the predicted probability of the second type of fault, the predicted probability of the third type of fault, and the predicted probability of the fourth type of fault.

[0068] Step S103: Calculate the average probability of each fault type in all fault probability results, and determine the fault diagnosis result of the data to be detected based on the average probability of all fault types.

[0069] Specifically, the average probability of each fault type in the data to be detected is calculated based on the fault probability results of the data to be detected. That is, assuming that the training fault classifier group includes three fault classifiers, the average probability of the first type of fault is calculated as follows: select the predicted probability of the first type of fault from the fault probability results output by the three fault classifiers respectively, and calculate the average of the predicted probabilities of the three first type of fault as the average predicted probability of the first type of fault; similarly, the average predicted probability of the second type of fault is calculated as the average probability of the second type of fault, and the average predicted probability of the third type of fault is calculated as the average probability of the third type of fault.

[0070] Then, the fault diagnosis result of the data to be detected is determined based on the average probability of all fault types. Specifically, the average predicted probability with the largest value is selected from the average predicted probabilities of the first type of fault, the second type of fault, and the third type of fault, and the fault type corresponding to the largest average predicted probability is taken as the fault diagnosis result of the data to be detected.

[0071] The process of acquiring the training feature extractor and training fault classifier group in the above steps includes the following steps.

[0072] Step S201: Construct a primary fault diagnosis model, which includes a feature extractor, a domain discriminator, a fault classifier group, and a loss calculator.

[0073] Specifically, building a primary fault diagnosis model includes the process of building a feature extractor, the process of building a domain discriminator, the process of building a fault classifier group, and the process of building a loss calculator.

[0074] The feature extractor is primarily used to extract features from the data to be detected or trained, thereby obtaining multi-scale feature map data. Its construction process includes: constructing an input layer, which can accept input from both the source and target domains. The source domain data is the training data containing fault labels, and the target domain data is the training or detection data without labels; constructing a wide convolutional layer for preliminary feature extraction to reduce noise in the data to be detected or trained; constructing a multi-scale convolutional layer for multi-scale feature extraction from the output of the wide convolutional layer to generate multi-scale feature map data; and constructing a gradient inversion layer, primarily used to invert gradients during backpropagation in model training, achieving adversarial training.

[0075] It should be noted that during the forward propagation of model training, if the input layer of the feature extractor is the training data from the source domain, the training data will sequentially pass through the input layer, wide convolutional layer, and multi-scale convolutional layer in the feature extractor to finally obtain the multi-scale feature map data of the training data; if the input layer of the feature extractor is the training data from the target domain, the training data will sequentially pass through the input layer, wide convolutional layer, multi-scale convolutional layer, and gradient inversion layer in the feature extractor to finally obtain the multi-scale feature map data of the training data.

[0076] Domain discriminators are primarily used to obtain the domain probability of training data based on multi-scale feature map data. Their construction process includes: building convolutional layers and fully connected layers to extract features from the multi-scale feature map data; and building an output layer to identify the data output by the convolutional and fully connected layers to determine the domain probability of the training data. The output layer has only one neuron and uses the sigmoid function as its activation function.

[0077] The fault classifier group comprises multiple fault classifiers. Each classifier obtains the fault probability result of the training data based on multi-scale feature map data. The fault probability results obtained by multiple classifiers for a single training data point form a fault probability result group for that training data. The construction process of each fault classifier includes: constructing a primary capsule layer by convolving the multi-scale feature map data with multiple sets of convolutional kernels of the same size and transforming it into primary capsule data; and constructing multiple fault capsule layers for fault classification of the primary capsule data. The number of fault capsules in each fault capsule layer is the same as the number of mechanical fault types in the target signal; that is, assuming the number of possible fault types in the target sample signal is p, then the number of fault capsules in the fault capsule layer is p. The primary capsule layer and fault capsule layer address the positional information loss problem caused by pooling layers in convolutional neural networks and possess stronger feature representation capabilities. The biggest difference between capsule networks and traditional neural networks lies in their basic unit. Capsule networks consist of a vector composed of multiple neurons, while neurons, as the basic unit of traditional neural networks, are scalars.

[0078] The loss calculator is primarily used to obtain the domain discriminator loss and source domain outlier loss of the training data based on the domain probability of the training data. It also obtains the source domain classifier loss and target domain classifier difference loss of the input training data group based on the fault probability results of the training data. The construction process of the loss calculator is essentially the design process for implementing these loss calculations. The design process for implementing these loss calculations will be explained in detail in conjunction with the subsequent training process, and will not be elaborated upon here.

[0079] It should also be noted that the features extracted by each convolutional layer in the above devices can be set by the designer according to the sample signal type of the data to be detected or trained, and no specific limitation is imposed here.

[0080] Step S202: Obtain the training data set, and group all the training data in the training data set according to the preset grouping method to obtain multiple training data groups. The training data in each training data group is divided into a source domain data subset and a target domain data subset.

[0081] Specifically, to train a basic fault diagnosis model, a large amount of training data is needed, thus requiring the acquisition of a training data set. For the purposes of this application, the training data set includes both source domain data and target domain data. The training data set is divided into multiple training data groups according to a certain grouping method; for example, assuming the training data set has 10,000 training data entries, it can be divided into 100 groups, each with 100 training data entries. Of course, the preset grouping method is not limited to this. It should also be noted that the training data in each training data group is divided into a source domain data subset and a target domain data subset, meaning that each training data group contains both source domain data and target domain data.

[0082] Step S203: Train the current basic fault diagnosis model based on the dataset to be trained to obtain the stage fault diagnosis model, and determine whether the actual training round N based on the dataset to be trained is less than the training round threshold. If so, proceed to step S204; otherwise, proceed to step S205.

[0083] Specifically, to improve the accuracy of the training feature extractor and the training fault classifier group, the fault diagnosis model needs to be trained multiple times based on the training dataset. The training round threshold can be set according to specific circumstances. The process of training the current basic fault diagnosis model based on the training dataset to obtain the stage fault diagnosis model will be explained in detail later and will not be repeated here. After completing one training run based on the training dataset, it is necessary to determine whether the actual number of training rounds N based on the training dataset is less than the training round threshold. If so, proceed to step S204; otherwise, proceed to step S205.

[0084] It should be noted that the initial value of the actual training round N is 1, and when the actual training round N is 1, the current basic fault diagnosis model is a primary fault diagnosis model.

[0085] Step S204: Use the current stage fault diagnosis model as the basic fault diagnosis model, and increase the actual training rounds N by 1, then proceed to step S203.

[0086] The currently acquired stage fault diagnosis model is used as the basic fault diagnosis model, which will be used as the model for the next round of training based on the training data set. At the same time, the actual training round N is incremented by 1 to indicate that the next round of training is about to begin. Then, proceed to step S203 to realize the next round of training.

[0087] Step S205: Use the current stage fault diagnosis model as the training fault diagnosis model, use the feature extractor in the training fault diagnosis model as the training feature extractor, and use the fault classifier group in the training fault diagnosis model as the training fault classifier group.

[0088] The process of training the current basic fault diagnosis model based on the dataset to be trained to obtain the stage fault diagnosis model includes the following steps.

[0089] Step S301: Take the Mth group of data to be trained in the dataset as the input training data group.

[0090] It should be noted that the initial value of M is 1, and when M is 1, the current temporary fault diagnosis model is the basic fault diagnosis model.

[0091] Step S302: Train the current temporary fault diagnosis model based on the input training data group to obtain the adjusted fault diagnosis model, and determine whether M is less than the total number of training data groups. If so, proceed to step S303; otherwise, proceed to step S304.

[0092] The process of training the current temporary fault diagnosis model based on the input training data set to obtain the adjusted fault diagnosis model will be explained in detail later, and will not be repeated here.

[0093] Step S303: Use the current adjusted fault diagnosis model as a temporary fault diagnosis model, increment M by 1, and proceed to step S301.

[0094] The currently acquired fault diagnosis model is used as a temporary fault diagnosis model to be used as the model for training the next set of training data. At the same time, M is incremented by 1, and the process proceeds to step S301 to redetermine the set of input training data.

[0095] Step S304: Use the current adjustment fault diagnosis model as the stage fault diagnosis model.

[0096] The process of training the current temporary fault diagnosis model based on the input training data set to obtain an adjusted fault diagnosis model includes the following steps.

[0097] Step S401: The feature extractor in the temporary fault diagnosis model extracts features from all the training data in the input training data group to obtain multi-scale feature map data for each training data in the input training data group.

[0098] Specifically, all the training data in the input training data group are sequentially input into the feature extractor in the temporary fault diagnosis model to obtain multi-scale feature map data for each training data in the input training data group.

[0099] Step S402: Input the multi-scale feature map data of all training data in the input training data group into the domain discriminator in the temporary fault diagnosis model to obtain the domain probability of all training data in the input training data group.

[0100] Specifically, the multi-scale feature map data of all training data in the input training data set are sequentially input into the domain discriminator in the temporary fault diagnosis model to obtain the domain probability of each training data in the input training data set. The domain probability of each training data is the probability that it belongs to the source domain and the probability that it belongs to the target domain.

[0101] Step S403: Using the loss calculator in the temporary fault diagnosis model, calculate the domain discriminator loss of each training data in the input training data group and the average domain discriminator loss of the input training data group based on the domain probability of each training data in the input training data group and its true domain.

[0102] Specifically, the loss calculator in the temporary fault diagnosis model calculates the domain discriminator loss of the training data as follows: Using the binary cross-entropy loss function, based on the domain probability of the training data and its true domain (i.e., whether it belongs to the source or target domain), the domain discriminator loss of the training data can be calculated. The domain discriminator losses of all training data in the input training data group are obtained in this way. Then, the average of the domain discriminator losses of all training data is calculated and used as the average domain discriminator loss of the input training data group.

[0103] Step S404: Using the loss calculator in the temporary fault diagnosis model, calculate the average source domain outlier loss of the training data group based on the domain discriminator loss of each training data in the source domain data subset of the training data group to be input.

[0104] Specifically, firstly, based on the domain discriminator loss of each training data point in the source domain data subset of the input training data set, the weight of each training data point in the source domain data subset of the input training data set is calculated. Further, based on the domain discriminator loss of a single training data point in the source domain data subset of the input training data set, the weight of that training data point is calculated using the following formula:

[0105]

[0106] Among them, w i The weight of the i-th data point to be trained in the source domain subset of the input training data group is represented by l. di Let represent the domain discriminator loss of the i-th data to be trained in the subset of source domain data of the input training data group, min(ldi ) represents the minimum value of the domain discriminator loss among all the data to be trained in the source domain subset of the input training data group, max(l di ) represents the maximum value of the domain discriminator loss of all data to be trained in the source domain data subset of the input training data group, γ is the scaling parameter, and ε is the positive minimum value.

[0107] Then, the average source domain outlier loss of the input training data group is calculated based on the weight of each training data point in the source domain subset of the input training data group. Further, the formula for calculating the average source domain outlier loss of the input training data group based on the weight of each training data point in the source domain subset of the input training data group is as follows:

[0108]

[0109] Among them, w i The weight of the i-th data point to be trained in the source domain subset of the input training data group is represented by l. di Let S represent the domain discriminator loss of the i-th data to be trained in the source domain data subset of the input training data group, and let S represent the number of data to be trained in the source domain data subset of the input training data group.

[0110] The above process is all implemented using the loss calculator in the temporary fault diagnosis model.

[0111] Step S405: Input the multi-scale feature map data of all training data in the input training data group into each fault classifier in the fault classifier group of the temporary fault diagnosis model, so as to obtain the fault probability result group of each training data in the input training data group.

[0112] Specifically, the multi-scale feature map data of a single training data point in the input training data set is sequentially input into all the fault classifiers in the fault classifier group of the temporary fault diagnosis model to obtain the fault probability results output by each fault classifier. All the fault probability results of the training data constitute the fault probability result set of the training data. The fault probability result set of each training data point in the input training data set can be obtained in the above manner.

[0113] Step S406: Using the loss calculator in the temporary fault diagnosis model, based on the fault probability result group of each training data in the source domain data subset of the input training data group, obtain the average source domain classifier loss of the input training data group, and based on the fault probability result group of each training data in the target domain data subset of the input training data group, obtain the average target domain classifier difference loss of the input training data group.

[0114] Specifically, the process by which the loss calculator in the temporary fault diagnosis model calculates the average source domain classifier loss of the input training data set can be represented by the following formula:

[0115]

[0116] Among them, l sf Let m+ represent the average source domain classifier loss of the input training data set, where m+ is 0.9 and m- is 0.1. Let h represent the number of fault types. c || represents the probability that the training data i in the input training data group is predicted to be fault c, K is the number of training data in the source domain data set of the input training data group, and Tc represents whether fault c exists. When fault c exists, Tc = 1, and when it does not exist, Tc = 0.

[0117] Based on the fault probability result group of each training data in the target domain data subset of the input training data group, the average target domain classifier difference loss of the input training data group is obtained by: firstly, based on the fault probability result group of each training data in the target domain data subset of the input training data group, calculating the average probability of each fault type for each training data in the target domain data subset of the input training data group. Further, as described in step S103, assuming that the training fault classifier group includes three fault classifiers, the average probability of the first type of fault is obtained as follows: the predicted probability of the first type of fault in the output fault probability results of the three fault classifiers is selected respectively, and their average is calculated as the average predicted probability of the first type of fault; similarly, the average predicted probability of the second type of fault is calculated as the average probability of the second type of fault, and the average predicted probability of the third type of fault is calculated as the average probability of the third type of fault.

[0118] Then, the classifier difference loss for each training data in the target domain dataset of the input training data group is calculated. The process of obtaining the classifier difference loss for a single training data in the target domain dataset of the input training data group includes: subtracting the average probability of each predicted probability in the fault probability result group of the training data from the average probability of the predicted probability to obtain the difference value group of the training data; and then using the sum of the absolute values ​​of all differences in the difference value group of the training data as the classifier difference loss of the training data.

[0119] Finally, the average difference loss of all the classifiers in the target domain data set of the input training data group is calculated, and this average difference loss is used as the average target domain classifier difference loss of the input training data group.

[0120] Step S407: Based on the average domain discriminator loss, average source domain outlier loss, average source domain classifier loss, and average target domain classifier difference loss of the input training data group, calculate the gradient of all basic parameters in the temporary fault diagnosis model, and adjust all basic parameters of the temporary fault diagnosis model based on the gradient of all basic parameters in the temporary fault diagnosis model to obtain the adjusted fault diagnosis model.

[0121] Specifically, the average domain discriminator loss, average source domain outlier loss, average source domain classifier loss, and average target domain classifier difference loss of the input training data set are summed to obtain the total loss of the input training data set. Based on the total loss of the input training data set, the gradients of all basic parameters in the temporary fault diagnosis model are obtained, i.e., the gradients of all basic parameters in the feature extractor, domain discriminator, and fault classifier groups of the temporary fault diagnosis model are obtained. Then, based on the gradients of all basic parameters in the temporary fault diagnosis model, the corresponding basic parameters in the feature extractor, domain discriminator, and fault classifier groups are adjusted respectively to obtain an adjusted fault diagnosis model. The gradient inversion layer in the feature extractor of the temporary fault diagnosis model is used to implement the gradient inversion function during the adjustment of basic parameters. All basic parameters in the feature extractor, domain discriminator, and fault classifier groups of the temporary fault diagnosis model are the parameters necessary for forming the feature extractor, domain discriminator, and fault classifier groups, and can be adjusted during training.

[0122] Experimental results show that, in the task of partial domain adaptation, the fault diagnosis method of partial domain adaptation in this embodiment has an accuracy of over 95%, which is better than other algorithms.

[0123] The partial domain adaptation fault diagnosis method provided in this invention achieves the diagnosis of mechanical faults in the data to be tested by training a set of trained feature extractors and trained fault classifiers that have partial domain spatial alignment effects and enhance the generalization of fault diagnosis. Furthermore, it achieves partial domain spatial alignment by weighting the training data in the subset of source domain data in the training data set. The generalization of fault diagnosis is enhanced by introducing multiple fault classifiers and fault capsule layers within the classifiers, thereby improving the accuracy of mechanical fault diagnosis in the data to be tested. In short, this invention provides an effective solution to the practical problem in existing mechanical fault diagnosis methods where the target domain label space is a subset of the source domain label space.

[0124] Example 2

[0125] To address the technical problems existing in the prior art, embodiments of the present invention provide a fault diagnosis device with partial domain adaptation.

[0126] Figure 3A schematic diagram of the structure of a fault diagnosis device with partial domain adaptation according to Embodiment 2 of the present invention is shown; see reference. Figure 3 As shown, the fault diagnosis device with partial domain adaptation in this embodiment of the invention includes a feature extraction module, a fault probability result module, and a fault diagnosis result acquisition module.

[0127] The feature extraction module is used to extract features from the data to be detected based on the trained feature extractor, so as to obtain multi-scale feature map data of the data to be detected.

[0128] The fault probability result module is used to input the multi-scale feature map data of the data to be detected into each fault classifier in the training fault classifier group to obtain the fault probability result output by each fault classifier.

[0129] The fault diagnosis result acquisition module is used to calculate the average probability of each fault type in all fault probability results, and to determine the fault diagnosis result of the data to be detected based on the average probability of all fault types.

[0130] The partial domain adaptation fault diagnosis device provided in this invention achieves the diagnosis of mechanical faults in the data to be tested by training a set of trained feature extractors and trained fault classifiers that have partial domain spatial alignment effects and enhanced generalization of fault diagnosis. Furthermore, it achieves partial domain spatial alignment by weighting the training data in the subset of source domain data in the training data set. The generalization of fault diagnosis is enhanced by introducing multiple fault classifiers and fault capsule layers within the classifiers, thereby improving the accuracy of mechanical fault diagnosis in the data to be tested. This invention provides an effective solution to the practical problem of the target domain label space being a subset of the source domain label space in existing mechanical fault diagnosis devices.

[0131] Example 3

[0132] To address the aforementioned technical problems in the prior art, this embodiment of the invention also provides a storage medium storing a computer program that, when executed by a processor, can implement all the steps in the partially domain-adaptive fault diagnosis method of Embodiment 1.

[0133] The specific steps of the fault diagnosis method with partial domain adaptation and the beneficial effects obtained by applying the readable storage medium provided in the embodiments of the present invention are the same as those in Embodiment 1, and will not be repeated here.

[0134] It should be noted that storage media include various media that can store program code, such as ROM, RAM, magnetic disks, or optical disks.

[0135] Example 4

[0136] To address the aforementioned technical problems in the prior art, embodiments of the present invention also provide a terminal.

[0137] Figure 4 A schematic diagram of the terminal structure of Embodiment 4 of the present invention is shown, with reference to... Figure 4 In this embodiment, the terminal includes a processor and a memory connected to each other; the memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory, so that when the terminal is executed, it can implement all the steps of the fault diagnosis method adapted to a part of the domain of the embodiment.

[0138] The specific steps of the fault diagnosis method with partial domain adaptation and the beneficial effects obtained by the terminal provided by the embodiment of the present invention are the same as those in Embodiment 1, and will not be repeated here.

[0139] It should be noted that the memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Similarly, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0140] While the embodiments disclosed in this invention are as described above, the content is merely for the purpose of facilitating understanding of the invention and is not intended to limit the invention. Any person skilled in the art to which this invention pertains may make any modifications and changes in form and detail of the implementation without departing from the spirit and scope disclosed herein; however, the scope of protection of this invention shall still be determined by the scope defined in the appended claims.

Claims

1. A partially domain-adaptive fault diagnosis method, comprising: Based on the trained feature extractor, feature extraction is performed on the data to be detected to obtain multi-scale feature map data of the data to be detected. The multi-scale feature map data of the data to be detected is input into each fault classifier in the training fault classifier group to obtain the fault probability result output by each fault classifier. Calculate the average probability of each fault type in all the fault probability results, and determine the fault diagnosis result of the data to be detected based on the average probability of all fault types; The methods for obtaining the training fault classifier group include: All training data within the training dataset are grouped to obtain multiple training datasets. The training data in each training dataset is divided into a source domain data subset and a target domain data subset. The current basic fault diagnosis model is trained based on the dataset to be trained, to obtain the practical fault diagnosis model; the fault classifier group in the practical fault diagnosis model is used as the practical fault classifier group, including: The Mth group of training data in the dataset to be trained is taken as the input training data group; wherein, the initial value of M is 1, and when M is 1, the current temporary fault diagnosis model is the basic fault diagnosis model. Feature extraction is performed on all training data in the input training data set to obtain multi-scale feature map data for each training data in the input training data set. The multi-scale feature map data of all the training data in the input training data group are respectively input into the domain discriminator in the temporary fault diagnosis model to obtain the domain probability of all the training data in the input training data group; based on the domain probability of each training data in the input training data group and its true domain, the domain discriminator loss of each training data in the input training data group and the average domain discriminator loss of the input training data group are calculated. Based on the domain discriminator loss of each training data in the source domain data subset of the input training data group, the weight of each training data in the source domain data subset of the input training data group is calculated, and the average source domain outlier loss of the input training data group is calculated based on the weight of each training data. The multi-scale feature map data of all the training data in the input training data group are respectively input into each fault classifier in the fault classifier group to obtain the fault probability result group of each training data in the input training data group. Based on the fault probability result group of each training data in the source domain data subset of the training data set to be input, the average source domain classifier loss of the training data set to be input is obtained, and based on the fault probability result group of each training data in the target domain data subset of the training data set to be input, the average target domain classifier difference loss of the training data set to be input is obtained. Based on the average domain discriminator loss, average source domain outlier loss, average source domain classifier loss, and average target domain classifier difference loss of the input training data set, the gradients of all basic parameters in the fault diagnosis model are calculated, and all basic parameters of the model are adjusted based on the gradients of all basic parameters.

2. The method according to claim 1, characterized in that, A basic fault diagnosis model includes a feature extractor, a domain discriminator, a fault classifier group, and a loss calculator. The process of obtaining the training fault classifier group includes: The current basic fault diagnosis model is trained based on the dataset to be trained to obtain a stage fault diagnosis model. It is determined whether the actual training round N is less than the training round threshold. If so, the current stage fault diagnosis model is used as the basic fault diagnosis model, and the actual training round N is incremented by 1. The current basic fault diagnosis model is then retrained based on the dataset to be trained. Otherwise, the current stage fault diagnosis model is used as the training fault diagnosis model, and the feature extractor in the training fault diagnosis model is used as the training feature extractor. The fault classifier group in the training fault diagnosis model is used as the training fault classifier group. The initial value of the actual training round N is 1, and when the actual training round N is 1, the current basic fault diagnosis model is a primary fault diagnosis model.

3. The method according to claim 2, characterized in that, The current basic fault diagnosis model is trained based on the aforementioned training dataset to obtain a stage-based fault diagnosis model, including: The current temporary fault diagnosis model is trained based on the input training data set to obtain an adjusted fault diagnosis model. It is determined whether M is less than the total number of training data sets. If so, the current adjusted fault diagnosis model is used as a temporary fault diagnosis model, M is incremented by 1, and the input training data set is re-determined. Otherwise, the current adjusted fault diagnosis model is used as a stage fault diagnosis model.

4. The method according to claim 3, characterized in that, Based on the fault probability result group of each training data in the source domain data subset of the training data set to be input, the formula for obtaining the average source domain classifier loss of the training data set to be input is as follows: Among them, l sf m represents the average source domain classifier loss of the input training data set. + It is 0.9, m - The value is 0.1, where h represents the number of fault types, and ||v c || represents the probability that the training data i in the input training data set is predicted as fault c, K is the number of training data in the source domain dataset of the input training data set, and T c Indicates whether fault c exists, and when fault c exists, T c =1, T if it does not exist c =0.

5. The method according to claim 3, characterized in that, Based on the domain discriminator loss of a single data point in the source domain subset of the input training data group, the formula for calculating the weight of that data point is as follows: Among them, w i The weight of the i-th data point to be trained in the source domain subset of the input training data group is represented by l. di Let represent the domain discriminator loss of the i-th data to be trained in the subset of source domain data of the input training data group, min(l di ) represents the minimum value of the domain discriminator loss among all the data to be trained in the source domain subset of the input training data group, max(l di ) represents the maximum value of the domain discriminator loss of all data to be trained in the source domain data subset of the input training data group, γ is the scaling parameter, and ε is the positive minimum value; The formula for calculating the average source domain outlier loss of the input training data group based on the weight of each training data in the source domain subset of the input training data group is as follows: Among them, w i The weight of the i-th data point to be trained in the source domain subset of the input training data group is represented by l. di Let S represent the domain discriminator loss of the i-th data to be trained in the source domain data subset of the input training data group, and let S represent the number of data to be trained in the source domain data subset of the input training data group.

6. The method according to claim 2, characterized in that, Building a basic fault diagnosis model includes: A feature extractor is constructed to extract features from the data to be detected or the data to be trained, so as to obtain multi-scale feature map data of the data to be detected or the data to be trained. Construct a domain discriminator to obtain the domain probability of the training data based on the multi-scale feature map data of the training data; A fault classifier group is constructed, including multiple fault classifiers, and each fault classifier includes a primary capsule layer and multiple fault capsule layers. The fault classifiers are used to obtain the fault probability results of the training data based on the multi-scale feature map data of the training data. The fault probability results obtained by all fault classifiers for a single training data form a fault probability result group for the training data. A loss calculator is constructed to obtain the domain discriminator loss and source domain outlier loss of the training data based on the domain probability of the training data, and to obtain the source domain classifier loss and target domain classifier difference loss of the training data based on the fault probability result group of the training data.

7. A fault diagnosis device with partial domain adaptation, characterized in that, It includes a feature extraction module, a fault probability result module, and a fault diagnosis result acquisition module; The feature extraction module is used to extract features from the data to be detected based on the trained feature extractor, so as to obtain multi-scale feature map data of the data to be detected. The fault probability result module is used to input the multi-scale feature map data of the data to be detected into each fault classifier in the training fault classifier group to obtain the fault probability result output by each fault classifier. The fault diagnosis result acquisition module is used to calculate the average probability of each fault type in all the fault probability results, and determine the fault diagnosis result of the data to be detected based on the average probability of all fault types. The methods for obtaining the training fault classifier group include: All training data within the training dataset are grouped to obtain multiple training datasets. The training data in each training dataset is divided into a source domain data subset and a target domain data subset. The current basic fault diagnosis model is trained based on the dataset to be trained, to obtain the practical fault diagnosis model; the fault classifier group in the practical fault diagnosis model is used as the practical fault classifier group, including: The Mth group of training data in the dataset to be trained is taken as the input training data group; wherein, the initial value of M is 1, and when M is 1, the current temporary fault diagnosis model is the basic fault diagnosis model. Feature extraction is performed on all training data in the input training data set to obtain multi-scale feature map data for each training data in the input training data set. The multi-scale feature map data of all the training data in the input training data group are respectively input into the domain discriminator in the temporary fault diagnosis model to obtain the domain probability of all the training data in the input training data group; based on the domain probability of each training data in the input training data group and its true domain, the domain discriminator loss of each training data in the input training data group and the average domain discriminator loss of the input training data group are calculated. Based on the domain discriminator loss of each training data in the source domain data subset of the input training data group, the weight of each training data in the source domain data subset of the input training data group is calculated, and the average source domain outlier loss of the input training data group is calculated based on the weight of each training data. The multi-scale feature map data of all the training data in the input training data group are respectively input into each fault classifier in the fault classifier group to obtain the fault probability result group of each training data in the input training data group. Based on the fault probability result group of each training data in the source domain data subset of the training data set to be input, the average source domain classifier loss of the training data set to be input is obtained, and based on the fault probability result group of each training data in the target domain data subset of the training data set to be input, the average target domain classifier difference loss of the training data set to be input is obtained. Based on the average domain discriminator loss, average source domain outlier loss, average source domain classifier loss, and average target domain classifier difference loss of the input training data set, the gradients of all basic parameters in the fault diagnosis model are calculated, and all basic parameters of the model are adjusted based on the gradients of all basic parameters.

8. A storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the fault diagnosis method of any one of claims 1 to 6 that is partially domain adapted.

9. A terminal, characterized in that, include: A processor and a memory, wherein the memory and the processor are communicatively connected; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to cause the terminal to perform a fault diagnosis method that is partially domain-adapted as claimed in any one of claims 1 to 6.