A method, system, device and medium for fault diagnosis of a wind turbine gearbox
By employing a biaxial sparse attention routing module and a loss function guided by time-frequency prior knowledge in the fault diagnosis of wind turbine gearboxes, the problems of difficulty in capturing local structural features and insufficient interpretability in existing methods are solved, and fault diagnosis with high accuracy and interpretability is achieved.
Patent Information
- Application Number
- CN202511184341.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-08-22
AI Technical Summary
Existing image-based fault diagnosis methods struggle to fully exploit the local structural features distributed along the time and frequency axes in time-frequency maps, and lack interpretability of the decision-making process, resulting in insufficient accuracy of the model in identifying local abnormal regions.
A dual-axis sparse attention routing module is used to construct sparse routing channels for capsule units on the time and frequency axes. Combined with an interpretable loss function guided by time-frequency prior knowledge, the model's ability to perceive local structural features in the time-frequency graph is improved through capsule networks and axial attention mechanisms. The interpretability is enhanced by visualization through class activation graphs.
It significantly improves the accuracy and interpretability of wind turbine gearbox fault diagnosis, and can accurately identify local abnormal areas in complex noise environments, thereby enhancing the model's discriminative transparency and engineering credibility.
Smart Images

Figure CN120969076B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of fault detection, in particular to a wind turbine gearbox fault diagnosis method, system, device and medium. BACKGROUND
[0002] Rotating machinery as the core power component in industrial systems, its running state is directly related to the performance and safety of production. In the long-term operation process, affected by fatigue damage, external disturbance and working condition change and other factors, often appear all kinds of structure damage or function degradation. Therefore, the development of intelligent fault diagnosis method with high precision and strong robustness is very important to improve the running safety of rotating machinery and reduce the cost of the whole industry. At the same time, in order to enhance its decision transparency and credibility, in recent years, the explainability of intelligent fault diagnosis is also put forward higher requirements.
[0003] With the rapid development of deep learning and visual intelligence technology, researchers have begun to explore the conversion of vibration signals into image form to capture key features in the signal in a more intuitive way and achieve efficient recognition with the help of deep neural networks. This strategy has gradually become an important research direction in the field of intelligent fault diagnosis, which to some extent overcomes the modeling limitations of traditional time and frequency domain methods under complex working conditions. Chen et al. proposed a novel rotating machinery fault diagnosis method based on dual-channel homologous information fusion bispectrum analysis, which can comprehensively extract nonlinear phase coupling features in vibration signals. Liu et al. proposed a fault diagnosis method for rolling bearings under variable speed conditions, which converts vibration signals into two-dimensional gray images and extracts texture features through a gray level co-occurrence matrix, combined with a dual-channel convolutional neural network to achieve fault recognition. Wang et al. proposed a gearbox fault diagnosis method combining Markov transform field and graph neural network, which converts vibration signals into two-dimensional images that preserve time correlation, and introduces the GCN-GAT model to achieve efficient recognition of non-Euclidean structure data, showing superior robustness under strong noise and variable load conditions. Tong et al. proposed a novel rolling bearing fault diagnosis method, which encodes vibration signals into Markov transform field (MTF) images with time dependence, and combines a hybrid attention residual network (MARN) to enhance feature expression capability. Liu et al. proposed a fault diagnosis framework for rolling bearings under variable speed conditions, which converts one-dimensional vibration signals into two-dimensional gray images adaptively, extracts texture features through a gray level co-occurrence matrix (GLCM), and uses a dual-channel convolutional neural network (DCCNN) for classification and recognition. Chen et al. proposed a robust rolling bearing fault diagnosis framework, which converts one-dimensional vibration signals into two-dimensional color recurrent graphs, and combines CNN, BiGRU and multi-head attention mechanism to build a fusion neural network model, achieving joint extraction of spatial and temporal features and high-precision recognition in a strong noise environment. He et al. proposed a rolling bearing fault diagnosis method, which converts one-dimensional vibration signals into two-dimensional gray images and uses a Wasserstein generative adversarial network (WGAN) to generate high-quality fault data under sample imbalance conditions, improving classification performance through a convolutional neural network with good noise robustness. Wang et al. proposed a novel rolling bearing fault diagnosis method that uses a time-frequency symmetric dot plot (TFSDP) to convert vibration signals into two-dimensional images, combines a CNN-based multi-scale feature extraction module and a Transformer network structure to achieve deep mining of global fault features and improve model interpretability under cross-condition.
[0004] Figure 1The visualization results of multiple typical two-dimensional representations of time sequence signals under the same fault sample are shown. Among them, the time-frequency diagram, as a two-dimensional representation that integrates time information and frequency components, can effectively depict the transient impact, frequency modulation, and local energy concentration in the fault signal, and is widely used in convolutional neural network (CNN) and transformer structure (Transformer) driven diagnostic frameworks. Li et al. proposed an intelligent fault diagnosis method for permanent magnet synchronous motor based on mechanism modeling, which combines continuous wavelet transform and convolutional neural network to convert current signals into time-frequency images, thereby extracting the feature patterns of stator inter-turn short circuit and demagnetization faults. Chen et al. proposed an intelligent fault diagnosis framework for rolling bearings under strong noise and cross-condition environment, which combines SFLA optimized variational mode extraction (SFLA-VME) and continuous wavelet transform (CWT) to generate two-dimensional time-frequency diagrams, and introduces deformable large kernel attention mechanism (DLKA) in YOLOv8 framework, which significantly enhances the recognition ability of multi-scale fault features. Ding et al. proposed a novel time-frequency transformer (TFT) structure for rolling bearing fault diagnosis, which converts vibration signals into time-frequency diagrams generated by synchronous wavelet transform (SWT), and extracts features and classifies through an end-to-end self-attention encoder, showing excellent diagnostic accuracy under multiple conditions and noise disturbances. Zhang et al. proposed an improved convolutional neural network framework for rolling bearing fault diagnosis, which converts vibration signals into time-frequency images through short-time Fourier transform (STFT), and introduces self-normalized activation function (SELU) and hierarchical regularization strategy, effectively alleviating overfitting and "dead neurons" and other problems.
[0005] Although the above methods have achieved certain results in feature extraction and fault recognition accuracy, however, most existing image-based fault diagnosis methods still mainly rely on global modeling strategy, which is difficult to fully exploit the local structure features along the time axis and frequency axis in the time-frequency diagram, and in the feature extraction process, the common convolution operation or self-attention mechanism is often affected by the scene, making it difficult for the model to accurately identify local abnormal areas, reducing the perception ability of key diagnostic features. SUMMARY
[0006] The present application aims to solve the problems of the prior art by providing a fault diagnosis method, system, device and medium for wind power gearboxes.
[0007] The present application specifically provides the following technical solutions: A fault diagnosis method for a wind power gearbox, comprising the following steps:
[0008] Collecting the vibration signal of the wind power gearbox and obtaining the time-frequency diagram of the vibration signal;
[0009] Obtaining a capsule feature tensor in a time-frequency graph, constituting a time-frequency two-dimensional network in space, and using different convolution kernels to extract corresponding query tensors in the time axis and the frequency axis of the time-frequency two-dimensional network;
[0010] Dot product matching the corresponding query tensors with the preset shared key-value pairs respectively to obtain the attention distribution of each query tensor, and fusing the time axis and the frequency axis direction aggregation output through the attention distribution;
[0011] Class activation mapping is performed on the aggregation output to determine the fault class of the wind turbine gearbox, and a class activation map focusing on the key time-frequency area is generated through the fault class to show the basis for judgment.
[0012] Preferably, the time-frequency graph is subjected to fault diagnosis through a pre-trained diagnostic model, and a class activation map is generated, wherein the diagnostic model comprises:
[0013] a primary capsule layer, a double-axis sparse attention routing module, a fully connected layer and a class activation mapping layer connected in sequence; wherein the double-axis sparse attention routing module comprises a time axis and a frequency axis connected in parallel, and a fusion layer connected subsequently, each axis comprises an axis attention layer, and the fusion layer comprises a summation and compression layer and a multilayer perception layer.
[0014] Preferably, before the time-frequency graph is subjected to fault diagnosis through the pre-trained diagnostic model, it further comprises:
[0015] For the generated class activation map, a frequency prior mask of the class activation map is obtained, and the average response intensity of the mask area is calculated through the frequency prior mask, and the average response intensity is used to define a prior semantic guidance loss; the class activation map is averaged along the frequency axis to obtain the average response of the time dimension, the average response of the time dimension is quantified for sparsity, and a target sparsity is set for each fault class, the difference between the average response of the time dimension after sparsity quantification and the target sparsity is squared to define a sparse activation constraint loss, and a classification loss is calculated based on the classification output of the fault class;
[0016] The prior semantic guidance loss and the sparse activation constraint loss are used to impose spatial and temporal prior guidance on the class activation map respectively, and the classification loss is combined to optimize the diagnostic model parameters together, so as to obtain the pre-trained diagnostic model.
[0017] Preferably, the capsule feature tensor in the time-frequency graph is obtained by:
[0018] The time-frequency graph is subjected to feature extraction through two convolution blocks in the primary capsule layer; wherein the convolution block is composed of two convolution layers with batch normalization and ReLU activation function;
[0019] The feature representation with direction perception capability is selected through a channel-by-channel convolution, and then the output channel dimension is adjusted to a preset capsule vector dimension through a 1*1 convolution, so as to form a capsule feature tensor with spatial directionality and local sparseness.
[0020] Preferably, the corresponding query tensor is respectively matched with a preset shared key-value pair through dot product to obtain the attention distribution of each query tensor, and specifically, the attention distribution is obtained through:
[0021] In the two orthogonal directions of the row direction and the column direction, the row direction query tensor and the column direction query tensor are respectively generated from the input feature map in parallel, and the shared key tensor and the value tensor are scaled and dot product attention calculation is performed to obtain the row direction attention output and the column direction attention output.
[0022] The application provides a fault diagnosis system of a wind turbine gearbox, comprising:
[0023] A data acquisition module is configured to collect a vibration signal of the wind turbine gearbox and acquire a time-frequency graph of the vibration signal.
[0024] A vector generation module is configured to acquire a capsule feature tensor in the time-frequency graph, form a time-frequency two-dimensional network in space, and extract corresponding query tensors in the time axis and the frequency axis of the time-frequency two-dimensional network by using different convolution kernels.
[0025] An aggregation module is configured to respectively match the corresponding query tensors with a preset shared key-value pair through dot product to obtain the attention distribution of each query tensor, and fuse the time axis and the frequency axis direction aggregation output through the attention distribution.
[0026] A discrimination module is configured to perform class activation mapping on the aggregation output, determine the fault category of the wind turbine gearbox, generate a class activation map focused on a key time-frequency region through the fault category, and display the discrimination basis.
[0027] The application provides a computer device comprising a memory and a processor, wherein the memory stores a program, and the program is executed by the processor to make the processor execute the steps of the above-mentioned fault diagnosis method of the wind turbine gearbox.
[0028] The application provides a storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the above-mentioned fault diagnosis method of the wind turbine gearbox.
[0029] Compared with the prior art, the application has the following advantages:
[0030] The application obtains a time-frequency graph of a wind power gear box vibration signal, obtains a capsule feature tensor of the time-frequency graph, constructs a time-frequency two-dimensional network, adopts different convolution kernels, extracts corresponding query tensors on the time axis and the frequency axis of the time-frequency two-dimensional network, respectively performs dot product matching on the corresponding query tensors and a preset shared key-value pair, obtains the attention distribution of each query tensor, improves the modeling efficiency and direction sensitivity in the two-dimensional feature graph, and fuses the aggregation output in the time axis and the frequency axis direction through the attention distribution, realizes the effect of constructing a sparse routing channel of a capsule unit on the time axis and the frequency axis respectively, enhances the perception ability of the model to the anisotropic local structure features in the complex time-frequency graph, can accurately identify the local abnormal area, improves the perception ability to the key diagnostic features, maps the aggregation output to the class activation, determines the fault class and the class activation map of the wind power gear box, the method can focus on the key time-frequency area with clear physical meaning, and significantly improves the discrimination transparency and engineering credibility of the model. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 The visualization results of various typical two-dimensional representations of time series signals in the background art under the same fault sample are provided, wherein Figure 1 (a) of is a CWT graph, Figure 1 (b) of is a Bispec graph, Figure 1 (c) of is a Gray graph, Figure 1 (d) of is an MTF graph, Figure 1 (e) of is an RP graph, Figure 1 (f) of is a GADF graph;
[0032] Figure 2 Various dependent structure graphs provided by the application are provided, wherein Figure 2 (a) of is an axial attention, Figure 2 (b) of is a double-axis sparse attention routing mechanism,
[0033] Figure 3 is a structural diagram of the application;
[0034] Figure 4 is a physical diagram mentioned in an embodiment of the application;
[0035] Figure 5 are time-frequency graphs of various fault states after time-frequency transformation of the application; wherein Figure 5 (a1)-(a7) in (a) of are time-frequency graphs of various fault states under label 0, Figure 5 (b1)-(b7) in (b) of are time-frequency graphs of various fault states under label 1, Figure 5 (c1)-(c7) in (c) of are time-frequency graphs of various fault states under label 2, Figure 5(d) in (a) is a time-frequency graph of each fault state under label 3, Figure 5 (e) in (a) is a time-frequency graph of each fault state under label 4,
[0036] Figure 6 a diagnostic example graph provided by the present application; wherein Figure 6 (a) in (a) is a diagnostic example graph under label 0, Figure 6 (b) in (a) is a diagnostic example graph under label 1, Figure 6 (c) in (a) is a diagnostic example graph under label 2, Figure 6 (d) in (a) is a diagnostic example graph under label 3, Figure 6 (e) in (a) is a diagnostic example graph under label 4; wherein Figure 6 (a1)-(e1) in (a) are input graphs under different labels, respectively, Figure 6 (a2)-(e2) in (a) are diagnostic example graphs provided by the present method DASECaps, respectively, Figure 6 (a3)-(e3) in (a) are diagnostic example graphs provided by the ablation model, respectively;
[0037] Figure 7 a prediction result graph provided by the present application;
[0038] Figure 8 a flowchart of a fault diagnosis method for a wind turbine gearbox provided by the present application. DETAILED DESCRIPTION
[0039] The technical solutions of the embodiments of the present application will be described clearly and completely in combination with the drawings in the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0040] Time-frequency graphs are widely used in fault detection and classification tasks based on deep learning because of their dual representation capabilities for short-time energy changes and frequency response characteristics in non-stationary vibration signals. However, existing methods mostly rely on global modeling, which is difficult to effectively capture the structural features contained in their axial distribution, and generally lack the support of explainability in the decision-making process. Moreover, there is generally a lack of explicit mechanism in explainability, and the model decision-making process is difficult to trace, and the diagnostic results lack transparency and credibility.
[0041] Based on the above problems, the present application proposes an interpretable fault diagnosis method DASECaps guided by time-frequency prior knowledge, and the specific contributions are as follows:
[0042] 1. A dual-axis sparse attention routing module is designed, which constructs sparse routing channels of capsule units on the time axis and the frequency axis respectively, enhancing the model's ability to capture anisotropic structural features in the time-frequency graph.
[0043] 2. An interpretive loss function guided by time-frequency prior knowledge is defined, which uses a predefined prior semantic mask and sparsity to guide the spatial distribution of the CAM activation map, promoting the model to focus on discriminative regions consistent with the prior from the optimization target level, thereby achieving targeted enhancement of explainability.
[0044] 3. The structural explainability of the model is proved by class activation map visualization experiments, further verifying the effectiveness and credibility of the proposed method in identifying and focusing on key time-frequency regions.
[0045] As shown in Figure 3 and Figure 8 , the present application proposes a fault diagnosis method for a wind turbine gearbox, which specifically includes the following steps:
[0046] Step S1: Collect the vibration signal of the wind turbine gearbox and obtain the time-frequency graph of the vibration signal.
[0047] Perform fault diagnosis on the time-frequency graph through the pre-trained diagnosis model to generate a class activation map, as shown in steps S2, S3 and S4, wherein the diagnosis model includes:
[0048] a primary capsule layer, a dual-axis sparse attention routing module, a fully connected layer and a class activation mapping layer connected in sequence; wherein the dual-axis sparse attention routing module includes a time axis and a frequency axis connected in parallel, and a fusion layer connected subsequently, each axis includes an axial attention layer, and the fusion layer includes a summation and compression layer and a multi-layer perception layer.
[0049] Capsule Network: Capsule Network was proposed by Hinton et al. in 2017 to address the problem of convolutional neural networks' difficulty in modeling spatial hierarchical relationships and pose changes, and to improve the model's robustness to local structure composition and geometric transformation. It is a neural network structure that uses vectors as the basic unit of information, which can more structurally express the hierarchical dependence between "part-whole". Unlike traditional convolutional network output scalar activation, capsule unit outputs a vector , where the vector norm represents the mode existence probability, direction encoding position, pose, scaling and other attribute information.
[0050] In order to realize the selective aggregation of features, the capsule network introduces a dynamic routing mechanism (Dynamic Routing), which predicts and weightedly aggregates high-level capsule vectors by low-level capsule vectors:
[0051] ;
[0052] ;
[0053] in, The projection matrix is learnable. The coupling coefficients are dynamically updated. It is the input to the high-level capsule vector. For high-level capsule vectors, For low-level capsule vectors, This represents the number of index variables for the current layer.
[0054] Finally, the high-level capsule vector output is compressed to a unit sphere using the squash activation function. While maintaining directional information, control the vector norm:
[0055] ;
[0056] Axial attention: Axial attention is a variant of self-attention designed to improve modeling efficiency and orientation sensitivity in 2D feature maps, particularly to address the high computational complexity of standard self-attention in high-resolution images. For example... Figure 2 As shown in (a), unlike the standard self-attention mechanism which establishes global relationships in the spatial dimension, axial attention decomposes the two-dimensional attention operation into two one-dimensional processes, which model the dependency structure between features along the horizontal and vertical directions (columns and rows), respectively.
[0057] Specifically, let the input feature map be... When performing line-direction attention, the following calculation is performed for each line:
[0058] ;
[0059] in, This represents the tensor in the h-th row of the input feature map, with the shape as follows: C is the number of channels. , and These represent linear mapping parameter matrices for query, key, and value, respectively, with shape [formula missing]. To facilitate subsequent multiplication with the linear projection matrix, it is necessary to first... The dimension from Transform into , , and They represent the first h The corresponding query, key, and value tensors for each row have the following shape: d is the feature dimension after projection.
[0060] Attention Output for:
[0061] ;
[0062] in, This is used to scale the dot product of attention weights to mitigate gradient instability caused by excessively large values.
[0063] After repeating this process for all rows, column attention is then performed to complete the orientation modeling of the entire image.
[0064] Dual-axis sparse attention routing module:
[0065] To effectively model the directional feature distribution in the time-frequency graph, a biaxial sparse attention routing method is designed based on the vector representation of capsule networks. For example... Figure 1 As shown in (b), by constructing attention paths on the time axis and frequency axis respectively, the model's ability to capture directional features is enhanced.
[0066] Step S2: Obtain the capsule feature tensor in the time-frequency map, construct a time-frequency two-dimensional network in space, and use different convolution kernels to extract the corresponding query tensor on the time axis and frequency axis of the time-frequency two-dimensional network.
[0067] Specifically, the input capsule feature tensor In space, it constitutes a A time-frequency two-dimensional network, where each location is a... 3D capsule vector, The batch size is specified. To model the connection weights along the two orthogonal axes respectively, convolutional kernels of (3,1) and (1,3) are used to construct local perceptual paths on the time and frequency axes, and extract the corresponding query tensors. and This design ensures that feature aggregation in each direction depends only on its own physical neighborhood, avoiding cross-axis aliasing.
[0068] The process of obtaining the capsule feature tensor from the time-frequency map includes:
[0069] Feature extraction of the time-frequency map is performed using two convolutional blocks in the primary capsule layer; each convolutional block consists of two convolutional layers with batch normalization and ReLU activation functions.
[0070] By selecting directional features through channel-wise convolution, and then adjusting the output channel dimension to the preset capsule vector dimension through 1×1 convolution, a capsule feature tensor with spatial directionality and local sparsity is formed.
[0071] Step S3: respectively dot product matching the corresponding query tensor with the preset shared key-value pair, obtaining the attention distribution of each query tensor, and fusing the time axis and frequency axis direction aggregation output through the attention distribution.
[0072] In the two orthogonal directions of row and column, the row direction query tensor and the column direction query tensor are respectively generated from the input feature map in parallel, and the scaled dot product attention calculation is performed with the shared key tensor and value tensor to obtain the row direction attention output and the column direction attention output. That is, the query tensors in the two directions are respectively dot product matched with the preset shared key-value pair to obtain the attention distribution of different tensors and :
[0073] (5);
[0074] (6);
[0075] The entmax activation function is used to realize the selective connection mechanism between sub-parent capsules in the capsule network, and by constructing a sparse attention distribution, it guides the low-level capsules to more focusedly connect the structurally related high-level capsules, thereby improving the local aggregation capability.
[0076] The aggregation outputs in the two directions are fused and compressed (Squash) activated, and then sent to the feedforward network (MLP) for nonlinear transformation to obtain the final feature representation :
[0077] (7);
[0078] (8);
[0079] If the above process is repeated for multiple rounds and residual connection is added, an iterative structure with routing capability can be constructed, and its recursive form can be written as:
[0080] (9);
[0081] (10);
[0082] wherein, represents the double-axis attention aggregation calculation process in formula (5), formula (6) and formula (7), is the intermediate value after aggregation, is the feature representation of the th step.
[0083] Step S4: class activation mapping is performed on the aggregated output to determine the fault class of the wind turbine gearbox, and a class activation map focusing on the key time-frequency region is generated through the fault class to show the basis for judgment.
[0084] Before performing fault diagnosis on the time-frequency map through the pre-trained diagnostic model, the following steps are further included:
[0085] For the generated class activation map, a frequency prior mask of the class activation map is obtained, and the average response intensity of the mask area is calculated through the frequency prior mask, and the average response intensity is used to define a prior semantic guidance loss; the class activation map is averaged along the frequency axis to obtain the average response in the time dimension, the average response in the time dimension is quantified for sparsity, and a target sparsity is set for each fault class, and the square of the difference between the average response in the time dimension after sparsity quantization and the target sparsity is defined as a sparse activation constraint loss, and a classification loss is calculated based on the classification output of the fault class.
[0086] The prior semantic guidance loss and the sparse activation constraint loss are used to impose spatial and temporal prior guidance on the class activation map, and the diagnostic model parameters are optimized together with the classification loss to obtain the pre-trained diagnostic model.
[0087] The explanatory loss function guided by the time-frequency prior knowledge is specifically:
[0088] The explanatory loss function guided by the time-frequency prior knowledge is used to constrain the consistency between the response area of the class activation map and the time-frequency features with diagnostic significance. Specifically, the loss guides the model to generate an activation pattern that conforms to the physical prior from two aspects: (1) Prior semantic guidance: based on the frequency prior mask, the class activation map is encouraged to focus on the high response area of the corresponding fault mode in the time-frequency map in the spatial domain, so as to enhance the attention ability of the model to the discriminative features; (2) Sparse activation constraint: by quantifying the sparsity of the time dimension activation intensity of the class activation map averaged along the frequency axis, the model is guided to present a response distribution in the time dimension that conforms to the characteristics of the actual fault signal, thereby being compatible with different fault performances such as transient impact and continuous modulation.
[0089] Prior semantic guidance loss:
[0090] In the time-frequency map, a specific frequency interval usually corresponds to typical fault characteristics such as burst impact, modulation harmonic or structural resonance, which is a significant mode area with physical meaning. Although these areas appear as high response blocks in the two-dimensional time-frequency map, they essentially correspond to local structural distribution on the frequency axis. Therefore, the present application introduces a prior semantic guidance loss function, which aims to guide the model to generate a class activation map that accurately focuses on these frequency structure prior areas in the spatial domain, thereby improving the response selectivity and physical consistency of the model.
[0091] Let the class activation map generated by the model be , the frequency prior mask is , the average response intensity of the mask region is defined
[0092]
[0093] wherein is a numerical stability term, respectively represent the index variable number of the spatial position. In order to make the model maintain high response to the region, the prior semantic guidance loss is defined
[0094]
[0095] Sparse activation constraint loss:
[0096] Different types of faults have significant differences in response characteristics on the time axis. For example, the broken tooth fault usually shows an instantaneous impact, and its energy distribution is sparse and concentrated; while the wear or modulation fault has a persistent response mode, and its energy distribution is relatively smooth and continuous. Therefore, the model should have the ability to distinguish different time sparse patterns to more accurately identify the potential fault type. To this end, the present application designs a sparse activation constraint loss based on the class activation map (CAM) output, which is used to constrain the distribution characteristics of the activation response generated by the model in the time dimension, so as to make it consistent with the prior sparsity of each category.
[0097] Specifically, let the activation map output by the model be , first average it along the frequency axis to obtain the average activation intensity in the time dimension , and the specific expression is:
[0098]
[0099] Subsequently, the sparsity of is quantified based on the Gini coefficient, which is defined as:
[0100]
[0101] wherein represents the th element arranged in ascending order of value, is a numerical stability term. The higher the Gini value, the more sparse the time response; the lower, the more smooth the response.
[0102] The target sparsity of each fault category is specified in advance, and the sparse activation constraint loss is finally defined as:
[0103] ;
[0104] Running flow:
[0105] As Figure 6 shown, this is a diagnostic example of a wind turbine gearbox in five fault states. Figure 6 It can be further summarized as follows:
[0106] 1) Signal acquisition and sample division: Collect vibration signals from the experimental platform, use continuous wavelet transform to convert them into time-frequency graphs, and then divide the samples for training, verification and testing.
[0107] 2) Prior knowledge definition: Based on the performance characteristics of various typical faults in the time-frequency graph, construct a structure mask and set the time sparsity prior corresponding to the category.
[0108] 3) Network training: Embedding the time-frequency prior knowledge guided interpretability loss function, jointly optimizing with classification loss, guiding the model to learn the structure consistent activation distribution in space and time two dimensions.
[0109] 4) Inference and result analysis: Use the trained DASECaps to diagnose the test samples, and analyze the model focus area through class activation map visualization to verify its diagnostic accuracy and explainability.
[0110] The first study is to test the adaptability of this method in a noisy environment using a planetary gearbox dataset.
[0111] The running environment is as follows: PyTorch 2.1.0; GPU is RTX 4060; CPU is i5-12600kf.
[0112] The planetary gearbox dataset of the wind power transmission system test bench of Beijing University of Technology was used, and the test platform and five health states are shown in Figure 4 . The experimental platform consists of a motor, a planetary gearbox, a fixed shaft gearbox and a load device. The dataset contains vibration signals corresponding to five health states of the sun gear. The internal structure of the gearbox is shown in Figure 4 . The vibration data was collected by an acceleration sensor, and the speed pulse signal was obtained by cooperating with the encoder. The sampling frequency of all channels was set to 48kHz.
[0113] The signal was divided into samples of 3000 points by the sliding window method, and then converted into a time-frequency graph by continuous wavelet transform. Figure 5 The time-frequency graphs of each fault condition after time-frequency transformation are shown. It is obvious that the image data generated for each fault condition shows certain differences in time-frequency structure features. For each healthy condition, 300 samples are selected, a total of 1500 samples, and the data set is divided into training set, validation set and test set in the ratio of 5:3:4. In order to simulate the working conditions of mechanical equipment in real environment and verify the performance of the proposed model under strong noise, noise with signal-to-noise ratio of 10dB, 5dB and 0dB is added in the samples. In addition, the initial experiment without adding signal-to-noise ratio is carried out.
[0114] In order to reduce randomness, each experiment is repeated five times. Each training is performed for 100 iterations, with a batch size of 32 and a learning rate using an adaptive decay mode. The initial learning rate of each method is set by using a grid search method based on the accuracy of the validation set.
[0115] Table 1 shows the diagnostic accuracy results of each model under different noise conditions. As can be seen from the table, the performance of each model shows a downward trend as the signal-to-noise ratio decreases. However, the proposed DASECaps always maintains superior performance under each signal-to-noise ratio condition. In the conditions of no noise and 10dB noise, the average accuracy of DASECaps reaches 99.04% and 96.88% respectively, both slightly higher than CapsNet and ResNet18. In 5dB noise, DASECaps still maintains an average accuracy of 81.64%, significantly better than CapsNet (74.64%) and ResNet18 (61.56%), showing strong robustness. When the signal-to-noise ratio is further reduced to 0dB, the performance of all models decreases significantly, but the average accuracy of DASECaps (53.60%) is still higher than that of the comparative models, with a maximum accuracy of 62.20%, showing better anti-interference ability under extreme noise interference.
[0116] Table 1 diagnostic results
[0117]
[0118] Figure 7The confusion matrix results of the model on each category under the condition of 5dB are shown in the table. From the results, it can be seen that the model performs best on category 0 and category 1, achieving 100% and 92% accurate classification respectively, indicating that the method can effectively identify fault patterns with clear features and concentrated distribution. In categories 2 and 4, the model also achieved good recognition performance, with accuracy rates of 74% and 82% respectively, but some samples were misclassified as adjacent categories, which may be related to the overlap of time-frequency features of these faults. For category 3, the accuracy rate is 66%, which is relatively weak, and there is more confusion with categories 0 and 1, indicating that the feature patterns of this type of fault have stronger similarity or feature boundary ambiguity with other categories. Overall, the model shows strong discriminant ability in most categories, but there is still room for improvement in distinguishing complex or ambiguous fault patterns.
[0119] Figure 6 The class activation map visualization results of samples in each category under DASECaps and ablation model are shown in the table. From the figure, it can be seen that DASECaps can focus well on the key time-frequency area in the input image that is highly related to the fault pattern, and the activation area is significantly coincident with the high-energy structural features of the input image, showing strong structural consistency and physical interpretability. The activation maps of DASECaps in different categories can accurately cover the main discriminative feature bands in the time-frequency map. The activation maps of the ablation model show that the attention area is relatively discrete and the focusing ability is weak, and the activation area deviates from the key structure, making it difficult to effectively indicate fault-related features. Overall, the activation patterns of DASECaps in each category are more focused on the physical key area, verifying the effectiveness of the proposed method in enhancing model discriminant ability and interpretability.
[0120] The present application aims at the shortcomings of existing time-frequency graph fault diagnosis methods in feature extraction and decision interpretability, and proposes an interpretable fault diagnosis method guided by structural prior information. Specifically, a dual-axis sparse attention routing module is designed to enhance the model's perception of anisotropic local structural features in the time-frequency graph, and an interpretability loss function guided by time-frequency prior knowledge is defined to spatially and temporally constrain the class activation map from the optimization target level. A case is used to verify that the proposed method has superior diagnostic accuracy, strong robustness and good interpretability under multiple noise conditions. The activation map visualization results further prove that the method can focus on key time-frequency areas with clear physical meaning, significantly improving the discriminant transparency and engineering credibility of the model.
[0121] Based on the above method, the present application provides a fault diagnosis system for a wind turbine gearbox, comprising a data acquisition module, a vector generation module, an aggregation module and a discrimination module.
[0122] The data acquisition module is configured to collect a vibration signal of the wind turbine gearbox and convert the vibration signal into a time-frequency graph using continuous wavelet transform.
[0123] The application further provides a computer device comprising a memory and a processor, and the memory stores a program which, when executed by the processor, causes the processor to perform the steps of the wind turbine gearbox fault diagnosis method.
[0124] According to the disclosed embodiments, the computer device can communicate with one or more external devices (such as a keyboard, a pointing device, a Bluetooth communication device, etc.), or communicate with any device (such as a router, a demodulator, etc.) that enables the computer device to communicate with one or more other computer devices.
[0125] The application further provides a storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the steps of the wind turbine gearbox fault diagnosis method.
[0126] According to the disclosed embodiments, the storage medium can be a non-volatile computer readable storage medium, which can include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus.
[0127] The above is a further detailed description of the application in combination with specific preferred embodiments. For those skilled in the art, without departing from the concept of the application, a number of simple deductions or substitutions can also be made, which should all be considered within the protection scope of the application.
Claims
1. A fault diagnosis method for a wind turbine gearbox, characterized in that, include: Vibration signals from wind turbine gearboxes were collected, and time-frequency diagrams of the vibration signals were obtained. Obtain the capsule feature tensor from the time-frequency map, construct a time-frequency two-dimensional network in space, and use different convolution kernels to extract the corresponding query tensor on the time axis and frequency axis of the time-frequency two-dimensional network; The corresponding query tensor is matched with the preset shared key-value pairs by dot product to obtain the attention distribution of each query tensor, and the aggregated output in the time axis and frequency axis is fused by the attention distribution. The aggregated output is subjected to class activation mapping to determine the fault category of the wind turbine gearbox, and a class activation map focusing on key time and frequency regions is generated based on the fault category to show the discrimination criteria. The acquisition of the capsule feature tensor in the time-frequency graph includes: Feature extraction of the time-frequency map is performed using two convolutional blocks in the primary capsule layer; each convolutional block consists of two convolutional layers with batch normalization and ReLU activation functions. By selecting directional features through channel-wise convolution, and then adjusting the output channel dimension to the preset capsule vector dimension through 1×1 convolution, a capsule feature tensor with spatial directionality and local sparsity is formed.
2. The fault diagnosis method for a wind turbine gearbox as described in claim 1, characterized in that, Fault diagnosis is performed on the time-frequency graph using a pre-trained diagnostic model to generate a class activation map, wherein the diagnostic model includes: The system consists of a primary capsule layer, a dual-axis sparse attention routing module, a fully connected layer, and a class activation mapping layer, connected sequentially. The dual-axis sparse attention routing module includes a parallel time axis and a frequency axis, as well as a fusion layer connected subsequently. Each axis includes an axial attention layer, and the fusion layer includes a summation and compression layer and a multilayer perceptron layer.
3. The fault diagnosis method for a wind turbine gearbox as described in claim 2, characterized in that, Before performing fault diagnosis on the time-frequency graph using the pre-trained diagnostic model, the following steps are also included: For the generated class activation map, the frequency prior mask of the class activation map is obtained, and the average response intensity of the masked region is calculated through the frequency prior mask. The prior semantic guidance loss is defined by the average response intensity. The class activation map is averaged along the frequency axis to obtain the average response in the time dimension. The average response in the time dimension is quantized for sparsity, and a target sparsity is set for each fault category. The sparse activation constraint loss is defined by the square of the difference between the average response in the time dimension after sparsity quantization and the target sparsity. The classification loss is calculated based on the classification output of the fault category. By applying spatial and temporal prior guidance to the class activation graph through prior semantic guidance loss and sparse activation constraint loss, and combining it with classification loss to jointly optimize the diagnostic model parameters, a pre-trained diagnostic model is obtained.
4. The fault diagnosis method for a wind turbine gearbox as described in claim 1, characterized in that, The step of performing dot product matching between the corresponding query tensor and the preset shared key-value pairs to obtain the attention distribution of each query tensor is specifically as follows: In the two orthogonal directions of rows and columns, row query tensors and column query tensors are generated in parallel from the input feature map, and scaled dot product attention is calculated with the shared key tensor and value tensor to obtain row attention output and column attention output.
5. A fault diagnosis system for a wind turbine gearbox, characterized in that, include: The data acquisition module is used to collect vibration signals from the wind turbine gearbox and obtain the time-frequency diagram of the vibration signals. The vector generation module is used to obtain the capsule feature tensor in the time-frequency map, construct a time-frequency two-dimensional network in space, and use different convolution kernels to extract the corresponding query tensor on the time axis and frequency axis of the time-frequency two-dimensional network. The aggregation module is used to perform dot product matching between the corresponding query tensor and the preset shared key-value pairs to obtain the attention distribution of each query tensor, and then fuse the aggregation output in the time axis and frequency axis directions through the attention distribution; The discrimination module is used to perform class activation mapping on the aggregated output, determine the fault category of the wind turbine gearbox, and generate a class activation map focusing on key time and frequency regions based on the fault category to show the discrimination criteria. The acquisition of the capsule feature tensor in the time-frequency graph includes: Feature extraction of the time-frequency map is performed using two convolutional blocks in the primary capsule layer; each convolutional block consists of two convolutional layers with batch normalization and ReLU activation functions. By selecting directional features through channel-wise convolution, and then adjusting the output channel dimension to the preset capsule vector dimension through 1×1 convolution, a capsule feature tensor with spatial directionality and local sparsity is formed.
6. A computer device, characterized in that, The device includes a memory and a processor, wherein the memory stores a program that, when executed by the processor, causes the processor to perform the steps of a fault diagnosis method for a wind turbine gearbox as described in any one of claims 1 to 4.
7. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the fault diagnosis method for a wind turbine gearbox according to any one of claims 1 to 4.
Citation Information
Patent Citations
Mechanical part fault diagnosis method and system based on time-frequency adaptive capsule network
CN117610617A
Deep hybrid convolutional neural network for fault diagnosis of wind turbine gearboxes
US11220999B1