Cross-domain fault diagnosis method and system based on domain-category double-constraint attention mechanism
By using a domain-category dual-constraint attention mechanism to dynamically adjust the weights of multi-scale branches, the problem of inconsistent domain sensitivity in cross-domain fault diagnosis is solved, resulting in more robust feature fusion and improved diagnostic accuracy and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHEAST DIANLI UNIVERSITY
- Filing Date
- 2026-01-05
- Publication Date
- 2026-04-17
AI Technical Summary
Existing multi-scale structures suffer from inconsistent domain sensitivity across branch scales in cross-domain fault diagnosis. Traditional attention mechanisms cannot effectively suppress domain noise, leading to degradation in diagnostic performance.
By adopting a domain-category dual-constraint attention mechanism, the weights of multi-scale branches are dynamically adjusted through evaluation of category discrimination effectiveness and domain insensitivity, thereby constructing a more robust feature fusion system and achieving robust diagnosis of the target domain.
It improves the robustness and generalization ability of cross-domain fault diagnosis, effectively suppresses domain noise, and enhances the diagnostic accuracy and stability of the model under complex working conditions.
Smart Images

Figure CN121880997A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent fault diagnosis technology for rotating machinery, specifically relating to a cross-domain fault diagnosis method and system based on a domain-category dual-constraint attention mechanism. Background Technology
[0002] With the increasing demand for mechanical fault diagnosis across equipment and operating conditions, deep learning-driven domain adaptation methods are widely used to address performance degradation caused by inconsistencies in data distribution between the source and target domains. To capture spectral and temporal patterns at different scales, various multi-scale feature extraction networks (such as different convolutional kernels, dilated convolutions, and hierarchical filter banks) have been introduced into the domain adaptation diagnostic framework to enhance the ability to express weak fault features.
[0003] However, existing multi-scale structures generally suffer from the problem of "inconsistent domain sensitivity" between branch scales in domain adaptation scenarios: although some branches have high class discriminative power, their feature distributions shift significantly between different domains, which can easily introduce domain noise; at the same time, traditional attention mechanisms usually rely only on class confidence (such as Softmax probability and entropy weight) for weighted fusion, and lack deliberate modeling of "domain invariance", which cannot suppress the negative influence of domain-sensitive branches in the target domain.
[0004] The root of the current problem lies in the lack of a unified weighting mechanism that can simultaneously characterize both "class discrimination effectiveness" and "domain insensitivity," especially in multi-scale structures where it is difficult to dynamically identify the scale branch most favorable to the target domain. Therefore, it is urgent to construct a robust weighting adjustment mechanism in the multi-scale domain adaptation framework to weaken the domain-sensitive scale and enhance the class discrimination-dominant scale, thereby significantly improving the robustness and generalization ability of cross-domain fault diagnosis. Summary of the Invention
[0005] The purpose of this invention is to provide a domain-category dual-constraint attention mechanism that integrates category discrimination effectiveness measurement, domain insensitivity evaluation, and dynamic balancing strategy. It aims to build a more robust feature fusion system for multi-scale domain adaptation tasks and provide technical support for cross-domain data classification, fault diagnosis, and other scenarios.
[0006] To achieve the above objectives, the present invention provides the following solution: a cross-domain fault diagnosis method based on a domain-category dual-constraint attention mechanism, comprising the following steps: S1. Acquire multi-channel timing signals under bearing operating conditions, and preprocess the timing signals to obtain preprocessed signals; S2. Extract features from the preprocessed signal to obtain scale branch features, and compress the scale branch features to obtain a compressed feature vector; S3. Perform category prediction and domain prediction on the compressed feature vector to obtain category evidence and domain sensitivity; S4. Calculate branch weights based on the category evidence and the domain sensitivity, and determine the final attention weights based on the branch weights; S5. Based on the attention weights and the scale branch features, a comprehensive feature is obtained, and based on the comprehensive feature, a fault diagnosis is performed in the target domain to obtain a diagnosis result.
[0007] More preferably, in S3, the method for obtaining the category evidence includes: The compressed feature vector is input into the category detection head to obtain the category logit vector; Calculate the probability distribution of the category logit vector for the i-th scale branch: ; In the formula, Represents the category logit vector of the i-th scale branch; , B For batch size, C Number of categories; Indicates the temperature coefficient; The entropy of the i-th branch is calculated based on the probability distribution, and the category evidence is obtained based on the entropy: ; ; In the formula, log C This represents the maximum entropy threshold value for the category probability distribution; Represents the numerically stable term; c Indicates the first c category; Indicates the i-th branch to the i-th branch. c Predicted probability of the category; e i Indicates category of evidence.
[0008] More preferably, in S3, the method for obtaining the domain sensitivity includes: The compressed feature vector is input into the domain sensitive head to obtain the output domain logit vector, and the domain probability distribution is calculated based on the output domain logit vector: ; In the formula, Represents the domain logit vector of the i-th scale branch; The domain probability is obtained based on the domain probability distribution: ; In the formula, ; Represents the probability of the target domain. This represents the source domain probability.
[0009] More preferably, the method for calculating the branch weights includes: ; In the formula, r i This represents the branch weight of the i-th branch; Indicates the balance coefficient; in, ; In the formula, , The range of strength for penalizing domain-discrepancy features is defined; t This represents the current iteration number; T The maximum number of iterations; More preferably, the method for obtaining the attention weights includes: ; In the formula, K Indicates the number of scale branches; express
[0010] More preferably, in S5, the method for obtaining the comprehensive features includes: ; In the formula, F out Indicates comprehensive characteristics; F i This represents the scale branch feature of the i-th branch.
[0011] More preferably, in S5, the method for performing target domain fault diagnosis based on the comprehensive features to obtain the diagnosis result includes: The fusion feature with dimensions [B, 64, 1024] is expanded from 64 to 128 channels by 1×1 convolution, followed by GroupNorm and ReLU activation; then a two-layer residual convolution structure is used to enhance the semantics, resulting in the fusion comprehensive feature. The fused and integrated features are input into a multi-level classifier to obtain the diagnostic results; The configuration of the multi-level classifier includes: First layer: Dropout(0.5) + FC(128, 64) + ReLU; Second layer: Dropout(0.4) + FC(64, 64) + ReLU; Third layer: Dropout(0.3) + FC(64, 32) + ReLU; Fourth layer: Dropout(0.2) + FC(32, 4), outputting the category logits; The category logits are normalized using softmax to obtain the fault probability distribution, which is the final output. The fault probability distribution includes fault category labels and confidence levels.
[0012] This invention also provides a cross-domain fault diagnosis system based on a domain-class dual-constraint attention mechanism, comprising: The signal acquisition module is used to acquire multi-channel timing signals under bearing operating conditions and preprocess the timing signals to obtain preprocessed signals. The feature extraction module is used to extract features from the preprocessed signal to obtain scale branch features, and to compress the scale branch features to obtain a compressed feature vector. The prediction module is used to perform category prediction and domain prediction on the compressed feature vector to obtain category evidence and domain sensitivity. The weighting module is used to calculate branch weights based on the category evidence and the domain sensitivity, and to determine the final attention weights based on the branch weights. The diagnostic module is used to obtain comprehensive features based on the attention weights and the scale branch features, and to perform target domain fault diagnosis based on the comprehensive features to obtain diagnostic results.
[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) This invention incorporates the effectiveness of class discrimination and domain insensitivity into a unified weight measurement system, which solves the core problem that traditional attention cannot balance "class discrimination power" and "cross-domain robustness" from a mechanism perspective.
[0014] (2) This invention quantifies category evidence and domain sensitivity, constructs a unified weight measurement mechanism, calculates weights through a double-constraint weight formula, effectively suppresses the negative interference of domain sensitive branches, and reduces the impact of domain noise on diagnostic results.
[0015] (3) In this invention, the traditional weighting method that relies solely on class confidence is abandoned. Instead, a balance coefficient of cosine decay scheduling is introduced. In the early stage of training, the focus is on domain constraints to reduce distribution differences, and in the later stage, the focus is on class constraints to strengthen the discriminative ability. This dynamically adapts to the different stages of cross-domain learning and improves the model's adaptability to complex working conditions. Attached Figure Description
[0016] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the 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.
[0017] Figure 1 This is a schematic diagram of the cross-domain fault diagnosis method based on the domain-category dual-constraint attention mechanism according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating the internal computation of the domain-category dual-constraint attention mechanism in an embodiment of the present invention. Figure 3 This is a schematic diagram of the feature extractor structure based on domain-category dual-constraint attention in an embodiment of the present invention; Figure 4 This is a visualization diagram of the cross-domain fault diagnosis results T-SNE based on the domain-category dual-constraint attention mechanism in an embodiment of the present invention; Figure 5 This is a schematic diagram of the target domain accuracy curve of cross-domain fault diagnosis results based on the domain-category dual-constraint attention mechanism in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0020] Example 1: like Figures 1-3As shown, this embodiment provides a cross-domain fault diagnosis method based on a domain-class dual-constraint attention mechanism. The proposed domain-adaptive fault diagnosis method is based on the CDAN adversarial network and achieves synergistic optimization of feature discriminativity and domain robustness by introducing a domain-class dual-constraint attention mechanism. Traditional CDAN models only utilize feature and class conditional distribution alignment to reduce domain differences. This embodiment further introduces a dual-constraint multi-scale attention mechanism on top of the traditional CDAN adversarial model. Through joint calculation of class confidence assessment and domain sensitivity suppression, the contribution weights of multi-scale branches are dynamically adjusted, enabling the model to adaptively highlight intra-class consistent and inter-domain robust feature channels during adversarial training. This mechanism not only effectively reduces distribution shifts between different operating conditions and improves the model's generalization ability and diagnostic stability in the target domain, but also enhances the sensitivity to key fault features (such as localized wear and crack initiation). Through this dual-constraint fusion of domain and class information, the model maintains higher discrimination accuracy and noise resistance under complex cross-domain conditions, providing technical support for adaptive health monitoring and reliable predictive maintenance of intelligent devices.
[0021] Specifically, the method includes the following steps: S1. Acquire multi-channel timing signals under bearing operating conditions and preprocess the timing signals to obtain preprocessed signals.
[0022] In this embodiment, after acquiring multi-channel time-series signals such as vibration, acoustics, and rotational speed from the field or historical data, preprocessing is performed. The preprocessing includes: zero-mean normalization of the original time-series signals to eliminate sensor bias effects; segmenting the long time-series signals using a sliding window mechanism, with a window length of 1024 points and an overlap rate preferably set to 0.5 (i.e., a step size of 512 points), achieving a balance between data augmentation and computational efficiency. Fast slicing is achieved through vectorization operations using a sliding window view (sliding_window_view), avoiding the overhead of iterative loops. Domain label vectors are generated synchronously, with source domain samples labeled as 1 and target domain samples labeled as 0, with dimensions of […]. B Z-score standardization was performed on the sliced samples. The StandardScaler (mean 0, variance 1) fitted to the source domain data was used for offline calculation and caching to avoid redundant statistics. The standardized data were then converted to [[] using .unsqueeze(1) with channel dimensions added. B The preprocessed signal is obtained from the input tensor [1, 1024]; where, B 1 represents the batch size, and 1 represents a single-channel input.
[0023] S2. Extract features from the preprocessed signal to obtain scale branch features, and compress the scale branch features to obtain compressed feature vectors.
[0024] A multi-scale feature extractor is used to extract features from the preprocessed signal. Parallel extraction is performed at least... K The multi-scale feature extractor employs a large-kernel low-pass convolution + four-branch parallel structure, with specific parameter configurations including: First, a 1×1 convolution is performed using a large_expand layer to expand the input channels from 1 dimension to 4 dimensions, achieving initial feature dimensionality enhancement. Then, a large-kernel convolution layer is used to perform large-scale convolutions with a kernel size of 15 and 4 groups (group convolutions reduce computation to 1 / 4). The output dimension of this layer is [ B [64, 1024], low-frequency global features are extracted to obtain long-distance temporal dependencies, laying the foundation for shared features in multi-scale analysis. This layer uses domain-specific batch normalization (DSBN) to maintain independent running_mean and running_var for the source and target domains respectively. Domain_labels routing is used to decouple inter-domain statistical information, significantly mitigating the impact of domain shift on the underlying features.
[0025] Four parallel branches with increasing receptive fields are constructed, and each branch independently extracts fault features at different scales.
[0026] Branch 1 (receptive field = 3): Uses Mixpool1d (kernel_size = 3, stride = 1, padding = 1), where Mixpool1d is used to extract local extremum features, Avgpool1d is used to capture the average energy of the region, and then dimensionality is reduced to 64 channels through 1×1 convolution, output dimension [ B [64, 1024]. This branch has a dual sensing capability for transient impact characteristics of local bearing damage and baseline energy fluctuations, and has a more robust cross-domain capability than a single pooling operation.
[0027] Branch 2 (Receptive Field = 7): After compression using a 1×1 convolution, the receptive field is expanded using a dilated convolution with kernel_size = 3 and dilation = 3, increasing the output dimension [ B [64, 1024]. This branch focuses on the modulation characteristics of the mid-frequency band.
[0028] Branch 3 (receptive field = 11): After compression using a 1×1 convolution, dilated convolution with kernel_size = 3 and dilation = 5 is used to output dimension [ B [64, 1024]. This branch extracts long-term periodic features and is suitable for capturing low-frequency modulation phenomena caused by bearing wear.
[0029] Branch 4 (receptive field = 15): After compression using a 1×1 convolution, dilated convolution with kernel_size = 3 and dilation = 7 is used to output the dimension [ B [64, 1024]. This branch captures the longest temporal dependency and is used to identify slowly changing operating conditions such as speed fluctuations.
[0030] Each branch employs DSBN in its first layer (after 1×1 convolution) to adapt to data distributions across different domains. The second convolution layer uses GroupNorm (preferably 16 groups in this embodiment; if the channels are not divisible, it automatically degenerates to LayerNorm). The number of groups is dynamically calculated using the `calculate_num_groups` function to ensure statistical stability during small-batch training. This hybrid normalization strategy decouples statistical information between the source and target domains while avoiding batch size sensitivity issues. The four-branch parallel architecture achieves multi-scale feature complementarity through differentiated receptive field configurations (3→7→11→15), and the hybrid normalization strategy ensures stable training even with a batch size of 64, improving the ability to suppress domain shifts.
[0031] AdaptiveAvgPool1d is used to compress the spatiotemporal dimensions of the scale branch features of each branch to reduce the computational complexity of attention and extract high-level semantics, resulting in a compressed feature vector with dimension [ B
[64] . The compressed scale branch features undergo two linear transformations (64→16→64) through a shared squeeze module, with the intermediate layers using the ReLU activation function. This bottleneck structure reduces the risk of overfitting while preserving key information. In this embodiment, the compression ratio reduction = 4, meaning the number of intermediate channels is set to 16. The refined compressed feature vectors are then input in parallel into two independent fully connected heads.
[0032] S3. Perform class prediction and domain prediction on the compressed feature vectors to obtain class evidence and domain sensitivity.
[0033] The domain-category dual-constraint attention mechanism used in this step calculates the quantified values of category discrimination effectiveness and domain insensitivity, and then smoothly schedules the two through dynamic balancing coefficients to obtain the final weighted coefficients of each scale branch, thereby achieving robust feature fusion for the target domain.
[0034] Specifically, K The compressed feature vectors of each branch are input into the category detection head to obtain the corresponding branch. C Dimensional category logit, through temperature coefficient Adjust and obtain the class probability through softmax. Information entropy is calculated based on probability. And normalization yields categorical evidence. .
[0035] Specifically, the category detection head (cls_head) outputs the number of categories. C =4 (corresponding to normal, inner race fault, outer race fault, and rolling element fault), and the weights are initialized using a Xavier normal distribution. This header outputs a category logit vector. cls_ logit i This is used for subsequent entropy calculations.
[0036] For the category logit vector of the i-th scale branch, according to the temperature coefficient (The preferred category temperature coefficient is fixed at 1.0) Calculate the probability distribution using the following formula: ; In the formula, Represents the category logit vector of the i-th scale branch; , B For batch size, C This represents the number of categories.
[0037] Calculate the uncertainty (entropy) of this branch based on the probability distribution and convert it into categorical evidence. The predictive entropy value is used to evaluate the branch's ability to classify faults; the lower the entropy value, the stronger the category evidence, and the greater the corresponding weight. The formula is: ; ; In the formula, log C This represents the maximum entropy threshold value of the category probability distribution, ensuring a uniform range of data after normalization. To avoid zero values in logarithmic operations; For the i-th branch, the first branch is the first branch. c Predicted probability of the category.
[0038] Category evidence when The closer a value is to 1, the more accurate the branch's classification and the stronger the evidence; the closer a value is to 0, the higher the uncertainty.
[0039] The compressed feature vector is input into the domain detector head to obtain the corresponding two-dimensional domain logit, which represents the prediction scores for the source and target domains, respectively. The source domain probability is then obtained using softmax. With target domain probability The difference between the two yields the domain sensitivity. .
[0040] Specifically, the domain-sensitive header (dom_head) has an output dimension of 2 (source domain / target domain), and its weights are also initialized using Xavier. This header outputs the domain logit vector. dom_logit i This is used to calculate the difference in domain probability distributions. Domain sensitivity measures how sensitive a branch is to domain shifts by measuring the difference in domain classification probabilities. The larger the probability difference, the higher the domain sensitivity, and its weight should be reduced.
[0041] ; ; In the formula, This represents the domain logit vector of the i-th scale branch. , For the target domain probability, Let be the source domain probability. B , is a domain-sensitive quantification value, if A small value indicates that the branch is closely distributed across the source / target domains and exhibits good robustness; if A larger value indicates that the branch is easily affected by domain differences.
[0042] The advantage of the dual-constraint attention mechanism proposed in this invention lies in that it no longer relies solely on a single confidence level or feature energy as a weighting criterion. Instead, through joint probabilistic modeling, it dynamically correlates the contribution of each scale feature with its cross-domain robustness and class representativeness, thereby maintaining high stability and high-precision diagnostic performance under multiple operating conditions. The superiority of domain-class dual-constraint attention is shown in Table 1.
[0043] Table 1
[0044] S4. Calculate branch weights based on category evidence and domain sensitivity, and determine the final attention weights based on the branch weights.
[0045] In this embodiment, the discriminant confidence of each branch is estimated based on the distribution characteristics of the category prediction results. The more concentrated the confidence, the stronger the class discrimination power of the branch's features. Simultaneously, a domain discriminator calculates the degree of distribution difference between the branch and the target domain to measure its cross-domain stability. Subsequently, a cosine decay balancing factor dynamically controls the weight ratio of both, allowing the model to prioritize suppressing domain differences in the early stages of training and gradually strengthen class discrimination in the later stages. Ultimately, the fused attention weights highlight features that are consistent within a class and separable between classes while effectively reducing inter-domain interference, achieving adaptive feature aggregation that is "strong in class and stable in domain."
[0046] Specifically, after completing the quantitative evaluation of categorical evidence and domain sensitivity, a method is introduced that iterates with training... t coefficient of smooth change To balance the weights of categorical evidence and domain suppression, the categorical evidence is multiplied by the suppressed domain sensitivity, and the final attention weight is generated after normalization. The optimal scale combination is dynamically selected based on the domain attributes and category patterns of the input signal to achieve synergistic enhancement of domain invariance and classification discriminative power.
[0047] The formula for obtaining the original branch weight of each branch is: ; In the formula, the balance coefficient The cosine decay strategy is adopted to smoothly change with the number of iterations. This scheduling strategy makes the early stage of training ( t When it is smaller) Approaching 1.0, strengthen domain constraints to reduce distribution differences; in the later stages of training The threshold is reduced to 0.1, emphasizing category constraints to improve discrimination accuracy, thus achieving a smooth transition from "domain alignment-driven" to "category discrimination-driven". The formula is: ; In the formula, , The strength range of the penalty applied to domain-discrepancy features is defined, and this embodiment preferably uses... , . t This represents the current iteration number; T The maximum number of iterations; This formula passes through the first term. Ensure that branches with strong categorical evidence receive higher initial weights, through the second term. The domain-sensitive suppression mechanism dynamically penalizes unstable branches. When the domain sensitivity is high, the branch has a strong domain bias, and its contribution is suppressed by weighted balancing coefficients. Conversely, when the class evidence is strong and the domain sensitivity is low, the weight value is relatively increased, thus preferentially preserving the features of branches with strong class discrimination and low domain sensitivity.
[0048] To avoid weight bias between scales, this invention applies a temperature-normalized softmax (weight temperature coefficient) to the original weights. The final attention weights are obtained by setting a fixed value of 1.0. .
[0049] ; In the formula, K Indicates the number of scale branches.
[0050] S5. Based on attention weights and scale branch features, a comprehensive feature is obtained, and based on the comprehensive feature, fault diagnosis in the target domain is performed to obtain the diagnosis result.
[0051] Finally, attention weights are used to weight and fuse the features of each scale branch at each time point to obtain the comprehensive feature. The four scale branch features [ B [4, 64, 1024] and weights [ B Perform element-wise multiplication and summation along the scale dimension: ; In the formula, F out Represents comprehensive features, with dimensions [ B [64, 1024]; F i This represents the scale branch feature of the i-th branch.
[0052] After a 1×1 convolution, the number of channels is expanded from 64 to 128, followed by GroupNorm (16 groups) and ReLU activation. This projection layer enhances the feature representation capability and provides sufficient capacity for subsequent deepening.
[0053] Subsequently, a two-layer residual convolutional structure was used to further enhance the semantic features.
[0054] The two-layer residual convolutional structure includes: First layer: Conv1d(128, 128, kernel_size=3, padding=1)+GroupNorm+ReLU.
[0055] Second layer: Conv1d(128, 128, kernel_size=3, padding=1)+GroupNorm+ReLU.
[0056] The number of GroupNorm groups in each convolutional layer is adaptively set to 16 (automatically degenerates to 8 or 4 if 128 is not divisible). This enhanced structure expands the receptive field to 23, capturing longer temporal dependencies. Then, AdaptiveAvgPool1d is used to compress the temporal dimension, resulting in a pooled feature vector of dimension []. B
[128] . The features are then mapped to 128 dimensions via an FC1 layer, followed by GroupNorm and ReLU activation. To adapt to CDAN adversarial training, an FC_compress layer is added to compress the features to 64 dimensions, which are then used as input to the adversarial network.
[0057] The target domain fault type is then input into a multi-level classifier. In this embodiment, a four-layer Dropout-FC structure is used to prevent overfitting, with the specific configuration as follows: First layer: Dropout(0.5)+FC(128,64)+ReLU.
[0058] Second layer: Dropout(0.4)+FC(64,64)+ReLU.
[0059] Third layer: Dropout(0.3)+FC(64,32)+ReLU.
[0060] Fourth layer: Dropout(0.2) + FC(32, 4), outputting the category logits.
[0061] All fully connected layer weights are initialized using a Xavier normal distribution, and biases are initialized to zero. Dropout layers randomly deactivate neurons during training and are automatically turned off during testing to improve generalization ability.
[0062] The output category logits are subjected to softmax normalization to obtain the fault probability distribution softmax_outputs, with dimensions [B, 4]. Here, the prediction results are used as the final output (fault category labels and their confidence scores) for subsequent alarm and maintenance decisions.
[0063] Combination Figure 4 The T-SNE feature visualization results show that, after processing by the method of this invention, the features of different fault categories exhibit clear clustering boundaries in the feature space (separable between classes), and the same type of samples in the source domain and the target domain achieve high overlap (inter-domain alignment), which strongly proves that the dual-constraint attention mechanism retains a very strong class discrimination ability while eliminating the differences in domain distribution.
[0064] Combination Figure 5 As shown in the target domain accuracy curve, with the increase of training iterations, the model's diagnostic accuracy in the target domain shows a steady upward trend and eventually converges rapidly to a high level. This indicates that the introduced dynamic balance coefficient and dual constraint mechanism effectively improve the model's convergence speed and ensure the robustness and stability of diagnostic performance in cross-domain scenarios with varying operating conditions.
[0065] In this embodiment, all steps emphasize batch parallelism and numerical stability (added to entropy calculation). (Softmax temperature adjustable); Note that when using the domain discriminator for estimation, it should be synchronized with the training strategy (e.g., whether to include source / target samples in the same batch to ensure that the domain head learns a discriminative signal); intermediate weights Logs should be retained for offline analysis and project acceptance. The endpoint of this implementation process is to "output the fault type of the target domain," meeting the judgment requirements for project productization.
[0066] Example 2: This embodiment provides a cross-domain fault diagnosis system based on a domain-category dual-constraint attention mechanism to implement the method described in Embodiment 1. The system includes: a signal acquisition module for acquiring multi-channel time-series signals under bearing operating conditions and preprocessing the signals to obtain a preprocessed signal; a feature extraction module for extracting features from the preprocessed signal to obtain scale branch features and compressing the scale branch features to obtain a compressed feature vector; a prediction module for performing category prediction and domain prediction on the compressed feature vector to obtain category evidence and domain sensitivity; a weighting module for calculating branch weights based on category evidence and domain sensitivity, and determining the final attention weights based on the branch weights; and a diagnosis module for obtaining comprehensive features based on the attention weights and scale branch features, and performing target domain fault diagnosis based on the comprehensive features to obtain a diagnosis result.
[0067] The above embodiments are merely illustrative disclosures of the technical solution of the present invention, and not limitations on its scope of protection. It should be understood that the domain-category dual-constraint attention mechanism described in this invention, and its derived processing flow, structural form, parameter values, and implementation details, can all be implemented in other embodiments, application scenarios, or other engineering implementation forms without departing from the substantive technical concept defined in the claims of this invention. This technical solution is not limited to the field of rolling bearings, but is a transferable and generalizable technical solution applicable to health assessment and fault diagnosis of gears, motors, pumps, and other rotating or non-rotating machinery; its applicability is not limited to multi-scale branching of scale weighting, but can be used for feature fusion and dynamic weighting at the channel, spatial, temporal, and finer-grained levels, or for the selection and adjustment of semantic features such as fault categories and operating conditions. Implementation can be in the form of pure software algorithms, embedded programs, firmware implementation, or can be solidified into hardware circuits such as FPGAs, ASICs, and SoCs, or integrated as system functional modules such as industrial controllers and smart sensors. For the various embodiments shown in this specification, any equivalent substitutions, combinations, adjustments or other equivalent modifications to their structure, order, parameters or implementation details shall be deemed to fall within the protection scope of this invention, as long as they do not depart from the basic principles and technical essence of this invention.
Claims
1. A cross-domain fault diagnosis method based on a domain-class dual-constraint attention mechanism, characterized in that, Includes the following steps: S1. Acquire multi-channel timing signals under bearing operating conditions, and preprocess the timing signals to obtain preprocessed signals; S2. Extract features from the preprocessed signal to obtain scale branch features, and compress the scale branch features to obtain a compressed feature vector; S3. Perform category prediction and domain prediction on the compressed feature vector to obtain category evidence and domain sensitivity; S4. Calculate branch weights based on the category evidence and the domain sensitivity, and determine the final attention weights based on the branch weights; S5. Based on the attention weights and the scale branch features, a comprehensive feature is obtained, and based on the comprehensive feature, a fault diagnosis is performed in the target domain to obtain a diagnosis result.
2. The cross-domain fault diagnosis method based on a domain-category dual-constraint attention mechanism according to claim 1, characterized in that, In S3, the methods for obtaining the aforementioned category evidence include: The compressed feature vector is input into the category detection head to obtain the category logit vector; Calculate the probability distribution of the category logit vector for the i-th scale branch: ; In the formula, Represents the category logit vector of the i-th scale branch; , B For batch size, C Number of categories; Indicates the temperature coefficient; The entropy of the i-th branch is calculated based on the probability distribution, and the category evidence is obtained based on the entropy: ; ; In the formula, log C This represents the maximum entropy threshold value for the category probability distribution; Represents the numerically stable term; c Indicates the first c category; Indicates the i-th branch to the i-th branch. c Predicted probability of the category; e i Indicates category of evidence.
3. The cross-domain fault diagnosis method based on a domain-category dual-constraint attention mechanism according to claim 1, characterized in that, In S3, the method for obtaining the domain sensitivity includes: The compressed feature vector is input into the domain sensitive head to obtain the output domain logit vector, and the domain probability distribution is calculated based on the output domain logit vector: ; In the formula, Represents the domain logit vector of the i-th scale branch; The domain probability is obtained based on the domain probability distribution: ; In the formula, ; Represents the probability of the target domain. This represents the source domain probability.
4. The cross-domain fault diagnosis method based on a domain-category dual-constraint attention mechanism according to claim 1, characterized in that, The method for calculating the branch weights includes: ; In the formula, r i This represents the branch weight of the i-th branch; Indicates the balance coefficient; in, ; In the formula, , The range of strength for penalizing domain-discrepancy features is defined; t This represents the current iteration number; T This represents the maximum number of iterations.
5. The cross-domain fault diagnosis method based on a domain-category dual-constraint attention mechanism according to claim 1, characterized in that, The methods for obtaining the attention weights include: ; In the formula, K Indicates the number of scale branches; express 6. The cross-domain fault diagnosis method based on a domain-category dual-constraint attention mechanism according to claim 1, characterized in that, In S5, the method for obtaining the comprehensive features includes: ; In the formula, F out Indicates comprehensive characteristics; F i This represents the scale branch feature of the i-th branch.
7. The cross-domain fault diagnosis method based on a domain-category dual-constraint attention mechanism according to claim 1, characterized in that, In S5, the method for obtaining the diagnosis result by performing target domain fault diagnosis based on the comprehensive features includes: The fusion feature with dimensions [B, 64, 1024] is expanded from 64 to 128 channels by 1×1 convolution, followed by GroupNorm and ReLU activation; then a two-layer residual convolution structure is used to enhance the semantics, resulting in the fusion comprehensive feature. The fused and integrated features are input into a multi-level classifier to obtain the diagnostic results; The configuration of the multi-level classifier includes: First layer: Dropout(0.5) + FC(128, 64) + ReLU; Second layer: Dropout(0.4) + FC(64, 64) + ReLU; Third layer: Dropout(0.3) + FC(64, 32) + ReLU; Fourth layer: Dropout(0.2) + FC(32, 4), outputting the category logits; The category logits are normalized using softmax to obtain the fault probability distribution, which is the final output. The fault probability distribution includes fault category labels and confidence levels.
8. A cross-domain fault diagnosis system based on a domain-category dual-constraint attention mechanism, the fault diagnosis system being used to implement the fault diagnosis method according to any one of claims 1-7, characterized in that, include: The signal acquisition module is used to acquire multi-channel timing signals under bearing operating conditions and preprocess the timing signals to obtain preprocessed signals. The feature extraction module is used to extract features from the preprocessed signal to obtain scale branch features, and to compress the scale branch features to obtain a compressed feature vector. The prediction module is used to perform category prediction and domain prediction on the compressed feature vector to obtain category evidence and domain sensitivity. The weighting module is used to calculate branch weights based on the category evidence and the domain sensitivity, and to determine the final attention weights based on the branch weights. The diagnostic module is used to obtain comprehensive features based on the attention weights and the scale branch features, and to perform target domain fault diagnosis based on the comprehensive features to obtain diagnostic results.
Citation Information
Patent Citations
Unsupervised cross-domain target detection method for aligning mean teachers based on pseudo label confidence
CN118823456A
Method and device for fault diagnosis of bearings
CN119293489A
Rolling bearing intelligent fault diagnosis method for generalization in single field
CN119862492A
Semi-supervised bladder tumor medical image segmentation method based on supervised branches and uncertainty estimation
CN120318255A
Rotating machine fault diagnosis method, device and equipment under variable working conditions
CN120354269A