A neural network explainable method for rotating machinery fault diagnosis and application
By performing S-transform and Fourier transform processing on the fault diagnosis signals of rotating machinery, and combining sparsity and out-of-domain distribution constraints to optimize the mask, a more accurate neural network interpretation is generated, which solves the problem of low interpretation resolution in the existing technology and improves the reliability of fault diagnosis.
Patent Information
- Application Number
- CN202411841083.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-13
AI Technical Summary
Existing neural network fault diagnosis methods have low interpretation resolution in rotating machinery, and the interpretation results often contain irrelevant features, making it difficult for users to judge the reliability of the diagnosis results.
By performing S-transform processing on the vibration signals of rotating machinery fault diagnosis, the time-frequency diagram is converted to the frequency domain using two-dimensional Fourier transform and masked, and then converted back to the spatial domain using inverse Fourier transform. The mask is optimized by combining sparsity and out-of-domain distribution constraints to generate a more accurate interpretation.
It improves the resolution of interpretation, accurately identifies fault impact characteristics, avoids interference from irrelevant features, and enhances the reliability of neural network diagnostic results.
Smart Images

Figure CN119761526B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of rotating machinery fault diagnosis, and more particularly relates to a neural network explainable method for rotating machinery fault diagnosis and application. BACKGROUND
[0002] Neural network models are widely used in the research of rotating machinery fault diagnosis due to their strong prediction performance. However, the diagnosis results of neural network models are difficult to explain, and users cannot determine whether the model diagnosis results are reliable, which hinders the application of neural network-based fault diagnosis methods in real industrial scenarios. The neural network explainable method can identify which features the model uses for diagnosis, and users can determine whether the diagnosis results are reliable accordingly. Therefore, it is of great application value to develop a neural network explainable method for rotating machinery fault diagnosis.
[0003] With the rapid development of artificial intelligence technology and the urgent need for explaining neural networks, many explainable methods for explaining neural networks have emerged, and these methods have also been applied to the field of fault diagnosis. These explainable methods usually identify which features in a sample are used by the model when predicting a sample as a certain class of fault, and users can determine whether the model diagnosis results are reliable accordingly. For the fault diagnosis task, the fault impact is transient and short in duration. Therefore, for the fault diagnosis task, the explainable method needs to accurately identify the features used by the model to determine whether the model uses fault features for diagnosis and whether the model is reliable. On the one hand, most explainable methods, such as Class Activation Map (CAM) and mask-based methods, generate explanations with low resolution, which can only roughly locate the features used by the model. Therefore, it is difficult to determine whether the model diagnosis results are reliable through such low-resolution explanations. On the other hand, the existing explainable methods often generate explanations that include features unrelated to the diagnosis results, which can lead to misjudgment of the reliability of the model diagnosis results by users. SUMMARY
[0004] In view of the above defects or improvement needs of the prior art, the present application provides a neural network explainable method for rotating machinery fault diagnosis and application, which aims to solve the problem of low resolution of the existing neural network explainable method.
[0005] To achieve the above-mentioned purpose, according to one aspect of the present application, a neural network explainable method for rotating machinery fault diagnosis is provided, which comprises the following steps:
[0006] (1) performing S-transform processing on the vibration signal used for rotating machinery fault diagnosis to obtain a time-frequency graph;
[0007] (2) using two-dimensional Fourier transform to convert the time-frequency map sample from spatial domain to frequency domain, and adding a mask on the frequency domain, and using inverse Fourier transform to convert the sample after the mask to spatial domain;
[0008] (3) inputting the obtained sample into the neural network to obtain the neural network last layer feature map and the neural network output logits, and simultaneously calculating the classification probability of the target category and the sparsity score of the mask sample;
[0009] (4) calculating the out-of-domain distribution score of the sample based on the obtained neural network last layer feature map and the neural network output logits;
[0010] (5) using the method of stochastic gradient descent to optimize the mask, and the optimization target is to maximize the classification probability of the target category, maximize the out-of-domain distribution score, and minimize the sparsity score of the mask sample;
[0011] (6) adding the optimized mask to the sample frequency coefficient to obtain the explanation of the classification of the sample.
[0012] Further, first, the vibration signal for fault diagnosis of rotating machinery is segmented and processed into n samples containing m data points, and then S transform is performed on each sample to obtain the time-frequency map of the sample.
[0013] Further, first, using two-dimensional Fourier transform to convert the time-frequency map sample from spatial domain to frequency domain; second, adding a 0-1 mask on the frequency coefficient of the time-frequency map, and simultaneously adding Gaussian noise on the frequency coefficient based on the mask; and finally using two-dimensional inverse Fourier transform to convert the masked image from frequency domain back to spatial domain.
[0014] Further, the expression of the sample after the mask is:
[0015]
[0016] In the formula, FFT 2D is two-dimensional Fourier transform, is two-dimensional inverse Fourier transform, x is the time-frequency map sample, m∈[0,1] n is a mask with the same dimension as the input sample, and u is random noise obeying Gaussian distribution.
[0017] Further, the calculation formula of the classification probability of the target category is:
[0018]
[0019] In the formula, Φ is a neural network, Φ(.) returns the classification probability of the classifier, Φ c is the classification probability of the target category.
[0020] Further, the calculation formula of the sparsity score of the mask sample is:
[0021]
[0022] In the formula, lambda 1 and lambda 2 are hyperparameters.
[0023] Further, the calculation formula of the out-of-domain distribution score of the mask sample is:
[0024] OoD score =(MaxCosine+MaxNorm)
[0025] In the formula, MaxCosine refers to the maximum cosine value of the angle between the features and the weights of the last layer of the neural network, and the calculation formula is:
[0026]
[0027] h is the feature of the last layer, w k is the weight corresponding to the classification probability of the kth class; and MaxNorm refers to the L1 norm of the features of the last layer.
[0028] Further, the formula corresponding to the optimization target is:
[0029]
[0030] Further, the calculation formula of the explanation is:
[0031]
[0032] The application further provides an application of the neural network explainable method for rotating machine fault diagnosis in judging whether the diagnosis result of the neural network model is reliable, which obtains the explanation of sample classification of a structure to be diagnosed by using the neural network explainable method, and judges whether the diagnosis result of the neural network model is reliable according to the obtained explanation.
[0033] Overall, compared with the prior art, the neural network explainable method for rotating machine fault diagnosis and the application provided by the application mainly have the following beneficial effects:
[0034] 1. The application uses two-dimensional Fourier transform to convert the time-frequency pattern sample from the spatial domain to the frequency domain, adds a mask in the frequency domain, and then uses inverse Fourier transform to convert the sample after the mask to the spatial domain, so that the advantages of better expression of fault impact features in the frequency domain are fully utilized, the strategy of adding a mask in the input sample frequency domain is adopted, the fault impact features are better identified, and the resolution of the explanation is improved.
[0035] 2. The sparse score is calculated to retain only the features related to the prediction result in the masked sample through the sparsity constraint, so that the features unrelated to the prediction result can be avoided from appearing in the explanation, and noise in the explanation result can be avoided.
[0036] 3. The present application makes full use of the feature map of the intermediate layer of the neural network and the output logits, and performs out-of-domain distribution constraint based on the feature map and the output logits constraint, so as to avoid the explanation of out-of-domain distribution.
[0037] 4. The present application can more accurately identify the fault impact features by optimizing the mask on the frequency domain of the input sample, and improve the feature resolution of the explanation. At the same time, the explanation result can be compared with prior knowledge to determine whether the neural network model diagnosis result is reliable. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 is a flowchart of a neural network explainable method for rotating machinery fault diagnosis provided by the present application;
[0039] Figure 2 is a vibration signal example diagram provided by the embodiment of the present application;
[0040] Figure 3 is a schematic diagram of inner ring fault samples and explanation results obtained by using the neural network explainable method provided by the present application;
[0041] Figure 4 (a), (b), (c) in are respectively inner ring fault samples, (d), (e), (f) are respectively the diagnosis results of the inner ring fault samples (a), (b), (c) obtained by using the prior art. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0043] Please refer to Figure 1This invention provides a neural network interpretable method for fault diagnosis of rotating machinery. The neural network interpretable method generates interpretation by optimizing the mask in the frequency domain of the input samples, which can more accurately identify features related to the fault diagnosis results. Compared with other interpretable algorithms, this invention can more accurately identify fault features and improve the interpretability and reliability of neural network-based fault diagnosis methods.
[0044] The described neural network interpretable method fully leverages the advantage that fault impact features can be better represented in the frequency domain. Instead of directly adding a mask to the input sample's frequency domain, it optimizes the mask to retain only the features used by the neural network model for diagnosis. Since the Fourier basis is smooth, this ensures the smoothness of the generated interpretation, avoiding noise without additional smoothing constraints, while maintaining the interpretation's resolution. Furthermore, sparsity constraints and out-of-domain distribution constraints prevent irrelevant features from appearing in the interpretation. Finally, the optimized mask and input sample are combined to obtain the interpretation.
[0045] The neural network interpretability method mainly includes the following steps:
[0046] Step 1: Perform S-transform processing on the vibration signal used for fault diagnosis of rotating machinery to obtain a time-frequency diagram.
[0047] The vibration signal of rotating machinery is segmented, and the segmented signal is processed to obtain a time-frequency diagram, which is then used as a sample.
[0048] In this embodiment, the acquired signal for equipment fault diagnosis is a vibration acceleration signal. First, the vibration signal for fault diagnosis of rotating machinery is segmented into n samples containing m data points. Then, an S-transform is performed on each sample to obtain a time-frequency diagram of the sample. The time-frequency diagram is used as the input sample for the neural network model.
[0049] In other implementations, timing signals such as acoustic emission and current can also be collected.
[0050] Step 2: Using the time-frequency graph as a sample, use a two-dimensional Fourier transform to convert the time-frequency graph sample from the spatial domain to the frequency domain, add a mask in the frequency domain, and then use an inverse Fourier transform to convert the masked sample back to the spatial domain.
[0051] The input sample is transformed from the spatial domain to the frequency domain using a two-dimensional Fourier transform. A mask is added to the frequency coefficients of the sample, and noise is injected into the frequency coefficients. The masked sample is then obtained through an inverse Fourier transform.
[0052] In one embodiment, first, the time-frequency pattern sample is converted from the spatial domain to the frequency domain using a two-dimensional Fourier transform; second, a 0-1 mask is added to the frequency coefficients of the time-frequency pattern, and at the same time, Gaussian noise is added to the frequency coefficients based on the mask; and finally, the masked image is converted from the frequency domain back to the spatial domain using a two-dimensional inverse Fourier transform.
[0053] The expression of the masked sample is:
[0054]
[0055] In the formula, FFT is a two-dimensional Fourier transform, 2D IFFT is a two-dimensional inverse Fourier transform, x is a time-frequency pattern sample, m∈[0,1] n is a mask with the same dimension as the input sample, and u is random noise obeying a Gaussian distribution.
[0056] In this embodiment, first, since the fault impact shows periodicity in the time-frequency pattern, the impact feature can be better expressed in the frequency domain, so the mask is added in the frequency domain of the time-frequency pattern to better identify the impact feature. In addition, since the Fourier basis is smooth, adding the mask in the frequency domain can ensure that the final interpretation result is smooth, avoiding noise caused by non-smooth interpretation results.
[0057] In this embodiment, since the mask removes part of the information, noise is used to replace this part of the information.
[0058] Step three, input the obtained sample into the neural network to obtain the neural network last layer feature map and neural network output logits, and at the same time, calculate the classification probability of the target class and the sparsity score of the masked sample.
[0059] The calculation formula of the classification probability of the target class is:
[0060]
[0061] In the formula, Φ is a neural network, Φ(.) is the classification probability returned by the classifier, and Φ c is the classification probability of the target class.
[0062] The calculation formula of the sparsity score of the masked sample is:
[0063]
[0064] In the formula, λ1 and λ2 are hyperparameters.
[0065] The last layer feature map of the neural network and the logits of the neural network output are used to calculate the out-of-domain distribution score. The sparsity score is calculated to retain only the features related to the prediction result in the masked sample by sparsity constraint.
[0066] Step four, based on the obtained last layer feature map of the neural network and the logits of the neural network output, the out-of-domain distribution score of the sample is calculated.
[0067] The calculation formula of the out-of-domain distribution score of the masked sample is:
[0068] OoD score =(MaxCosine+MaxNorm)
[0069] In the formula, MaxCosine refers to the maximum cosine value of the angle between the last layer feature of the neural network and the weight, and the calculation formula is:
[0070]
[0071] h is the last layer feature, w k is the weight corresponding to the k-th class classification probability; MaxNorm refers to the L1 norm of the last layer feature.
[0072] The embodiment fully utilizes the feature map and the output logits of the intermediate layer of the neural network, and performs out-of-domain distribution constraint based on the feature map and the output logits constraint, to avoid the explanation of out-of-domain distribution.
[0073] Step five, using the method of stochastic gradient descent to optimize the mask, the optimization target is to maximize the target class classification probability, maximize the out-of-domain distribution score, and minimize the sparsity score of the masked sample.
[0074] Using the method of stochastic gradient descent to optimize the mask, the formula corresponding to the optimization target is:
[0075]
[0076] Compared with the traditional mask optimization method, the mask is added to the frequency domain of the input sample, rather than directly added to the input sample, which can better identify the fault features. Through sparsity constraint and out-of-domain distribution constraint, the features unrelated to the model prediction in the explanation result are avoided.
[0077] Step six, adding the optimized mask to the sample frequency coefficient to obtain the explanation of the sample classification.
[0078] The calculation formula of the explanation is:
[0079]
[0080] By using a mask, only the features in the input samples that are used by the model for diagnosis are retained.
[0081] The present invention also provides an application of the neural network interpretable method for fault diagnosis of rotating machinery as described above in judging whether the diagnostic results of the neural network model are reliable. The neural network interpretable method is used to obtain the interpretation of the sample classification of the structure to be diagnosed, and the reliability of the diagnostic results of the neural network model is judged based on the obtained interpretation.
[0082] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0083] The dataset used is the rolling bearing fault diagnosis dataset provided by Case Western Reserve University. Faults are categorized into three types: inner race, outer race, and vibrating body, with three fault diameter sizes for each type. Vibration data was collected using accelerometers, which were positioned at both the drive and fan ends. Vibration data from the drive end was collected at a sampling frequency of 12 kHz, and data from the fan end was also collected at a sampling frequency of 12 kHz. The drive motor speed was 1797 rpm. This implementation uses vibration data collected from the drive end at a sampling frequency of 12 kHz as an example. Figure 2 As shown, the vibration data was segmented into samples of 1024 data points each. The segmented samples were then converted into time-frequency graphs using an S-transform, which served as input to the neural network. A ResNet-18 was used as the neural network for fault classification. Based on the characteristics of the test bearing, the theoretical fault characteristic frequency of the inner ring of the rolling bearing was calculated to be 162.3 Hz, with a corresponding fault impact interval of 6.16 ms.
[0084] A comparison of early fault detection results between the interpretable method provided by this invention and other interpretable methods:
[0085] The diagnostic results of ResNet-18 for one inner ring fault sample were interpreted using the interpretation method provided in this invention and other interpretation methods, respectively. The interpretation results are as follows: Figure 3 , Figure 4 As shown. Observation Figure 3 The fault samples clearly show impact characteristics, with an impact time interval of 6.2 ms, which is very close to the theoretical impact time interval for inner ring faults. This indicates that these impacts are fault impacts. Observation Figure 3 The interpretation of the sample obtained by this invention shows that it accurately identified the fault impact features, indicating that ResNet-18 used these features to predict the fault category of the sample. This result verifies the effectiveness of the ResNet-18 model in fault diagnosis and improves the model's reliability.
[0086] since Figure 4It can be seen that the Integrated Gradients method only identifies part of the fault impact features, and the other two methods cannot distinguish fault impact features from irrelevant features due to low feature resolution, and cannot determine whether the ResNet-18 model only uses fault features for diagnosis. Compared with the neural network explainable method provided by the present application, the other three methods cannot accurately identify fault impact features, making it difficult to verify the effectiveness of the ResNet-18 model for fault diagnosis, proving the superiority and effectiveness of the method provided by the present application.
[0087] Those skilled in the art can easily understand that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A neural network-interpretable method for fault diagnosis of rotating machinery, characterized in that, The method includes the following steps: (1) Perform S-transform processing on the vibration signal used for fault diagnosis of rotating machinery to obtain a time-frequency diagram; (2) Using the time-frequency graph as a sample, the two-dimensional Fourier transform is used to convert the time-frequency graph sample from the spatial domain to the frequency domain, and a mask is added to the frequency domain. Then, the inverse Fourier transform is used to convert the masked sample back to the spatial domain. (3) Input the obtained samples into the neural network to obtain the feature map of the last layer of the neural network and the output logits of the neural network. At the same time, calculate the classification probability of the target category and the sparsity score of the mask samples. (4) Calculate the out-of-domain distribution score of the sample based on the obtained feature map of the last layer of the neural network and the logits output of the neural network; (5) Use stochastic gradient descent to optimize the mask. The optimization objective is to maximize the target class classification probability, maximize the out-of-domain distribution score, and minimize the sparsity score of the mask samples. (6) Add the optimized mask to the sample frequency coefficients to obtain an explanation of the sample classification; The masked sample expression is: In the formula, It is a two-dimensional Fourier transform. It is a two-dimensional inverse Fourier transform. It is a time-frequency graph sample. It is a mask with the same dimensions as the input sample. It is random noise that follows a Gaussian distribution; The formula for calculating the classification probability of the target category is: In the formula, It's a neural network. To return the classification probability of the classifier, It is the classification probability of the target category; The formula for calculating the sparsity score of the masked samples is: In the formula, and For hyperparameters; The formula for calculating the out-of-domain distribution score of the masked sample is: In the formula, This refers to the maximum cosine of the angle between the features and weights of the last layer of a neural network, and its calculation formula is: It is a feature of the last layer. It corresponds to the first The weights of the class classification probabilities; This refers to the L1 norm of the last layer of features; The formula corresponding to the optimization objective is: The calculation formula for the explanation is: .
2. The neural network interpretable method for fault diagnosis of rotating machinery as described in claim 1, characterized in that: First, the vibration signals used for fault diagnosis of rotating machinery are segmented and processed into... It contains The data points are sampled, and then an S-transform is performed on each sample to obtain the time-frequency diagram of the sample.
3. The neural network interpretable method for fault diagnosis of rotating machinery as described in claim 1, characterized in that: First, a two-dimensional Fourier transform is used to convert the time-frequency image samples from the spatial domain to the frequency domain. Second, a 0-1 mask is added to the frequency coefficients of the time-frequency image, and Gaussian noise is added to the frequency coefficients based on the mask. Finally, a two-dimensional inverse Fourier transform is used to convert the masked image back from the frequency domain to the spatial domain.
4. The application of the neural network interpretable method for fault diagnosis of rotating machinery as described in any one of claims 1-3 in determining the reliability of the diagnostic results of the neural network model, characterized in that: The neural network interpretable method is used to obtain the sample classification interpretation of the structure to be diagnosed, and the reliability of the diagnostic results of the neural network model is judged based on the obtained interpretation.
Citation Information
Patent Citations
Radiation source individual identification method based on main signal suppression
CN110135390A
Robust visual converter
CN117178276A