Zero-sample unsupervised multi-expert diesel engine fault detection method and system based on reconstructor-discriminator

By processing the Mel spectrum of diesel engine vibration signals using a reconstructor-discriminator combined with a multi-expert shift window attention module, the problem of high-precision fault detection of diesel engines under fault-free sample conditions is solved, achieving high-accuracy and robust fault identification.

CN121786679APending Publication Date: 2026-04-03BEIJING UNIV OF CHEM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing diesel engine fault detection methods struggle to achieve high accuracy and stability in environments with scarce fault samples and high noise levels, and are particularly ineffective when there are no fault samples available.

Method used

A zero-sample unsupervised multi-expert diesel engine fault detection method based on reconstructor-discriminator is adopted. The Mel spectrum of diesel engine vibration signal is processed by multi-expert shift window attention module. Combined with the training method of reconstructor and discriminator, the reconstruction error is used for fault identification.

Benefits of technology

Achieving high-precision fault detection under fault-free sample conditions improves the accuracy and robustness of diesel engine fault detection and is suitable for complex industrial environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786679A_ABST
    Figure CN121786679A_ABST
Patent Text Reader

Abstract

The invention discloses a zero sample diesel engine fault detection method and system based on a multi-expert reconstruction model, and belongs to the technical field of mechanical equipment state monitoring and intelligent fault diagnosis. The invention provides a multi-expert reconstruction model for solving the problem that accurate fault detection of a large diesel engine is difficult to realize under the condition of no fault sample. The model comprises a reconstructor guided by a discriminator and a multi-expert window moving attention mechanism. Wherein the reconstructor guided by the discriminator realizes feature reconstruction of a vibration signal; the multi-expert window-moving attention mechanism adaptively captures the spectral characteristic change under the load change, thereby enhancing the robustness in the non-stationary noise environment. Through a test bench and field data verification, high detection precision and stable measurement response can be maintained under different working conditions. The method breaks through the limitation of traditional dependence on fault samples, realizes accurate fault identification under a zero sample condition by using the discriminator and the attention feature routing, and has relatively high diagnosis precision and engineering deployability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mechanical signal processing and equipment fault diagnosis, and in particular to a zero-sample unsupervised multi-expert diesel engine fault detection method and system based on a reconstructor-discriminator. Background Technology

[0002] Diesel engines, as crucial power units in transportation, construction machinery, and power generation, play a vital role in the national economy. Due to their complex structure, variable operating environment, and prolonged exposure to high temperatures and pressures, diesel engines are prone to various malfunctions during operation. In recent years, with the rapid development of artificial intelligence and signal processing technologies, deep learning models such as convolutional neural networks, long short-term memory networks, and Transformers have been widely applied in the field of mechanical equipment anomaly detection. These methods, through analysis and feature extraction of vibration, temperature, and acoustic signals collected by sensors, achieve intelligent monitoring and fault identification of diesel engine operating conditions, significantly improving the accuracy and efficiency of detection.

[0003] However, existing diesel engine anomaly detection methods still have significant shortcomings. On the one hand, fault samples are extremely scarce, costly to acquire, and pose safety risks, making it difficult for models to learn effective fault features during the training phase, thus limiting diagnostic performance. On the other hand, mainstream methods such as transfer learning, semantic feature learning, and few-shot learning all rely on some fault data or manually labeled semantic features, making them difficult to apply in industrial scenarios with no fault samples. Especially under the conditions of high noise, high sampling rate, and strict real-time requirements of diesel engines, the stability and interpretability of existing models are insufficient. Therefore, this invention discloses a zero-shot unsupervised multi-expert diesel engine fault detection method and system based on a reconstructor-discriminator architecture to improve the accuracy, robustness, and practical application feasibility of diesel engine fault detection. Unlike existing fault diagnosis methods based on supervised learning or few-shot learning, this invention requires no fault samples for training. It only uses vibration signals under normal operating conditions to construct a Mel spectrogram and combines it with a multi-expert shifted window attention module (ME-SWA) to achieve high-precision reconstruction. By identifying data that deviates from the normal pattern through reconstruction errors, it fundamentally solves the practical problem of "no fault samples available" in industrial settings. This technical solution has not been reported in the known literature and has significant novelty. Summary of the Invention

[0004] To address the shortcomings of existing technologies, particularly the difficulties in obtaining diesel engine fault samples and the high sampling frequency and strong noise of diesel engine vibration signals, this invention proposes a zero-sample unsupervised multi-expert diesel engine fault detection method and system based on a reconstructor-discriminator, which can achieve accurate diesel engine fault detection under zero fault sample conditions.

[0005] This invention provides a zero-sample unsupervised multi-expert diesel engine fault detection method and system based on a reconstructor-discriminator, comprising the following steps:

[0006] S1: Collect vibration signals x(t) from various locations of the diesel engine to be diagnosed, including each cylinder block, crankcase, and timing gearbox, where t is the sampling time, and convert them into Mel-frequency spectrograms x. mel Considering that Mel spectra are based on human auditory perception, and that converting the spectrum to a Mel scale better reflects human perception of different frequencies, this invention synchronously acquires multi-channel signals and converts them into Mel spectra separately; these are then stitched together along the channel dimension to form a multi-channel Mel spectra as model input. This processing method preserves the spatial correlation information between different measurement points, enabling the reconstructor to utilize cross-channel consistency features to improve its sensitivity to anomalous patterns.

[0007] S2: Design of reconstructor and discriminator based on multi-expert shift window attention mechanism;

[0008] S3: Train the reconstructor's ability to reconstruct the Mel spectrum of diesel engine vibration data and the discriminator's ability to distinguish between the real Mel spectrum and the reconstructed Mel spectrum, and enhance the reconstructor's reconstruction ability based on the discriminator's resolution ability;

[0009] S4: Calculate the reconstruction error as a test indicator, and trigger an alarm when it exceeds the alarm threshold;

[0010] In one embodiment of the present invention, step S2, the design of the reconstructor and discriminator based on the multi-expert shift window attention mechanism, includes the following steps:

[0011] S201: Design of a Multi-Expert Shift-Window Attention Module (ME-SWA). Considering the multi-channel characteristics of diesel engine vibration signals (e.g., multiple sensors are deployed in locations such as the cylinder block, crankcase, and timing gearbox), the signals of each channel exhibit strong correlation in the time-frequency domain. The design of the ME-SWA module is based on this inherent relationship, achieving effective modeling of joint features across multiple channels by sharing attention weights and expert networks. In the shift-attention mechanism, we use two shifting methods for block segmentation: regular segmentation and shift-window segmentation. "Blocking" refers to dividing the Mel spectrogram into non-overlapping segments. By introducing the shift-window attention mechanism, each module processes windows that are interleaved with the previous module, enhancing the model's ability to capture global information, thereby improving overall performance and efficiency. The "multi-expert" refers to a set of K independent feedforward neural networks, each with the same structure but different parameters. After each block passes through the shift-attention mechanism, the "routing mechanism" selects the Top-K most relevant experts based on the feature response intensity of the input block to process the data and extract features.

[0012] G(x n ) = Softmax(TopK(x n ·W g ))

[0013] Among them W g The weights represent the routes in G, which are linear layers. Deep learning is used to update these weights and learn how to assign corresponding experts to each block. n Represents x mel The feature data of each block obtained after block division, x n ·W g That is, the weight of each expert is selected for each block, and TopK(x) represents the top K largest values ​​in x. n ·W g That is, we obtain the weights of the K experts with the largest weights, and finally normalize them using Softmax to obtain the final weight of each expert.

[0014] S202: Design the reconstructor model. The reconstructor includes 12 convolutional layers and 16 ME-SWA modules. The ME-SWA modules appear in groups and are arranged in the reconstructor using alternating regular and shifted windows. For the Mel-spectrum graph x of the diesel engine vibration signal... mel The reconstructor first inputs the Mel spectrogram into the encoder to extract its features, thus obtaining the reconstructor features R. f The data is then input into the decoder and deconvolved to the same size as the original Mel spectrogram, resulting in the reconstructed Mel spectrogram. mel The encoder has 6 layers of 2D convolutions. The first 5 layers have 4×4 kernels, a stride of 2, and padding of 1. After convolution, they pass through a layer normalization module and a LeakyReLU activation function. After the activation function of the first four convolutions, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. The 6th convolution layer has a 4×4 kernel, a stride of 1, and padding of 0. The decoder consists of six deconvolutional layers. The first deconvolutional layer has a 4×4 kernel, a stride of 1, and zero padding. After deconvolution, it passes through a layer normalization module and a LeakyReLU activation function. In the second, third, fourth, and fifth deconvolutional layers, the kernel is 4×4, the stride is 2, and the padding is 1. After convolution, it passes through a layer normalization module and a LeakyReLU activation function. After each activation function, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. In the sixth deconvolutional layer, the kernel is 4×4, the stride is 2, and the padding is 1. After convolution, it passes through a LeakyReLU activation function.Figure 3 It contains the detailed structure of the refactorer;

[0015] S203: Design the discriminator model. The discriminator includes 6 convolutional layers and 8 ME-SWA modules. The first 5 convolutional layers have 4×4 kernels, a stride of 2, and padding of 1. After convolution, they pass through a layer normalization module and a LeakyReLU activation function. After the activation function of the 2nd, 3rd, 4th, and 5th convolutional layers, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. The 6th convolutional layer has a 4×4 kernel, a stride of 1, and padding of 0. After convolution, the two-dimensional feature vector is flattened into a one-dimensional feature vector. The structure is similar to the first half of the reconstructor and is the feature extractor D of the discriminator. FE Input Mel spectrogram x mel Or the reconstructed Mel spectrogram (recon) mel The discriminator feature D is obtained. f After passing through a layer normalization module and the LeakyReLU activation function, the input is then fed into a linear layer to determine whether the input data is real data. Figure 3 It includes the detailed structure of the discriminator;

[0016] In one embodiment of the present invention, step S3, training the reconstructor model and the discriminator model, includes the following steps:

[0017] S301: For x mel and recon mel First, extract the features of each discriminator:

[0018] and x mel and recon mel Discriminator features;

[0019] S302: The reconstructor training used x mel recon mel , and The four features have the following loss function:

[0020]

[0021] In the formula, MSE represents the mean squared error, and mean(x) represents the mean of x;

[0022] S303: The discriminator is trained using the same method as WGAN-GP, with the following loss function:

[0023]

[0024] In the formula, D represents the reconstructor, D(x) represents the output vector obtained after x is input into the discriminator, the random number ∈ (0,1), and λ is the penalty factor;

[0025] S304: During training, the reconstructor and discriminator are trained alternately until both achieve optimal results;

[0026] In one embodiment of the present invention, step S4, where the calculated reconstruction error is used as a test indicator, triggers an alarm when the alarm threshold is exceeded, includes the following steps:

[0027] S401: Calculate x mel and recon mel The differences between them are used as part of the test metrics:

[0028] TI1 = MSE(x mel ,recon mel )

[0029] S402: Calculate x mel and recon mel Reconstruction features and Incorporate the differences between reconstructed features as part of the test metrics:

[0030]

[0031] S403: Calculate test data With training set X train Discriminator features The distance is used as the loss function:

[0032]

[0033] S404: Integrate the test metrics calculated in S401, S402, and S403 into a single metric used during testing.

[0034] TI=λ1TI1+λ2TI2+λ3TI3

[0035] In the formula, λ1, λ2, λ3∈{0,1}, λ1+λ2+λ3=1, that is, one of the three test indicators is selected as the final test indicator. When selecting, the test indicator that performs best in the validation set after training should be used.

[0036] S405: We use the validation set data X eval Fitting the location, shape, and scale parameters (τ,κ,λ) of the Weibull distribution = Weibull(X) evalWhen determining whether data is outlier, it is necessary to calculate the Weibull cumulative distribution function (CDF) probability:

[0037]

[0038] An anomaly is identified when the CDF of the test data exceeds a set value Ω. The optimal threshold is obtained in the validation set and used for fault detection in subsequent applications.

[0039] This invention addresses the challenges of obtaining fault data and conducting supervised training for industrial equipment during actual operation. It proposes a zero-sample fault detection method and system based on reconstruction error. This method effectively solves the zero-negative-sample problem caused by relying on fault samples in traditional methods by training the model using only normal data samples. The invention reconstructs the Mel-spectrum of diesel engine vibration signals using a reconstructor and discriminator, designs a multi-expert shifted window attention module to extract data features and perform accurate reconstruction. Furthermore, it designs training methods for the reconstructor and discriminator, as well as methods for calculating reconstruction error and selecting thresholds in practical applications, allowing for flexible use in various scenarios. This invention achieves high-precision fault detection without the involvement of fault data, significantly improving the model's practicality and generalization ability in complex industrial environments, and has broad engineering application prospects.

[0040] The beneficial technical effects of this invention are as follows:

[0041] 1. This invention establishes a zero-sample fault detection model framework for diesel engines. For operating conditions where only normal vibration data exists but no fault samples are available, a unified model system is proposed that can be used to identify unknown faults. This framework effectively solves the problem that traditional methods cannot identify unseen fault samples, providing a reliable technical foundation for zero-sample anomaly detection in engine condition monitoring.

[0042] 2. This invention proposes an adversarial-guided reconstruction strategy. By introducing a discriminator to constrain the feature learning direction during the reconstruction process, the feature distribution becomes more consistent, enhancing the separability and stability of abnormal features, thereby significantly improving the reliability and robustness of fault identification.

[0043] 3. This invention designs a multi-expert shift window attention mechanism, which can adaptively allocate multiple expert networks in the time-frequency domain, thereby improving the model's sensitivity to load changes and non-stationary spectral features, and achieving accurate capture of signal features under complex working conditions.

[0044] 4. This invention has extremely high accuracy in terms of diagnostic precision, robustness and measurement reliability, and is particularly effective when fault samples cannot be obtained. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a schematic diagram of a zero-sample unsupervised multi-expert diesel engine fault detection method and system based on a reconstructor-discriminator according to an embodiment of the present invention;

[0047] Figure 2 This is a diagram of the multi-expert shift window attention structure provided in an embodiment of the present invention;

[0048] Figure 3 This is a structural diagram of the reconstructor and discriminator provided in the embodiments of the present invention;

[0049] Figure 4 This is a comparison experiment confusion matrix diagram provided in the embodiments of the present invention;

[0050] Figure 5 This is the t-SNE visualization of MERM provided in the embodiments of the present invention;

[0051] Figure 6 This is a frequency diagram of expert selection in the multi-expert module of MERM provided in this embodiment of the invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0053] Figure 1 This is a schematic diagram of a zero-sample unsupervised multi-expert diesel engine fault detection method and system based on a reconstructor-discriminator according to an embodiment of the present invention. See also... Figure 1 The zero-sample unsupervised multi-expert diesel engine fault detection method and system based on reconstructor-discriminator includes the following steps:

[0054] S1: Collect vibration signals x(t) from various locations of the diesel engine to be diagnosed, including each cylinder block, crankcase, and timing gearbox, where t is the sampling time, and convert them into Mel-frequency spectrograms x. melConsidering that Mel spectra are based on human auditory perception, and that converting the spectrum to a Mel scale better reflects human perception of different frequencies, this invention synchronously acquires multi-channel signals and converts them into Mel spectra separately; these are then stitched together along the channel dimension to form a multi-channel Mel spectra as model input. This processing method preserves the spatial correlation information between different measurement points, enabling the reconstructor to utilize cross-channel consistency features to improve its sensitivity to anomalous patterns.

[0055] S2: Design of reconstructor and discriminator based on multi-expert shift window attention mechanism;

[0056] S3: Train the reconstructor's ability to reconstruct the Mel spectrum of diesel engine vibration data and the discriminator's ability to distinguish between the real Mel spectrum and the reconstructed Mel spectrum, and enhance the reconstructor's reconstruction ability based on the discriminator's resolution ability;

[0057] S4: Calculate the reconstruction error as a test indicator, and trigger an alarm when it exceeds the alarm threshold;

[0058] In one embodiment of the present invention, step S2, the design of the reconstructor and discriminator based on the multi-expert shift window attention mechanism, includes the following steps:

[0059] S201: Design of a Multi-Expert Shift-Window Attention Module (ME-SWA). Considering the multi-channel characteristics of diesel engine vibration signals (e.g., multiple sensors are deployed in locations such as the cylinder block, crankcase, and timing gearbox), the signals of each channel exhibit strong correlation in the time-frequency domain. The design of the ME-SWA module is based on this inherent relationship, achieving effective modeling of joint features across multiple channels by sharing attention weights and expert networks. In the shift-attention mechanism, we use two shifting methods for block segmentation: regular segmentation and shift-window segmentation. "Blocking" refers to dividing the Mel spectrogram into non-overlapping segments. By introducing the shift-window attention mechanism, each module processes windows that are interleaved with the previous module, enhancing the model's ability to capture global information, thereby improving overall performance and efficiency. The "multi-expert" refers to a set of K independent feedforward neural networks, each with the same structure but different parameters. After each block passes through the shift-attention mechanism, the "routing mechanism" selects the Top-K most relevant experts based on the feature response intensity of the input block to process the data and extract features.

[0060] G(x n ) = Softmax(TopK(x n ·W g ))

[0061] Among them W g The weights represent the routes in G, which are linear layers. Deep learning is used to update these weights and learn how to assign corresponding experts to each block.n Represents x mel The feature data of each block obtained after block division, x n ·W g That is, the weight of each expert is selected for each block, and TopK(x) represents the top K largest values ​​in x. n ·W g That is, we obtain the weights of the K experts with the largest weights, and finally normalize them using Softmax to obtain the final weight of each expert.

[0062] It should be noted that the number of experts selected can be determined according to the actual task; preferably, K=2.

[0063] S202: Design the reconstructor model. The reconstructor includes 12 convolutional layers and 16 ME-SWA modules. The ME-SWA modules appear in groups and are arranged in the reconstructor using alternating regular and shifted windows. For the Mel-spectrum graph x of the diesel engine vibration signal... mel The reconstructor first inputs the Mel spectrogram into the encoder to extract its features, thus obtaining the reconstructor features R. f The data is then input into the decoder and deconvolved to the same size as the original Mel spectrogram, resulting in the reconstructed Mel spectrogram. mel The encoder has 6 layers of 2D convolutions. The first 5 layers have 4×4 kernels, a stride of 2, and padding of 1. After convolution, they pass through a layer normalization module and a LeakyReLU activation function. After the activation function of the first four convolutions, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. The 6th convolution layer has a 4×4 kernel, a stride of 1, and padding of 0. The decoder consists of six deconvolutional layers. The first deconvolutional layer has a 4×4 kernel, a stride of 1, and zero padding. After deconvolution, it passes through a layer normalization module and a LeakyReLU activation function. In the second, third, fourth, and fifth deconvolutional layers, the kernel is 4×4, the stride is 2, and the padding is 1. After convolution, it passes through a layer normalization module and a LeakyReLU activation function. After each activation function, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. In the sixth deconvolutional layer, the kernel is 4×4, the stride is 2, and the padding is 1. After convolution, it passes through a LeakyReLU activation function. Figure 3 It contains the detailed structure of the refactorer;

[0064] S203: Design the discriminator model. The discriminator includes 6 convolutional layers and 8 ME-SWA modules. The first 5 convolutional layers have 4×4 kernels, a stride of 2, and padding of 1. After convolution, they pass through a layer normalization module and a LeakyReLU activation function. After the activation function of the 2nd, 3rd, 4th, and 5th convolutional layers, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. The 6th convolutional layer has a 4×4 kernel, a stride of 1, and padding of 0. After convolution, the two-dimensional feature vector is flattened into a one-dimensional feature vector. The structure is similar to the first half of the reconstructor and is the feature extractor D of the discriminator. FE Input Mel spectrogram x mel Or the reconstructed Mel spectrogram (recon) mel The discriminator feature D is obtained. f After passing through a layer normalization module and the LeakyReLU activation function, the input is then fed into a linear layer to determine whether the input data is real data. Figure 3 It includes the detailed structure of the discriminator;

[0065] In one embodiment of the present invention, step S3, training the reconstructor model and the discriminator model, includes the following steps:

[0066] S301: For x mel and recon mel First, extract the features of each discriminator:

[0067] and x mel and recon mel Discriminator features;

[0068] S302: The reconstructor training used x mel recon mel , and The four features have the following loss function:

[0069]

[0070] In the formula, MSE represents the mean squared error, and mean(x) represents the mean of x;

[0071] S303: The discriminator is trained using the same method as WGAN-GP, with the following loss function:

[0072]

[0073] In the formula, D represents the reconstructor, D(x) represents the output vector obtained after x is input into the discriminator, the random number ε∈(0,1) and λ is the penalty factor;

[0074] It should be noted that the penalty factor is the gradient penalty for training the discriminator, which can be adjusted according to the task. Preferably, λ = 10 is set.

[0075] S304: During training, the reconstructor and discriminator are trained alternately until both achieve optimal results;

[0076] In one embodiment of the present invention, step S4, where the calculated reconstruction error is used as a test indicator, triggers an alarm when the alarm threshold is exceeded, includes the following steps:

[0077] S401: Calculate x mel and recon mel The differences between them are used as part of the test metrics:

[0078] TI1 = MSE(x mel ,recon mel )

[0079] S402: Calculate x mel and recon mel Reconstruction features and Incorporate the differences between reconstructed features as part of the test metrics:

[0080]

[0081] S403: Calculate test data With training set X train Discriminator features The distance is used as the loss function:

[0082]

[0083] S404: Integrate the test metrics calculated in S401, S402, and S403 into a single metric used during testing.

[0084] TI=λ1TI1+λ2TI2+λ3TI3

[0085] In the formula, λ1, λ2, λ3∈{0,1}, λ1+λ2+λ3=1, that is, one of the three test indicators is selected as the final test indicator. When selecting, the test indicator that performs best in the validation set after training should be used.

[0086] S405: We use the validation set data X evalFitting the location, shape, and scale parameters (τ,κ,λ) of the Weibull distribution = Weibull(X) eval When determining whether data is outlier, it is necessary to calculate the Weibull cumulative distribution function (CDF) probability:

[0087]

[0088] An anomaly is identified when the CDF of the test data exceeds a set value Ω. The optimal threshold is obtained from the validation set and used for fault detection in subsequent applications.

[0089] It should be noted that Ω is the cumulative distribution function threshold used to determine the threshold, which can be adjusted according to the task. Preferably, Ω = 0.95.

[0090] According to a second aspect of the present invention, a zero-sample unsupervised multi-expert diesel engine fault detection method and system based on a reconstructor-discriminator includes:

[0091] The signal acquisition module is used to acquire the fault signal x(t) of the diesel engine to be diagnosed, where t is the sampling time;

[0092] The signal conversion module is used to convert the sampled diesel engine fault signal x(t) into a Mel-frequency spectrogram x. mel ;

[0093] The reconstructor module is used to reconstruct the Mel spectrum of the diesel engine vibration signal for reconstruction error calculation.

[0094] The discriminator module is used to guide the reconstructor to reconstruct the Mel spectrum of the diesel engine vibration signal;

[0095] The error calculation module is used to calculate the reconstruction error as an indicator of whether a fault has occurred.

[0096] The alarm module is used to determine the alarm threshold and judge whether the reconstruction error reaches the alarm threshold, so as to realize the fault detection function of the diesel engine.

[0097] In one embodiment of the present invention, the reconstructor module includes:

[0098] The system employs 12 convolutional layers and 16 ME-SWA layers, with the ME-SWA modules appearing in groups and arranged in the reconstructor using alternating regular and shifted windows. This is used for the Mel-spectrum graph x of the diesel engine vibration signal. mel The reconstructor first inputs the Mel spectrogram into the encoder to extract its features, thus obtaining the reconstructor features R. f The data is then input into the decoder and deconvolved to the same size as the original Mel spectrogram, resulting in the reconstructed Mel spectrogram. melThe encoder has 6 layers of 2D convolutions. The first 5 layers have 4×4 kernels, a stride of 2, and padding of 1. After convolution, they pass through a layer normalization module and a LeakyReLU activation function. After the activation function of the first four convolutions, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. The 6th convolution layer has a 4×4 kernel, a stride of 1, and padding of 0. The decoder consists of six deconvolutional layers. The first deconvolutional layer has a 4×4 kernel, a stride of 1, and zero padding. After deconvolution, it passes through a layer normalization module and a LeakyReLU activation function. In the second, third, fourth, and fifth deconvolutional layers, the kernel is 4×4, the stride is 2, and the padding is 1. After convolution, it passes through a layer normalization module and a LeakyReLU activation function. After each activation function, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. In the sixth deconvolutional layer, the kernel is 4×4, the stride is 2, and the padding is 1. After convolution, it passes through a LeakyReLU activation function. Figure 3 It contains the detailed structure of the refactorer;

[0099] In one embodiment of the present invention, the discriminator module includes:

[0100] The system consists of 6 convolutional layers and 8 ME-SWA layers. The first 5 convolutional layers have 4×4 kernels, a stride of 2, and padding of 1. After convolution, they pass through a layer normalization module and a LeakyReLU activation function. After the activation function of the 2nd, 3rd, 4th, and 5th convolutional layers, there is one ME-SWA layer using a regular window and one ME-SWA layer using a shifted window. Each ME-SWA layer uses an 8×8 window for block division. The 6th convolutional layer has a 4×4 kernel, a stride of 1, and padding of 0. After convolution, the 2D feature vector is flattened into a 1D feature vector. The structure is similar to the first half of the reconstructor and is the feature extractor D of the discriminator. FE Input Mel spectrogram x mel Or the reconstructed Mel spectrogram (recon) mel The discriminator feature D is obtained. f After passing through a layer normalization module and the LeakyReLU activation function, the input is then fed into a linear layer to determine whether the input data is real data. Figure 3 It includes the detailed structure of the discriminator;

[0101] In one embodiment of the present invention, the error calculation module includes:

[0102] After training the reconstructor and discriminator, the reconstruction error needs to be calculated using the features extracted by the model. Calculate x.mel and recon mel The differences between them are used as part of the test metrics:

[0103] TI1 = MSE(x mel ,recon mel )

[0104] Calculate x mel and recon mel Reconstruction features and Incorporate the differences between reconstructed features as part of the test metrics:

[0105]

[0106] Calculate test data With training set X train Discriminator features The distance is used as the loss function:

[0107]

[0108] The test metrics calculated in S401, S402, and S403 are integrated into the metrics used during testing:

[0109] TI=λ1TI1+λ2TI2+λ3TI3

[0110] In the formula, λ1, λ2, λ3∈[0,1], λ1+λ2+λ3=1;

[0111] In one embodiment of the present invention, the alarm module includes:

[0112] After calculating the reconstruction error, we use the validation set data X. eval Fit Weibull distribution (τ,κ,λ)=Weibull(X) eval When determining whether data is outlier, it is necessary to calculate the Weibull cumulative distribution function (CDF) probability:

[0113]

[0114] An anomaly is identified when the CDF of the test data exceeds a set value Ω. The optimal threshold is obtained from the validation set and used for fault detection in subsequent applications.

[0115] It should be noted that Ω is the cumulative distribution function threshold used to determine the threshold, which can be adjusted according to the task. Preferably, Ω = 0.95.

[0116] The specific implementation method is as follows:

[0117] Various experiments were conducted on the model using three datasets to verify the capabilities of MERM. During the experiments, each dataset was divided into training, validation, and test sets. The experimental datasets covered three typical fault conditions: bearing damage, misfire, and abnormal valve clearance. This dataset detailed engine performance under different operating conditions, specifically including five different speed settings (900, 950, 1000, 1050, and 1100 rpm) and five different load levels (0, 50, 100, 150, and 200 N·m). These conditions comprised 25 different operating conditions, as shown in Table 1. The complete dataset included 44,566 operating cycles. Field case datasets A and B were both real vibration signals of diesel engines obtained from field measurements. Both datasets contained different speed and load variations. Field case dataset A included 8,809 operating cycles, while field case dataset B included 23,608 operating cycles.

[0118] In the experiments, we used accuracy, the area under the receiver operating characteristic (ROC) curve (AUC), and model confidence as the main evaluation metrics. Accuracy was:

[0119]

[0120] Where N c N represents the number of correctly classified samples. test This refers to the number of samples tested on the testing machine.

[0121] The ROC curve depicts the relationship between the true positive rate and the false positive rate across all possible classification thresholds. The AUC value, or the area under the ROC curve, provides a quantitative metric for measuring the model's ability to distinguish between normal and abnormal data. For the test set X... test and its label Y test The inference loss is calculated by the model. i AUC is defined as:

[0122]

[0123] Among them, rank i loss i The index values ​​sorted from smallest to largest, loss i The rank of the maximum value in X is n, where n is X. test The number of samples. M is y i The number of samples with a value of 1, N is the number of samples with a value of y. i The number of samples with a value of 0. The advantage of this metric is that it is insensitive to the choice of classification threshold, can effectively handle imbalanced datasets, and is easy to interpret and compare the performance of different models, making it particularly important in various application scenarios;

[0124] Confidence level describes the reliability of the results. In the model proposed in this invention, we set the distance between the test data's TI and the threshold as the confidence level; the greater the distance, the higher the confidence level.

[0125]

[0126] We conducted ablation experiments and comparative tests on the model of this invention using three datasets. In the ablation experiments, we used experimental bench data and two real-world datasets to experimentally verify the role of the discriminator and ME-SWA block, the key components of MERM. We explored the improvement of the model performance by the discriminator and ME-SWA in this invention using three datasets, and designed the ablation experiments shown in Table 1. The results are shown in the table. After using the discriminator, the reconstructor no longer only performs simple denoising, but performs accurate reconstruction only on normal data. The model's AUC improved by about 20%, and the accuracy also improved by about 10%. It can be seen that the discriminator enhances the model's reconstruction ability to address the limitations of normal data. After adding ME-SWA, the model's accuracy improved by 4%, and the AUC improved by 1%. ME-SWA gives the model a stronger feature extraction capability, making the model perform better. To explore the impact of different data preprocessing methods on the model performance, we designed the experiments shown in Table 2. We compared the short-time Fourier transform, wavelet transform, and the ME-SWA spectrogram we used in the experiments. The experimental results show that Mel spectrograms are better than short-time Fourier transform and wavelet transform for feature extraction of diesel engine vibration signals, which can improve the discrimination of abnormal signals and enhance the model performance.

[0127] Table 1 Ablation Experiment Results of Key Components

[0128]

[0129] Table 2 Data Preprocessing Methods and Ablation Experiment Results

[0130]

[0131] We conducted comparative experiments between the method of this invention and several existing methods, including the following models: Wu et al. proposed a hybrid learning framework that first learns features by reconstructing unlabeled data and then fine-tunes it on a classification task using a limited number of labeled samples. Zhang et al. performed metric learning with a small amount of data before fine-tuning the classification task. Chang et al. used the self-attention mechanism of the Transformer to classify the health status in vibration signals. Torabi et al. employed an autoencoder-based method that reconstructs normal data and uses the reconstruction error for fault detection. The reconstruction error-based method uses only normal data for training, while the few-sample fault detection method adds a small amount of fault data to the training set.

[0132] We conducted comparative experiments on the above model using three datasets, and the results are shown in Table 3, validating the superiority of our model. Compared to existing deep learning methods, our model improves accuracy by approximately 10%, AUC by approximately 7%, and also boasts the highest confidence score among all compared models. The confusion matrices of each model on each dataset are shown below. Figure 4 As shown, the confusion matrices of five fault detection models on three datasets are presented. These models include: a hybrid classification autoencoder, a domain difference-guided contrastive feature learning model, a model based on extended attention and class imbalance loss, an autoencoder based on data reconstruction error, and the MERM model proposed in this invention. The results show the performance on experimental datasets (a)-(e), field case datasets A (f)-(j), and field case datasets B (k)-(o). It is also evident that the MERM model performs best among all contrastive models. Furthermore, contrastive models must be trained with fault data for fault diagnosis. Our proposed model, however, only requires normal data for anomaly detection. In some real-world scenarios, abnormal samples are unavailable; therefore, only the model proposed in this invention can achieve anomaly detection, preventing major accidents and losses. It perfectly solves the zero-sample problem for mechanical equipment. Regarding the interpretability of the model, we explored it further by visualizing the discriminator features of the model on the three datasets using t-SNE, as shown below. Figure 5The t-SNE visualization of the discriminator features is shown below: (a) MERM model trained on the experimental dataset, (b) MERM model trained on field case dataset A, and (c) MERM model trained on field case dataset A. The visualization results show that the model can clearly separate different working states into different clustering regions across the three datasets, indicating that the feature representations learned by the discriminator have good separability. Particularly noteworthy is that the normal state (purple dots) forms a tight and well-defined cluster, while fault types also cluster into independent regions, demonstrating that the model can effectively capture the essential features of different fault modes.

[0133] At the same time, we conducted an in-depth exploration of the ME-SWA module of the MERM model. Figure 6 The expert selection distribution diagrams for the ME-SWA modules at layers 0, 15, and 31 of the model reveal that some experts in the middle-layer ME-SWA modules have specific strengths in handling certain data categories. Expert 0 is frequently assigned to handle normal data, expert 3 is often assigned to handle misfire and valve clearance fault data, and expert 4 is often assigned to handle broken tooth fault data. In contrast, the ME-SWA modules at the beginning and end show a more even distribution of usage frequency across different data categories. This indicates that the middle-layer ME-SWA modules primarily extract features from different categories, while the beginning and end ME-SWA modules are more focused on handling features common to all data categories.

[0134] Table 3 Comparison of experimental results

[0135]

[0136]

[0137] The method and system described in this invention can be deployed and run on standard industrial computers or edge computing devices. Model training can be completed simply by collecting vibration signals under normal conditions, eliminating the need for manual annotation or external fault data, thus significantly reducing implementation costs. Experimental and field case studies demonstrate that this method operates stably on various diesel engine models, exhibiting good robustness and promising prospects for wider application, making it highly practical.

[0138] The above description is merely a preferred embodiment of this application and an explanation of the technical principles used. Those skilled in the art should understand that the scope involved in this application is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the inventive concept. For example, technical solutions formed by replacing the above-mentioned features with technical features with similar functions disclosed in this application (but not limited to) each other.

[0139] Apart from the technical features described in the specification, the other technical features are known to those skilled in the art. To highlight the innovative features of this invention, the other technical features will not be described in detail here.

Claims

1. A method for diagnosing complex faults in rotating machinery based on adaptive eigenmode decomposition, characterized in that, Includes the following steps: S1: Collect vibration signals x(t) from various locations of the diesel engine to be diagnosed, including each cylinder block, crankcase, and timing gearbox, where t is the sampling time, and convert them into Mel-frequency spectrograms x. mel Considering that the Mel spectrum is based on the way human ears perceive, the spectrum is converted into Mel scale to better reflect human perception of different frequencies. Multi-channel signals are collected synchronously and converted into Mel spectrograms respectively. Multi-channel Mel spectrograms are then stitched together along the channel dimension as model input. S2: Design of reconstructor and discriminator based on multi-expert shift window attention mechanism; S3: Train the reconstructor's ability to reconstruct the Mel spectrum of diesel engine vibration data and the discriminator's ability to distinguish between the real Mel spectrum and the reconstructed Mel spectrum, and enhance the reconstructor's reconstruction ability based on the discriminator's resolution ability; S4: Calculate the reconstruction error as a test indicator and trigger an alarm when it exceeds the alarm threshold.

2. The method according to claim 1, characterized in that, In step S2, the design of the reconstructor and discriminator based on the multi-expert shift window attention mechanism includes the following steps: S201: Design of Multi-Expert Shifted Window Attention Module (ME-SWA); Considering the multi-channel characteristics of diesel engine vibration signals, and the strong correlation between signals in each channel in the time and frequency domain; In the shifted attention mechanism, two shifting methods are used for block division: regular segmentation and shifted window segmentation. "Block division" refers to dividing the Mel spectrogram into non-overlapping segments; By introducing a shifted window attention mechanism, each module processes windows that are interleaved with the previous module, enhancing the model's ability to capture global information and thus improving overall performance and efficiency. The "multi-expert" refers to a set of sub-modules composed of K independent feedforward neural networks, each with the same structure but different parameters. After each block passes through the shifted attention mechanism, the "routing mechanism" selects the Top-K most relevant experts based on the feature response strength of the input block to process the data and extract features. G(x n )=Softmax(Ropk(x n ·W g )) Among them W g The weights represent the routes in G, which are linear layers. Deep learning is used to update these weights and learn how to assign corresponding experts to each block. n Represents x mel The feature data of each block obtained after block division, x n ·W g That is, the weight of each expert is selected for each block, and TopK(x) represents the top K largest values ​​in x. n ·W g That is, we obtain the weights of the K experts with the largest weights, and finally normalize them using Softmax to obtain the final weight of each expert. S202: Design the reconstructor model; the reconstructor includes 12 convolutional layers and 16 ME-SWA modules, where the ME-SWA modules appear in groups and are arranged in the reconstructor using alternating regular windows and shifted windows. For the Mel-spectrum graph x of the diesel engine vibration signal... mel The reconstructor first inputs the Mel spectrogram into the encoder to extract its features, thus obtaining the reconstructor features R. f The data is then input into the decoder and deconvolved to the same size as the original Mel spectrogram, resulting in the reconstructed Mel spectrogram. mel The encoder contains six 2D convolutional layers. The first five layers have 4×4 kernels, a stride of 2, and padding of 1. After convolution, they pass through a layer normalization module and a LeakyReLU activation function. After the activation function of the first four convolutional layers, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. The sixth convolutional layer has a 4×4 kernel, a stride of 1, and padding of 0. The decoder contains six deconvolutional layers. The first deconvolutional layer has a 4×4 kernel, a stride of 1, and padding of 0. The kernel is padded to 0, and after deconvolution, it passes through a layer normalization module and a LeakyReLU activation function. In the 2nd, 3rd, 4th, and 5th deconvolution layers, the kernel is 4×4 with a stride of 2 and padding of 1. After convolution, it passes through a layer normalization module and a LeakyReLU activation function. After the activation function, there is a ME-SWA module using a regular window and a ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. In the 6th deconvolution layer, the kernel is 4×4 with a stride of 2 and padding of 1. After convolution, it passes through a LeakyReLU activation function. S203: Design the discriminator model; the discriminator includes 6 convolutional layers and 8 ME-SWA modules. The first 5 convolutional layers have 4×4 kernels, a stride of 2, and padding of 1. After convolution, they pass through a layer normalization module and a LeakyReLU activation function. After the activation function of the 2nd, 3rd, 4th, and 5th convolutional layers, there is one ME-SWA module using a regular window and one ME-SWA module using a shifted window. Each ME-SWA uses an 8×8 window for block division. The 6th convolutional layer has a 4×4 kernel, a stride of 1, and padding of 0. After convolution, the two-dimensional feature vector is flattened into a one-dimensional feature vector. The structure is similar to the first half of the reconstructor and is the feature extractor D of the discriminator. FE Input Mel spectrogram x mel Or the reconstructed Mel spectrogram (recon) mel The discriminator feature D is obtained. f After passing through a layer normalization module and the LeakyReLU activation function, the input is then fed into a linear layer to determine whether the input data is real data.

3. The method according to claim 1, characterized in that, In step S3, training the reconstructor model and the discriminator model includes the following steps: S301: For x mel and recon mel First, extract the features of each discriminator: and x mel and recon mel Discriminator features; S302: The reconstructor training used x mel recon mel , and The four features have the following loss function: In the formula, MSE represents the mean squared error, and mean(x) represents the mean of x; S303: The discriminator is trained using the same method as WGAN-GP, with the following loss function: In the formula, D represents the reconstructor, D(x) represents the output vector obtained after x is input into the discriminator, the random number ∈ (0,1), and λ is the penalty factor; S304: During training, the reconstructor and discriminator are trained alternately until both achieve optimal results.

4. The method according to claim 1, characterized in that, In step S4, the calculation of the reconstruction error is used as a test indicator, and an alarm is triggered when the error exceeds the alarm threshold. This includes the following steps: S401: Calculate x mel and recon mel The differences between them are used as part of the test metrics: TI1=MSE(x mel ,recon mel ) S402: Calculate x mel and recon mel Reconstruction features and Incorporate the differences between reconstructed features as part of the test metrics: S403: Calculate test data With training set X train Discriminator features The distance is used as the loss function: S404: Integrate the test metrics calculated in S401, S402, and S403 into a single metric used during testing. TI=λ1TI1+λ2TI2+λ3TI3 In the formula, λ1, λ2, λ3∈{0,1}, λ1+λ2+λ3=1, that is, one of the three test indicators is selected as the final test indicator. When selecting, the test indicator that performs best in the validation set after training should be used. S405: Using data from the validation set X eval Fitting the location, shape, and scale parameters (τ,κ,λ) of the Weibull distribution = Weibull(X) eval When determining whether data is outlier, it is necessary to calculate the Weibull cumulative distribution function (CDF) probability: An anomaly is identified when the CDF of the test data is greater than the set value Ω.