Bearing fault diagnosis method, system and storage medium based on characterization guidance
By introducing class activation mapping and channel attention modules into the fault diagnosis model, the problem of insufficient stability and interpretability of the deep learning model in fault diagnosis is solved, higher diagnosis accuracy and stability are achieved, and the model is improved. interpretability.
Patent Information
- Application Number
- CN202410985317.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-23
AI Technical Summary
Existing fault diagnosis methods have shortcomings in stability and interpretability, and the decision-making process of deep learning models is opaque and difficult to understand, resulting in trust issues and potential threats in applications in key areas.
Using a method based on representation guidance, by building a fault diagnosis model including a feature extractor and classifier, using class activation mapping and channel attention modules, the model parameters are optimized to enhance the diagnostic accuracy and stability of the model, and through positive class activation loss Weighted fusion with negative class activation loss improves the interpretability of the model.
It improves the diagnostic accuracy and stability of the model, makes the decision-making process more interpretable, can focus more effectively on target category features, reduces the impact of data set bias and overfitting, and improves reliability in actual scenarios. .
Smart Images

Figure CN118520357B
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and fault diagnosis, and in particular to a bearing fault diagnosis method, system and storage medium based on characterization guidance. Background Art
[0002] In the field of modern fault diagnosis, deep learning technology has attracted widespread attention from industry and academia due to its excellent feature learning ability and efficient processing ability for large-scale data. Although deep learning models have outstanding image processing and pattern recognition capabilities, due to their high nonlinearity, multiple hidden layers and large number of parameters, people cannot know the decision-making basis behind them and the reliability of their internal structure, so they think it is a "black box". Especially in key areas such as autonomous driving and industrial equipment health monitoring, the decision results of the model are directly related to human life safety, which deepens people's trust in it. Therefore, the decision of the model requires not only high accuracy, but also good stability and reliability so that its decision results can be understood and trusted by humans. In order to improve the interpretability of the model, researchers have tried to explain the decision mechanism of the model from different perspectives. However, a major limitation of the interpretation methods of the decision mechanism is that they only highlight the areas that the model considers important for the decision, but do not provide the actual reasons for the decision.
[0003] If an object often co-occurs with certain visual features in training samples, the model may learn to use the co-occurring features to represent the object. When the co-occurring features used are not relevant to the object, these features are considered biased feature representations. In traditional research, correcting representation defects caused by dataset bias or overfitting problems is a common problem. It may bring potential threats to tasks in real scenarios and also bring similar biases to test samples, which cannot be checked using traditional evaluation strategies. Summary of the invention
[0004] The present invention provides a bearing fault diagnosis method, system and storage medium based on characterization guidance, which are used to solve the technical problem that the existing fault diagnosis method has poor stability.
[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0006] A bearing fault diagnosis method based on characterization guidance, comprising:
[0007] Constructing a fault diagnosis model, wherein the fault diagnosis model includes a feature extractor and a classifier connected in series;
[0008] Acquire vibration signals of normal bearings and faulty bearings to construct a training sample set, and formulate a training strategy to train the fault diagnosis model;
[0009] The training strategy is:
[0010] Extract the feature map output by the last convolutional layer of the feature extractor, and use the class activation mapping method to obtain the positive and negative class activation maps of the input sample; calculate the difference between the positive class activation map of the training sample and the feature map as the positive class activation loss; and calculate the difference between the negative class activation map of the input sample and the inhibition constant as the negative class activation loss; perform weighted fusion on the negative class activation loss, the positive class activation loss and the classification loss of the classifier, and optimize the model parameters of the fault diagnosis model according to the weighted fusion loss function;
[0011] The vibration signal of the target bearing is obtained to construct a detection sample, and the detection sample is input into a trained fault diagnosis model to obtain the fault category of the target bearing.
[0012] Preferably, the feature extractor includes a plurality of residual layers connected in series, each residual layer includes a plurality of residual blocks connected in series, each residual block includes a plurality of convolutional normalization units connected in series, and each convolutional normalization unit includes a convolutional layer and a batch normalization layer connected in series; among the N residual layers at the tail of the series, the last batch normalization layer of each residual block is connected to a channel attention module.
[0013] Preferably, the feature extractor includes 4 residual layers, each residual layer includes 2 residual blocks, and each residual block includes 2 convolutional normalization units; in the last 2 residual layers located at the tail of the series, the last batch normalization layer of each residual block is connected to a channel attention module.
[0014] Preferably, the channel attention module includes an average pooling layer, a maximum pooling layer, a first fully connected layer, a second fully connected layer, a first activation layer, and a second activation layer. The output ends of the average pooling layer and the maximum pooling layer are both connected to the input end of the first fully connected layer, the output end of the first fully connected layer is connected to the input end of the first activation layer, the output end of the first activation layer is connected to the input end of the second fully connected layer; and the output end of the second fully connected layer is connected to the input end of the second activation layer.
[0015] Preferably, the first activation layer adopts a ReLU activation function, and the second activation layer adopts a Sigmoid function.
[0016] Preferably, the positive class activation loss satisfies:
[0017] ;
[0018] in, is the positive class activation loss, is the height of the attention map, is the width of the attention map, is the class activation map of the positive class, It is the pixel location coordinates in the class activation map and the attention map; AM is the attention map;
[0019] The negative class activation loss satisfies:
[0020] ;
[0021] in, is the negative class activation loss, is the true label of the input image, is a tag collection, is the set of all negative class labels: , is the negative class label number, is the inhibition constant.
[0022] Preferably, the classification loss satisfies:
[0023] ;
[0024] is the classification loss value, is the predicted value, is the true value, For time point, Number the sample labels.
[0025] Preferably, the detection samples and training samples are single-channel time-frequency diagrams of the bearing, and the fault categories include fault location categories and damage depth categories; the fault location categories are divided into outer ring and inner ring;
[0026] The vibration signals of normal bearings and faulty bearings are obtained to construct a training sample set, including:
[0027] Acquire vibration signals of multiple known fault categories from historical data, and extract a single-channel time-frequency graph from each of the vibration signals;
[0028] The fault category corresponding to each single-channel time-frequency graph is used as a label to construct a training sample set.
[0029] A computer system comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above method are implemented.
[0030] A computer storage medium stores a computer program, which implements the steps of the above method when executed by a processor.
[0031] The present invention has the following beneficial effects:
[0032] 1. When training the fault diagnosis model, the present invention constrains the class activation maps of all categories, which can drive the backbone network to focus on the target category and express the visually salient area as the characteristics of the target category, thereby improving the diagnostic accuracy and stability of the model and making the decision-making process of the model more explainable.
[0033] 2. In the preferred embodiment, when designing the fault diagnosis model, the present invention introduces a channel attention module into the traditional residual structure, which effectively enhances the information extraction and feature representation capabilities of the model, thereby improving the accuracy of fault diagnosis.
[0034] In addition to the above-described purposes, features and advantages, the present invention has other purposes, features and advantages. The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings constituting a part of this application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0036] Figure 1 The flowchart of the bearing fault diagnosis method based on characterization guidance of the present invention.
[0037] Figure 2 It is a structural schematic diagram of the feature extractor of the present invention.
[0038] Figure 3 Schematic diagram of the structure of the channel attention module of the present invention.
[0039] Figure 4 The flowchart of the training diagnosis model of the present invention.
[0040] Figure 5 It is a functional module diagram of the characterization-guided fault diagnosis system of the present invention. DETAILED DESCRIPTION
[0041] The embodiments of the present invention are described in detail below with reference to the accompanying drawings, but the present invention can be implemented in many different ways as defined and covered by the claims.
[0042] In this embodiment, Figure 1 As shown, this embodiment provides a bearing fault diagnosis method based on characterization guidance, comprising the following steps:
[0043] Step S1, constructing a model input sample using rolling bearing vibration signal data;
[0044] The rolling bearing vibration signal is sampled and divided into samples with the same number of sampling points; the divided one-dimensional signal is converted into a two-dimensional image by performing short-time Fourier transform.
[0045] In this embodiment, the data used are from the rolling bearing data set of Case Western Reserve University and Paderborn University. For the Case Western Reserve University data set, the bearing vibration signal collected by the drive end acceleration sensor is selected, which contains four healthy states of bearings: normal, rolling element fault, inner ring fault and outer ring fault. The fault diameters of each fault type are 0.007 inches, 0.014 inches and 0.021 inches, respectively, and there are a total of ten fault categories. The data set is expanded by overlapping sampling, with a moving step of 400, and each sample contains 2048 data points. Then, each sample is short-time Fourier transform converted to obtain a single-channel time-frequency diagram as the input of the model. 1000 samples are selected from each category of the data set, totaling 10,000 samples, and are divided into training set, validation set and test set in a ratio of 6:2:2. For the Paderborn University data set, the model of all test bearings in the data set is 6203, and the sampling frequency is 64kHz. Faulty bearings are divided into artificial damage and real damage. Artificial damage mainly includes cracks caused by electric sparks, peeling caused by drilling, and pitting caused by electric engraving machines. Real damaged bearings are obtained through accelerated life test benches. The two types of damage data are divided according to the fault location and damage degree. The fault location is divided into inner ring and outer ring. The damage depth includes 0mm~2mm and 2mm~4.5mm, which together with normal data constitute 5 fault categories. 2000 samples are sampled for each fault category, and the sample length is set to 2048, which is the same as the setting of the Case Western Reserve University data set. Short-time Fourier transform is performed on the collected samples and divided into training set, validation set and test set in a ratio of 6:2:2.
[0046] Step S2, constructing a fault diagnosis model, wherein the diagnosis model is composed of a convolutional feature extractor, a classifier, etc.;
[0047] like Figure 2 As shown, the feature extractor described in this embodiment adopts an improved ResNet18 residual network structure, with a total of 4 residual layers, each residual layer contains 2 residual blocks, and each residual block is composed of two 3*3 convolutional layers and two batch normalization layers connected in series. Due to the 32-fold downsampling of the ResNet structure, the feature map output by its last layer retains only less spatial information. Therefore, a hole convolution with a hole rate of 2 is applied in the third residual block, and a hole convolution with a hole rate of 4 is applied in the fourth residual block. In this way, the downsampling multiple is reduced to 8 times while maintaining the original receptive field. In addition, in the third and fourth residual layers, a channel attention module is added after the second batch normalization layer of each residual block. The classifier consists of only one fully connected layer.
[0048] The channel attention module improves the feature selection and representation capabilities of the network by dynamically adjusting the weights of each channel of the feature map. The channel attention module uses global maximum pooling and global average pooling to aggregate the spatial information of the input feature map, thereby obtaining two global information summaries, and then inputs the two aggregated features into two fully connected layers respectively, and then merges the output feature vectors element by element, and activates them with the Sigmoid function to generate the importance weights of each channel. Finally, the input feature map is weighted to obtain the feature map enhanced by the channel attention module.
[0049] Specifically, the structure of the channel attention module in this embodiment is as follows: Figure 3 As shown, it includes two main steps: compression and excitation. In the compression stage, global average pooling is used to summarize the global information of the features of each channel. In the excitation stage, a weight value is generated for the features of each channel using the information aggregated in the compression stage. Finally, the generated weights are normalized and multiplied channel by channel with the input feature map. In addition, the attention map generated by combining global average pooling and global maximum pooling has a more distinct visual effect. In this embodiment, an improved channel attention module is used. In the compression stage, the feature map is used as input, and the spatial information of the feature map is aggregated using global average pooling and global maximum pooling to obtain two global information summaries. In the excitation stage, the two aggregated features are input into two fully connected layers, and the output feature vectors are then element-wise merged to generate the importance weights of each channel, which are used to reweight the feature responses of each channel so as to better highlight important feature channels and suppress unimportant channels.
[0050] Step S3, during the model training process, obtain the feature map output by the last convolutional layer of the model feature extractor, and use the class activation mapping method to obtain the positive and negative class activation maps of the input samples;
[0051] The class activation map is a representation visualization method that uses a visualization model to characterize and guide the decision-making basis of feature areas of different categories in the image. The basic idea of the method is to add a global average pooling layer to the last convolutional layer of the model to compress the spatial dimension of the feature map, and input the compressed feature map into the fully connected layer for classification. The weight of the specific category in the fully connected layer is weighted with the feature map output by the convolutional layer to obtain the class activation map of the specific category, so as to locate the area associated with the specific category on the image. The class activation map of the target category is called the positive class activation map, and the class activation maps of the non-target category are collectively referred to as the negative class activation map. The advantage of the class activation map is that no additional annotations or supervisory information are required for training because it is completely based on the internal feature representation of the model. This makes it a simple and effective object localization technology. Through the class activation map, we can intuitively understand the feature representation learned by the model for different categories.
[0052] Step S4: During the model training process, the difference between the positive class activation map and the feature map of the training sample is calculated as the positive class activation loss. At the same time, the difference between the negative class activation map of the input sample and the suppression constant is calculated as the negative class activation loss.
[0053] In this embodiment, the loss function aims to solve the feature characterization defects caused by data set deviation or overfitting. These characterization defects can cause underreporting or false positives in fault diagnosis of deep learning models, thus limiting their application in practical engineering.
[0054] The attention mechanism imitates the human visual system, guiding the model to focus on representing the key activation areas of the attention map, allowing the model to work in a form that conforms to human cognition. Currently, the existing attention mechanisms can drive the model to focus on the discriminative areas in the image, but these attention mechanisms do not consider the correlation between the target category and non-targets, making it difficult for the model to significantly distinguish the target features from other non-target features.
[0055] Therefore, the present invention implements the constraints on the activation map of all categories, and the training process of the model is as follows Figure 5 As shown in Figure 2. After introducing the channel attention module, we use the feature map (attention map) output by the last convolutional layer of the model to guide the features of the positive class activation map, thereby driving the model to associate the target category with the salient region. In addition, by minimizing the redundant activation of the negative class activation map, the model suppresses the feature expression of non-target categories.
[0056] In order to make the model use the visually salient region as the feature representation of the target category, we define Positive class activation loss is used to guide the attention graph to focus on the positive class activation features. Definition is the negative class activation loss value, which suppresses the model's representation of negative class features by minimizing the redundant features of the negative class activation map. and As a parameter update supervisor during model training. is the true label of the input image, where is a tag collection, is the class activation map of the positive class, The mean square error loss is used for measurement and is defined as follows: , where AM is the attention map, H , W are the height and width of the attention map, respectively. is the pixel location in the class activation map and attention map. In addition, is the set of all negative class labels: ,definition ,in It is an inhibition constant used to suppress the activation level of negative classes and is generally set to 0.
[0057] In step S5, the weighted combination of the positive class activation loss, the negative class activation loss and the classification loss constitutes the final training loss function to optimize the model.
[0058] In this embodiment, the As the classification loss, it is defined as , where is the predicted value, is the true value. Finally, the overall training loss function is , where and For control and The hyperparameters of weights can be adjusted according to actual conditions.
[0059] Fault diagnosis performance test. This embodiment tests the model based on ResNet18 and traditional CNN training, and adds Gaussian white noise with different signal-to-noise ratios (SNR=4dB~-4dB) to the test set. Based on the ResNet18 model, experiments are conducted on the Case Western Reserve University data set. The test results are: when the SNR is above 4dB, the diagnostic accuracy can be maintained at 100%, and when the SNR=-4dB, the high diagnostic accuracy of 93.25% can still be maintained. Using the CNN model, experiments are conducted on the Paderborn University data set. In the SNR=-4dB noise environment, a diagnostic accuracy of 92.78% can be achieved for real damage data. Under the same conditions, a diagnostic accuracy of 73.99% can be achieved for complex data with artificial damage. The values measured in this embodiment are higher than other comparison methods, such as center loss and focus loss. It can be seen that this embodiment can effectively enhance the robustness of the model to external interference. The above provides only part of the test results of this embodiment, not all of the test results. In fact, on this basis, this embodiment also carried out fault diagnosis performance tests based on different image classification models, different loss function methods, and visual analysis of attention maps. The results show that this embodiment has good performance in terms of diagnostic accuracy, stability, and interpretability.
[0060] like Figure 5 As shown, this embodiment also provides a fault diagnosis system based on characterization guidance, including:
[0061] A sample acquisition module, used for constructing a model input sample using rolling bearing vibration signal data;
[0062] The class activation map acquisition module obtains the feature map output by the last convolutional layer of the model feature extractor and uses the class activation mapping method to obtain the positive and negative class activation maps of the input samples;
[0063] Model training module, constructs a diagnostic model, which is composed of a convolutional feature extractor, a classifier, etc.; calculates the difference between the positive class activation map and the feature map of the training sample as the positive class activation loss. At the same time, calculates the difference between the negative class activation map of the input sample and the inhibition constant as the negative class activation loss; the weighted combination of the positive class activation loss, the negative class activation loss and the classification loss constitutes the final training loss function to optimize the model;
[0064] The fault diagnosis module uses the model trained by this method to perform explainable fault diagnosis on the input samples.
[0065] This system is based on Figure 1 Therefore, for the specific processing operations of each module, reference may be made to the relevant description of the previous method embodiment.
[0066] In summary, the present invention introduces an attention mechanism and uses an attention map to guide the activation area of the target category activation map, thereby driving the model to associate the target category with the salient area. In addition, by minimizing the redundant activation of the non-target category activation map, the model's feature expression of the non-target category is suppressed. This can help the model focus on the target category during training and automatically learn more reliable feature representations, thereby improving the model's diagnostic accuracy and stability while making its decisions more visually interpretable.
[0067] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A bearing fault diagnosis method based on characterization guidance, characterized in that: include: Constructing a fault diagnosis model, wherein the fault diagnosis model includes a feature extractor and a classifier connected in series; Acquire vibration signals of normal bearings and faulty bearings to construct a training sample set, and formulate a training strategy to train the fault diagnosis model; The training strategy is: Extract the feature map output by the last convolutional layer of the feature extractor, and use the class activation mapping method to obtain the positive and negative class activation maps of the input sample; calculate the difference between the positive class activation map of the training sample and the feature map as the positive class activation loss; and calculate the difference between the negative class activation map of the input sample and the inhibition constant as the negative class activation loss; perform weighted fusion on the negative class activation loss, the positive class activation loss and the classification loss of the classifier, and optimize the model parameters of the fault diagnosis model according to the weighted fusion loss function; The vibration signal of the target bearing is obtained to construct a detection sample, and the detection sample is input into a trained fault diagnosis model to obtain the fault category of the target bearing.
2. The bearing fault diagnosis method based on characterization guidance according to claim 1 is characterized in that: The feature extractor includes a plurality of residual layers connected in series, each residual layer includes a plurality of residual blocks connected in series, each residual block includes a plurality of convolutional normalization units connected in series, and each convolutional normalization unit includes a convolutional layer and a batch normalization layer connected in series; among the N residual layers at the end of the series, the last batch normalization layer of each residual block is connected to a channel attention module.
3. The bearing fault diagnosis method based on characterization guidance according to claim 2 is characterized in that: The feature extractor includes 4 residual layers, each residual layer includes 2 residual blocks, and each residual block includes 2 convolutional normalization units; in the last 2 residual layers located at the end of the series, the last batch normalization layer of each residual block is connected to a channel attention module.
4. The bearing fault diagnosis method based on characterization guidance according to claim 3 is characterized in that: The channel attention module includes an average pooling layer, a maximum pooling layer, a first fully connected layer, a second fully connected layer, a first activation layer, and a second activation layer. The output ends of the average pooling layer and the maximum pooling layer are both connected to the input end of the first fully connected layer, the output end of the first fully connected layer is connected to the input end of the first activation layer, the output end of the first activation layer is connected to the input end of the second fully connected layer; the output end of the second fully connected layer is connected to the input end of the second activation layer.
5. The bearing fault diagnosis method based on characterization guidance according to claim 4 is characterized in that: The first activation layer adopts the ReLU activation function, and the second activation layer adopts the Sigmoid function.
6. The bearing fault diagnosis method based on characterization guidance according to any one of claims 1 to 5, characterized in that: The positive class activation loss satisfies: ; in, is the positive class activation loss, is the height of the attention map, is the width of the attention map, is the class activation map of the positive class, It is the pixel location coordinates in the class activation map and the attention map; AM is the attention map; The negative class activation loss satisfies: ; in, is the negative class activation loss, is the true label of the input image, is a tag collection, is the set of all negative class labels: , is the negative class label number, is the inhibition constant.
7. The bearing fault diagnosis method based on characterization guidance according to claim 6 is characterized in that: The classification loss satisfies: ; is the classification loss value, is the predicted value, is the true value, For time point, Number the sample labels.
8. The bearing fault diagnosis method based on characterization guidance according to any one of claims 1 to 5, characterized in that: The detection samples and training samples are single-channel time-frequency diagrams of the bearing, and the fault categories include fault location categories and damage depth categories; The fault location categories are divided into outer ring and inner ring; The vibration signals of normal bearings and faulty bearings are obtained to construct a training sample set, including: Acquire vibration signals of multiple known fault categories from historical data, and extract a single-channel time-frequency graph from each of the vibration signals; The fault category corresponding to each single-channel time-frequency graph is used as a label to construct a training sample set.
9. A computer system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of any one of the methods in claims 1 to 8 are implemented.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method in any one of claims 1 to 8 are implemented.
