Equipment fault diagnosis method based on domain generalization and attention enhancement

Through dynamic signal preprocessing and dual-channel feature decoupling network, combined with the attention mechanism, the problem of insufficient adaptability of traditional mechanical fault diagnosis methods under multiple working conditions and category imbalance is solved, and high-precision and high-generalization fault diagnosis effects are achieved.

CN120850132APending Publication Date: 2025-10-28ANHUI UNIV OF SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510743086.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Traditional mechanical fault diagnosis methods rely on manual feature engineering and are difficult to adapt to changes in multiple working conditions. Existing deep learning methods perform poorly in the case of domain shift and category imbalance, especially insufficient research on acoustic signal diagnosis, which leads to misdiagnosis and limited generalization ability.

Method used

By employing a domain generalization and attention enhancement approach, dynamic signal preprocessing, a dual-channel feature decoupling network, and a multi-objective loss function, combined with an attention mechanism, adaptive feature extraction and decoupling are achieved, thereby improving the model's fault diagnosis capability in multi-source heterogeneous devices.

Benefits of technology

The model's fault identification accuracy and generalization ability under multiple working conditions are improved, effectively addressing the problem of category imbalance, enhancing sensitivity to weak fault features and cross-domain adaptability, and providing highly reliable fault prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120850132A_ABST
    Figure CN120850132A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of mechanical equipment fault detection, and discloses an equipment fault diagnosis method based on domain generalization and attention enhancement, comprising the following steps: step 1, preprocessing acoustic signals from multi-source domain equipment; step 2, constructing a dual-channel feature decoupling network composed of a machine feature encoder and a health feature encoder; 3, introducing a channel-space attention mechanism at the output end of the health feature encoder, and performing weighted enhancement on the health state features; step 4, constructing a multi-objective joint optimization function including signal reconstruction loss, feature redundancy suppression loss and causal aggregation loss; and 5, adopting a dynamic domain adaptive training strategy based on classification loss weighting and a class imbalance optimization method. According to the method, the expression ability of weak fault features and the identifiability of multi-domain data are improved, key fault features are effectively strengthened, and a redundant interference area is inhibited.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mechanical equipment fault technology, and in particular to a method for diagnosing equipment faults based on domain generalization and attention enhancement. Background Technology

[0002] Intelligent operation and maintenance of industrial equipment is a crucial link in intelligent manufacturing systems. Accurate identification of mechanical faults directly impacts the reliability of production systems and the efficiency of equipment lifecycle management. Traditional fault diagnosis methods largely rely on experience-driven approaches and manually designed features, such as time-domain and frequency-domain feature parameters. However, manual feature engineering has significant limitations: the feature selection process is heavily influenced by subjective experience, making it difficult to guarantee the completeness of the feature set. Furthermore, fixed feature combinations are poorly adaptable to changes in various operating conditions, easily leading to misdiagnosis when equipment load, speed, and other operating parameters change.

[0003] In recent years, deep learning-based intelligent diagnostic methods have demonstrated significant advantages through automatic feature extraction mechanisms, such as convolutional neural networks for vibration signal analysis and graph convolutional networks for multi-sensor topology modeling. However, these methods all implicitly assume that training and testing are identically distributed. When sensor layout, operating environment, and background noise change, significant domain shift problems are introduced, leading to a sharp decline in the performance of diagnostic models in new scenarios. Furthermore, data-driven black-box models are susceptible to spurious correlations, resulting in insufficient causal inference capabilities. To mitigate domain shift, domain adaptation methods achieve cross-domain feature alignment through adversarial training or sample reweighting, but these rely on target domain data for training, increasing deployment costs. Moreover, frequent labeling or collection of new data in industrial settings limits generalization ability. Additionally, the proportion of common fault samples in operating conditions is too low, causing severe class imbalance, making it difficult for traditional cross-entropy loss to effectively learn the minority classes.

[0004] It is worth noting that most existing literature focuses on vibration or temperature signal analysis, while research on fault diagnosis based on acoustic signals is relatively scarce. Although vibration monitoring has a high signal-to-noise ratio, it has inherent limitations as a contact measurement method. Fault diagnosis based on vibration signals is a contact measurement, requiring sensor installation locations to strictly adhere to modal analysis theory, making deployment difficult in complex equipment or multi-constraint scenarios. Furthermore, high-frequency sampling places stringent requirements on the dynamic response characteristics of the data acquisition system. Additionally, direct contact with rotating parts may introduce additional mass loads, affecting the normal operation of the equipment. This provides unique technical advantages and application value for non-contact diagnostic methods based on acoustic signals. Therefore, a novel, domain-generalizable fault diagnosis method based on acoustic signals is urgently needed. Summary of the Invention

[0005] To address the technical problems mentioned in the background section, this invention provides a device fault diagnosis method based on domain generalization and attention enhancement.

[0006] This invention is achieved using the following technical solution: a device fault diagnosis method based on domain generalization and attention enhancement, comprising the following steps:

[0007] Step 1: Preprocess the acoustic signals from the multi-source domain device. Based on the difference in runtime and sampling strategy, adopt a dynamic length adjustment mechanism. Use Gaussian noise filling and center truncation strategies to achieve signal alignment. Extract time-frequency domain features of a unified structure through Mel spectrum transformation, trailing edge noise injection and frequency domain normalization.

[0008] Step 2: Construct a dual-channel feature decoupling network consisting of a machine feature encoder and a health feature encoder. The machine feature encoder uses multi-layer one-dimensional convolution to extract device attribute features, and the health feature encoder integrates strided convolution and residual connection to extract fault-sensitive features. Orthogonal decoupling of features is achieved through gradient inversion layer and domain discriminator.

[0009] Step 3: Introduce a channel-spatial attention mechanism at the output of the health feature encoder to weight and enhance the health status features;

[0010] Step 4: Construct a multi-objective joint optimization function, which includes signal reconstruction loss, feature redundancy suppression loss, and causal aggregation loss, to guide the model to learn discriminative features with reconstructibility, low redundancy, and high causality.

[0011] Step 5: Employ a dynamic domain adaptive training strategy based on classification loss weighting and a class imbalance optimization method. Improve the model's adaptability to imbalanced data through domain balancing strategy, class-aware loss function, and robustness enhancement module.

[0012] Step 6: In the inference stage, a multi-domain joint inference mechanism is adopted to integrate the output of the health feature encoder and the attention module to output the probability distribution of the device health status.

[0013] Furthermore, the preprocessing includes:

[0014] Acoustic signals are acquired using a 16kHz sampling frequency, and the signals are segmented using overlapping sampling.

[0015] Time-frequency features were extracted using a 128-Vimel filter bank;

[0016] Undersampling is filled using a silent filling method, and oversampling is reduced using a center truncation method.

[0017] The spectral characteristics are logarithmically compressed and frequency domain normalization is introduced.

[0018] More specifically, in the audio signal preprocessing stage, a dynamic length adjustment mechanism is first introduced for the acoustic signal based on differences in device operating time and sampling strategies. The target number of sampling points is calculated based on the time frame number, frame shift, and frame length. To adaptively adjust the signal length, short-time signals are padded with Gaussian noise at the trailing edge to preserve temporal integrity, while long-time signals are truncated at the center to retain core acoustic features, ensuring that the time-frequency feature dimension is , where is the number of Mel bands. This strategy uses adaptive signal shaping technology to eliminate signal length deviations caused by differences in device operating conditions while preserving key acoustic features. In the time-frequency domain Mel spectrum feature extraction, 4-dimensional band features are extracted through Mel spectrum time-frequency analysis, combined with trailing edge noise injection to enhance data diversity. Dynamic normalization technology is introduced in the frequency domain, using training set statistics as a benchmark to nonlinearly compress the spectral energy distribution, effectively suppressing environmental noise interference and improving the sensitivity of features to minor faults.

[0019] Furthermore, both the machine feature encoder and the health feature encoder adopt a five-layer one-dimensional convolutional network structure, and each layer contains a convolutional block and a max pooling layer. The decoder adopts a mirror symmetric structure, and the classifier introduces a channel-space attention module.

[0020] More specifically, the machine feature encoder employs a one-dimensional temporal convolutional network structure, composed of multiple cascaded Conv1dBlock modules, which extract inherent attribute features such as device structure and operation mode from the original signal layer by layer. This module deeply models time-series patterns through convolutional kernels of different scales, thereby generating discriminative f... m The health feature encoder is also built on a one-dimensional temporal convolution framework, employing convolutional operations with strides and a normalization mechanism to effectively expand the network's receptive field and enhance its ability to capture key fault modes. Simultaneously, the residual concept is introduced to maintain feature stability, enhance sensitivity to subtle health changes, and generate a fault-sensitive feature vector f. h An end-to-end training framework is constructed by introducing a gradient reversal layer, further constraining f in the feature space. m with f h The orthogonality of the two types of features is determined. A domain discriminator is used to dynamically evaluate the two types of features, improving the feature decoupling effect and ultimately achieving explicit separation and independent modeling of device attributes and health status.

[0021] Furthermore, the channel-spatial attention mechanism includes:

[0022] The channel attention module generates channel weights through global average pooling or max pooling, and calculates channel weighted features using a shared multilayer perceptron.

[0023] The spatial attention module, based on channel-weighted features, extracts local temporal features through convolution to generate spatial weights;

[0024] By fusing channel-weighted and spatial-weighted features, an enhanced feature representation is formed.

[0025] More specifically, as a further improvement to the above scheme, a convolutional attention module is introduced at the end of the health feature encoder to jointly weight the extracted fault features along both the channel and spatial dimensions. The channel attention branch extracts the global statistical features of each channel through global average pooling or max pooling, and then fuses them through a shared multilayer perceptron to generate the channel-dimensional output X. c The spatial attention branch is based on the enhanced channel feature X. c Max pooling or average pooling is performed again along the channel direction, and then a one-dimensional temporal convolution with a kernel size of 7 is used to capture salient regions in the local temporal structure, finally generating the spatial attention weight X. s Compared to traditional convolutional features, attention-enhanced feature representations are more focused on key temporal regions and sensitive frequency bands, effectively suppressing the interference of background redundancy on classification tasks and improving the model's generalization ability in multi-source domain environments.

[0026] Furthermore, the multi-objective joint optimization function consists of the following loss term:

[0027] Signal reconstruction loss is measured by truncation mean square error, which measures the error between the input and the reconstructed signal.

[0028] Feature redundancy suppression loss constrains the independence of machine features and health features by orthogonalizing the feature similarity matrix;

[0029] The causal aggregation loss, based on positive and negative sample comparison learning, guides the clustering of the distribution of true causal relationships in the feature space.

[0030] Furthermore, the signal reconstruction loss employs a truncated mean square error metric to locally truncate the error between the input signal and the model's reconstructed output. Only reconstruction deviations within a reasonable error range are retained for loss calculation, significantly reducing the impact of outliers and improving reconstruction stability. The feature redundancy suppression loss is based on orthogonalization constraints of the feature similarity matrix. By constructing a feature similarity matrix and applying orthogonalization constraints, it minimizes redundant coupling between high-dimensional features, strengthens the discriminative power and complementarity between feature dimensions, and enables the network to form a more discriminative decoupled representation in the representation space. The causal aggregation loss, combined with a contrastive learning framework, constructs positive and negative sample pairs to guide the aggregation of true causal relationships in the feature space, promoting the concentrated expression of key causal features and avoiding interference from spurious correlation factors in classification decisions. These three elements work synergistically to achieve multi-objective joint optimization of signal recovery, feature decoupling, and causal expression, enhancing the model's overall representational ability and its generalization ability to complex health states.

[0031] Furthermore, the dynamic domain adaptive training strategy includes:

[0032] Based on dynamic weighted training of classification loss from each source domain, we enhance our focus on samples from difficult domains.

[0033] Introducing class-imbalanced weighted FocalLoss improves the ability to identify minority class samples;

[0034] By introducing entropy regularization loss, the prediction probability entropy value is minimized, thereby enhancing prediction confidence;

[0035] Gradient clipping technique is used to limit the magnitude of parameter updates, and dynamic learning rate scheduling and early stopping mechanism are employed to optimize the training process.

[0036] As a further improvement to the above scheme, a set of dynamic weight coefficients is generated using a normalization function based on the classification loss of each source domain. This strengthens the focus on difficult sample domains with large current errors, improves the model's attention to and fitting ability of weak feature domains, and avoids a single domain dominating the optimization direction. Simultaneously, to avoid unstable updates caused by gradient explosion or gradient shift, a gradient clipping threshold is introduced in the training process to limit parameter gradients and stabilize parameter updates. In terms of optimization scheduling, a dynamic learning rate adjustment strategy is introduced. By periodically reducing the learning rate, the oscillating descent problem is alleviated, allowing the model to converge to the optimal region with smaller steps in the later stages of training, effectively improving generalization ability. Furthermore, an early stopping mechanism is integrated to automatically monitor changes in validation performance. When the model's performance on the validation set tends to saturate, training is terminated early, effectively mitigating the risk of overfitting. To address the problem of scarce minority class samples and their susceptibility to being masked by the dominant class in the fan fault diagnosis task, a class-sensitive FocalLoss function is introduced to replace the traditional cross-entropy loss. During loss calculation, FocalLoss adds a probability modulation factor and a class weight term to the standard cross-entropy, focusing the training process on difficult-to-classify or scarce class samples. Furthermore, a Dropout layer is inserted before the classification layer, with a random inactivation rate set to 0.3. Dropout, as a regularization method, can significantly reduce the risk of overfitting and improve the model's generalization ability under imbalanced data conditions. By synergistically integrating a loss-driven dynamic domain weighting strategy, an optimized scheduling mechanism, and a class reweighting regularization method, this step effectively improves the model's stability, adaptability, and minority class fault identification accuracy in multi-source imbalanced data scenarios.

[0037] Furthermore, the multi-domain joint reasoning mechanism includes:

[0038] Input the test sample into the trained health feature encoder to extract features;

[0039] Enhance feature representation using attention modules;

[0040] The enhanced features are input into the classifier, which outputs a probability distribution of the device's health status.

[0041] As a further improvement to the above scheme, a multi-domain joint inference mechanism is proposed in the inference stage to enhance the model's generalization ability on unknown test domains. This mechanism no longer relies on a single source domain representation, but fully utilizes the multi-source health feature encoder learned during training to jointly extract discriminative representations of test samples. Specifically, the test samples are input to the trained health feature encoder, and robust fault-sensitive features are extracted through multi-layer convolution operations and residual connections to comprehensively reflect the current health status of the equipment. The same attention mechanism as in step 3 is introduced to achieve information filtering and enhancement at both spatial and temporal levels. The fused feature vector is passed to the classifier module, outputting a multi-class health status probability distribution, and finally generating a fault prediction result with clear semantic interpretability. This joint inference strategy achieves cross-domain information fusion while enhancing key feature responses through the attention mechanism, effectively strengthening the model's transfer and generalization capabilities across varying operating conditions and different equipment, providing support for reliable fault diagnosis in engineering practice.

[0042] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0043] This invention proposes an intelligent fault diagnosis method integrating feature decoupling and attention enhancement for acoustic data throughout the entire lifecycle of multi-source heterogeneous devices. By introducing a multi-dimensional preprocessing strategy to achieve dynamic signal alignment and feature enhancement, and employing adaptive Gaussian filling and center truncation mechanisms to unify signal duration, combined with Mel-spectrum time-frequency transformation, frequency domain normalization, and trailing-edge noise injection techniques, the method improves the expressive power of weak fault features and the discriminability of multi-domain data.

[0044] In terms of feature modeling, this invention proposes a multi-branch structure decoupled coding framework. A machine feature encoder is designed to capture device attribute features using a 1D convolutional structure, while a health feature encoder integrates residual connections and strided convolutional structures to extract health-sensitive features, explicitly separating device attributes from fault modes. Simultaneously, an attention enhancement mechanism is introduced, embedding a CBAM module at the end of the health encoder to integrate channel and spatial attention distributions, providing high-weight region cues for the classifier, effectively strengthening key fault features and suppressing redundant interference regions.

[0045] In the training and optimization phase, this invention designs a ternary loss function that includes truncation and reconstruction loss, feature orthogonality constraints, and causal comparison aggregation. This function compresses redundancy while maintaining the original structure and optimizes feature separability. Furthermore, it proposes a domain balancing strategy based on dynamic weighting of classification loss, combining cosine annealing learning rate and gradient pruning to regulate the training process and introducing an early stopping mechanism to avoid overfitting. In terms of imbalanced learning, it integrates Focal Loss to adjust class weights and introduces a Dropout module before the classification layer to suppress overfitting and enhance model robustness.

[0046] In the inference stage, this invention integrates multi-source training features with an attention weighting mechanism to achieve a multi-domain joint recognition strategy and perform high-confidence health status judgment on test data. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of a device fault diagnosis method based on domain generalization and attention enhancement.

[0048] Figure 2 This is a schematic diagram of the multi-source domain sound signal processing and feature extraction process in step 1.

[0049] Figure 3 This is a schematic diagram of the dual-channel feature decoupling network process in step 2.

[0050] Figure 4 This is a comparison chart of the Acc results for fault diagnosis of various models in different cross-domain scenarios.

[0051] Figure 5 A comparison chart of AUC results for fault diagnosis of various models in different cross-domain scenarios.

[0052] Figure 6 A comparison chart of F1-score results for fault diagnosis of various models in different cross-domain scenarios. Detailed Implementation

[0053] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments. It should be noted that, without conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments.

[0054] Example 1:

[0055] This embodiment provides an acoustic fault diagnosis method based on multi-source domain feature decoupling and attention mechanism, applicable to cross-domain health status identification tasks of rotating mechanical equipment such as fans, and mainly includes the following steps:

[0056] First, the device's audio signal is acquired using a high sampling rate sensor. For fan-type devices, a 16kHz sampling frequency is used to obtain audio segment data. Overlapping sampling is employed to segment the raw signal, with a sample length l = 1024 and a step size s = 256 to ensure effective capture of the device's full lifecycle characteristics. The raw audio signal acquired by the acoustic sensor undergoes multi-source preprocessing, and time-frequency features are extracted using a 128-Vimel filter bank. Specifically, let the original time-domain signal y∈R... N Define the Mel frequency mapping function mel(f) according to Formula 1, where f represents the frequency; construct a 128-dimensional triangular filter bank. The y signal is windowed and framed. Let the signal in frame t be y. tAccording to formula 2, for y t Calculate the power spectrum P(t,f):

[0057] mel(f) = 2595 × log 10 (+f / 7)(1)

[0058]

[0059] The filter bank projection Mel(t,k) is calculated according to Formula 3, and an improved version of logarithmic compression is performed as shown in Formula 4 below:

[0060]

[0061] logMel=ln(1+Mel+ε)(4)

[0062] Where ε = 10 -7 This is to prevent division by zero when logMel is used as the denominator later in the text.

[0063] The timeline is standardized using the following strategies:

[0064] For the current frame number T c For undersampling of <T, the following formula 5 is used for mute filling:

[0065] logMel pad =Pad(logMel,(0,TT) c ))(5)

[0066] The missing time steps in each Mel band are directly filled with a constant of -80, which is equivalent to setting the logarithmic energy intensity of that band to -80dB to simulate a completely silent state.

[0067] For the current frame number T c For oversampling of >T, the center cutoff is taken as shown in Formula 6 below:

[0068] logMel clip =logMel(f,t)(6)

[0069] in

[0070] The final output feature matrix X∈R T×128 It satisfies the specific formula shown in Formula 7:

[0071] X(t,k)=logMel processed (k,t)(7)

[0072] Adopting such Figure 3The network architecture shown is used to construct a dual-channel feature decoupling network, mainly composed of dual encoders, decoders, and a classifier. The machine feature encoder and health feature encoder adopt a five-layer one-dimensional convolutional structure, with each layer containing a Conv1DBlock module followed by max pooling. The decoder adopts a mirror-symmetric structure, achieving signal reconstruction through upsampling and convolution. The classifier introduces the CBAM attention mechanism, with its channel attention module using a 16x compression ratio, spatial attention using a 7×1 convolutional kernel, and residual connections enhancing feature representation. The structural parameters are shown in Table 1.

[0073] Table 1. Structure parameters of the dual-channel feature decoupling network

[0074]

[0075]

[0076] In the attention enhancement mechanism described in step 3, for the channel attention mechanism, let the input feature X∈R B×C×L The channel weights generated globally by the input feature X are calculated according to Formula 8. Alternatively, calculate the channel weights generated by max pooling according to Formula 9. Channel attention output X c The specific formula is shown in Formula 10:

[0077]

[0078] Where σ(·) represents the Sigmoid activation function, ⊙ represents element-wise multiplication, and MLP(·) is a shared multilayer perceptron, whose structure is defined as shown in Equation 11:

[0079] MLP(·)=W1(ReLU(W0(·))) (11)

[0080] Where W1 is the weight matrix of the dimension-upgrading layer, W0 is the weight matrix of the dimension-reducing layer, and the ReLU activation function is only applied after the output of W0.

[0081] For the spatial attention mechanism, the input feature is the output X of the channel attention mechanism. c For input feature X c Calculate the spatial weight of the globally average generation according to Formula 12. Alternatively, calculate the spatial weights generated by max pooling according to Formula 13. Spatial attention output X s The calculation is shown in Formula 14:

[0082]

[0083] Where f 7×7(·) indicates a convolution operation with a 7×7 kernel, and [·;·] indicates concatenation of channel dimensions to ensure that features that meet the dimensionality requirements are generated.

[0084] The final output result X of step 3 out As shown in Formula 15:

[0085]

[0086] To suppress redundant information and improve feature separability, a joint optimization framework is constructed, introducing a ternary objective loss function that includes three loss terms:

[0087] In the feature decoupling stage, a signal reconstruction loss L is introduced. s It employs a truncated mean square error metric and constrains feature separation to ensure that the health features contain a complete representation of the original signal. Its calculation is shown in Equation 16:

[0088]

[0089] Where B is the batch size, and X is the original input feature. sr These are the reconstructed features.

[0090] In the redundancy elimination phase, a characteristic redundancy suppression loss L is introduced. r Based on the orthogonalization constraint of the feature similarity matrix, it encourages the machine and the health encoder to extract mutually independent feature subspaces, and its calculation is shown in Equation 17:

[0091]

[0092] Where X m Let X be the machine feature matrix. h Let D be the health feature matrix, and D be the matrix dimension. Force the machine feature matrix to be diagonalized relative to the health feature matrix.

[0093] In the causal aggregation phase, a causal aggregation loss L is introduced. c It combines positive and negative sample comparison learning to guide the health features to cluster and converge in the feature space, and its calculation is shown in Equation 18:

[0094]

[0095] Where M y Let M be the fault label similarity matrix. d This is the domain label similarity matrix.

[0096] The integrated ternary objective loss function L t The calculation is shown in Formula 19:

[0097] L t =λ s Ls +λ r L r +λ c L c (19)

[0098] Where λ s , λ r , λ c As the loss weight, this invention sets it to λ. s =1, λ r =0.1, λ c =1.

[0099] This invention integrates multiple adaptive mechanisms. During the optimization process, it introduces a class-imbalanced weighted Focal Loss mechanism to automatically statistically analyze the distribution of each class of samples in the training set and adjust the cross-entropy weights. Simultaneously, it employs a focus factor γ=2 to enhance the response to the minority class, resulting in a classification loss L. f ;

[0100] A dynamic domain adaptive training mechanism is introduced to calculate the classification loss of each source domain in real time. The weighting coefficient w is calculated using formula 20. d This enables weighted training of multi-source domain data, enhancing learning of samples from difficult domains;

[0101]

[0102] Introducing entropy loss L e The Shannon entropy of the predicted probability is calculated. Minimizing the entropy value enhances the model's predictive confidence and prevents the model from being overly uncertain about the prediction results. The specific calculation is shown in Formula 21.

[0103]

[0104] Where p i,k This represents the predicted probability that the i-th sample belongs to the k-th class after softmax normalization.

[0105] Combining the above various losses, the final total loss L is obtained. total The specific calculation is shown in Formula 22:

[0106] L total =λ s L s +λ r L r +λ c L c +L f +w d L e (twenty two)

[0107] Combining gradient clipping techniques, a gradient clipping threshold G is set.c Limit the magnitude of parameter updates and periodically adjust the learning rate;

[0108] An early stopping mechanism is set up to monitor validation set performance. If there is no improvement in F1-score, AUC, or Acc, and training continues without improvement within a set tolerance number of steps, training is terminated to prevent overfitting.

[0109] To comprehensively evaluate the robustness and transferability of the method of this invention under multi-source domain conditions, the following experimental tests were designed. Furthermore, the currently popular equipment fault diagnosis methods were introduced for comparison with the domain generalization-based equipment fault diagnosis model designed in this invention, and the performance of each method was compared and analyzed based on these comparisons.

[0110] This embodiment is implemented using the PyTorch framework. Network optimization uses the Adam optimizer, with an initial learning rate set to 1×10⁻⁶. -4 It gradually decays to 1×10 through a periodic decay strategy. -7 The total number of iterations is 3×10 4 To prevent overfitting, the model incorporates Dropout and CBAM attention mechanisms, and implements L2 regularization at the classifier front end, with a weight decay coefficient of 1×10⁻⁶. -4 The training process employs an early stopping mechanism, terminating training when the target domain's Acc metric fails to improve for 10 consecutive epochs.

[0111] This embodiment uses the industrial fan dataset from the MIMII dataset. Each segment in the dataset is a 10-second, single-channel, 16-bit, 16kHz audio file. The training data for the source domain in each section contains at least 1000 audio segments, while the training data for the target domain contains only 3 audio segments per section. Since this dataset is used to evaluate unsupervised anomalous sound detection, all training data consists of normal sounds. The test data contains approximately 100 normal and anomalous sounds in each domain. This effectively simulates the reality of scarce target equipment data in industrial scenarios. The dataset consists of the following three parts:

[0112] 1. Section 00: Using different fan speed settings for the same fan model;

[0113] 2. Section 01: Two different sizes of fans from the same manufacturer;

[0114] 3. Section 02: The same fan working in different factory noise environments.

[0115] For performance evaluation, the following three metrics are selected:

[0116] 1. Accuracy: Comprehensively reflects the model's ability to distinguish between normal and abnormal states;

[0117] 2. AUC: Measures the robustness of a model in class imbalance scenarios;

[0118] 3. F1-score: A comprehensive evaluation of accuracy and recall, suitable for scenarios with sparse faulty samples.

[0119] Bar charts were drawn showing the test results of different methods under the same configuration, as follows: Figure 4 , Figure 5 , Figure 6 As shown.

[0120] In summary, this embodiment not only effectively improves the model's fault identification accuracy under multi-source heterogeneous equipment, but also demonstrates significant advantages in key feature extraction, redundancy suppression, and cross-domain adaptability, especially exhibiting stronger robustness and generalization ability under complex operating conditions or weak fault scenarios. Furthermore, the model's inference results possess good interpretability and stability, and the health status identification results are accurate and reliable, making it widely applicable to practical engineering scenarios such as intelligent operation and maintenance and remote monitoring of industrial equipment.

[0121] The implementation principle of a device fault diagnosis method based on domain generalization and attention enhancement in this application embodiment is as follows: By standardizing and preprocessing the acoustic data of multi-source domain devices, a dynamic length adjustment strategy and Mel spectrum transformation are introduced to construct input features with a unified time-frequency structure, fundamentally improving the recognizability and cross-device adaptability of the original signal. A dual-channel decoupling network extracts device attribute features and health status features in parallel. The machine feature encoder captures stable structural information, while the health feature encoder mines key fault representations. Explicit feature decoupling is achieved through gradient inversion mechanism and domain discriminator. An attention mechanism fuses channel and spatial attention at the end of the health encoding branch, guiding the model to focus on sensitive regions and significant frequency bands in the time series, thereby enhancing the intensity of fault feature expression. During the model training phase, a multi-objective joint loss function composed of reconstruction error, feature orthogonality constraint, and causal comparison is introduced to simultaneously optimize the feature learning process from three aspects: reconstruction capability, decoupling effect, and causal expression. During training, a domain-weighted strategy based on dynamic loss adjustment and a cosine annealing learning rate scheduling mechanism are employed to improve the model's adaptability to weak domain samples. To address the class imbalance problem, FocalLoss and Dropout are introduced to enhance the model's robustness. Finally, in the inference phase, discriminative features of test samples are extracted through a health feature encoder and an attention module, and multi-domain joint recognition is performed to output the health status distribution. This enables high-precision and highly generalized fault diagnosis of equipment under complex operating conditions, providing technical support for intelligent operation and maintenance in real-world industrial scenarios.

[0122] Example 2:

[0123] This embodiment is an improvement on embodiment 1, further described in the following aspects:

[0124] In the dynamic domain adaptive mechanism during the training phase, the weighting strategy for source domain classification loss has been optimized. The original strategy assigned a uniform dynamic weight coefficient to each source domain. This embodiment introduces a domain loss change trend factor, which adaptively adjusts the weights of each source domain based on its loss decrease rate during training: if the classification loss of a certain source domain continues to decrease, it indicates that the model has basically adapted to the samples in that domain, and its weight is appropriately reduced to prevent overfitting; if the loss of a certain source domain fluctuates drastically or decreases slowly, its training attention is increased to guide the model to improve its learning ability for difficult sample domains, thereby better achieving feature alignment between source domains.

[0125] Furthermore, a feature balancing gating mechanism is introduced during feature decoupling. Before fusing machine features and health features, the gating structure automatically adjusts the expression weight of the two types of features. This mechanism dynamically adjusts the fusion ratio based on the feature correlation and decoupling degree learned during training, effectively avoiding a single feature branch dominating the discrimination result and improving the stability and interpretability of the final classification.

[0126] During the inference phase, to further verify the model's cross-domain generalization ability, this embodiment, in addition to using the main test domain, introduces an extended test set including equipment speed-changing conditions and noise interference environments to simulate complex usage scenarios in actual industrial applications. Regarding evaluation metrics, in addition to accuracy, AUC, and F1 score, features space separation (FSD) and sample confidence distribution skewness (SCS) are added to measure the model's ability to distinguish between different categories of samples in high-dimensional space and the stability of its predicted output. Experimental results show that the improved model, while maintaining its original performance, exhibits better performance in complex situations with ambiguous fault boundaries, low data quality, or class imbalance, demonstrating stronger robustness and transfer adaptability.

[0127] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.

Claims

1. A device fault diagnosis method based on domain generalization and attention enhancement, characterized in that, The steps include: Step 1: Preprocess the acoustic signals from the multi-source domain device. Based on the difference in runtime and sampling strategy, adopt a dynamic length adjustment mechanism. Use Gaussian noise filling and center truncation strategies to achieve signal alignment. Extract time-frequency domain features of a unified structure through Mel spectrum transformation, trailing edge noise injection and frequency domain normalization. Step 2: Construct a dual-channel feature decoupling network consisting of a machine feature encoder and a health feature encoder. The machine feature encoder uses multi-layer one-dimensional convolution to extract device attribute features, and the health feature encoder integrates strided convolution and residual connection to extract fault-sensitive features. Orthogonal decoupling of features is achieved through gradient inversion layer and domain discriminator. Step 3: Introduce a channel-spatial attention mechanism at the output of the health feature encoder to weight and enhance the health status features; Step 4: Construct a multi-objective joint optimization function, which includes signal reconstruction loss, feature redundancy suppression loss, and causal aggregation loss, to guide the model to learn discriminative features with reconstructibility, low redundancy, and high causality. Step 5: Employ a dynamic domain adaptive training strategy based on classification loss weighting and a class imbalance optimization method. Improve the model's adaptability to imbalanced data through domain balancing strategy, class-aware loss function, and robustness enhancement module. Step 6: In the inference stage, a multi-domain joint inference mechanism is adopted to integrate the output of the health feature encoder and the attention module to output the probability distribution of the device health status.

2. The device fault diagnosis method based on domain generalization and attention enhancement as described in claim 1, characterized in that, The preprocessing includes: Acoustic signals are acquired using a 16kHz sampling frequency, and the signals are segmented using overlapping sampling. Time-frequency features were extracted using a 128-Vimel filter bank; Undersampling is filled using a silent filling method, and oversampling is reduced using a center truncation method. The spectral characteristics are logarithmically compressed and frequency domain normalization is introduced.

3. The device fault diagnosis method based on domain generalization and attention enhancement as described in claim 1, characterized in that, Both the machine feature encoder and the health feature encoder adopt a five-layer one-dimensional convolutional network structure, and each layer contains a convolutional block and a max pooling layer. The decoder adopts a mirror symmetric structure, and the classifier introduces a channel-space attention module.

4. The device fault diagnosis method based on domain generalization and attention enhancement as described in claim 1, characterized in that, The channel-space attention mechanism includes: The channel attention module generates channel weights through global average pooling or max pooling, and calculates channel weighted features using a shared multilayer perceptron. The spatial attention module, based on channel-weighted features, extracts local temporal features through convolution to generate spatial weights; By fusing channel-weighted and spatial-weighted features, an enhanced feature representation is formed.

5. The device fault diagnosis method based on domain generalization and attention enhancement as described in claim 1, characterized in that, The multi-objective joint optimization function consists of the following loss term: Signal reconstruction loss is measured by truncation mean square error, which measures the error between the input and reconstructed signals. Feature redundancy suppression loss constrains the independence of machine features and health features by orthogonalizing the feature similarity matrix; The causal aggregation loss, based on positive and negative sample comparison learning, guides the clustering of the distribution of true causal relationships in the feature space.

6. The device fault diagnosis method based on domain generalization and attention enhancement as described in claim 1, characterized in that, The dynamic domain adaptive training strategy includes: Based on dynamic weighted training of classification loss from each source domain, we enhance our focus on samples from difficult domains. Introducing class-imbalanced weighted Focal Loss improves the ability to identify minority class samples; By introducing entropy regularization loss, the prediction probability entropy value is minimized, thereby enhancing prediction confidence; Gradient clipping technique is used to limit the magnitude of parameter updates, and dynamic learning rate scheduling and early stopping mechanism are employed to optimize the training process.

7. The device fault diagnosis method based on domain generalization and attention enhancement as described in claim 1, characterized in that, The multi-domain joint reasoning mechanism includes: Input the test sample into the trained health feature encoder to extract features; Enhance feature representation using attention modules; The enhanced features are input into the classifier, which outputs a probability distribution of the device's health status.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the device fault diagnosis method based on domain generalization and attention enhancement as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the device fault diagnosis method based on domain generalization and attention enhancement as described in any one of claims 1-7.

Citation Information

Cited By

  • Full-life-cycle health diagnosis method of variable frequency water supply unit for water resource management

    CN121412597A

  • Hybrid prompt learning network and system for rolling bearing cross-domain fault diagnosis

    CN122196487A