Gearbox fault diagnosis method based on lightweight CNN and efficient mixed attention mechanism

By using lightweight CNN and efficient hybrid attention mechanism in gearbox fault diagnosis, combining wavelet transform and depth separable convolution, the problems of low efficiency and insufficient feature extraction in noise environments are solved, and the problem of traditional CNN models is realized. Higher diagnostic accuracy and robustness.

CN118916759APending Publication Date: 2024-11-08BEIJING INSTITUTE OF GRAPHIC COMMUNICATION
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410951948.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

Traditional CNN models are inefficient in gearbox fault diagnosis and insufficient extraction of key features, especially in complex operating environments with noise interference, which is difficult to accurately identify weak faults.

Method used

Using lightweight CNN combined with efficient hybrid attention mechanism, the vibration signal data is converted through continuous wavelet transformation, and a hybrid attention mechanism containing channel and spatial attention module is constructed, which integrates depth separation convolution, optimizes feature extraction and model structure, and improves Diagnostic accuracy.

Benefits of technology

It significantly improves the accuracy of gearbox fault diagnosis and the generalization and robustness of the model, reduces training time, enhances the ability to extract effective features of vibration signals, suppresses noise interference, and improves the reliability of equipment operation and Security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916759A_ABST
    Figure CN118916759A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of gearbox fault diagnosis, and particularly relates to a gearbox fault diagnosis method based on a lightweight CNN and an efficient mixed attention mechanism, and the method comprises the steps: collecting the vibration signal data of a gearbox, and converting a one-dimensional signal of the gearbox into a time-frequency diagram through continuous wavelet transform; marking corresponding wavelet time-frequency diagrams according to different states of the gearbox, and dividing the wavelet time-frequency diagrams into a training set and a test set for training and testing the model; constructing an efficient mixed attention mechanism capable of strengthening fault sample channels and spatial key features; a convolutional neural network structure is improved based on an efficient mixed attention mechanism, and the fault recognition capability of the model is improved; a bearing and gear fault data set is selected for verification, and compared with a classic fault diagnosis method, the result shows that the gearbox fault diagnosis accuracy is better, the fault diagnosis efficiency is higher, and the problems that a traditional CNN model is low in fault diagnosis efficiency and insufficient in key feature extraction are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of gearbox fault diagnosis, and in particular relates to a gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism. Background Art

[0002] As a key transmission component in mechanical equipment, the gearbox occupies an indispensable position. In actual operation, the working environment of the gearbox is relatively harsh, and the working conditions are complex and changeable. Due to the interference of environmental noise, the weak faults of the rotating parts in the gearbox in the early stage are easy to be ignored. If allowed to develop, it will affect the operation of the equipment, making the equipment lose its working ability, and in serious cases, it will cause casualties and other accidents. Therefore, timely detection and identification of gearbox faults is of great significance to improving the reliability and safety of equipment operation.

[0003] With the continuous innovation of technical methods, scholars at home and abroad have developed fault diagnosis methods based on deep learning. By organically combining with deep neural networks, they have realized feature mining of fault data, got rid of the dependence on the experience of fault diagnosis experts, and improved data utilization. However, the traditional CNN model has a large number of parameters and high model complexity. In addition, the operating environment of the gearbox is complex and often accompanied by noise interference. CNN's ability to extract key effective features from vibration signals needs to be further optimized.

[0004] Therefore, there is an urgent need for a gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism to solve the problems of low fault diagnosis efficiency and insufficient extraction of key features using traditional CNN models in the existing technology. Summary of the invention

[0005] The purpose of the present invention is to provide a gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism, characterized in that it comprises the following steps:

[0006] Step S1: collecting gearbox vibration signal data, and converting the gearbox vibration signal data into a wavelet time-frequency diagram using continuous wavelet transform;

[0007] Step S2: construct a sample data set based on the wavelet time-frequency graph, and divide the sample data set into a training set and a test set;

[0008] Step S3: construct an efficient hybrid attention mechanism containing a channel attention module and a spatial attention module;

[0009] Step S4: Integrate the efficient hybrid attention mechanism into the lightweight CNN fault diagnosis model to obtain the lightweight CNN fault diagnosis model integrated with EHA; use the training set to train the lightweight CNN fault diagnosis model integrated with EHA;

[0010] Step S5: Use the test set to verify the reliability of the lightweight CNN fault diagnosis model integrated with EHA, predict the probability of occurrence of each gearbox fault type based on the lightweight CNN fault diagnosis model integrated with EHA, and judge the gearbox fault type with the highest probability of occurrence as the gearbox fault type to achieve gearbox fault diagnosis.

[0011] The step of converting the gearbox vibration signal data into a wavelet time-frequency diagram by using continuous wavelet transform in step S1 includes:

[0012] Step S1-1: Select Morlet wavelet as the wavelet basis function used for continuous wavelet transform. The Morlet wavelet function ψ(t) is expressed as:

[0013]

[0014] In the formula, ω0 is a constant and i is an imaginary number;

[0015] Step S1-2: Perform inner product of the Morlet wavelet function ψ(t) and the gearbox vibration signal to obtain the wavelet coefficient CWT(a,b). The wavelet coefficient CWT(a,b) is expressed as:

[0016]

[0017] Where a is the scaling factor, b is the translation factor, and the conditions a>0, b∈R, ψ * is the conjugate complex number of the wavelet basis function, x(t) is the gearbox time domain signal;

[0018] Step S1-3: Plot the wavelet coefficients CWT(a,b) obtained in step S1-2 into a wavelet time-frequency diagram, where the horizontal axis of the wavelet time-frequency diagram represents time and the vertical axis of the wavelet time-frequency diagram represents frequency.

[0019] The step of constructing a sample data set based on the wavelet time-frequency diagram in step S2 includes:

[0020] Step S2-1: unify the specifications of all wavelet time-frequency images obtained in step S1 to 224 pixels in length, 224 pixels in width, and 3 image channels;

[0021] Step S2-2: setting a fault type label for each wavelet time-frequency graph according to the gearbox fault type;

[0022] The gearbox fault types include: bearing fault type and gear fault type;

[0023] The bearing fault types include: rolling element cracks, cracks on both the inner and outer rings, normal state, inner ring cracks and outer ring cracks;

[0024] The gear fault types include: tooth crack, missing tooth, normal state, root crack and tooth surface wear;

[0025] The ratio of the number of wavelet time-frequency graphs contained in the training set and the test set is 4:1.

[0026] The steps of constructing an efficient hybrid attention mechanism containing a channel attention module and a spatial attention module in step S3 include:

[0027] Step S3-1: Input the feature map into the channel attention module for average pooling and maximum pooling operations. The average pooling and maximum pooling operations are expressed as:

[0028]

[0029] Where z1 is the output of global average pooling, z2 is the output of global maximum pooling, f is a set of two-dimensional feature maps, H is the height of the feature map, and W is the width of the feature map;

[0030] Step S3-2: The output z1 of the global average pooling and the output z2 of the global maximum pooling are superimposed in series to obtain a vector z, and the vector z is input into a one-dimensional convolutional layer that can automatically adjust the cross-channel interaction range for convolution operation to obtain a weight coefficient w, which is expressed as:

[0031] w=hard-sigmoid(C1D k (z))

[0032] Where, C1D k (z) represents a one-dimensional convolution operation with a kernel size of K, and hard-sigmoid represents the activation function;

[0033] Set the kernel size of the 1×1 convolution layer to K, where K represents the coverage of local cross-channel interactions, and K is:

[0034]

[0035] In the formula, represents the nearest odd number, C is the number of channels, γ and b are the channel coefficients;

[0036] The Hard-Sigmoid activation function is used to perform nonlinear processing on the output of the one-dimensional convolutional layer. The formula of the Hard-Sigmoid activation function is:

[0037]

[0038] Step S3-3: Multiply the weight coefficient by the input feature map to obtain the feature map optimized by the channel attention module It is expressed as:

[0039]

[0040] In the formula, w is the weight coefficient, f(i,j) is the input feature map;

[0041] Step S3-4: The feature map optimized by the channel attention module The input is sent to the spatial attention module to extract its global information and local characteristics, and then concatenated and input to the 7×7 two-dimensional convolutional layer to obtain a new weight coefficient and combine it with Multiply to obtain the feature map after EHA optimization It is expressed as:

[0042]

[0043] In the formula, hard-sigmoid is the activation function, f 7×7 is a 7×7 two-dimensional convolutional layer, AvgPool is a global average pooling layer, and MaxPool is a global maximum pooling layer.

[0044] The step of obtaining a lightweight CNN fault diagnosis model integrating EHA in step S4 includes:

[0045] Step S4-1: construct the Fused-MBConv module to form the shallow part of the lightweight CNN fault diagnosis model fused with EHA;

[0046] Step S4-2: Integrate EHA into the MBConv module to construct an EHA-MBConv module, which constitutes the deep part of the lightweight CNN fault diagnosis model integrating EHA;

[0047] Step S4-3: construct a lightweight CNN fault diagnosis model based on the Fused-MBConv module and the EHA-MBConv module to obtain a lightweight CNN fault diagnosis model integrated with EHA.

[0048] The steps of constructing the Fused-MBConv module include:

[0049] The input feature map is input into a 3×3 convolution layer to embed the features from a low-dimensional distribution into a high-dimensional space, and then nonlinearly processed by a switch activation function. The expanded features are compressed to the original dimension through a 1×1 convolution and added to the input feature map as the output of the Fused-MBConv module.

[0050] The Switch activation function is:

[0051]

[0052] The steps of constructing the EHA-MBConv module include:

[0053] The input feature map is input into a 1×1 convolution for dimensionality increase, the features are embedded from low-dimensional distribution into high-dimensional space, and then further features are extracted through a 3×3 deep convolution. The channels and spatial weights are calibrated through an efficient hybrid attention mechanism, and finally the expanded features are compressed to the original dimension through a 1×1 convolution and added to the input feature map as the output of the EHA-MBConv module.

[0054] The steps of constructing a lightweight CNN fault diagnosis model include:

[0055] The sample data set is first input into a 3×3 convolutional layer for feature extraction, then input into two Fused-MBConv modules and use a 3×3 small convolution kernel to extract the detailed features of the signal, then input into two Fused-MBConv modules to increase the number of channels of the feature map to 48, then input into three Fused-MBConv modules to increase the number of channels of the feature map to 64, retaining more feature information of the sample, and input its output results into four EHA-MBConv modules to extract more complex deep-level features of the time-frequency graph, then input into four EHA-MBConv modules to increase the number of channels of the feature map to 160, so that the model can extract more complex feature information, then input into a 1×1 convolutional layer for feature extraction, then input into the average pooling layer to compress the features, and finally input into the fully connected layer to output the probability of occurrence of each gearbox fault type.

[0056] Add a batch normalization module BN after the 3×3 convolution layer and the 1×1 convolution layer to avoid gradient vanishing or overflow and accelerate convergence. The expression of the batch normalization module BN is:

[0057]

[0058] In the formula, x i is the eigenvalue of the i-th feature map, μ is the mean of the feature map, σ is the variance of the feature map, y i is the output of the BN layer, γ i and β i are learnable parameters.

[0059] The step of using the training set to train the lightweight CNN fault diagnosis model fused with EHA in step S4 includes:

[0060] The training set in step S2 is input into the model for training; the number of iterations is designed to be 50 times, the batch size is 32, the Adam optimization algorithm is used to update the network training parameters, and the cross entropy function is applied to calculate the model loss value; the automatic learning rate adjustment strategy is used, the initial learning rate is set to 0.1, and the test set accuracy is used as an indicator. When the model iteration number exceeds 3 times and the accuracy does not change, the learning rate decay strategy is adopted to reduce the original learning rate by 0.01 times to achieve automatic adjustment of the learning rate.

[0061] The beneficial effects of the present invention are:

[0062] The present invention discloses a gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism (Efficient HybridAttention, EHA), which adopts deep separable convolution to reduce the model parameter amount and improve the fault diagnosis efficiency, and designs an efficient hybrid attention mechanism to dynamically adjust the weights of different channels or positions in the feature map, giving a higher weight to important information, so as to achieve the purpose of optimizing the recognition ability of lightweight CNN. In order to solve the problems of low fault diagnosis efficiency and insufficient extraction of key features of traditional CNN models, a lightweight CNN is constructed to improve the fault diagnosis accuracy of the network while reducing the training time, and an efficient hybrid attention mechanism that can strengthen the channel and spatial key features of fault samples is designed, and it is integrated into the lightweight CNN to strengthen the model's extraction of effective features of vibration signals, suppress the interference of invalid features, and further enhance the generalization and robustness of the model. The specific beneficial effects are as follows:

[0063] 1. The continuous wavelet transform is used to convert the gearbox vibration data into a time-frequency diagram, which can suppress noise interference and analyze the local characteristics of the signal more intuitively, making it easier for subsequent models to accurately diagnose different fault types.

[0064] 2. Build a high-performance lightweight CNN model and introduce deep separable convolution into the deep structure of the model, which reduces the model training time and improves the fault diagnosis accuracy of CNN.

[0065] 3. Design an efficient hybrid attention mechanism that can adaptively adjust the coverage of local cross-channel interactions according to the number of channels and channel coefficients. By dynamically adjusting the weights of different channels or positions in the feature map, the model can adaptively select features that are more relevant to the fault type, thereby enhancing the robustness, generalization and stability of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 It is a flow chart of a gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism in the present invention;

[0067] Figure 2It is the structural diagram of the EHA module in the present invention;

[0068] Figure 3 It is a structural diagram of the Fused-MBConv module in the present invention;

[0069] Figure 4 It is a structural diagram of the EHA-MBConv module in the present invention;

[0070] Figure 5 This is a comparison chart of the fault diagnosis accuracy of the model before and after the fusion of EHA in the present invention;

[0071] Figure 6 It is the confusion matrix diagram of the bearing sample under 20Hz-0V working condition, where (a) is the confusion matrix before integrating EHA, and (b) is the confusion matrix after integrating EHA;

[0072] Figure 7 It is the confusion matrix diagram of the bearing sample under 30Hz-2V working condition, where (a) is the confusion matrix before integrating EHA, and (b) is the confusion matrix after integrating EHA;

[0073] Figure 8 It is the confusion matrix diagram of the gear sample under 20Hz-0V working condition, where (a) is the confusion matrix before integrating EHA, and (b) is the confusion matrix after integrating EHA;

[0074] Fig. 9 It is the confusion matrix diagram of the gear sample under 30Hz-2V working condition, where (a) is the confusion matrix before integrating EHA, and (b) is the confusion matrix after integrating EHA;

[0075] Fig.10 This is a curve diagram of the fault diagnosis accuracy change based on 50 iterations of the three attention mechanism models on the bearing test set, where (a) is the bearing working condition: 20Hz-0V, (b) is the bearing working condition: 30Hz-2V;

[0076] Fig.11 This is a curve diagram of the fault diagnosis accuracy change based on 50 iterations of the three attention mechanism models on the gear test set, where (a) is the gear working condition: 20Hz-0V, (b) is the gear working condition: 30Hz-2V;

[0077] Fig.12 This is a comparison chart of the training time of the four CNN models in the present invention. DETAILED DESCRIPTION

[0078] The present invention provides a gearbox fault diagnosis method based on a lightweight CNN and an efficient hybrid attention mechanism. The present invention is further described in detail below in conjunction with the accompanying drawings.

[0079] like Figure 1 The embodiment of the present invention shown discloses a gearbox fault diagnosis method based on a lightweight CNN and an efficient hybrid attention mechanism, comprising the following steps:

[0080] Step S1: collecting gearbox vibration signal data, and converting the gearbox vibration signal data into a wavelet time-frequency diagram using continuous wavelet transform;

[0081] Step S2: construct a sample data set based on the wavelet time-frequency graph, and divide the sample data set into a training set and a test set;

[0082] Step S3: construct an efficient hybrid attention mechanism containing a channel attention module and a spatial attention module;

[0083] Step S4: Integrate the efficient hybrid attention mechanism into the lightweight CNN fault diagnosis model to obtain the lightweight CNN fault diagnosis model integrated with EHA; use the training set to train the lightweight CNN fault diagnosis model integrated with EHA;

[0084] Step S5: Use the test set to verify the reliability of the lightweight CNN fault diagnosis model integrated with EHA, predict the probability of occurrence of each gearbox fault type based on the lightweight CNN fault diagnosis model integrated with EHA, and judge the gearbox fault type with the highest probability of occurrence as the gearbox fault type to achieve gearbox fault diagnosis.

[0085] In this embodiment, a deep separable convolution is used to reduce the number of model parameters and improve the efficiency of fault diagnosis. An efficient hybrid attention mechanism is designed to dynamically adjust the weights of different channels or positions in the feature map, and a higher weight is given to important information to achieve the purpose of optimizing the recognition ability of lightweight CNN. In order to solve the problems of low fault diagnosis efficiency and insufficient extraction of key features of traditional CNN models, a lightweight CNN is constructed to improve the fault diagnosis accuracy of the network while reducing training time. An efficient hybrid attention mechanism that can strengthen the key features of the fault sample channel and space is designed, and it is integrated into the lightweight CNN to strengthen the model's extraction of effective features of vibration signals, suppress invalid feature interference, and further enhance the generalization and robustness of the model. The following is a detailed description of each step in conjunction with the figure.

[0086] Step S1: collecting gearbox vibration signal data, and converting the gearbox vibration signal data into a wavelet time-frequency diagram using continuous wavelet transform;

[0087] In this embodiment, the gearbox vibration signal data is collected, and the one-dimensional signal of the gearbox is converted into a time-frequency diagram using continuous wavelet transform.

[0088] In this embodiment, publicly available bearing and gearbox data sets are obtained. The data used is from the bearing and gearbox vibration data set provided by Southeast University {Shao S, Mcaleer S, Yan R, et al. Highly accurate machine fault diagnosis using deep transfer learning [J]. IEEE Transactions on Industrial Informatics, 2019, 15 (4): 2446-2455.}. The experimental device is composed of a programmable controller, a variable speed drive motor, a two-stage planetary gearbox, a two-stage parallel shaft spur gearbox, etc. The bearing and gearbox data under two working conditions of 20Hz-0 V and 30Hz-2 V are selected as the fault diagnosis data set. Each data set has 1 healthy state and 4 fault states. The specific states are shown in Table 1.

[0089] Table 1 Bearing and gear fault types and data set division

[0090]

[0091] The step of converting the gearbox vibration signal data into a wavelet time-frequency diagram by using continuous wavelet transform in step S1 includes:

[0092] Step S1-1: Select Morlet wavelet as the wavelet basis function used for continuous wavelet transform. The Morlet wavelet function ψ(t) is expressed as:

[0093]

[0094] In the formula, ω0 is a constant and i is an imaginary number;

[0095] In this embodiment, the vibration signal is processed by using continuous wavelet transform to map the original signal into a two-dimensional space, and the wavelet basis function used by the continuous wavelet transform is Morlet wavelet.

[0096] Step S1-2: Perform inner product of the Morlet wavelet function ψ(t) and the gearbox vibration signal to obtain the wavelet coefficient CWT(a,b). The wavelet coefficient CWT(a,b) is expressed as:

[0097]

[0098] Where a is the scaling factor, b is the translation factor, and the conditions a>0, b∈R, ψ * is the conjugate complex number of the wavelet basis function, x(t) is the gearbox time domain signal;

[0099] Step S1-3: Plot the wavelet coefficients CWT(a,b) obtained in step S1-2 into a wavelet time-frequency diagram, where the horizontal axis of the wavelet time-frequency diagram represents time and the vertical axis of the wavelet time-frequency diagram represents frequency.

[0100] In this embodiment, the wavelet coefficients are plotted into a time-frequency diagram, the horizontal axis of the time-frequency diagram represents time, and the vertical axis of the time-frequency diagram represents frequency, so as to obtain wavelet time-frequency diagrams under different states of bearings and gears.

[0101] Step S2: construct a sample data set based on the wavelet time-frequency graph, and divide the sample data set into a training set and a test set;

[0102] In this embodiment, according to the normal state or fault state of the gearbox, the corresponding wavelet time-frequency diagram is marked and divided into a training set and a test set for model training and testing.

[0103] Through manual labeling, the labels used for bearing fault types are: Ball, Comb, Inner, Normal, Outer; the labels used for gear fault types are: Chipped, Miss, Normal, Root, Surface.

[0104] The step of constructing a sample data set based on the wavelet time-frequency diagram in step S2 includes:

[0105] Step S2-1: unify the specifications of all wavelet time-frequency images obtained in step S1 to 224 pixels in length, 224 pixels in width, and 3 image channels;

[0106] Step S2-2: setting a fault type label for each wavelet time-frequency graph according to the gearbox fault type;

[0107] The gearbox fault types include: bearing fault type and gear fault type;

[0108] The bearing fault types include: rolling element cracks, cracks on both the inner and outer rings, normal state, inner ring cracks and outer ring cracks;

[0109] The gear fault types include: tooth crack, missing tooth, normal state, root crack and tooth surface wear;

[0110] The ratio of the number of wavelet time-frequency graphs contained in the training set and the test set is 4:1.

[0111] In this embodiment, the obtained time-frequency graph sample set is uniformly compressed to a size of 224×224×3 (corresponding to a length of 224 pixels, a width of 224 pixels, and an image channel number of 3 for the wavelet time-frequency graph), the sample capacity of the bearing and gear data sets is 4000, each fault type consists of 800 samples, and the data sets are divided into training sets and test sets at a ratio of 4:1. The specific division of the data sets is shown in Table 1.

[0112] Step S3: construct an efficient hybrid attention mechanism containing a channel attention module and a spatial attention module;

[0113] In this embodiment, an efficient hybrid attention mechanism (EHA) is designed, which contains a channel attention module and a spatial attention module. The module structure of the EHA is as follows: Figure 2 As shown in Figure 2, the EHA module is an efficient hybrid attention mechanism that can enhance the channel and spatial key features of fault samples.

[0114] The steps of constructing an efficient hybrid attention mechanism containing a channel attention module and a spatial attention module in step S3 include:

[0115] Step S3-1: Input the feature map into the channel attention module for average pooling and maximum pooling operations. The average pooling and maximum pooling operations are expressed as:

[0116]

[0117] Where z1 is the output of global average pooling, z2 is the output of global maximum pooling, f is a set of two-dimensional feature maps, H is the height of the feature map, and W is the width of the feature map;

[0118] In this embodiment, the feature map is input into the channel attention module to perform average pooling and maximum pooling operations.

[0119] Step S3-2: The output z1 of the global average pooling and the output z2 of the global maximum pooling are superimposed in series to obtain a vector z, and the vector z is input into a one-dimensional convolutional layer that can automatically adjust the cross-channel interaction range for convolution operation to obtain a weight coefficient w, which is expressed as:

[0120] w=hard-sigmoid(C1D k (z))

[0121] Where, C1D k (z) represents a one-dimensional convolution operation with a kernel size of K, and hard-sigmoid represents the activation function;

[0122] In this embodiment, z1 and z2 are superimposed in series to obtain a vector z, and z is input into a one-dimensional convolutional layer that can automatically adjust the cross-channel interaction range for convolution operation.

[0123] Set the kernel size of the 1×1 convolution layer to K, where K represents the coverage of local cross-channel interactions, and K is:

[0124]

[0125] In the formula, represents the nearest odd number, C is the number of channels, γ and b are the channel coefficients;

[0126] The Hard-Sigmoid activation function is used to perform nonlinear processing on the output of the one-dimensional convolutional layer. The formula of the Hard-Sigmoid activation function is:

[0127]

[0128] Step S3-3: Multiply the weight coefficient by the input feature map to obtain the feature map optimized by the channel attention module It is expressed as:

[0129]

[0130] In the formula, w is the weight coefficient, f(i,j) is the input feature map;

[0131] Step S3-4: The feature map optimized by the channel attention module The input is sent to the spatial attention module to extract its global information and local characteristics, and then concatenated and input to the 7×7 two-dimensional convolutional layer to obtain a new weight coefficient and combine it with Multiply to obtain the feature map after EHA optimization It is expressed as:

[0132]

[0133] In the formula, hard-sigmoid is the activation function, f 7×7 is a 7×7 two-dimensional convolutional layer, AvgPool is a global average pooling layer, and MaxPool is a global maximum pooling layer.

[0134] In this embodiment, The input is sent to the spatial attention module to extract its global information and local characteristics, and then concatenated and input to the 7×7 two-dimensional convolutional layer to obtain a new weight coefficient and then combined with Multiply.

[0135] Step S4: Integrate the efficient hybrid attention mechanism into the lightweight CNN fault diagnosis model to obtain the lightweight CNN fault diagnosis model integrated with EHA; use the training set to train the lightweight CNN fault diagnosis model integrated with EHA;

[0136] In this embodiment, EHA is integrated into lightweight CNN, a lightweight CNN fault diagnosis model integrating EHA is constructed, and the model is trained using a training set.

[0137] The step of obtaining a lightweight CNN fault diagnosis model integrating EHA in step S4 includes:

[0138] Step S4-1: construct the Fused-MBConv module to form the shallow part of the lightweight CNN fault diagnosis model fused with EHA;

[0139] Step S4-2: Integrate EHA into the MBConv module to construct an EHA-MBConv module, which constitutes the deep part of the lightweight CNN fault diagnosis model integrating EHA;

[0140] Step S4-3: construct a lightweight CNN fault diagnosis model based on the Fused-MBConv module and the EHA-MBConv module to obtain a lightweight CNN fault diagnosis model integrated with EHA.

[0141] The steps of constructing the Fused-MBConv module include:

[0142] The input feature map is input into a 3×3 convolution layer to embed the features from a low-dimensional distribution into a high-dimensional space, and then nonlinearly processed by a switch activation function. The expanded features are compressed to the original dimension through a 1×1 convolution and added to the input feature map as the output of the Fused-MBConv module.

[0143] The Switch activation function is:

[0144]

[0145] In this embodiment, the shallow part of the benchmark network is constructed based on the inverted bottleneck convolution module (Fused-MBConv) {Gupta S, Akin B. Accelerator-aware neural network design using automl[J].arXiv preprintarXiv:2003.02838,2020.}, and the structure of the Fused-MBConv module is as follows: Figure 3As shown in the figure, this module uses a 3×3 convolution layer to embed features from a low-dimensional distribution into a high-dimensional space, and then performs nonlinear processing through a Switch activation function. The expanded features are compressed to the original dimension through a 1×1 convolution and added to the input feature map as the output of the Fused-MBConv module.

[0146] The steps of constructing the EHA-MBConv module include:

[0147] The input feature map is input into a 1×1 convolution for dimensionality increase, the features are embedded from low-dimensional distribution into high-dimensional space, and then further features are extracted through a 3×3 deep convolution. The channels and spatial weights are calibrated through an efficient hybrid attention mechanism, and finally the expanded features are compressed to the original dimension through a 1×1 convolution and added to the input feature map as the output of the EHA-MBConv module.

[0148] In this embodiment, the deep part of the benchmark network is constructed based on the MBConv structure containing deep separable convolution in MobileNetV2 {Sandler M, Howard A, Zhu M, et al. Mobilenetv2: Inverted residuals and linear bottlenecks [C] / / Proceedings of the IEEE conference on computer vision and pattern recognition. 2018: 4510-4520.}, and EHA is integrated into the MBConv module to form an EHA-MBConv module. The EHA-MBConv module structure is as follows Figure 4 As shown in the figure, the module first uses 1×1 point-by-point convolution to perform dimensionality increase operation, embeds the features from low-dimensional distribution into high-dimensional space, and then further extracts features through 3×3 deep convolution. Next, EHA is used to calibrate the channels and spatial weights, and finally the expanded features are compressed to the original dimension through 1×1 convolution and added to the input feature map as the output of the EHA-MBConv module.

[0149] The steps of constructing a lightweight CNN fault diagnosis model include:

[0150] The sample data set is first input into a 3×3 convolutional layer for feature extraction, then input into two Fused-MBConv modules and use a 3×3 small convolution kernel to extract the detailed features of the signal, then input into two Fused-MBConv modules to increase the number of channels of the feature map to 48, then input into three Fused-MBConv modules to increase the number of channels of the feature map to 64, retaining more feature information of the sample, and input its output results into four EHA-MBConv modules to extract more complex deep-level features of the time-frequency graph, then input into four EHA-MBConv modules to increase the number of channels of the feature map to 160, so that the model can extract more complex feature information, then input into a 1×1 convolutional layer for feature extraction, then input into the average pooling layer to compress the features, and finally input into the fully connected layer to output the probability of occurrence of each gearbox fault type.

[0151] In this embodiment, the constructed lightweight CNN model is based on the EHA-MBConv module and the Fused-MBConv module, including a 3×3 convolutional layer, 7 Fused-MBConv modules and 8 EHA-MBConv modules.

[0152] In an optional embodiment, a batch normalization module BN is added after the 3×3 convolution layer and the 1×1 convolution layer operations to avoid gradient vanishing or overflow and accelerate convergence. The expression of the batch normalization module BN is:

[0153]

[0154] In the formula, x i is the eigenvalue of the i-th feature map, μ is the mean of the feature map, σ is the variance of the feature map, y i is the output of the BN layer, γ i and β i are learnable parameters.

[0155] By adding Batch Normalization (BN) after the convolution operation, we can avoid gradient vanishing or overflow and accelerate convergence.

[0156] The detailed structure of the lightweight CNN fault diagnosis model fused with EHA is shown in Table 2.

[0157] Table 2 Specific parameters and structural statistics of the model

[0158]

[0159] The step of using the training set to train the lightweight CNN fault diagnosis model fused with EHA in step S4 includes:

[0160] The training set in step S2 is input into the model for training; the number of iterations is designed to be 50 times, the batch size is 32, the Adam optimization algorithm is used to update the network training parameters, and the cross entropy function is applied to calculate the model loss value; the automatic learning rate adjustment strategy is used, the initial learning rate is set to 0.1, and the test set accuracy is used as an indicator. When the model iteration number exceeds 3 times and the accuracy does not change, the learning rate decay strategy is adopted to reduce the original learning rate by 0.01 times to achieve automatic adjustment of the learning rate.

[0161] In this embodiment, the training data of bearings and gears under two working conditions in S2 are input into the model for training. The number of iterations is designed to be 50, the batch size is 32, the Adam optimization algorithm is used to update the network training parameters, and the cross entropy function is applied to calculate the model loss value. The automatic learning rate adjustment strategy is used, the initial learning rate is set to 0.1, and the test set accuracy is used as an indicator. When the model iteration number exceeds 3 times and the accuracy does not change, the learning rate decay strategy is adopted to reduce the original learning rate by 0.01 times to achieve automatic adjustment of the learning rate.

[0162] Step S5: Use the test set to verify the reliability of the lightweight CNN fault diagnosis model integrated with EHA, predict the probability of occurrence of each gearbox fault type based on the lightweight CNN fault diagnosis model integrated with EHA, and judge the gearbox fault type with the highest probability of occurrence as the gearbox fault type to achieve gearbox fault diagnosis.

[0163] In this embodiment, by conducting fault experiments on gearbox data under different working conditions, the reliability of the gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism is verified, the gearbox fault diagnosis results are obtained, and the corresponding confusion matrix diagram is drawn. The bearing and gear test sets under two working conditions in step S2 are used to verify the model. In order to verify the optimization ability of the EHA module, the accuracy of the lightweight model before and after the EHA is compared and analyzed, and the corresponding confusion matrix diagram is drawn to verify the recognition accuracy of the model for bearings and gears.

[0164] The fault diagnosis accuracy results of the model before and after fusion of EHA are as follows: Figure 5 As shown in the figure, the fault diagnosis effect of the model after integrating EHA is better, with accuracy rates of 99.25% and 99.88% on the bearing dataset, and 99.63% and 99.13% on the gear dataset. The EHA module strengthens the key features of space and channels, and after considering the features of different input scales, the accuracy of the model is reasonably improved. The fault diagnosis results show that the model has stronger feature extraction capabilities after integrating EHA.

[0165] Figure 6-Figure 9 The confusion matrix of the model before and after fusion of EHA on bearing and gear samples is shown. Figure 6It is the confusion matrix diagram of the bearing sample under 20Hz-0V working condition, where (a) is the confusion matrix before integrating EHA, and (b) is the confusion matrix after integrating EHA; Figure 7 It is the confusion matrix diagram of the bearing sample under 30Hz-2V working condition, where (a) is the confusion matrix before integrating EHA, and (b) is the confusion matrix after integrating EHA; Figure 8 It is the confusion matrix diagram of the gear sample under 20Hz-0V working condition, where (a) is the confusion matrix before integrating EHA, and (b) is the confusion matrix after integrating EHA; Fig. 9 The confusion matrix diagram of the gear sample under 30Hz-2V working condition, where (a) is the confusion matrix before EHA integration, and (b) is the confusion matrix after EHA integration. The horizontal axis represents the real label, and the vertical axis represents the predicted label. On the bearing data set under 20Hz-0V working condition, all normal bearing samples can be correctly classified before EHA integration, and there are many misclassifications of other categories of samples. Among them, the most misclassifications are for composite faults, with 20 samples being misclassified. After EHA integration, the model can correctly predict normal and outer ring faults, and only a few other categories are misclassified. On the bearing data set under 30Hz-2V working condition, the recognition effect of outer ring faults is the worst before integration, with 15 samples being misclassified. After EHA integration, only one outer ring fault is classified as a rolling element fault, and other categories of samples can be completely correctly classified. On the gear dataset of 20Hz-0V working condition, the recognition effect of tooth surface wear samples was good before fusion, with only three samples misclassified, and the recognition effect of other categories was poor. After fusion with EHA, root cracks and tooth surface wear can be completely correctly classified, and only one sample in other categories is misclassified. On the gear dataset of 30Hz-2V working condition, the recognition effect of tooth surface wear samples was the worst before fusion, with 14 samples misclassified, and the recognition effect of missing teeth and root cracks also needs to be improved. After fusion with EHA, gear tooth cracks and normal samples can be completely accurately predicted, and the recognition effect on other categories is also good.

[0166] To demonstrate the advantages of EHA, the recognition accuracy of lightweight CNNs incorporating three attention mechanisms, namely efficient channel attention (ECA), convolutional attention module (CBAM) and EHA, is compared and analyzed. Table 3 shows the fault diagnosis accuracy of the models based on the three attention mechanisms on the bearing and gear datasets.

[0167] Table 3 Statistics of fault diagnosis accuracy of models based on three attention mechanisms on bearing and gear datasets

[0168]

[0169] As shown in Table 3, the accuracy of the models based on the three attention mechanisms on the bearing and gear datasets is above 96%. Among the three attention mechanisms, ECA only focuses on the channel information of the feature map and ignores the extraction of spatial position information. The accuracy rates are 97.25%, 96.75%, 97.5% and 97% under the two working conditions of bearings and gears. CBMA adds a spatial attention module, but the comprehensive extraction effect of channel and spatial features after integrating it into the model is lower than the extraction effect of the model after integrating the EHA module. The accuracy rates are 97.63%, 97.38%, 97.75% and 97.88% under the two working conditions of bearings and gears. The fault diagnosis performance of the model after integrating EHA is the best among all methods. Compared with ECA and CBMA, the model after integrating the EHA module can learn richer fault features and has the best extraction effect on effective channel and spatial key information.

[0170] The fault diagnosis accuracy curves of the three attention mechanism models after 50 iterations on the bearing test set are shown in the figure below. Fig.10 As shown in Figure 2, (a) is the bearing working condition: 20Hz-0V, (b) is the bearing working condition: 30Hz-2V; the fault diagnosis accuracy change curve based on the three attention mechanism models after 50 iterations on the gear test set is shown in Figure 2. Fig.11 As shown, (a) is the gear working condition: 20Hz-0 V, (b) is the gear working condition: 30Hz-2 V. For the bearing data sets under the two working conditions, after integrating the ECA module, the accuracy of the model can continue to rise in the early training process. In the subsequent training, the model is more oscillating. After about 30 iterations, the model gradually stabilizes at about 97%. After integrating the CBAM module, the model is also relatively stable after about 30 iterations. For the gear data under the two working conditions, after integrating the ECA and CBMA modules, the model has been fluctuating under the 20Hz-0 V working condition, and it starts to stabilize after about 40 iterations. Under the 30Hz-2 V working condition, it takes about 25 iterations and gradually stabilizes at about 97%. On the bearing and gear data sets of the two working conditions, the model converges fastest and is more stable after integrating the EHA module.

[0171] In order to verify the effectiveness of the method disclosed in the present invention, the lightweight CNN model fused with EHA proposed in the present invention (i.e.: Fig.12 The recognition accuracy, training time and model complexity of EHA-LCNN in Tables 4 and 5 are compared with those of Vgg13, ResNet50 and MobileNetV3. The bearing and gear test sets under two working conditions in S2 are input into the above models respectively. Table 4 shows the fault diagnosis accuracy of the four models under different working conditions.

[0172] Table 4 Statistics of fault diagnosis accuracy of four models under different working conditions

[0173]

[0174] As shown in Table 4, the model of the present invention has stronger feature learning ability than other models, and has the highest accuracy in both bearing and gear working conditions. In the comparison method, the accuracy of MobileNetV3 in both bearing and gear working conditions is 94.93%, 95.25%, 95.15% and 94.88%, and the accuracy in the four scenarios is lower than that of the proposed method, which proves that the model can obtain richer fault information compared with the classic lightweight network. The accuracy of the ResNet50 model is 94.05%, 94.38%, 94.23% and 93.73%, respectively, and its recognition effect is also lower than the lightweight CNN fault diagnosis model fused with EHA constructed by the present invention. Among all the comparison networks, Vgg13 has the lowest model accuracy due to the lack of the identical path and the parameters are not effectively updated. The fault diagnosis accuracy in both gear and bearing working conditions does not reach 90%. The above results show that the constructed lightweight CNN fault diagnosis model fused with EHA can effectively identify the fault types of bearings and gears under different working conditions.

[0175] Comparison of training time of four models on bearing and gear datasets under different working conditions Fig.12 As shown, the method based on the EHA-LCNN model disclosed in the present invention has the highest efficiency, with average iteration times of 11.02s and 10.98s on the bearing data set, and 10.97s and 10.94s on the gear data set. Among the comparison models, MobileNetV3 is also relatively lightweight, and its training time is similar to that of the method disclosed in the present invention, which is 11.22s, 11.18s, 11.15s, and 11.13s on the bearing and gear data, respectively, with a difference of only about 0.3. Vgg13 has the longest average iteration time among all methods, which is quite different from other models.

[0176] In addition to training time, floating-point operations and parameter count are also considered important indicators for evaluating model complexity. Floating-point operations are indicators of model computational complexity. Table 5 shows the computational complexity and parameter count of the four models. Among them, the proposed method has the lowest parameter count of 2.43M. The model complexity of MobileNetV3 is also relatively low. The parameter count and computational complexity of Vgg13 are both the largest. Combined with the model training time, the proposed method meets the lightweight requirements and has a high fault diagnosis efficiency.

[0177] Table 5 Comparison of parameters and calculation amount of four models

[0178]

Claims

1. A gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism, characterized in that: The following steps are involved: Step S1: collecting gearbox vibration signal data, and converting the gearbox vibration signal data into a wavelet time-frequency diagram using continuous wavelet transform; Step S2: construct a sample data set based on the wavelet time-frequency graph, and divide the sample data set into a training set and a test set; Step S3: construct an efficient hybrid attention mechanism containing a channel attention module and a spatial attention module; Step S4: Integrate the efficient hybrid attention mechanism into the lightweight CNN fault diagnosis model to obtain the lightweight CNN fault diagnosis model integrated with EHA; use the training set to train the lightweight CNN fault diagnosis model integrated with EHA; Step S5: Use the test set to verify the reliability of the lightweight CNN fault diagnosis model integrated with EHA, predict the probability of occurrence of each gearbox fault type based on the lightweight CNN fault diagnosis model integrated with EHA, and judge the gearbox fault type with the highest probability of occurrence as the gearbox fault type to achieve gearbox fault diagnosis.

2. The gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism according to claim 1 is characterized in that: The step of converting the gearbox vibration signal data into a wavelet time-frequency diagram by using continuous wavelet transform in step S1 includes: Step S1-1: Select Morlet wavelet as the wavelet basis function used for continuous wavelet transform. The Morlet wavelet function ψ(t) is expressed as: In the formula, ω0 is a constant and i is an imaginary number; Step S1-2: Perform inner product of the Morlet wavelet function ψ(t) and the gearbox vibration signal to obtain the wavelet coefficient CWT(a,b). The wavelet coefficient CWT(a,b) is expressed as: Where a is the scaling factor, b is the translation factor, and the conditions a>0, b∈R, ψ * is the conjugate complex number of the wavelet basis function, x(t) is the gearbox time domain signal; Step S1-3: Plot the wavelet coefficients CWT(a,b) obtained in step S1-2 into a wavelet time-frequency diagram, where the horizontal axis of the wavelet time-frequency diagram represents time and the vertical axis of the wavelet time-frequency diagram represents frequency.

3. The gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism according to claim 1 is characterized in that: The step of constructing a sample data set based on the wavelet time-frequency diagram in step S2 includes: Step S2-1: unify the specifications of all wavelet time-frequency images obtained in step S1 to 224 pixels in length, 224 pixels in width, and 3 image channels; Step S2-2: setting a fault type label for each wavelet time-frequency graph according to the gearbox fault type; The gearbox fault types include: bearing fault type and gear fault type; The bearing fault types include: rolling element cracks, cracks on both the inner and outer rings, normal state, inner ring cracks and outer ring cracks; The gear fault types include: tooth crack, missing tooth, normal state, root crack and tooth surface wear; The ratio of the number of wavelet time-frequency graphs contained in the training set and the test set is 4:

1.

4. The gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism according to claim 1 is characterized in that: The steps of constructing an efficient hybrid attention mechanism containing a channel attention module and a spatial attention module in step S3 include: Step S3-1: Input the feature map into the channel attention module for average pooling and maximum pooling operations. The average pooling and maximum pooling operations are expressed as: Where z1 is the output of global average pooling, z2 is the output of global maximum pooling, f is a set of two-dimensional feature maps, H is the height of the feature map, and W is the width of the feature map; Step S3-2: The output z1 of the global average pooling and the output z2 of the global maximum pooling are superimposed in series to obtain a vector z, and the vector z is input into a one-dimensional convolutional layer that can automatically adjust the cross-channel interaction range for convolution operation to obtain a weight coefficient w, which is expressed as: w=hard-sigmoid(C1D k (z)) Where, C1D k (z) represents a one-dimensional convolution operation with a kernel size of K, and hard-sigmoid represents the activation function; Set the kernel size of the 1×1 convolution layer to K, where K represents the coverage of local cross-channel interactions, and K is: In the formula, represents the nearest odd number, C is the number of channels, γ and b are the channel coefficients; The Hard-Sigmoid activation function is used to perform nonlinear processing on the output of the one-dimensional convolutional layer. The formula of the Hard-Sigmoid activation function is: Step S3-3: Multiply the weight coefficient by the input feature map to obtain the feature map optimized by the channel attention module It is expressed as: In the formula, w is the weight coefficient, f(i,j) is the input feature map; Step S3-4: The feature map optimized by the channel attention module The input is sent to the spatial attention module to extract its global information and local characteristics, and then concatenated and input to the 7×7 two-dimensional convolutional layer to obtain a new weight coefficient and combine it with Multiply to obtain the feature map after EHA optimization It is expressed as: In the formula, hard-sigmoid is the activation function, f 7×7 is a 7×7 two-dimensional convolutional layer, AvgPool is a global average pooling layer, and MaxPool is a global maximum pooling layer.

5. The gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism according to claim 1 is characterized in that: The step of obtaining a lightweight CNN fault diagnosis model integrating EHA in step S4 includes: Step S4-1: construct the Fused-MBConv module to form the shallow part of the lightweight CNN fault diagnosis model fused with EHA; Step S4-2: Integrate EHA into the MBConv module to construct an EHA-MBConv module, which constitutes the deep part of the lightweight CNN fault diagnosis model integrating EHA; Step S4-3: construct a lightweight CNN fault diagnosis model based on the Fused-MBConv module and the EHA-MBConv module to obtain a lightweight CNN fault diagnosis model integrated with EHA.

6. The gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism according to claim 5 is characterized in that: The steps of constructing the Fused-MBConv module include: The input feature map is input into a 3×3 convolution layer to embed the features from a low-dimensional distribution into a high-dimensional space, and then nonlinearly processed by a switch activation function. The expanded features are compressed to the original dimension through a 1×1 convolution and added to the input feature map as the output of the Fused-MBConv module. The Switch activation function is:

7. The gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism according to claim 5 is characterized in that: The steps of constructing the EHA-MBConv module include: The input feature map is input into a 1×1 convolution for dimensionality increase, the features are embedded from low-dimensional distribution into high-dimensional space, and then further features are extracted through a 3×3 deep convolution. The channels and spatial weights are calibrated through an efficient hybrid attention mechanism, and finally the expanded features are compressed to the original dimension through a 1×1 convolution and added to the input feature map as the output of the EHA-MBConv module.

8. The gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism according to claim 5 is characterized in that: The steps of constructing a lightweight CNN fault diagnosis model include: The sample data set is first input into a 3×3 convolutional layer for feature extraction, then input into two Fused-MBConv modules and use a 3×3 small convolution kernel to extract the detailed features of the signal, then input into two Fused-MBConv modules to increase the number of channels of the feature map to 48, then input into three Fused-MBConv modules to increase the number of channels of the feature map to 64, retaining more feature information of the sample, and input its output results into four EHA-MBConv modules to extract more complex deep-level features of the time-frequency graph, then input into four EHA-MBConv modules to increase the number of channels of the feature map to 160, so that the model can extract more complex feature information, then input into a 1×1 convolutional layer for feature extraction, then input into the average pooling layer to compress the features, and finally input into the fully connected layer to output the probability of occurrence of each gearbox fault type.

9. The gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism according to claim 8, characterized in that: Add a batch normalization module BN after the 3×3 convolution layer and the 1×1 convolution layer to avoid gradient vanishing or overflow and accelerate convergence. The expression of the batch normalization module BN is: In the formula, x i is the eigenvalue of the i-th feature map, μ is the mean of the feature map, σ is the variance of the feature map, y i is the output of the BN layer, γ i and β i are learnable parameters.

10. The gearbox fault diagnosis method based on lightweight CNN and efficient hybrid attention mechanism according to claim 1, characterized in that: The step of using the training set to train the lightweight CNN fault diagnosis model fused with EHA in step S4 includes: The training set in step S2 is input into the model for training; the number of iterations is designed to be 50 times, the batch size is 32, the Adam optimization algorithm is used to update the network training parameters, and the cross entropy function is applied to calculate the model loss value; the automatic learning rate adjustment strategy is used, the initial learning rate is set to 0.1, and the test set accuracy is used as an indicator. When the model iteration number exceeds 3 times and the accuracy does not change, the learning rate decay strategy is adopted to reduce the original learning rate by 0.01 times to achieve automatic adjustment of the learning rate.

Citation Information

Cited By

  • Small sample cross-domain equipment fault diagnosis method based on mixed attention and meta learning

    CN120876451A

  • Pump cavitation state intelligent identification method based on multi-scale fusion DCNN

    CN120995201A

  • A pump cavitation state intelligent identification method based on a multi-scale fusion DCNN

    CN120995201B

  • Gearbox fault diagnosis method based on continuous wavelet transform and attention fusion

    CN122753746A