Mechanical fault diagnosis model migration training method and mechanical fault diagnosis method, device, equipment and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2026-08-11
AI Technical Summary
[0005]故障诊断领域的现有迁移学习方法主要集中于对齐源域和目标域的边缘特征分布,尽管对齐边缘特征分布有助于提高迁移训练后的故障诊断模型的诊断性能,但这些方法所生成的故障诊断模型通常主要关注对齐边缘特征分布而不考虑样本的类别,即使完全对齐了边缘特征分布并生成了域不变特征,也不能保证这些特征具有目标样本具有判别能力,这种局限性对迁移训练后所得到的故障诊断模型的诊断性能产生不利影响,也即影响迁移训练后所得到的故障诊断模型的准确度
[0018]根据本公开的各方面,通过至少利用样本分类损失、特征差异损失以及类别混淆损失训练机械故障诊断模型,能够使训练后的目标机械故障诊断模型中的特征提取器提取出具有更强域不变性和判别性的样本特征,并使分类器表现出更强的分类能力,从而能够实现将源工况下的机械故障诊断模型迁移学习到目标工况下的目标机械故障诊断模型,并使训练后的目标机械故障诊断模型对目标工况下无标签的故障样本具有更高的故障类型诊断准确性。
Smart Images

Figure CN119474865B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of mechanical fault diagnosis, and in particular to a mechanical fault diagnosis model transfer training method, and mechanical fault diagnosis methods, devices, equipment and media. Background Technology
[0002] Modern mechanical manufacturing systems exhibit significant characteristics such as large-scale control, high automation, and flexibility. Due to the increasing complexity of these systems, downtime caused by various failures has become an intolerable burden. Therefore, fault diagnosis systems are considered necessary to minimize downtime due to maintenance and ensure timely action after a failure occurs. With the continuous increase in data volume, traditional machine learning-based fault diagnosis methods are no longer sufficient, and there is an urgent need to develop advanced intelligent fault diagnosis methods.
[0003] Deep learning utilizes a deep hierarchical architecture to automatically extract abstract features from large-scale datasets, contrasting with traditional machine learning methods that require manual feature engineering, imposing a significant workload on users. While deep learning has achieved remarkable results in machine fault diagnosis, its performance largely depends on the availability of large amounts of labeled data required to train diagnostic models. However, in engineering scenarios, obtaining such labeled data is often impractical due to the high cost of fault data collection and labeling, thus limiting the growth potential of deep learning in this field.
[0004] Transfer learning challenges the assumption that training and test data must be independent and identically distributed. This paradigm has inspired researchers to utilize transfer learning techniques to address the problem of limited training data. In transfer learning, models can be trained in the target domain using both labeled source data and unlabeled target data, significantly reducing reliance on labeled data and shortening training time in the target domain.
[0005] Existing transfer learning methods in the field of fault diagnosis mainly focus on aligning the edge feature distributions of the source and target domains. Although aligning the edge feature distributions helps improve the diagnostic performance of the fault diagnosis model after transfer training, the fault diagnosis models generated by these methods usually focus on aligning the edge feature distributions without considering the category of the samples. Even if the edge feature distributions are fully aligned and domain-invariant features are generated, it cannot be guaranteed that these features have the discriminative power of the target samples. This limitation has an adverse effect on the diagnostic performance of the fault diagnosis model obtained after transfer training, that is, it affects the accuracy of the fault diagnosis model obtained after transfer training. Summary of the Invention
[0006] In view of this, this disclosure proposes a mechanical fault diagnosis model transfer training method and a mechanical fault diagnosis method, device, equipment and medium, which can improve the accuracy of mechanical fault diagnosis using the trained target mechanical fault diagnosis model.
[0007] According to one aspect of this disclosure, a transfer training method for a mechanical fault diagnosis model is provided, comprising: acquiring a mechanical fault diagnosis model to be trained, a source domain sample set, and a target domain sample set; wherein, the source domain sample set includes multiple source fault samples and sample labels corresponding to each source fault sample, and the target domain sample set includes multiple unlabeled target fault samples; the source fault samples include mechanical vibration signals collected when the machine fails under source operating conditions, and the target fault samples include mechanical vibration signals collected when the machine fails under target operating conditions, wherein the source operating conditions are different from the target operating conditions; the sample labels are used to indicate the fault type corresponding to the source fault samples; wherein, the mechanical fault diagnosis model includes a feature generator and a classifier, the feature generator is used to extract sample features of the fault samples, and the classifier is used to generate fault prediction results based on the sample features, the fault prediction results including the probability that the fault samples belong to each fault type; and utilizing the mechanical fault diagnosis model based on each source fault sample in the source domain sample set and each source fault sample in the target domain sample set... The system generates multiple target fault samples and outputs the sample features and fault prediction results of each source fault sample. Based on the fault prediction results and sample labels of the multiple source fault samples, a sample classification loss is determined, representing the classification error of the mechanical fault diagnosis model in determining the fault type of the source fault samples. Based on the sample features of the multiple source fault samples and the sample features of the multiple target fault samples, a feature difference loss is determined, representing the feature distribution difference between the sample features of the source fault samples and the sample features of the target fault samples. Based on the fault prediction results of the multiple target fault samples, a class confusion loss is determined, representing the degree of confusion between different fault types by the mechanical fault diagnosis model. Based on the sample classification loss, the feature difference loss, and the class confusion loss, a target loss is determined, and the target loss is used to optimize the mechanical fault diagnosis model to obtain the trained target mechanical fault diagnosis model.
[0008] In one possible implementation, the method further includes: inputting the sample features of the plurality of source fault samples and the sample features of the plurality of target fault samples into a domain discriminator to obtain the domain classification results of each source fault sample and each target fault sample, wherein the domain classification results characterize the probability that the sample features belong to the feature distribution space corresponding to the source domain sample set, or characterize the probability that the sample features belong to the feature distribution space corresponding to the target domain sample set; determining a domain adversarial loss based on the domain classification results of each source fault sample and each target fault sample, wherein the domain adversarial loss characterizes the classification error of the domain discriminator in the feature distribution space to which the sample features belong; wherein determining the target loss based on the sample classification loss, the feature difference loss, and the class confusion loss includes: determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, and the domain adversarial loss.
[0009] In one possible implementation, the method further includes: adding a perturbation signal to each source fault sample in the source domain sample set to obtain a source fault perturbation sample corresponding to each source fault sample; inputting the source fault perturbation sample corresponding to each source fault sample into the mechanical fault diagnosis model to obtain a fault prediction result of the source fault perturbation sample corresponding to each source fault sample; and determining a first virtual adversarial loss based on the fault prediction results of the multiple source fault samples and the fault prediction results of the source fault perturbation samples corresponding to each source fault sample, wherein the first virtual adversarial loss characterizes the difference between the fault prediction result of the source fault sample and the fault prediction result of the corresponding source fault perturbation sample.
[0010] In one possible implementation, determining the target loss based on the sample classification loss, the feature difference loss, and the class confusion loss includes: determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, and the first virtual adversarial loss; or, determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, the domain adversarial loss, and the first virtual adversarial loss; wherein the domain adversarial loss is determined based on the domain classification results of each source fault sample and the domain classification results of each target fault sample.
[0011] In one possible implementation, the method further includes: adding a perturbation signal to each target fault sample in the target domain sample set to obtain a target fault perturbation sample corresponding to each target fault sample; inputting the target fault perturbation sample corresponding to each target fault sample into the mechanical fault diagnosis model to obtain a fault prediction result of the target fault perturbation sample corresponding to each target fault sample; and determining a second virtual adversarial loss based on the fault prediction results of the multiple target fault samples and the fault prediction results of the target fault perturbation samples corresponding to each target fault sample, wherein the second virtual adversarial loss characterizes the difference between the fault prediction result of the target fault sample and the fault prediction result of the corresponding target fault perturbation sample.
[0012] In one possible implementation, determining the target loss based on the sample classification loss, the feature difference loss, and the class confusion loss includes: determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, and the second virtual adversarial loss; or, determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, the domain adversarial loss, and the second virtual adversarial loss; or, determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, the first virtual adversarial loss, and the second virtual adversarial loss; or, determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, the domain adversarial loss, the first virtual adversarial loss, and the second virtual adversarial loss; wherein the domain adversarial loss is determined based on the domain classification results of each source fault sample and the domain classification results of each target fault sample, and the first virtual adversarial loss is determined based on the fault prediction results of the plurality of source fault samples and the fault prediction results of the source fault disturbance samples corresponding to each source fault sample.
[0013] According to another aspect of this disclosure, a mechanical fault diagnosis method is provided, comprising: acquiring actual fault data collected when a mechanical fault occurs under a target operating condition, the fault data including mechanical vibration signals; using a target mechanical fault diagnosis model based on the fault data to determine a fault diagnosis result corresponding to the fault data, the fault diagnosis result characterizing the fault type of the mechanical fault occurring under the target operating condition; wherein the target mechanical fault diagnosis model is trained using the training method described above.
[0014] According to another aspect of this disclosure, a transfer training apparatus for a mechanical fault diagnosis model is provided, comprising: an acquisition module for acquiring a mechanical fault diagnosis model to be trained, a source domain sample set, and a target domain sample set; wherein the source domain sample set includes multiple source fault samples and sample labels corresponding to each source fault sample, and the target domain sample set includes multiple unlabeled target fault samples; the source fault samples include mechanical vibration signals collected when the machine fails under source operating conditions, and the target fault samples include mechanical vibration signals collected when the machine fails under target operating conditions, wherein the source operating conditions are different from the target operating conditions; the sample labels are used to indicate the fault type corresponding to the source fault samples; wherein the mechanical fault diagnosis model includes a feature generator and a classifier, the feature generator is used to extract sample features of the fault samples, and the classifier is used to generate fault prediction results based on the sample features, the fault prediction results including the probability that the fault samples belong to each fault type; and a prediction module for using the mechanical fault diagnosis model to output based on each source fault sample in the source domain sample set and each target fault sample in the target domain sample set. The system comprises: a sample feature and fault prediction result for each source fault sample, and a sample feature and fault prediction result for each target fault sample; a classification loss determination module, used to determine the sample classification loss based on the fault prediction results of the multiple source fault samples and the sample labels of each source fault sample, wherein the sample classification loss characterizes the classification error of the mechanical fault diagnosis model in the fault type of the source fault sample; a difference loss determination module, used to determine the feature difference loss based on the sample features of the multiple source fault samples and the sample features of the multiple target fault samples, wherein the feature difference loss characterizes the difference in sample feature distribution between the source domain sample set and the target domain sample set; a confusion loss determination module, used to determine the category confusion loss based on the fault prediction results of the multiple target fault samples, wherein the category confusion loss characterizes the degree of confusion between different fault types by the mechanical fault diagnosis model; and an optimization module, used to determine the target loss based on the sample classification loss, the feature difference loss, and the category confusion loss, and to optimize the mechanical fault diagnosis model using the target loss to obtain the trained target mechanical fault diagnosis model.
[0015] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the above-described method when executing instructions stored in the memory.
[0016] According to another aspect of this disclosure, a non-volatile computer-readable storage medium is provided that stores computer program instructions thereon, wherein the computer program instructions, when executed by a processor, implement the above-described method.
[0017] According to another aspect of this disclosure, a computer program product is provided, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-described method.
[0018] According to various aspects of this disclosure, by training a mechanical fault diagnosis model using at least sample classification loss, feature difference loss, and category confusion loss, the feature extractor in the trained target mechanical fault diagnosis model can extract sample features with stronger domain invariance and discriminativeness, and the classifier can exhibit stronger classification ability. This enables the transfer learning of the mechanical fault diagnosis model under the source working condition to the target mechanical fault diagnosis model under the target working condition, and makes the trained target mechanical fault diagnosis model have higher fault type diagnosis accuracy for unlabeled fault samples under the target working condition.
[0019] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0020] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.
[0021] Figure 1 A schematic diagram illustrating the comparison effect of transfer training according to an embodiment of the present disclosure is shown.
[0022] Figure 2 A flowchart is shown for a mechanical fault diagnosis model transfer training according to an embodiment of the present disclosure.
[0023] Figure 3 A schematic diagram of a network structure table of a feature generator according to an embodiment of the present disclosure is shown.
[0024] Figure 4 This diagram illustrates a conventional transfer learning training process based on existing technology.
[0025] Figure 5 This diagram illustrates a mechanical fault vibration model transfer training process according to an embodiment of the present disclosure.
[0026] Figure 6 A schematic diagram showing a sample table of a PHM2009 dataset according to an embodiment of the present disclosure is provided.
[0027] Figure 7 A schematic diagram showing experimental results of the classification accuracy (%) and standard deviation of various models on the PHM2009 dataset according to an embodiment of the present disclosure is illustrated.
[0028] Figure 8 This diagram illustrates an experimental results table showing the classification accuracy (%) and standard deviation of an ablation experiment in a target domain on the PHM2009 dataset according to an embodiment of the present disclosure.
[0029] Figure 9 This diagram illustrates the confusion matrix in the target domain of the target mechanical fault diagnosis model trained using the training method proposed in the embodiments of this disclosure.
[0030] Figure 10 A schematic diagram of the confusion matrix of DCTLN in the target domain in the prior art is shown.
[0031] Figure 11 A schematic diagram of the confusion matrix of the baseline model in the prior art in the target domain is shown.
[0032] Figure 12 A schematic diagram showing a sample table of a CWRU2000 dataset according to an embodiment of the present disclosure is provided.
[0033] Figure 13 This diagram illustrates an experimental results table showing the classification accuracy (%) and standard deviation in a target domain on the CWRU2000 dataset according to an embodiment of the present disclosure.
[0034] Figure 14 A block diagram of a mechanical fault diagnosis model transfer training device according to an embodiment of the present disclosure is shown.
[0035] Figure 15 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. Detailed Implementation
[0036] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0037] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0038] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. In the description of this disclosure, "multiple" means two or more, unless otherwise explicitly specified.
[0039] It should be understood that the terms "first," "second," etc., in the claims, specification, and drawings of this disclosure are used to distinguish different objects, rather than to describe a specific order. The terms "comprising" and "including" as used in the specification and claims of this disclosure indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.
[0040] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0041] As mentioned above, in the field of fault diagnosis, many existing transfer learning methods mainly focus on aligning the edge feature distributions of the source and target domains. Therefore, the generated fault diagnosis models often prioritize features invariant to the source domain while neglecting to extract discriminative features from the target samples. This limitation adversely affects the diagnostic performance of the generated fault diagnosis model in the target domain. Figure 1 As shown, existing transfer learning methods in the field of fault diagnosis are aimed at... Figure 1 The "i" in the figure represents the source fault samples and target fault samples in different domains, which can only achieve... Figure 1 The classification effect shown in "ii" is that although it can map samples from different domains to the same distribution space, the decision boundary will cross some sample distribution areas because the discriminative features are not considered, which makes the model's accuracy in diagnosing faults low.
[0042] In view of this, embodiments of this disclosure propose a transfer training method for a mechanical fault diagnosis model. The method aims to extract domain-invariant features and focus on the discriminative attributes of these features for target fault samples, thereby improving the diagnostic performance of the target mechanical fault diagnosis model after transfer training. In other words, it can achieve... Figure 1The classification effect shown in "iii" means that it can map samples from different domains to the same distribution space and extract the discriminative features of the samples, thereby making the decision boundary far away from the dense area of sample distribution and achieving more accurate fault type diagnosis.
[0043] To construct the mechanical fault diagnosis model transfer training method proposed in this embodiment, a modular architecture is designed, mainly including three modules: a domain-invariant module, a discriminant module, and a stabilization module, with specific requirements for each module. First, the domain-invariant module is responsible for obtaining domain-invariant features by aligning edge feature distributions; therefore, this module must be able to align edge feature distributions. Second, since samples in the target domain lack labels, discriminant features for the target samples cannot be directly obtained. To ensure that the features are not only domain-invariant but also discriminative for the target samples, inspired by the clustering hypothesis—that data points located in dense regions naturally form a cluster, and samples sharing the same cluster are expected to exhibit the same label—the discriminant module can employ some unsupervised constraint term to move the decision boundary away from the dense region, indirectly extracting the discriminant features of the target fault samples. In other words, this discriminant module must be able to move the decision boundary away from the dense region. Furthermore, since the discriminant module and the domain-invariant module introduce losses with different constraints, the gradient directions of these losses with different constraints cannot be guaranteed to be consistent. This may cause the model to suddenly change when making predictions near certain data points, leading to model collapse. To mitigate this problem, a stabilizing module is introduced to enhance the smoothness and stability of the model. Therefore, the requirement of the stabilizing module is to ensure the smoothness of the model.
[0044] Next, based on the requirements of the three modules, appropriate constraints can be found for each module to realize the mechanical fault diagnosis model transfer training method proposed in this embodiment. For the domain-invariant module, the mechanical fault diagnosis model transfer training method of this embodiment incorporates a feature distribution difference metric into the domain adversarial training. This combination can extract stronger domain-invariant features. For the discriminative module, the mechanical fault diagnosis model transfer training method of this embodiment introduces class confusion minimization training. Intuitively, minimizing class confusion forces the classifier to exhibit high confidence when predicting unlabeled target fault samples, thereby pushing the decision boundary away from dense regions. For the stability module, the mechanical fault diagnosis model transfer training method proposed in this embodiment introduces local Lipshitz constraints into virtual adversarial training, making the trained target mechanical fault diagnosis model smoother and preventing model collapse. It should be understood that the modules in the above modular architecture are flexible and scalable, and any appropriate constraints in the art can be selected to construct each module, as long as the requirements of each module are met.
[0045] In summary, to ensure that the extracted sample features are domain-invariant while retaining their discriminative properties, this disclosure proposes a modular transfer learning architecture and sets specific requirements for each module. After satisfying the requirements of the three modules, appropriate constraints are selected for each module to construct the mechanical fault diagnosis model transfer training method proposed in this disclosure. Furthermore, this disclosure has been experimentally validated on gearbox and bearing fault datasets. Experimental results show that the mechanical fault diagnosis model transfer training method proposed in this disclosure achieves higher fault diagnosis classification accuracy. In addition, based on the above modular architecture, the mechanical fault diagnosis model transfer training method proposed in this disclosure is scalable and flexible, and any existing constraints can be replaced with other constraints according to the requirements of each module in the proposed architecture.
[0046] In practical applications, the mechanical fault diagnosis model transfer training method proposed in this disclosure can be deployed on various terminal devices through software or hardware modifications. The terminal devices involved in this disclosure can refer to devices with wireless and / or wired connection functions. Wireless connection means that they can connect to other devices via Wi-Fi, Bluetooth, or other wireless connection methods. The terminal devices involved in this disclosure can also communicate with other devices via wired connection functions. The terminal devices involved in this disclosure can be touchscreen, non-touchscreen, or screenless. Touchscreen devices can be controlled by clicking or swiping on the display screen using fingers, styluses, etc. Non-touchscreen devices can connect to input devices such as mice, keyboards, and touch panels to control the terminal device. Screenless devices can be, for example, screenless Bluetooth speakers. For example, the terminal devices in this application can include, but are not limited to, user equipment (UE), mobile devices, user terminals, terminals, handheld devices, tablet computers, laptops, PDAs, computing devices, etc.
[0047] The mechanical fault diagnosis model transfer training method of this disclosure can also be deployed on a server. This server can be located in the cloud or locally, and can be a physical device or a virtual device, such as a virtual machine or container. It has wireless communication capabilities, which can be configured in the server's chip (system) or other components. It can refer to a device with wireless connectivity, meaning it can connect to other servers or terminal devices via Wi-Fi, Bluetooth, or other wireless connection methods. The server involved in this disclosure can also have wired communication capabilities. For example, the server can receive the mechanical fault diagnosis model to be trained, as well as a source domain sample set and a target domain sample set sent by the terminal device. The server then executes the mechanical fault diagnosis model transfer training method of this disclosure based on the mechanical fault diagnosis model to be trained, the source domain sample set, and the target domain sample set to obtain a trained target mechanical fault diagnosis model. The trained target mechanical fault diagnosis model is then returned to the terminal device so that the terminal device can provide feedback to the user about the trained target mechanical fault diagnosis model.
[0048] To better understand the mechanical fault diagnosis model transfer training method proposed in the embodiments of this disclosure, the relevant theoretical basis involved in the embodiments of this disclosure is introduced as follows.
[0049] (1) Represent a field as in Let X represent the feature space (i.e., the sample distribution space), and P(X) represent the marginal probability distribution. Therefore, the source domain is represented as Similarly, the target domain is represented as Based on this, the source domain can be understood as the feature space of labeled source fault samples collected under source conditions and the corresponding marginal probability distribution, while the target domain can be understood as the feature space of unlabeled target fault samples collected under target conditions and the corresponding marginal probability distribution.
[0050] (2) The effectiveness of deep learning depends on the following assumptions: there is a sufficient amount of labeled data to train the diagnostic model, and the training data and test data follow the property of being independent and identically distributed, i.e. In engineering scenarios, there are always different but related operating conditions (such as operating environments with different loads, pressures, and speeds). If the user wants to operate under condition A (i.e.... A fault diagnosis model was trained in condition A to diagnose the types of mechanical faults that might occur under condition A, but there was not enough labeled training data in condition A, while condition B (i.e., There is sufficient labeled training data under condition A. Furthermore, due to different operating conditions, the data in condition A and the data in condition B may not satisfy the independent and identically distributed hypothesis (i.e., ...). Therefore, a fault diagnosis model trained using sufficient labeled data in operating condition B may not be directly applicable to operating condition A. Transfer learning can alleviate this constraint to some extent. Transfer learning actually introduces a transfer regularization term, which utilizes unlabeled data from the target domain to prevent overfitting in the source domain during training using labeled data from the source domain. Typically, the goal of the transfer regularization term is to minimize domain variance by minimizing a metric that measures distributional differences, thus enabling a fault diagnosis model trained using sufficient labeled data in operating condition B (i.e., the source condition) to be applied to operating condition A (i.e., the target condition).
[0051] The following is passed Figures 2 to 5 The mechanical fault diagnosis model transfer training method proposed in the embodiments of this disclosure is described in detail.
[0052] Figure 2 A flowchart illustrating a mechanical fault diagnosis model transfer training method according to an embodiment of this disclosure is shown. This method can be applied to the aforementioned terminal devices or electronic devices such as servers. Figure 2 As shown, the method includes steps S11 to S16.
[0053] In step S11, the mechanical fault diagnosis model to be trained, as well as the source domain sample set and the target domain sample set, are obtained.
[0054] The mechanical fault diagnosis model to be trained includes a feature generator and a classifier. The feature generator is used to extract sample features from fault samples, and the classifier is used to generate fault prediction results based on the sample features. The fault prediction results include the probability that the fault sample belongs to each fault type. It should be understood that those skilled in the art can customize the network structure of the feature generator and classifier in the mechanical fault diagnosis model according to actual needs. For example, a ResNet-18 network can be used as the feature generator, and the ResNet-18 network can be adaptively adjusted (e.g., replacing the original two-dimensional convolution with a one-dimensional convolution (e.g., from 3x3 to 1x3), and removing the hierarchical structure after the global pooling layer is removed); a fully connected layer of 256 × the number of fault types can be used as the classifier, etc. This disclosure does not limit the scope of the embodiments.
[0055] For example, Figure 3The diagram shows the network structure of a feature generator, including the layers: Convolutional Layer 1 (Conv1), Pooling Layer 1 (pool1), Linear Layers (L1-1 to L4-4), AvgPool, and Bottleneck. The operators for each layer are convolution, pooling, Adaptive AvgPool, and Linear. The parameter sizes of the convolutional kernels are also shown; for example, "64×1×7,2,1" represents a kernel size of 64×1×7 with a stride of 2 and padding of 1, and so on. Further details are omitted.
[0056] The source domain sample set includes multiple source fault samples and corresponding sample labels for each source fault sample. The target domain sample set includes multiple unlabeled target fault samples. The source fault samples include mechanical vibration signals collected when the machine fails under the source operating condition. The target fault samples include mechanical vibration signals collected when the machine fails under the target operating condition. The source operating condition and the target operating condition are different. The sample label is used to indicate the fault type corresponding to the source fault sample. The fault type can include no fault (i.e., normal operation) and various specific faults.
[0057] It should be understood that the machinery mentioned in the embodiments of this disclosure can be any mechanical system (such as an engine, motor, gearbox, etc.) or a mechanical component within a mechanical system (such as a bearing, gear, rotor, etc.). The types of failures of different machines are usually different. For example, the failure types of an engine can include no failure, spark plug failure, bearing failure, piston failure, etc.; the failure types of an electrode can include no failure, bearing failure, rotor failure, etc.; the failure types of a gearbox can include no failure, bearing failure, gear failure, etc.; the failure types of a bearing can include no failure, outer ring failure, inner ring failure, ball failure, etc.; and the failure types of a rotor can include no failure, broken rotor bars, bent rotor, misaligned rotor, etc. The embodiments of this disclosure do not limit these aspects.
[0058] In practical applications, those skilled in the art can employ any known vibration signal acquisition method. For example, sensors such as accelerometers or speedometers can be used to acquire mechanical vibration signals, and this disclosure does not limit such methods. It should be understood that those skilled in the art can obtain source fault samples with sample labels by actually acquiring mechanical vibration signals when various faults occur in the machine under source operating conditions; or, they can also obtain source fault samples with sample labels by simulating various faults that occur in the machine under source operating conditions through experimental simulation. For target fault samples without labels, unlabeled target fault samples can be obtained by actually acquiring mechanical vibration signals when various faults occur in the machine under target operating conditions, and this disclosure does not limit such methods.
[0059] As mentioned above, the fault type can include no fault. Therefore, optionally, source fault samples labeled as no fault can also be obtained by actually collecting or simulating mechanical vibration signals when the machine is running normally under the source working condition. The source domain sample set can also include source fault samples labeled as no fault and source fault samples labeled with various faults. And, the target fault samples can be obtained by actually collecting mechanical vibration signals when the machine is running normally under the target working condition. The target domain sample set can also include target fault samples without labels and target fault samples with various faults.
[0060] In practical applications, the collected or simulated mechanical vibration signals can also be subjected to a fast Fourier transform to generate N Fourier coefficients for each mechanical vibration signal (e.g., generating 1200 Fourier coefficients). Due to the symmetry of the coefficients, the first N / 2 Fourier coefficients can be used as fault samples (e.g., the first 600 Fourier coefficients can be used as fault samples). That is, the first N / 2 Fourier coefficients converted from the mechanical vibration signal collected under the source condition can be used as source fault samples, and the first N / 2 Fourier coefficients converted from the mechanical vibration signal collected under the target condition can be used as target fault samples. Of course, the N Fourier coefficients converted from the mechanical vibration signal can also be used as fault samples, and this embodiment of the present disclosure does not limit this.
[0061] Considering that model training involves multiple rounds, a total source domain sample library containing a large number of labeled source fault samples and a total target domain sample library containing a large number of unlabeled target fault samples can be generated. Based on a preset batch size, in each training round, source fault samples and target fault samples of the same quantity and batch size are randomly selected from the total source domain sample library and the total target domain sample library to obtain the current batch's source domain sample set and target domain sample set. This current batch's source domain sample set and target domain sample set are then used to train the mechanical fault diagnosis model for the current round. It should be understood that the mechanical fault diagnosis model trained in the current round is the same as the mechanical fault diagnosis model trained in the previous round. Those skilled in the art can set the batch size and training rounds according to actual needs; for example, the batch size can be set to 120 and the training rounds to 100, etc. This embodiment of the present disclosure does not limit this.
[0062] It should be noted that the methods for obtaining source fault samples and target fault samples provided in the above embodiments of this disclosure are some possible implementation methods provided in the embodiments of this disclosure. In fact, those skilled in the art can use any known related technology in the art to generate source fault samples and target fault samples, and construct source domain sample sets and target domain sample sets. This disclosure does not limit this.
[0063] In step S12, the mechanical fault diagnosis model is used to output the sample features and fault prediction results of each source fault sample, as well as the sample features and fault prediction results of each target fault sample, based on each source fault sample in the source domain sample set and each target fault sample in the target domain sample set.
[0064] As described above, the number of samples in the source domain sample set and the target domain sample set of the current batch is the same. In practical applications, each source fault sample in the source domain sample set and each target fault sample in the target domain sample set can be randomly concatenated to form a batch, which is then input into the mechanical fault diagnosis model to obtain the sample features and fault prediction results of each source fault sample, as well as the sample features and fault prediction results of each target fault sample in the current batch. Alternatively, each source fault sample and each target fault sample can be input into the mechanical fault diagnosis model separately to obtain the sample features and fault prediction results of each source fault sample, as well as the sample features and fault prediction results of each target fault sample. This disclosure does not limit the scope of the embodiments. It should be understood that the sample features of each source fault sample and each target fault sample are extracted by the feature generator in the mechanical fault diagnosis model, and the fault prediction results of each source fault sample and each target fault sample are generated by the classifier in the mechanical fault diagnosis model.
[0065] In step S13, the sample classification loss is determined based on the fault prediction results of multiple source fault samples and the sample labels of each source fault sample. The sample classification loss characterizes the classification error of the mechanical fault diagnosis model in the fault type of the source fault sample.
[0066] Among them, the sample classification loss aims to minimize the classification error of the mechanical fault diagnosis model on the source fault samples. The sample classification loss serves as the basic loss that enables the generator to obtain domain-invariant and discriminative features. The loss function used to calculate the sample classification loss can, for example, be the SoftMax cross-entropy loss function shown in Equation (1):
[0067]
[0068] in, Representative sample classification loss, Multiple source fault samples in the representative source fault sample set Sample labels corresponding to each source fault sample x s y represents any source fault sample s Representative source fault sample x s The sample label, G(x) s ) represents the source fault sample x extracted by the feature generator G. s The sample features, C(G(x) s )) represents the fault prediction result generated by classifier C, K represents the total number of fault types, and k represents the fault type; Represents the source fault sample x s The value is 1 when the sample label is equal to k, and 0 otherwise; Represents the various source fault samples in the computational source fault sample set. The expectation.
[0069] It should be noted that the above-mentioned calculation of the sample classification loss using the SoftMax cross-entropy loss function is one possible implementation method provided by the embodiments of this disclosure. In fact, those skilled in the art can also use other known classification loss functions in the art, and the embodiments of this disclosure do not limit this.
[0070] In step S14, feature difference loss is determined based on the sample features of multiple source fault samples and multiple target fault samples. Feature difference loss characterizes the feature distribution difference between the sample features of source fault samples and the sample features of target fault samples.
[0071] The feature difference loss aims to make the sample features extracted by the feature generator domain invariant. After mapping cross-domain samples (i.e., source fault samples and target fault samples) to a shared high-level feature space using the feature generator, the feature distribution difference can be calculated, for example, using the Multi-kernel maximum mean discrepancy (MK-MMD) loss function shown in Equation (2).
[0072]
[0073] in, Representative feature difference loss, Sample features representing multiple source fault samples. Sample features representing multiple target fault samples. represent and The difference in the maximum mean of the multi-core samples can also be understood as... and The distance between them.
[0074] It should be understood that the obtained loss result can be backpropagated by minimizing the feature difference loss to optimize the parameters of the feature generator, thereby promoting the reduction of the feature distribution space difference of the sample features extracted by the feature generator. In other words, the sample features extracted by the feature extractor have domain invariance, or can map sample features from different feature distribution spaces to the same feature distribution space.
[0075] It should be noted that the above-described method of calculating feature difference loss using the MK-MMD loss function is one possible implementation provided by the embodiments of this disclosure. In fact, those skilled in the art can also use other known maximum mean difference loss functions, such as Joint Maximum Mean Discrepancy (JMMD), etc., and the embodiments of this disclosure do not limit this.
[0076] In step S15, the category confusion loss is determined based on the fault prediction results of multiple target fault samples. The category confusion loss characterizes the degree of confusion between different fault types by the mechanical fault diagnosis model.
[0077] The category confusion loss aims to extract class-discriminative (or class-differentiating) sample features from unlabeled target fault samples. This facilitates the classifier's accurate classification of unlabeled target fault samples based on these class-discriminative features. Since target fault samples lack labels, it's impossible to directly obtain discriminative sample features. Therefore, this disclosure introduces a clustering hypothesis, which states that the decision boundary should not intersect with high-density regions (i.e., regions where features are concentrated). This leads to the idea of selecting a specific constraint term (i.e., a loss term) corresponding to this clustering hypothesis. Minimizing this constraint term will move the decision boundary away from high-density regions. Furthermore, the feature generator optimized by minimizing the constraint term also extracts discriminative sample features for the target fault samples.
[0078] As we know, category confusion refers to the phenomenon where a classifier confuses itself with the correct category and the ambiguous category when making category predictions. Minimizing category confusion (MCC) aims to force the classifier to show confidence in its category predictions for unlabeled target fault samples, thereby shifting the decision boundary away from high-density regions. Since the labels of the target fault samples are unavailable, MCC cannot calculate the true category confusion, i.e., the error matrix. However, the degree of confusion can be reflected by the inner product between the probability predicted by the classifier and its transpose, and thus can be calculated using the probability predicted by the classifier.
[0079] For example, the class confusion loss can be calculated using the MCC loss function shown in formula (3):
[0080]
[0081] Where, x t This represents any target fault sample. Let C represent the target domain sample set (i.e., a batch containing B target fault samples), K represent the total number of fault types, j and j′ represent the j-th fault type and the j′-th fault type, respectively, and j′≠j. jj′ This represents the degree of confusion between each pair of fault types j and j′, used to assess and measure the confusion between different categories. The transpose of the matrix representing the probability that each of the B target fault samples in each batch is assigned to the j-th fault type. Let W be a matrix representing the probability that each of the B target fault samples in each batch is assigned to the j′-th fault type, and let W represent the importance of each target fault sample in the target domain sample set, which can be quantified as probability weights. jj′The purpose of using W is to obtain a probability distribution that assigns higher probabilities to samples with greater confidence in their class prediction. W is represented as the corresponding diagonal matrix, where W represents the importance of the i-th target fault sample. ii It can be calculated using formula (4):
[0082]
[0083] in, This represents the fault prediction result of the i-th target fault sample out of B target fault samples in each batch. Let represent the fault prediction result of the i′-th target fault sample out of B target fault samples in each batch, where exp represents an exponential function with the natural constant as the base, and H represents entropy, which can measure uncertainty. This can be expressed as formula (5-1). This can be expressed as formula (5-2):
[0084]
[0085] in, The probability that the i-th target fault sample belongs to the j-th fault type in the fault prediction result represents the i-th target fault sample. The probability that the i′th target fault sample belongs to the j-th fault type in the fault prediction result represents the i′th target fault sample.
[0086] It should be noted that the above-described method of calculating the category confusion loss using the MCC loss function is one possible implementation provided by the embodiments of this disclosure. In fact, those skilled in the art can also use other known category confusion loss functions in the art, and the embodiments of this disclosure do not limit this.
[0087] In step S16, the target loss is determined based on the sample classification loss, feature difference loss, and class confusion loss, and the target loss is used to optimize the mechanical fault diagnosis model to obtain the trained target mechanical fault diagnosis model.
[0088] In practical applications, the sample classification loss, feature difference loss, and class confusion loss can be summed to obtain the target loss. Alternatively, the sample classification loss, feature difference loss, and class confusion loss can be weighted and summed using weighting coefficients to obtain the target loss. For example, the target loss can be expressed as formula (6):
[0089]
[0090] Where λ represents the weighting coefficient, which can be gradually adjusted from 0 to 1 according to λ=2 / (1+exp(-10·p))-1, where p represents the current training round.
[0091] Among these methods, optimizing mechanical fault diagnosis models using target loss can be achieved through model optimization techniques such as backpropagation based on target loss. This optimization can be used to improve the parameters of the mechanical fault diagnosis model, including feature difference loss. The main optimizations can be made to the parameters of the feature generator and the category classification loss. And category confusion loss This can be used to optimize the parameters of the classifier and feature generator. It should be understood that those skilled in the art can utilize any known model optimization method in the art to optimize the mechanical fault diagnosis model using the target loss, and this disclosure does not limit such implementation.
[0092] As described above, the training of the mechanical fault diagnosis model can be performed in multiple rounds. The mechanical fault diagnosis model optimized in the current round can be used as the mechanical fault diagnosis model trained in the next round. Those skilled in the art can set training termination conditions, such as convergence or zeroing of the target loss, reaching a preset total number of iterations, etc., so that the mechanical fault diagnosis model optimized when the training termination conditions are met can be used as the target mechanical fault diagnosis model after training. This disclosure does not limit this aspect.
[0093] According to the training method of this disclosure, by training the mechanical fault diagnosis model using at least sample classification loss, feature difference loss, and category confusion loss, the feature extractor in the trained target mechanical fault diagnosis model can extract sample features with domain invariance and discriminativeness, and the classifier can exhibit stronger classification ability. This enables the transfer learning of the mechanical fault diagnosis model under the source working condition to the target mechanical fault diagnosis model under the target working condition, and makes the trained target mechanical fault diagnosis model have higher fault type diagnosis accuracy for unlabeled fault samples under the target working condition.
[0094] To further enhance the domain invariance of the sample features extracted by the feature generator and align the edge feature distribution, one possible implementation can also refer to domain adversarial training to improve the domain invariance of the sample features extracted by the feature generator. Specifically, the method may further include:
[0095] Step S17: Input the sample features of multiple source fault samples and the sample features of multiple target fault samples into the domain discriminator to obtain the domain classification results of each source fault sample and each target fault sample. The domain classification results represent the probability that the sample features belong to the feature distribution space corresponding to the source domain sample set, or the probability that the sample features belong to the feature distribution space corresponding to the target domain sample set.
[0096] Step S18: Based on the domain classification results of each source fault sample and the domain classification results of each target fault sample, determine the domain adversarial loss. The domain adversarial loss characterizes the classification error of the domain discriminator in the feature distribution space to which the sample features belong.
[0097] It should be understood that those skilled in the art can use domain discriminators known in the art, or can customize the network structure of the domain discriminator. For example, a domain discriminator composed of multiple hidden fully connected layers can be used, such as a domain discriminator mainly containing 3 hidden fully connected layers. The convolution kernel size of each hidden fully connected layer can be 256×1024, 1024×1024 and 1024×2, respectively. This disclosure does not limit the embodiments.
[0098] The domain discriminator takes the sample features extracted by the feature generator as input and distinguishes these sample features into the source domain or the target domain. It can be seen that domain adversarial training can be divided into two steps: first, the feature generator G is fixed, that is, the feature generator G is not optimized, and the sample features G(x) of the source fault samples extracted by the feature generator G are directly used. s ) or the sample features G(x) of the target fault sample t The domain discriminator (D) is considered as input to the domain discriminator (D). The classification error of D is minimized to optimize it. Then, with D fixed, the classification error of D is maximized to optimize the feature generator (G). Intuitively, if a good domain discriminator cannot distinguish between the source and target domains of the sample features extracted by the feature generator, then these sample features can be considered almost domain-invariant. These two steps can be further simplified due to the presence of the gradient reversal layer. Therefore, the domain adversarial training loss function shown in (7-1) can be used to calculate the above domain adversarial loss:
[0099]
[0100] in, 'sup' represents the domain adversarial loss, and 'sup' represents the supremum function, which can be understood as a maximization function. This represents finding a domain discriminator that makes Reaching the supremum; This represents the expected domain classification result for each source fault sample in the source domain sample set. D(G(x) represents the expected value of the domain classification result for each target fault sample in the target domain sample set. s )) represents the probability that the sample features of the source fault sample belong to the feature distribution space corresponding to the source domain sample set (that is, the probability that the sample features belong to the source domain), D(G(x) t)) represents the probability that the sample features of the target fault sample belong to the feature distribution space corresponding to the source domain sample set. For example, it can be set that if the probability is greater than 0.5, it belongs to the source domain sample set, and otherwise it belongs to the target domain sample set.
[0101] As mentioned above, domain adversarial training consists of two steps. First, the feature generator G is fixed to optimize the domain classifier D. Based on the above formula (7-1), it can be considered that it can maximize... It is a good domain discriminator, in which the first term is maximized. This allows the domain discriminator to better classify source fault samples (the first sample comes from the source domain sample set). ), due to the second item The first step involves a minus sign, so maximizing the second term is actually minimizing it. This means minimizing the probability that a target fault sample from the target domain sample set is classified as belonging to the source domain sample set, thus obtaining a good domain discriminator. The second step involves finding a feature generator that minimizes the domain adversarial loss, i.e., optimizing the feature generator so that the domain discriminator obtained in the previous step cannot determine whether a sample feature comes from the source or target domain. This ensures that the sample features generated by the feature generator possess domain invariance.
[0102] As mentioned above, the domain classification result can also characterize the probability that a sample feature belongs to the feature distribution space corresponding to the target domain sample set. Therefore, the domain adversarial training loss function shown in formula (7-2) can be used to calculate the above-mentioned domain adversarial loss:
[0103]
[0104] It should be understood that the explanation of formula (7-2) can be referred to the above explanation of formula (7-1), and will not be repeated here.
[0105] It should be noted that using the above formula (7-1) or formula (7-2) to calculate the domain adversarial loss is one possible implementation method provided by the embodiments of this disclosure. In fact, those skilled in the art can also use other known domain adversarial training loss functions in the art, and the embodiments of this disclosure do not limit this.
[0106] Based on the aforementioned domain adversarial loss, step S16, which determines the target loss according to the sample classification loss, feature difference loss, and class confusion loss, may include: determining the target loss based on the sample classification loss, feature difference loss, class confusion loss, and domain adversarial loss. This target loss can then be used to train the mechanical fault diagnosis model to obtain the trained target mechanical fault diagnosis model.
[0107] In practical applications, the sample classification loss, feature difference loss, class confusion loss, and domain adversarial loss can be summed to obtain the target loss. Alternatively, the sample classification loss, feature difference loss, class confusion loss, and domain adversarial loss can be weighted and summed using weighting coefficients to obtain the target loss. For example, the target loss can be expressed as formula (8):
[0108]
[0109] As mentioned above, λ represents the weighting coefficient, which can be gradually adjusted from 0 to 1 according to λ=2 / (1+exp(-10·p))-1, where p represents the current training round.
[0110] Then, the target loss shown in formula (8) can be used to train the mechanical fault diagnosis model to obtain the trained target mechanical fault diagnosis model. Among them, the feature difference loss... Domain confrontation losses The main optimization can be done by adjusting the parameters of the feature generator and the category classification loss. And category confusion loss This can be used to optimize the parameters of the classifier and feature generator. It should be understood that those skilled in the art can utilize any known model optimization method in the art to optimize the mechanical fault diagnosis model using the target loss, and this disclosure does not limit such implementation.
[0111] According to the training method of this disclosure, by training the mechanical fault diagnosis model using at least sample classification loss, feature difference loss, category confusion loss, and domain adversarial loss, the feature extractor in the trained target mechanical fault diagnosis model can extract sample features with stronger domain invariance and discriminativeness, and the classifier can exhibit stronger classification ability. This enables the transfer learning of the mechanical fault diagnosis model under the source working condition to the target mechanical fault diagnosis model under the target working condition, and makes the trained target mechanical fault diagnosis model have higher fault type diagnosis accuracy for unlabeled fault samples under the target working condition.
[0112] Considering that directly using the aforementioned sample classification loss, feature difference loss, class confusion loss, and domain adversarial loss to train the mechanical fault diagnosis model may lead to model collapse, a virtual adversarial loss can be introduced as an additional constraint term into the target loss to reduce this risk. This helps to make model training smoother, and virtual adversarial training can act as a lubricant throughout the entire model training process. Virtual adversarial training can be applied to the target domain sample set and / or the source domain sample set. Specifically, when applied to the source domain sample set, the method may further include:
[0113] Step S19: Add a perturbation signal to each source fault sample in the source domain sample set to obtain the source fault perturbation sample corresponding to each source fault sample.
[0114] Step S20: Input the source fault disturbance samples corresponding to each source fault sample into the mechanical fault diagnosis model to obtain the fault prediction results of the source fault disturbance samples corresponding to each source fault sample.
[0115] Step S21: Based on the fault prediction results of multiple source fault samples and the fault prediction results of the source fault disturbance samples corresponding to each source fault sample, determine the first virtual adversarial loss. The first virtual adversarial loss characterizes the difference between the fault prediction results of the source fault samples and the fault prediction results of the corresponding source fault disturbance samples.
[0116] The disturbance signal can be a small vibration signal, which can be selected from a small signal range and randomly added to each source fault sample in the source domain sample set to generate source fault disturbance samples corresponding to each source fault sample. Then, the mechanical fault diagnosis model can be used to output the fault prediction results of the source fault disturbance samples corresponding to each source fault sample. It should be understood that the difference between the source fault sample and the source fault disturbance sample after adding the disturbance is small, or the fault prediction results of the two are similar or the same (i.e., they are close). Therefore, the mechanical fault diagnosis model can be trained by the first virtual adversarial loss, which can make the mechanical fault diagnosis model more stable and less prone to collapse. It avoids the model from changing the fault prediction results significantly just because a small disturbance is added to the sample. In other words, if the mechanical fault diagnosis model can classify the source fault sample and the source fault disturbance sample with a small disturbance into the same category, then the mechanical fault diagnosis model is considered to be a smooth model with a low risk of collapse.
[0117] For example, the first virtual adversarial loss described above can be calculated using the virtual adversarial training loss function shown in formula (9):
[0118]
[0119] in, Representing the first virtual adversarial loss, x s Representative source fault sample, Let x represent the source fault sample set, r represent the disturbance signal, and ∥r∥≤∈ represent the disturbance signal being less than a small threshold ∈. s +r represents the source fault disturbance sample corresponding to the source fault sample, G(x) s +r) represents the sample features of the source fault disturbance sample, C(G(x) s +r)) represents the fault prediction result of the source fault disturbance sample, D KL Represents the KL divergence function, DKL (C(G(x s ))∥C(G(x s +r))) is equivalent to calculating C(G(x) s )) and C(G(x s The distance between +r)) This can be understood as finding a perturbation signal r that makes D KL maximum, This represents the calculation of the corresponding source fault samples. The expectation. Among them, utilizing Training the model can ensure that the classifier in the model is consistent within the norm sphere neighborhood of each source fault sample.
[0120] It should be noted that using the above formula (9) to calculate the first virtual adversarial loss is one possible implementation method provided by the present disclosure embodiment. In fact, those skilled in the art can also use other known virtual adversarial training loss functions in the art, and the present disclosure embodiment does not limit this.
[0121] Based on the aforementioned first virtual adversarial loss, step S16, which determines the target loss according to the sample classification loss, feature difference loss, and class confusion loss, may further include:
[0122] The target loss is determined based on the sample classification loss, feature difference loss, class confusion loss, and first virtual adversarial loss; or,
[0123] The target loss is determined based on the sample classification loss, feature difference loss, category confusion loss, domain adversarial loss, and first virtual adversarial loss.
[0124] As mentioned above, the domain adversarial loss is determined based on the domain classification results of each source fault sample and the domain classification results of each target fault sample.
[0125] In practical applications, the target loss can be obtained by summing the sample classification loss, feature difference loss, class confusion loss, and first virtual adversarial loss. Alternatively, the target loss can be obtained by weighting the sample classification loss, feature difference loss, class confusion loss, and first virtual adversarial loss using weighting coefficients. Thus, the target loss can also be expressed as formula (10-1):
[0126]
[0127] Alternatively, the target loss can be obtained by summing the sample classification loss, feature difference loss, class confusion loss, domain adversarial loss, and first virtual adversarial loss. Alternatively, the target loss can be obtained by weighting the sample classification loss, feature difference loss, class confusion loss, domain adversarial loss, and first virtual adversarial loss using weighting coefficients. Therefore, the target loss can also be expressed as formula (10-2):
[0128]
[0129] Then, the target loss shown in formula (10-1) or formula (10-2) can be used to train the mechanical fault diagnosis model to obtain the trained target mechanical fault diagnosis model. Among these, the feature difference loss... Domain confrontation losses The main optimization can be done by adjusting the parameters of the feature generator and the category classification loss. Category confusion loss Losses in the first virtual confrontation This can be used to optimize the parameters of the classifier and feature generator. It should be understood that those skilled in the art can utilize any known model optimization method in the art to optimize the mechanical fault diagnosis model using the target loss, and this disclosure does not limit such implementation.
[0130] According to the training method of this disclosure, by training the mechanical fault diagnosis model using at least sample classification loss, feature difference loss, category confusion loss, domain adversarial loss, and first virtual adversarial loss, the feature extractor in the trained target mechanical fault diagnosis model can extract sample features with stronger domain invariance and discriminativeness, and the classifier can exhibit stronger classification ability. It can also make the target mechanical fault diagnosis model more stable, smooth, and less prone to collapse. Thus, it is possible to transfer the mechanical fault diagnosis model under the source working condition to the target mechanical fault diagnosis model under the target working condition, and make the trained target mechanical fault diagnosis model have higher fault type diagnosis accuracy for unlabeled fault samples under the target working condition.
[0131] As described above, virtual adversarial training can also be applied to a target domain sample set. Therefore, in one possible implementation, the method may further include:
[0132] Step S22: Add perturbation signals to each target fault sample in the target domain sample set to obtain the target fault perturbation sample corresponding to each target fault sample.
[0133] Step S23: Input the target fault disturbance sample corresponding to each target fault sample into the mechanical fault diagnosis model to obtain the fault prediction result of the target fault disturbance sample corresponding to each target fault sample.
[0134] Step S24: Based on the fault prediction results of multiple target fault samples and the fault prediction results of the target fault disturbance samples corresponding to each target fault sample, determine the second virtual adversarial loss. The second virtual adversarial loss characterizes the difference between the fault prediction results of the target fault samples and the fault prediction results of the corresponding target fault disturbance samples.
[0135] The disturbance signal can be a small vibration signal, which can be selected from a small signal range and randomly added to each target fault sample in the target domain sample set to generate target fault disturbance samples corresponding to each target fault sample. Then, the mechanical fault diagnosis model can be used to output the fault prediction results of the target fault disturbance samples corresponding to each target fault sample. It should be understood that the difference between the target fault sample and the target fault disturbance sample after adding the disturbance is small, or the fault prediction results of the two are similar or the same (i.e., they are close). Therefore, by using the second virtual adversarial loss to train the mechanical fault diagnosis model, the mechanical fault diagnosis model can be made more stable and have a lower risk of collapse. It avoids the model from changing the fault prediction results significantly just because a small disturbance is added to the sample. In other words, if the mechanical fault diagnosis model can classify the target fault sample and the target fault disturbance sample with added disturbance into the same category, then the mechanical fault diagnosis model is considered to be a smooth model with a low risk of collapse.
[0136] For example, the virtual adversarial loss function shown in formula (11) can be used to calculate the second virtual adversarial loss mentioned above:
[0137]
[0138] in, Representing the second virtual adversarial loss, x t Represents the target fault sample. Let x represent the target fault sample set, r represent the disturbance signal, and ∥r∥≤∈ represent the disturbance signal being less than a small threshold v. t +r represents the target fault disturbance sample corresponding to the target fault sample, G(x t +r) represents the sample features of the target fault disturbance sample, C(G(x) t +r)) represents the fault prediction result of the target fault disturbance sample, D KL Represents the KL divergence function, D KL (C(G(x t ))∥C(G(x t +r))) is equivalent to calculating C(G(x) t )) and C(G(x t The distance between +r)) This can be understood as finding a perturbation signal r that minimizes D.KL maximum, This represents the calculation of the corresponding target fault samples. The expectation. Among them, utilizing Training the model can make the classifier consistent within the norm sphere neighborhood of each target fault sample.
[0139] It should be noted that using the above formula (11) to calculate the second virtual adversarial loss is one possible implementation method provided by the present disclosure embodiment. In fact, those skilled in the art can also use other known virtual adversarial training loss functions in the art, and the present disclosure embodiment does not limit this.
[0140] Based on the aforementioned second virtual adversarial loss, step S16 determines the target loss according to the sample classification loss, feature difference loss, and class confusion loss, including:
[0141] The target loss is determined based on the sample classification loss, feature difference loss, class confusion loss, and second virtual adversarial loss; or,
[0142] The target loss is determined based on the sample classification loss, feature difference loss, class confusion loss, domain adversarial loss, and second virtual adversarial loss; or,
[0143] The target loss is determined based on the sample classification loss, feature difference loss, class confusion loss, first virtual adversarial loss, and second virtual adversarial loss; or,
[0144] The target loss is determined based on the sample classification loss, feature difference loss, category confusion loss, domain adversarial loss, first virtual adversarial loss, and second virtual adversarial loss.
[0145] As mentioned above, the domain adversarial loss is determined based on the domain classification results of each source fault sample and the domain classification results of each target fault sample, and the first virtual adversarial loss is determined based on the fault prediction results of multiple source fault samples and the fault prediction results of the source fault disturbance samples corresponding to each source fault sample.
[0146] In practical applications, the target loss can be obtained by summing the sample classification loss, feature difference loss, class confusion loss, and second virtual adversarial loss. Alternatively, the target loss can be obtained by weighting the sample classification loss, feature difference loss, class confusion loss, and second virtual adversarial loss using weighting coefficients. Thus, the target loss can also be expressed as formula (12-1):
[0147]
[0148] Alternatively, the target loss can be obtained by summing the sample classification loss, feature difference loss, class confusion loss, domain adversarial loss, and second virtual adversarial loss. Alternatively, the target loss can be obtained by weighting the sample classification loss, feature difference loss, class confusion loss, domain adversarial loss, and second virtual adversarial loss using weighted coefficients. Therefore, the target loss can also be expressed as formula (12-2):
[0149]
[0150] Alternatively, the target loss can be obtained by summing the sample classification loss, feature difference loss, class confusion loss, first virtual adversarial loss, and second virtual adversarial loss. Alternatively, the target loss can be obtained by weighting the sample classification loss, feature difference loss, class confusion loss, first virtual adversarial loss, and second virtual adversarial loss using weighting coefficients. Therefore, the target loss can also be expressed as formula (12-3):
[0151]
[0152] Alternatively, the target loss can be obtained by summing the sample classification loss, feature difference loss, class confusion loss, domain adversarial loss, first virtual adversarial loss, and second virtual adversarial loss. Alternatively, the target loss can be obtained by weighting the sample classification loss, feature difference loss, class confusion loss, domain adversarial loss, first virtual adversarial loss, and second virtual adversarial loss using weighting coefficients. Therefore, the target loss can also be expressed as formula (12-4):
[0153]
[0154] Then, any one of the target loss formulas (12-1) to (12-4) can be used to train the mechanical fault diagnosis model to obtain the trained target mechanical fault diagnosis model. Among these, the feature difference loss... Domain confrontation losses The main optimization can be done by adjusting the parameters of the feature generator and the category classification loss. Category confusion loss First Virtual Confrontation Loss Second virtual confrontation loss This can be used to optimize the parameters of the classifier and feature generator. It should be understood that those skilled in the art can utilize any known model optimization method in the art to optimize the mechanical fault diagnosis model using the target loss, and this disclosure does not limit such implementation.
[0155] According to the training method of this disclosure, by using sample classification loss, feature difference loss, category confusion loss, domain adversarial loss, first virtual adversarial loss and / or second virtual adversarial loss to train the mechanical fault diagnosis model, the feature extractor in the trained target mechanical fault diagnosis model can extract sample features with stronger domain invariance and discriminativeness, and the classifier can exhibit stronger classification ability. It can also make the target mechanical fault diagnosis model more stable, smooth and less prone to collapse. In this way, it is possible to transfer the mechanical fault diagnosis model under the source working condition to the target mechanical fault diagnosis model under the target working condition, and make the trained target mechanical fault diagnosis model have higher fault type diagnosis accuracy for unlabeled fault samples under the target working condition.
[0156] It is known that in the current field of fault diagnosis, many popular transfer methods can generally be summarized into two categories. The first category focuses on aligning edge feature distributions and typically includes four main steps. First, a feature generator is used to map cross-domain data to a shared feature space. Then, various distance metrics are used to quantify the differences in edge feature distributions. Furthermore, a classifier is used to classify the labeled source features. Finally, the classification results and distribution differences are backpropagated to optimize model parameters. The second category has a similar architectural framework to the first, the only difference being the second step. In the second category, the second step serves as a transfer regularization term, measuring the differences in edge feature distributions through the loss of a domain classifier that distinguishes between source and target features. These two methods can also be combined to better align edge distributions and extract more domain-invariant features. These methods achieve the same goal—aligning edge feature distributions—through different means, such as... Figure 4 This illustrates an existing transfer learning training process, such as... Figure 4 As shown, for source fault samples and target fault samples, existing technologies optimize the feature generator by calculating domain adversarial loss or MK-MMD loss based on the sample features extracted by the feature generator and classifier, and optimize the feature generator and classifier by calculating cross entropy loss based on the fault prediction results output by the classifier.
[0157] Based on the transfer training method proposed in the embodiments of this disclosure above, the embodiments of this disclosure can achieve the following: Figure 5The training process shown is used to train the feature generator and classifier in the mechanical fault diagnosis model. Specifically, MK-MMD is chosen to calculate the feature difference loss, a domain discriminator is used to calculate the domain adversarial loss, MCC is used to calculate the class confusion loss, and the Virtual Adversarial Training (VAT) loss function is selected to calculate the virtual adversarial loss. In detail, the feature generator G is responsible for mapping cross-domain data to high-level features (i.e., extracting sample features from fault samples) and using MK-MMD to calculate the feature difference loss based on the sample features of the source fault sample and the target fault sample. And the domain adversarial loss is calculated using the domain classification results of the source fault sample features and the target fault sample features generated by the domain discriminator. To use feature difference loss Domain confrontation losses A backpropagation approach is used to optimize the feature generator, enabling the use of feature difference loss and domain adversarial loss to measure the differences in edge feature distributions. Classifier C operates in both the source and target domains, taking the features extracted by the feature generator as input and outputting fault prediction results. Specifically, for the fault prediction results of source fault samples, the cross-entropy loss is calculated to obtain the class classification loss. and the first virtual confrontation loss And it can utilize category classification loss and the first virtual confrontation loss Backpropagation is employed to optimize the classifier and feature generator, ensuring consistency of the classifier within the canonical sphere neighborhood of each source fault sample and reducing classification errors for source fault samples. For the fault prediction results of the target fault sample, MCC can be used to calculate the class confusion loss. And using VAT to calculate the second virtual adversary loss And utilize category confusion loss and the losses of the second virtual adversarial training Backpropagation is used to optimize the classifier and feature generator to ensure that the classifier remains consistent within the canonical sphere neighborhood of each target fault sample and to improve the classification accuracy of the target fault samples.
[0158] Based on the mechanical vibration model training method proposed in the above embodiments of this disclosure, this disclosure also provides a mechanical fault diagnosis method, including:
[0159] Step S31: Obtain the actual fault data collected when the machine fails under the target working condition. The fault data includes mechanical vibration signals.
[0160] Step S32: Based on the fault data, the fault diagnosis result corresponding to the fault data is determined using the target mechanical fault diagnosis model. The fault diagnosis result characterizes the fault type of the mechanical fault under the target working condition. The target mechanical fault diagnosis model is trained by the training method described above.
[0161] In step S31, those skilled in the art can use vibration signal acquisition methods known in the art to acquire mechanical vibration signals when mechanical failure occurs under the target working condition as fault data. As mentioned above, the mechanical vibration signals can also be subjected to fast Fourier transform to obtain N or N / 2 Fourier coefficients as fault data. This disclosure does not limit this aspect.
[0162] In step S32, fault data can be input into the target mechanical fault diagnosis model, and the probability of the fault data belonging to various fault types can be output. Then, the fault type with the highest probability can be selected as the fault diagnosis result corresponding to the mechanical fault. This embodiment of the present disclosure does not limit this.
[0163] According to the diagnostic method of this disclosure, an accurate fault type diagnosis can be obtained when a mechanical fault occurs under a target working condition using a target mechanical fault diagnosis model.
[0164] To intuitively demonstrate the beneficial effects of the mechanical fault diagnosis model transfer training method proposed in this embodiment, this embodiment also conducted experimental verification on the PHM2009 dataset and the CWRU2000 dataset for the transfer training method proposed in this embodiment and some existing transfer learning methods. The experimental process and results are described below.
[0165] The PHM2009 dataset (PHM09,2009) contains fault data typical of industrial gearboxes. The gearbox configuration includes two gear types: spur gears and helical cut (threaded) gears. The gearbox consists of three shafts, four gears, and six bearings. Synchronous data acquisition was employed, with accelerometers mounted on retaining plates on the input and output shafts. Additionally, tachometers were used to generate 10 pulses per revolution, providing accurate zero-crossing information. Data acquisition was performed at a sampling frequency of 66.67 kHz, capturing vibration signals at shaft speeds of 30 Hz, 35 Hz, 40 Hz, 45 Hz, and 50 Hz under high and low load conditions. The experimental dataset contains six different fault types, each originating from a different component failure within the gearbox. Figure 6The sample information table for the PHM2009 dataset shown allows for the evaluation of model performance using vibration signals from helical gearboxes operating at 30Hz, 35Hz, 40Hz, and 45Hz under high load conditions. These four sample sets (i.e., four domains) corresponding to these four frequencies can be labeled A, B, C, and D, respectively. Under different operating conditions, for each of the six fault types (i.e., No. of Category 0 to 5) at each load frequency of 30Hz, 35Hz, 40Hz, and 45Hz, the number of samples is 222. This means the dataset contains a total of 5328 data samples, each with 1200 data points.
[0166] Based on the aforementioned PHM2009 dataset, this embodiment of the present disclosure evaluated the target mechanical fault diagnosis model (i.e., Proposed) obtained by the training method proposed in this embodiment on 12 transfer learning fault diagnosis experiments. It was also compared with diagnostic models obtained by nine other existing transfer learning methods (i.e., CDAN (Conditional Adversarial Domain Adaptation), JAN (Joint Adaptation Network), DCTLN (Deep Convolutional Transfer Learning Network), DANN (Domain-Adversarial Neural Network), DAN (Deep Adaptation Network), MCD (Maximum Classifier Discrepancy), MDD (Maximum Classifier Discrepancy), CORAL (Correlation Alignment), and Baseline Model Basis). The results are as follows: Figure 7 The table showing the experimental results, including the model classification accuracy (%) and standard deviation, is as follows: Figure 7 As shown, o→p represents a transfer fault diagnosis experiment from the source domain sample set o to the target domain sample set p, where o≠p, o, p∈A,B,C,D. For example, A→B represents a transfer from the source domain sample set A to the target domain sample set B. The training dataset includes samples from both the source and target domain sample sets, while the test dataset may only include samples from the target domain sample set. To ensure fair comparison, the model structures used by different methods remain the same; that is, the same network structure can be used to construct the feature generators and classifiers for different methods. Under the above configuration, each transfer fault diagnosis experiment can be repeated five times to ensure reliable results and robustness.
[0167] As described above, the performance of the training method proposed in this public embodiment is evaluated by comparing the classification accuracy achieved by the models trained by the nine existing transfer methods in the target domain. Figure 7 The experimental results table shown indicates how much higher the accuracy of the training method of this embodiment is compared to the second-best transfer method, and how much lower the accuracy of the training method of this embodiment is compared to the first-best transfer method. The baseline model refers to a convolutional neural network (CNN) trained only on labeled data in the source domain. DANN achieves good transfer performance through a domain discriminator. DAN relies on the MK-MMD distance metric. MDD and DCORAL also rely on some very effective metrics for measuring distributional differences. DCTLN further incorporates MDD into domain adversarial training and better aligns edge feature distributions. CDAN and JAN are also methods that attempt to acquire discriminative features for target samples. MCD utilizes two classifiers to enhance discriminative performance. As... Figure 7 As shown, the target mechanical fault diagnosis model trained by the training method proposed in this embodiment of the present disclosure achieves competitive results. In 9 out of 12 experiments, the target mechanical fault diagnosis model trained by the training method proposed in this embodiment of the present disclosure outperforms other existing methods in transfer fault diagnosis accuracy. This means that even without labeled data, the target mechanical fault diagnosis model trained by the training method proposed in this embodiment of the present disclosure can effectively identify gearbox fault conditions.
[0168] Compared to the baseline, not only the training method proposed in this disclosure, but also all other popular transfer learning methods demonstrate superior classification accuracy. The key difference between the transfer learning method and the baseline model trained solely on source data lies in the transfer regularization, which utilizes labeled data from the source domain and unlabeled data from the target domain. Transfer regularization is typically used to align marginal feature distributions by minimizing a metric that measures the difference in distribution. In the training method proposed in this disclosure, transfer regularization refers to the domain-invariant module; more specifically, it is a combination of feature difference loss and domain adversarial loss. As the results show, due to the addition of transfer regularization, transfer learning can achieve what traditional deep learning cannot, further facilitating intelligent mechanical fault diagnosis.
[0169] For methods such as DAN, DANN, DCORAL, MDD, and DCTLN, these methods are first analyzed. DAN uses MK-MMD, and DANN uses a domain discriminator; these are popular transfer learning methods, and the results show that their performance is similar. DCORAL and MDD both aim to obtain domain-invariant features by reducing distributional discrepancies, but their performance is generally mediocre. DCTLN can actually be seen as a combination of DAN and DANN, and it performs better in most transfer learning tasks. Even with the integration of DAN and DANN, DCTLN still mainly focuses on aligning edge feature distributions and does not address the problem of extracting discriminative features for the target. Fundamentally, these methods are only equivalent to the domain-invariant modules in the training method proposed in this disclosure. However, the training method proposed in this disclosure not only includes a domain-invariant module but also integrates a discriminative module and a stabilizing module. The class confusion loss in the discriminative module helps extract discriminative features for the target samples, while the virtual adversarial loss in the stabilizing module is responsible for ensuring the smoothness of the model. As the results show, the training method proposed in this disclosure outperforms existing methods in 9 out of 12 experiments. To some extent, this means that simply relying on the alignment of edge feature distributions is far from sufficient, and that MK-MCC and VAT have already achieved their intended goals.
[0170] Compared to CDAN, JAN, and MCD, the training method proposed in this disclosure performs better, although these three methods also attempt to obtain discriminative features. The training architecture of the proposed method consists of three modules, each with specific requirements. In this case, the most suitable constraints can be customized or selected according to the requirements of each module. However, these three methods are not modular and cannot achieve a level comparable to the training method proposed in this disclosure in all three aspects (domain invariance, discriminability, and stability). This also explains to some extent why the target mechanical fault diagnosis model trained by the proposed method outperforms CDAN, JAN, and MCD.
[0171] To verify whether the virtual adversarial loss and class confusion loss truly function, a comprehensive ablation analysis was also performed in the embodiments of this disclosure, yielding the following results: Figure 8 The classification accuracy (%) and standard deviation of ablation experiments in the target domain on the PHM2009 dataset are shown below. Figure 8As shown, ↑ in the third and fourth columns indicate an improvement in accuracy compared to the second column, while ↓ indicates a decrease. The addition of virtual adversarial loss is represented by "+VAT", and the addition of class confusion loss is represented by "+MCC". Experimental results demonstrate that DANN+MK-MMD+MCC is sufficient to outperform DANN+MK-MMD in eight out of twelve experiments. MCC further enhances the capabilities of DANN+MK-MMD, proving the effectiveness of MCC. Furthermore, performance is further improved when VAT is integrated into the model. Ultimately, in eleven out of twelve experiments, both VAT and MCC play a significant role in achieving optimal performance. In summary, the ablation experiments further validate the effectiveness of each loss in the training method proposed in this disclosure.
[0172] This disclosure also provides visualizations to illustrate the impact of extracting discriminative features of the target domain. Specifically, a migration fault diagnosis experiment C→A is used as an example, and the results are presented respectively. Figure 9 , Figure 10 and Figure 11 The confusion matrix shown is as follows. Where, Figure 9 , Figure 10 and Figure 11 The confusion matrices of the target mechanical fault diagnosis model, DCTLN, and baseline model trained using the training method proposed in this disclosure are shown in the target domain. In the confusion matrix, the six numbers on the diagonal represent different outcomes for six fault types. The larger the number and the darker the color, the closer the model's predicted fault types are to the actual distribution of fault types. Through comparison... Figure 9 , Figure 10 and Figure 11 It can be observed that the baseline model cannot distinguish different categories well in the target domain, indicating that the baseline cannot extract discriminative features for the target samples. However, the transfer method works well, and the target mechanical fault diagnosis model trained by the training method proposed in this embodiment shows stronger classification performance, thus verifying its ability to extract discriminative features more effectively.
[0173] In experiments using the CWRU2000 dataset, this embodiment of the disclosure uses bearing data obtained from the CWRU2000 dataset. The bearing data was obtained from a motor-driven mechanical system, and the bearing type used in the experiments was SKF6205. The system was operated under four different loads with a sampling frequency of 12 kHz. The bearing dataset includes four different fault states: (1) normal state (NC), (2) outer ring fault (OF), (3) inner ring fault (IF), and (4) roller fault (RF). Each fault condition is associated with a specific fault diameter: IF is 0.18 mm, OF is 0.36 mm, and RF is 0.54 mm. Figure 12 This table shows the sample information for a CWRU2000 dataset. Fault samples were acquired at three different load levels (0Hp, 1Hp, and 2Hp), forming three sample sets A, B, and C. Sample sets A, B, and C each contain 10 different fault types (i.e., No. of Category 0 to 9). The table also shows the number of samples for each fault type in each sample set at loads of 0Hp, 1Hp, and 2Hp. For example, the number of samples for No. of Category 0 in sample set A is 203, and so on. Each sample in this dataset can have 1200 data points.
[0174] Based on the CWRU2000 dataset, six transfer fault diagnosis experiments were conducted to evaluate the effectiveness of the training method proposed in this embodiment. In these six experiments, the target mechanical fault diagnosis model trained by the method proposed in this embodiment directly used the original data as input, while maintaining consistency with the experimental settings used in the previous PHM2009 experiment. The training method proposed in this embodiment was then compared with baselines, DAN, DANN, DCTLN, CDAN, and JAN, yielding the following results: Figure 13 The experimental results table shown presents the classification accuracy (%) and standard deviation of each model in the target domain on the CWRU dataset. ↑ indicates how much higher the accuracy of the training method proposed in this embodiment is compared to the second-highest accurate method, and ↓ indicates how much lower the accuracy of the training method proposed in this embodiment is compared to the highest accurate method. As the results show, in six transfer fault diagnosis experiments, the target mechanical fault diagnosis model trained by the training method proposed in this embodiment outperformed other methods in three of the experiments. In the other three experiments, one of the other methods slightly outperformed the target mechanical fault diagnosis model trained by the training method proposed in this embodiment. However, overall, the training method proposed in this embodiment is no worse than any other method and performs well on the CWRU dataset. This indicates that the target mechanical fault diagnosis model trained by the training method proposed in this embodiment can work under the original data conditions. Furthermore, although the above... Figure 13 A slight imbalance exists between fault type 0 (the normal type) and fault types 1-9 in the CWRU2000 dataset shown, but the training method proposed in this disclosure can still be effectively implemented. These observations reflect, to some extent, the generalization ability of the target mechanical fault diagnosis model trained by the training method proposed in this disclosure on imbalanced data and different input types.
[0175] The experiments described above demonstrate an inherent flaw in current popular transfer learning methods for fault diagnosis: even if the model acquires domain-invariant features, it cannot guarantee the acquisition of discriminative sample features. In contrast, the mechanical fault diagnosis model training method proposed in this disclosure achieves excellent fault diagnosis results on gearbox and bearing fault datasets. Experimental results on these datasets show that the target mechanical fault diagnosis model trained by the proposed method achieves superior fault diagnosis classification accuracy under various operating conditions, surpassing current mainstream fault diagnosis methods. Furthermore, additional ablation experiments further validate the effectiveness of the mechanical fault diagnosis model training method proposed in this disclosure.
[0176] Figure 14 This diagram illustrates a block diagram of a mechanical fault diagnosis model transfer training apparatus according to an embodiment of the present disclosure, such as... Figure 14 As shown, the device includes:
[0177] The acquisition module 141 is used to acquire the mechanical fault diagnosis model to be trained, as well as a source domain sample set and a target domain sample set. The source domain sample set includes multiple source fault samples and corresponding sample labels for each source fault sample. The target domain sample set includes multiple unlabeled target fault samples. The source fault samples include mechanical vibration signals collected when the machine fails under source operating conditions, and the target fault samples include mechanical vibration signals collected when the machine fails under target operating conditions. The source operating conditions and the target operating conditions are different. The sample labels are used to indicate the fault type corresponding to the source fault sample. The mechanical fault diagnosis model includes a feature generator and a classifier. The feature generator is used to extract sample features from the fault samples, and the classifier is used to generate fault prediction results based on the sample features. The fault prediction results include the probability that each fault sample belongs to a specific fault type.
[0178] The prediction module 142 is used to use the mechanical fault diagnosis model to output the sample features and fault prediction results of each source fault sample, as well as the sample features and fault prediction results of each target fault sample, based on each source fault sample in the source domain sample set and each target fault sample in the target domain sample set.
[0179] The classification loss determination module 143 is used to determine the sample classification loss based on the fault prediction results of the multiple source fault samples and the sample labels of each source fault sample. The sample classification loss characterizes the classification error of the mechanical fault diagnosis model in the fault type of the source fault sample.
[0180] The difference loss determination module 144 is used to determine the feature difference loss based on the sample features of the plurality of source fault samples and the sample features of the plurality of target fault samples, wherein the feature difference loss characterizes the difference in sample feature distribution between the source domain sample set and the target domain sample set.
[0181] The confusion loss determination module 145 is used to determine the category confusion loss based on the fault prediction results of the multiple target fault samples. The category confusion loss characterizes the degree of confusion between different fault types by the mechanical fault diagnosis model.
[0182] The optimization module 146 is used to determine the target loss based on the sample classification loss, the feature difference loss and the category confusion loss, and to optimize the mechanical fault diagnosis model using the target loss to obtain the trained target mechanical fault diagnosis model.
[0183] In one possible implementation, the apparatus further includes: a domain adversarial loss determination module, configured to: input the sample features of the plurality of source fault samples and the sample features of the plurality of target fault samples into a domain discriminator, respectively, to obtain the domain classification results of each source fault sample and each target fault sample, wherein the domain classification results characterize the probability that a sample feature belongs to the feature distribution space corresponding to the source domain sample set, or characterize the probability that a sample feature belongs to the feature distribution space corresponding to the target domain sample set; and determine the domain adversarial loss based on the domain classification results of each source fault sample and each target fault sample, wherein the domain adversarial loss characterizes the classification error of the domain discriminator in the feature distribution space to which the sample feature belongs.
[0184] In one possible implementation, determining the target loss based on the sample classification loss, the feature difference loss, and the class confusion loss includes: determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, and the domain adversarial loss.
[0185] In one possible implementation, the apparatus further includes: a first virtual adversarial loss determination module, configured to: add perturbation signals to each source fault sample in the source domain sample set to obtain source fault perturbation samples corresponding to each source fault sample; input the source fault perturbation samples corresponding to each source fault sample into the mechanical fault diagnosis model to obtain fault prediction results of the source fault perturbation samples corresponding to each source fault sample; and determine a first virtual adversarial loss based on the fault prediction results of the plurality of source fault samples and the fault prediction results of the source fault perturbation samples corresponding to each source fault sample, wherein the first virtual adversarial loss characterizes the difference between the fault prediction results of the source fault samples and the fault prediction results of the corresponding source fault perturbation samples.
[0186] In one possible implementation, determining the target loss based on the sample classification loss, the feature difference loss, and the class confusion loss includes: determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, and the first virtual adversarial loss; or, determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, the domain adversarial loss, and the first virtual adversarial loss; wherein the domain adversarial loss is determined based on the domain classification results of each source fault sample and the domain classification results of each target fault sample.
[0187] In one possible implementation, the apparatus further includes: a second virtual adversarial loss determination module, configured to: add perturbation signals to each target fault sample in the target domain sample set to obtain target fault perturbation samples corresponding to each target fault sample; input the target fault perturbation samples corresponding to each target fault sample into the mechanical fault diagnosis model to obtain fault prediction results of the target fault perturbation samples corresponding to each target fault sample; and determine a second virtual adversarial loss based on the fault prediction results of the plurality of target fault samples and the fault prediction results of the target fault perturbation samples corresponding to each target fault sample, wherein the second virtual adversarial loss characterizes the difference between the fault prediction results of the target fault samples and the fault prediction results of the corresponding target fault perturbation samples.
[0188] In one possible implementation, determining the target loss based on the sample classification loss, the feature difference loss, and the class confusion loss includes: determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, and the second virtual adversarial loss; or, determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, the domain adversarial loss, and the second virtual adversarial loss; or, determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, the first virtual adversarial loss, and the second virtual adversarial loss; or, determining the target loss based on the sample classification loss, the feature difference loss, the class confusion loss, the domain adversarial loss, the first virtual adversarial loss, and the second virtual adversarial loss; wherein the domain adversarial loss is determined based on the domain classification results of each source fault sample and the domain classification results of each target fault sample, and the first virtual adversarial loss is determined based on the fault prediction results of the plurality of source fault samples and the fault prediction results of the source fault disturbance samples corresponding to each source fault sample.
[0189] According to the training apparatus of this disclosure, by using sample classification loss, feature difference loss, category confusion loss, domain adversarial loss, first virtual adversarial loss and / or second virtual adversarial loss to train the mechanical fault diagnosis model, the feature extractor in the trained target mechanical fault diagnosis model can extract sample features with stronger domain invariance and discriminativeness, and the classifier can exhibit stronger classification ability. It can also make the target mechanical fault diagnosis model more stable, smooth and less prone to collapse. In this way, it can realize the transfer learning of the mechanical fault diagnosis model under the source working condition to the target mechanical fault diagnosis model under the target working condition, and make the trained target mechanical fault diagnosis model have higher fault type diagnosis accuracy for unlabeled fault samples under the target working condition.
[0190] Based on the above-described training device, this disclosure also provides a mechanical fault diagnosis device, comprising:
[0191] The data acquisition module is used to acquire actual fault data collected when mechanical failure occurs under the target working condition, and the fault data includes mechanical vibration signals;
[0192] The fault diagnosis module is used to determine the fault diagnosis result corresponding to the fault data based on the fault data using the target mechanical fault diagnosis model. The fault diagnosis result characterizes the fault type of the mechanical failure under the target working condition. The target mechanical fault diagnosis model is trained using the training device.
[0193] The diagnostic apparatus according to the embodiments of this disclosure can obtain an accurate fault type diagnosis when a mechanical fault occurs under a target working condition by utilizing a target mechanical fault diagnosis model.
[0194] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0195] This disclosure also proposes a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the above-described method. The computer-readable storage medium can be volatile or non-volatile.
[0196] This disclosure also proposes an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.
[0197] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-described method.
[0198] Figure 15 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. For example, the electronic device 1900 may be provided as a server or a terminal device. (Refer to...) Figure 15 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.
[0199] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). Electronic device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM Mac OS X TM Unix TM Linux TM FreeBSD TM Or similar.
[0200] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of an electronic device 1900 to perform the above-described method.
[0201] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0202] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0203] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0204] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0205] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0206] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0207] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0208] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0209] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for transferring and training a mechanical fault diagnosis model, characterized in that, include: The process involves acquiring a mechanical fault diagnosis model to be trained, along with a source domain sample set and a target domain sample set. The source domain sample set includes multiple source fault samples and corresponding sample labels for each source fault sample. The target domain sample set includes multiple unlabeled target fault samples. Source fault samples include mechanical vibration signals collected when a mechanical fault occurs under source operating conditions. Target fault samples include mechanical vibration signals collected when a mechanical fault occurs under target operating conditions, where the source operating conditions and target operating conditions are different. The sample labels indicate the fault type corresponding to each source fault sample. The mechanical fault diagnosis model includes a feature generator and a classifier. The feature generator extracts sample features from the fault samples, and the classifier generates fault prediction results based on the sample features. The fault prediction results include the probability that each fault sample belongs to a specific fault type. The mechanical fault diagnosis model is used to output the sample features and fault prediction results of each source fault sample, as well as the sample features and fault prediction results of each target fault sample, based on each source fault sample in the source domain sample set and each target fault sample in the target domain sample set. Based on the fault prediction results of the multiple source fault samples and the sample labels of each source fault sample, the sample classification loss is determined, and the sample classification loss characterizes the classification error of the mechanical fault diagnosis model in the fault type of the source fault sample. Based on the sample features of the multiple source fault samples and the sample features of the multiple target fault samples, a feature difference loss is determined, wherein the feature difference loss characterizes the feature distribution difference between the sample features of the source fault samples and the sample features of the target fault samples; wherein, the feature difference loss is the multi-kernel maximum mean difference between the sample features of the multiple source fault samples and the sample features of the multiple target fault samples. Based on the fault prediction results of the multiple target fault samples, the category confusion loss is determined, which characterizes the degree of confusion between different fault types by the mechanical fault diagnosis model; Based on the sample classification loss, the feature difference loss, and the category confusion loss, a target loss is determined, and the mechanical fault diagnosis model is optimized using the target loss to obtain the trained target mechanical fault diagnosis model.
2. The method according to claim 1, characterized in that, The method further includes: The sample features of the multiple source fault samples and the sample features of the multiple target fault samples are respectively input into the domain discriminator to obtain the domain classification results of each source fault sample and each target fault sample. The domain classification results represent the probability that the sample features belong to the feature distribution space corresponding to the source domain sample set, or the probability that the sample features belong to the feature distribution space corresponding to the target domain sample set. Based on the domain classification results of each source fault sample and the domain classification results of each target fault sample, the domain adversarial loss is determined. The domain adversarial loss characterizes the classification error of the domain discriminator in the feature distribution space to which the sample features belong. The step of determining the target loss based on the sample classification loss, the feature difference loss, and the class confusion loss includes: The target loss is determined based on the sample classification loss, the feature difference loss, the category confusion loss, and the domain adversarial loss.
3. The method according to claim 1 or 2, characterized in that, The method further includes: Add a perturbation signal to each source fault sample in the source domain sample set to obtain the source fault perturbation sample corresponding to each source fault sample; The source fault disturbance samples corresponding to each source fault sample are input into the mechanical fault diagnosis model to obtain the fault prediction results of the source fault disturbance samples corresponding to each source fault sample. Based on the fault prediction results of the multiple source fault samples and the fault prediction results of the source fault disturbance samples corresponding to each source fault sample, a first virtual adversarial loss is determined. The first virtual adversarial loss characterizes the difference between the fault prediction results of the source fault samples and the fault prediction results of the corresponding source fault disturbance samples.
4. The method according to claim 3, characterized in that, The step of determining the target loss based on the sample classification loss, the feature difference loss, and the class confusion loss includes: The target loss is determined based on the sample classification loss, the feature difference loss, the category confusion loss, and the first virtual adversarial loss; or, The target loss is determined based on the sample classification loss, the feature difference loss, the category confusion loss, the domain adversarial loss, and the first virtual adversarial loss; The domain adversarial loss is determined based on the domain classification results of each source fault sample and the domain classification results of each target fault sample.
5. The method according to claim 1 or 2, characterized in that, The method further includes: Add a perturbation signal to each target fault sample in the target domain sample set to obtain the target fault perturbation sample corresponding to each target fault sample; The target fault disturbance sample corresponding to each target fault sample is input into the mechanical fault diagnosis model to obtain the fault prediction result of the target fault disturbance sample corresponding to each target fault sample. Based on the fault prediction results of the multiple target fault samples and the fault prediction results of the target fault disturbance samples corresponding to each target fault sample, a second virtual adversarial loss is determined. The second virtual adversarial loss characterizes the difference between the fault prediction results of the target fault samples and the fault prediction results of the corresponding target fault disturbance samples.
6. The method according to claim 5, characterized in that, The step of determining the target loss based on the sample classification loss, the feature difference loss, and the class confusion loss includes: The target loss is determined based on the sample classification loss, the feature difference loss, the class confusion loss, and the second virtual adversarial loss; or, The target loss is determined based on the sample classification loss, the feature difference loss, the category confusion loss, the domain adversarial loss, and the second virtual adversarial loss; or, The target loss is determined based on the sample classification loss, the feature difference loss, the category confusion loss, the first virtual adversarial loss, and the second virtual adversarial loss; or, The target loss is determined based on the sample classification loss, the feature difference loss, the category confusion loss, the domain adversarial loss, the first virtual adversarial loss, and the second virtual adversarial loss. The domain adversarial loss is determined based on the domain classification results of each source fault sample and the domain classification results of each target fault sample, and the first virtual adversarial loss is determined based on the fault prediction results of the multiple source fault samples and the fault prediction results of the source fault disturbance samples corresponding to each source fault sample.
7. A method for diagnosing mechanical faults, characterized in that, include: Acquire actual fault data collected when mechanical failure occurs under target working conditions, the fault data including mechanical vibration signals; Based on the fault data, the fault diagnosis result corresponding to the fault data is determined using the target mechanical fault diagnosis model. The fault diagnosis result characterizes the type of fault that occurs in the machine under the target working condition. The target mechanical fault diagnosis model is trained using the training method described in any one of claims 1 to 6.
8. A mechanical fault diagnosis model transfer training device, characterized in that, include: An acquisition module is used to acquire the mechanical fault diagnosis model to be trained, as well as a source domain sample set and a target domain sample set. The source domain sample set includes multiple source fault samples and corresponding sample labels for each source fault sample. The target domain sample set includes multiple unlabeled target fault samples. Source fault samples include mechanical vibration signals collected when the machine fails under source operating conditions, and target fault samples include mechanical vibration signals collected when the machine fails under target operating conditions. The source operating conditions and target operating conditions are different. The sample labels are used to indicate the fault type corresponding to the source fault sample. The mechanical fault diagnosis model includes a feature generator and a classifier. The feature generator is used to extract sample features from the fault samples, and the classifier is used to generate fault prediction results based on the sample features. The fault prediction results include the probability that each fault sample belongs to a specific fault type. The prediction module is used to utilize the mechanical fault diagnosis model to output the sample features and fault prediction results of each source fault sample, as well as the sample features and fault prediction results of each target fault sample, based on each source fault sample in the source domain sample set and each target fault sample in the target domain sample set. The classification loss determination module is used to determine the sample classification loss based on the fault prediction results of the multiple source fault samples and the sample labels of each source fault sample. The sample classification loss characterizes the classification error of the mechanical fault diagnosis model in the fault type of the source fault sample. The difference loss determination module is used to determine the feature difference loss based on the sample features of the plurality of source fault samples and the sample features of the plurality of target fault samples. The feature difference loss characterizes the difference in sample feature distribution between the source domain sample set and the target domain sample set. The feature difference loss is the multi-kernel maximum mean difference between the sample features of the plurality of source fault samples and the sample features of the plurality of target fault samples. The confusion loss determination module is used to determine the category confusion loss based on the fault prediction results of the multiple target fault samples. The category confusion loss characterizes the degree of confusion between different fault types by the mechanical fault diagnosis model. An optimization module is used to determine a target loss based on the sample classification loss, the feature difference loss, and the category confusion loss, and to optimize the mechanical fault diagnosis model using the target loss to obtain a trained target mechanical fault diagnosis model.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the method of any one of claims 1 to 7 when executing instructions stored in the memory.
10. A non-volatile computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Gear case fault diagnosis method based on deep transfer learning
CN116894187A
Adaptive cross-working-condition fault diagnosis method for rotary machinery based on depth discrimination and unsupervised field
CN118643324A