A rolling bearing fault diagnosis method based on scale-adaptive metric

By combining a multi-level metric module and a scale-adaptive attention module, the problem of insufficient feature fusion in rolling bearing fault diagnosis under small sample conditions is solved, and higher accuracy fault identification is achieved.

CN116089863BActive Publication Date: 2026-01-13CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310071125.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-17
Publication Date
2026-01-13
Estimated Expiration
2043-01-17

AI Technical Summary

Technical Problem

Existing technologies for rolling bearing fault diagnosis under small sample conditions suffer from problems such as high cost of fault samples, easy overfitting of diagnostic models, and insufficient feature fusion, resulting in insufficient diagnostic accuracy.

Method used

A fault diagnosis method based on scale-adaptive metric is adopted. The similarity of samples is measured from three perspectives: pixel level, partial level and global level through a multi-level metric module. A scale-adaptive attention module is introduced to fuse multi-sensor data and wavelet packet transform and multi-frequency component DCT transform are used to capture fault features.

Benefits of technology

It improves the accuracy of fault diagnosis under small sample conditions, enhances feature fusion capabilities, and improves the accuracy and robustness of fault identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089863B_ABST
    Figure CN116089863B_ABST
Patent Text Reader

Abstract

The application relates to the field of fault diagnosis, in particular to a rolling bearing fault diagnosis method based on scale self-adaptive measurement. The method comprises the following steps: collecting vibration signals of multiple sensors, cutting each vibration signal into a fault sample according to equal sample length and marking a corresponding category label; converting each fault sample into a time-frequency spectrum graph by adopting a wavelet packet transform, and dividing a time-frequency spectrum graph set into a support set, a query set and a test set; constructing a scale self-adaptive measurement fault diagnosis model, training the fault diagnosis model through the support set, the query set and the test set; the scale self-adaptive measurement fault diagnosis model comprises a scale self-adaptive attention module and a multi-level measurement module; obtaining rolling bearing fault sample data, inputting the processed rolling bearing fault sample data into the trained fault diagnosis model, and calculating a fault diagnosis result; the method can effectively diagnose the fault of the rolling bearing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of fault diagnosis, and in particular to a rolling bearing fault diagnosis method based on scale self-adaptive measurement. BACKGROUND

[0002] As a basic component of mechanical equipment, rolling bearings are prone to damage due to overload, fatigue and wear. If operated under adverse conditions, such as high temperature, high humidity and overload, it may also cause mechanical failure, resulting in serious property loss and even casualties. Therefore, intelligent fault diagnosis of rolling bearings is of great significance in industry and academia.

[0003] Compared with traditional machine learning methods, deep learning has a deeper network structure and strong non-linear feature extraction capability, such as Deep Belief Network (DBN), Stacked Auto Encoder (SAE), Convolutional Neural Networks (CNN) and Recursive Neural Network (RNN). Unfortunately, although these methods have strong feature extraction capability, they require strong computing power and a large amount of labeled data to support, and cannot be applied to the environment of fault sample data scarcity in actual industrial application scenarios. When there are few labeled fault samples or the data set is small, it is a great challenge for researchers to ensure that the fault diagnosis model can quickly learn the samples and improve the generalization ability and robustness. Therefore, it is of great significance to study the fault diagnosis of rolling bearings under small sample conditions.

[0004] Currently, the Deep Nearest Neighbor Neural Network (DN4) introduces local descriptors into small sample learning, successfully using the distribution of local descriptors to represent each sample, and obtains better detection results compared with the image-level global features of Prototypical Networks. The Discriminative Mutual Nearest Neighbor Neural Network (DMN4) introduces the mutual nearest neighbor algorithm, effectively reducing the interference of background noise, and reducing the influence of weakly related non-background feature descriptors in the recognition process. However, the above methods only calculate the similarity between samples at a single level, and under small sample conditions, using a single similarity measurement can easily lead to certain similarity bias.

[0005] Meanwhile, multi-sensor data fusion to obtain comprehensive feature information has become the consensus of mechanical equipment fault diagnosis development, but simple data combination, splicing and other methods are difficult to effectively fuse features, and the generalization ability and robustness of shallow models such as BP neural network and support vector machine need to be further improved. SUMMARY

[0006] In order to solve the problem that fault samples are difficult to obtain and fault diagnosis models trained by a small number of labeled fault samples are prone to overfitting and difficult to accurately diagnose in rolling bearing fault diagnosis, the present application provides a rolling bearing fault diagnosis method based on scale adaptive metric, comprising the following steps:

[0007] S1. Collecting vibration signals of multiple sensors, cutting each vibration signal into fault samples according to equal sample length and marking corresponding class labels;

[0008] S2. Converting each fault sample into a time-frequency spectrum by wavelet packet transform, and dividing the time-frequency spectrum set into a support set, a query set and a test set;

[0009] S3. Constructing a scale adaptive metric fault diagnosis model, training the fault diagnosis model through the support set, the query set and the test set; the scale adaptive metric fault diagnosis model comprises a scale adaptive attention module and a multi-level metric module;

[0010] S4. Obtaining rolling bearing fault sample data and inputting the processed data into the trained fault diagnosis model to obtain fault diagnosis results.

[0011] Further, training the scale adaptive metric fault diagnosis model through the support set, the query set and the test set comprises:

[0012] S31. Any time-frequency spectrum is obtained through a first convolution block to obtain an intermediate feature map;

[0013] S32. The scale adaptive attention module is used to capture the information of the intermediate feature map in the spatial dimension and the channel dimension to obtain an attention weighted feature map;

[0014] S33. The attention weighted feature map is sequentially input into a second convolution block and a third convolution block to obtain corresponding feature representations and input into the multi-level metric module;

[0015] S34. The multi-level metric module measures the similarity of the feature representations of the query set and the support set from three different angles of pixel level feature, partial level feature and global level feature;

[0016] S35. The similarity measurement results of the three different angles are fused by a fusion layer to obtain fault diagnosis results, the loss is calculated and the model parameters are trained by back propagation.

[0017] Furthermore, the scale-adaptive attention module includes a horizontal DCT transform unit, a vertical DCT transform unit, a stitching unit, a segmentation unit, and a weight calculation unit; the specific operation process of the scale-adaptive attention module is as follows:

[0018] S331. A horizontal DCT transform unit is used to perform a horizontal discrete cosine transform on the intermediate feature map to obtain multiple horizontal feature vectors. The multiple horizontal feature vectors are weighted and summed, and then the horizontal compression result is obtained through a convolution function.

[0019] S332. A vertical DCT transform unit is used to perform a vertical discrete cosine transform on the intermediate feature map to obtain multiple vertical feature vectors. The weighted sum of the multiple vertical feature vectors is then passed through a convolution function to obtain the vertical compression result.

[0020] S333. The horizontal compression result and the vertical compression result are concatenated by the concatenation unit, and the concatenated result is convolved with 1×1 to obtain the encoded feature map;

[0021] S334. The segmentation unit divides the encoded feature map into a height vector and a width vector according to the spatial dimension, and obtains the height feature map and the width feature map by a 1×1 convolution respectively;

[0022] S335. The weight calculation unit uses the sigmoid function to process the height feature map and the width feature map, and finally obtains the attention-weighted feature map.

[0023] Furthermore, the multi-level measurement module includes pixel-level feature measurement units, partial-level feature measurement units, and global-level feature measurement units.

[0024] Furthermore, the fusion layer combines the similarity measurement results from three different perspectives to obtain the fault diagnosis result, which is represented as:

[0025]

[0026] Where α, β, γ represent hyperparameters, Q` represents any time-spectral graph in the query set, y represents the category label of Q`, and S... n This represents the support sample set consisting of N time-spectral maps selected from any category of the support set, where n represents the support sample set S. n Category labels; D pixel (Q′,S n ), D part (Q′,S n ) and D global (Q′,S n ) represent Q` and S respectively n Pixel-level feature similarity, partial-level feature similarity, and global-level feature similarity.

[0027] Furthermore, the formula for calculating the loss in step S35 is as follows:

[0028]

[0029] Where α, β, γ represent hyperparameters, Q` represents any time-spectral graph in the query set, y represents the category label of Q`, and S... n This represents the support sample set consisting of N time-spectral maps selected from any category of the support set, where n represents the support sample set S. n Category labels; D pixel (Q′,S n ), D part (Q′,S n ) and D global (Q′,S n ) represent Q` and S respectively n The similarity between pixels is calculated as pixel-level, partial-level, and global-level features, and J(·,·) is the cross-entropy loss function.

[0030] Furthermore, the processing procedure for pixel-level feature measurement units is as follows:

[0031] Select one time-spectrum graph Q' from the query set, and select N time-spectrum graphs from any category in the support set to form the support sample set S. n ;

[0032] Execute steps S31-S33 to obtain the feature representation of the time-frequency spectrum Q' And supporting sample set S n Feature representation Among them, feature representation There are H×W C-dimensional local descriptors, and their features are represented as follows: Dimensional local descriptor;

[0033] Computational feature representation With feature representation Correlation matrix between The calculation formula is:

[0034]

[0035] In the correlation matrix R pixel For each row, select the k largest elements to calculate the time-spectrum Q' and the support sample set S. n The similarity between them is calculated using the following formula:

[0036]

[0037] in, Represents the correlation matrix Rpixel The set of elements in the i-th row.

[0038] Furthermore, the processing procedure for partial-level feature measurement units is as follows:

[0039] Select one time-spectrum graph Q' from the query set, and select N time-spectrum graphs from any category in the support set to form the support sample set S. n ;

[0040] Execute steps S31-S33 to obtain the feature representation of the time-frequency spectrum Q' And supporting sample set S n Feature representation Among them, feature representation There are C H×W dimensional local descriptors, and their features are represented as follows: There are C×N H×W dimensional local descriptors;

[0041] Computational feature representation With feature representation Correlation matrix between The calculation formula is:

[0042]

[0043] In the correlation matrix R part For each row, select the k largest elements to calculate the time-spectrum Q' and the support sample set S. n The similarity between them is calculated using the following formula:

[0044]

[0045] in, Represents the correlation matrix R part The set of elements in the i-th row.

[0046] Furthermore, the processing procedure for the global-level feature measurement unit is as follows:

[0047] Select one time-spectrum graph Q' from the query set, and select N time-spectrum graphs from any category in the support set to form the support sample set S. n ;

[0048] Execute steps S31-S33 to obtain the feature representation of the time-frequency spectrum Q' And supporting sample set S n Feature representation Among them, feature representation There are H×W C-dimensional local descriptors, and their features are represented as follows: There are N×H×W C-dimensional local descriptors;

[0049] The time-varying spectrogram Q' and the supporting sample set Sn The similarity between them is calculated using the following formula:

[0050]

[0051] in, Indicates the support sample set S n The inverse covariance matrix, ∑ Q′ This represents the covariance matrix of the spectrum Q' in the query set. Indicates the support sample set S n The covariance matrix, Indicates the support sample set S n The mean vector, μ Q′ Let represent the mean vector of the spectrogram Q' in the query set, c represent the feature dimension of the mean vector of the spectrogram Q' in the query set, trace(·) represents the trace operation of the matrix, ln(·) represents the logarithm with e as the base, and Det represents the determinant of the square matrix.

[0052] The beneficial effects of this invention are:

[0053] Existing diagnostic methods calculate the similarity between samples at only a single level. Under small sample conditions, using a single similarity measure can easily lead to certain similarity biases. Therefore, this invention proposes a multi-level measurement module that measures query-level and support set similarity from three different perspectives: pixel-level features, partial-level features, and global-level features, to obtain more comprehensive and effective sample similarity measurement results.

[0054] Existing data fusion methods are difficult to effectively fuse features. It is essential to introduce an attention mechanism for weighted fusion of vibration signals from multiple sensors. Therefore, this invention proposes a scale-adaptive attention module, which introduces coordinate attention (CA) to decompose channel attention into two one-dimensional feature encoding processes. Features are aggregated along the width and height spatial directions respectively, which can simultaneously obtain the channel and spatial importance information of the feature map.

[0055] On the other hand, FcaNet (Frequency Channel Attention Networks) mathematically proves that traditional Global Average Pooling (GAP) is a special case of Discrete Cosine Transform (DCT), advocating the use of multi-frequency component DCT to replace the original GAP and retain more effective information. Therefore, this invention introduces multi-frequency component DCT into the CA network to capture key fault information contained in the feature map from different perspectives. Simultaneously, it weights and fuses the fault information captured from different perspectives, realizing a scale-adaptive attention weighting mechanism for the feature map, thereby obtaining richer fault features. Attached Figure Description

[0056] Figure 1 This is a flowchart illustrating a specific implementation of a rolling bearing fault diagnosis method based on a scale-adaptive metric network model disclosed in this invention.

[0057] Figure 2 A schematic diagram of the proposed network model structure;

[0058] Figure 3 This is a schematic diagram of the scale-adaptive attention module structure proposed in this invention;

[0059] Figure 4 This is the DDS experimental platform of the present invention;

[0060] Figure 5 This is a schematic diagram of the rolling bearing vibration signal collected by the DDS experimental device of the present invention;

[0061] Figure 6 A schematic diagram comparing the diagnostic accuracy of different fault diagnosis and identification methods;

[0062] Figure 7 This is a schematic diagram of the confusion matrix output for different fault diagnosis and identification methods. Detailed Implementation

[0063] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] This invention provides a method for diagnosing rolling bearing faults based on scale-adaptive metrics, such as... Figure 1 As shown, it includes the following steps:

[0065] S1. Collect vibration signals from multiple sensors, divide each vibration signal into fault samples according to the same sample length, and label them with the corresponding category.

[0066] Preferably, the drivetrain diagnostics simulator (DDS) mainly consists of a drive motor, a planetary gearbox, a fixed-axis gearbox, and a magnetic brake, such as... Figure 4 As shown, this invention acquires vibration signals of rolling bearings using a DDS (Digital Data Sensor). Specifically, the vibration signals are acquired by an NI9234 data acquisition card at a sampling frequency of 12800Hz. Then, 800 fault samples are collected for each fault category, with each sample containing 4096 signal points. Based on the fault report, the fault samples are labeled with fault categories including: outer ring fault, inner ring fault, rolling element fault, etc. Figure 5 The time-domain waveform of the acquired vibration signal is given.

[0067] S2. Wavelet packet transform is used to convert each fault sample into a time-domain spectrogram, and the set of time-domain spectrograms is divided into a support set, a query set, and a test set.

[0068] Specifically, the one-dimensional vibration signal is transformed into a two-dimensional time spectrum through wavelet packet transform. Selecting a suitable wavelet basis function is a necessary condition for feature extraction. In this invention, Daubechies is selected as the wavelet basis function.

[0069] Specifically, in training a fault diagnosis model, three non-overlapping datasets are typically used: a support set S, a query set Q, and a test set T. In this embodiment, assuming there are C1 fault categories, the time-domain spectrogram set is divided, that is, the fault sample set is divided into a support set, a query set, and a test set. First, K fault samples are randomly selected from each fault category to form the support set. This approach is called C-way K-shot; then, M fault samples are randomly selected from the remaining fault samples for each fault category to form a query set. After constructing the query set and support set, L fault samples are randomly selected from the remaining fault samples of each fault category to obtain the test set. Where, x i ∈R D Let y represent the D-dimensional feature vector of the i-th fault sample. i ∈(1,2,3,4...C1) represents the true label corresponding to the i-th fault sample, i.e., the true fault category label.

[0070] S3. Construct a scale-adaptive metric fault diagnosis model, and train the fault diagnosis model using a support set, a query set, and a test set; the scale-adaptive metric fault diagnosis model includes a scale-adaptive attention module and a multi-level metric module.

[0071] S4. After obtaining the rolling bearing fault sample data and converting it into the corresponding time spectrum, input it into the trained fault diagnosis model to calculate the fault diagnosis result.

[0072] In one embodiment, the structure of the scale-adaptive metric fault diagnosis model is as follows: Figure 2 As shown, it includes a feature extractor, a multi-level metric module, and a fusion layer. The feature extractor includes a first convolutional block, a scale-adaptive attention module, a second convolutional block, and a third convolutional block, all cascaded sequentially. Training the scale-adaptive metric fault diagnosis model using a support set, a query set, and a test set includes:

[0073] S31. Any temporal spectrogram is processed through the first convolutional block to obtain an intermediate feature map;

[0074] S32. A scale-adaptive attention module is used to capture information of the intermediate feature map in the spatial and channel dimensions to obtain an attention-weighted feature map;

[0075] S33. Pass the attention-weighted feature map through the second and third convolutional blocks in sequence to obtain the corresponding feature representation and input it into the multi-level metric module;

[0076] S34. The multi-level measurement module measures the similarity of feature representations between the query set and the support set from three different perspectives: pixel-level features, partial-level features, and global-level features.

[0077] S35. The fault diagnosis result is obtained by fusing the similarity measurement results from three different perspectives through the fusion layer, the loss is calculated and the model parameters are trained by backpropagation.

[0078] Specifically, such as Figure 3 As shown, the scale-adaptive attention module includes a horizontal DCT transform unit, a vertical DCT transform unit, a stitching unit, a segmentation unit, and a weight calculation unit. Through this module, multi-sensor data can be better fused, simultaneously capturing the spatial and channel importance information of the time-spectrum, thereby obtaining richer fault features. The specific operation process of the scale-adaptive attention module is as follows:

[0079] S331. An intermediate feature map is obtained by passing any time-spectrum image through a 1×1 first convolutional block. Where C×H×W represent the number of channels, feature height, and feature width of the intermediate feature map X, respectively;

[0080] S332. The horizontal DCT transform unit performs a discrete cosine transform (DCT) on multiple frequency components in the horizontal direction (width direction) of the intermediate feature map X to obtain multiple horizontal feature vectors:

[0081]

[0082] The horizontal compression result Freq is obtained by weighted summation of multiple horizontal feature vectors and then passing the sum through a convolution function. h :

[0083]

[0084] Among them, [u i ,v i ] represents the parameter of the i-th frequency component in the horizontal direction of the intermediate feature map X. F represents the i-th C×H-dimensional horizontal feature vector of the intermediate feature map X in the horizontal direction. x Represents the convolution function. represents the basic DCT function, n represents the number of feature maps contained in the intermediate feature map X, and in this embodiment n = 8; cat represents the feature map splicing operation.

[0085] S332. Multiple vertical feature vectors are obtained by performing discrete cosine transform on multiple frequency components in the vertical direction (height direction) of the intermediate feature map using a vertical DCT transform unit:

[0086]

[0087] The vertical compression result Freq is obtained by weighted summation of multiple vertical feature vectors and then passing the sum through a convolution function. w ;

[0088]

[0089] Among them, [u i ,v i ] represents the parameter of the i-th frequency component in the vertical direction of the intermediate feature map X. F represents the i-th C×W-dimensional vertical feature vector of the intermediate feature map X in the vertical direction. y This represents the convolution function.

[0090] S333. The horizontal compression result and the vertical compression result are concatenated by the concatenation unit, and the concatenated result is convolved with 1×1 to obtain the encoded feature map:

[0091] f=δ(F1([Freq h ,Freq w ]))

[0092] Where [·,·] denotes cascading operations along spatial dimensions, δ is a nonlinear activation function, and F1 represents a 1×1 convolution. It is the encoded feature map obtained by encoding in the horizontal and vertical directions, and r is the reduction ratio.

[0093] S334. The segmentation unit segments the encoded feature map into height vectors along the spatial dimension. and width vector Additionally, two 1×1 convolution functions F are used. h and F w f respectively h and f w Transform it into a height feature map and a width feature map with the same number of channels as the intermediate feature map X;

[0094] S335. The weight calculation unit uses the sigmoid function to process the height and width feature maps, ultimately obtaining the attention-weighted feature map:

[0095] g h =σ(F h (f h ))

[0096] g W =σ(F w (f w ))

[0097] y c (i,j)=x c (i,j)×g h (i)×g w (j)

[0098] Where σ is the Sigmoid function, g h g represents the attention weight vector along the height direction of the intermediate feature map X. w Let x represent the attention weight vector along the width direction of the intermediate feature map X. c (i,j) represents the intermediate feature map of the input, y c (i,j) represents x c (i,j) is the output after passing through the scale-adaptive attention module.

[0099] Specifically, the multi-level measurement module includes pixel-level feature measurement units, partial-level feature measurement units, and global-level feature measurement units. The multi-level measurement module measures the similarity of the feature representations of the query set and the support set from three different perspectives: pixel-level features, partial-level features, and global-level features. This yields more comprehensive and effective sample similarity measurement results, further improving the accuracy of fault diagnosis.

[0100] Pixel-level feature measurement is used to calculate the similarity between the support set and the query set. Compared to prototype networks that only use global-level features for measurement, pixel-level feature measurement can retain more fine-grained fault information and achieve better results under small sample conditions. The processing procedure of the pixel-level feature measurement unit is as follows:

[0101] Select one time-spectrum graph Q' from the query set, and select N time-spectrum graphs from any fault category in the support set to form the support sample set S. n ;

[0102] Through feature extractor Acquiring the feature representation of the time-frequency spectrum Q' And supporting sample set S n Feature representation Among them, the selection feature representation H×W C-dimensional local descriptors and feature representations Pixel-level feature measurement is performed on N×H×W C-dimensional local descriptors:

[0103]

[0104]

[0105] in, Feature representation The i-th C-dimensional local descriptor in Feature representation The i-th C-dimensional local descriptor in;

[0106] Computational feature representation With feature representation Correlation matrix between The calculation formula is:

[0107]

[0108] In the correlation matrix R pixel For each row, select the k largest elements to calculate the time-spectrum Q' and the support sample set S. n The similarity between them is calculated using the following formula:

[0109]

[0110] in, Represents the correlation matrix R pixel The set of elements in the i-th row.

[0111] Partial-level feature measurement and pixel-level feature measurement share similarities, both measuring local similarity based on local descriptors. However, their local descriptor shapes differ. The dimension of the local descriptor in partial-level features is H×W, achieving sample similarity measurement from different feature channel levels. The processing procedure for the partial-level feature measurement unit is as follows:

[0112] Similarly, select one time-spectrum graph Q' in the query set, and select N time-spectrum graphs from any fault category in the support set to form the support sample set S. n ;

[0113] Through feature extractor Acquiring the feature representation of the time-frequency spectrum Q' And supporting sample set S n Feature representation Among them, the selection feature representation C H×W dimensional local descriptors and feature representations in the dataset. Partial-level feature measurement is performed on C×N H×W dimensional local descriptors in the model;

[0114] Computational feature representation With feature representation Correlation matrix between The calculation formula is:

[0115]

[0116] In the correlation matrix R part For each row, select the k largest elements to calculate the time-spectrum Q' and the support sample set S. n The similarity between them is calculated using the following formula:

[0117]

[0118] in, Represents the correlation matrix R part The set of elements in the i-th row.

[0119] Global-level feature measurement differs from pixel-level and partial-level feature measurement. It does not measure pixel or local similarity, but rather uses local descriptors to represent the overall probability distribution of samples, expressing similarity from a global perspective. The processing procedure for a global-level feature measurement unit is as follows:

[0120] Select one time-spectrum graph Q' from the query set, and select N time-spectrum graphs from any fault category in the support set to form the support sample set S. n ;

[0121] Through feature extractor Acquiring the feature representation of the time-frequency spectrum Q' And supporting sample set S n Feature representation Among them, feature representation is also selected. H×W C-dimensional local descriptors and feature representations Global-level feature measurement is performed on N×H×W C-dimensional local descriptors in the dataset;

[0122] Time-frequency spectrum Q' and support sample set S n The KL divergence between two points can be defined as:

[0123]

[0124] in, Indicates the support sample set S n The inverse covariance matrix, ∑ Q′ This represents the covariance matrix of the spectrum Q' in the query set. Indicates the support sample set S n The covariance matrix, Indicates the support sample set S n The mean vector, μ Q′ Let represent the mean vector of the spectrogram Q' in the query set, c represent the feature dimension of the mean vector of the spectrogram Q' in the query set, trace(·) represents the trace operation of the matrix, ln(·) represents the logarithm with e as the base, and Det represents the determinant of the square matrix.

[0125] Specifically, through the above three different levels of sample similarity measurement methods, three different levels of sample similarity output by the multi-level measurement module can be obtained. The three levels of sample similarity measurement results are then fused through a fusion layer to generate a probability function for the fault diagnosis result:

[0126]

[0127] Where α, β, γ represent hyperparameters, Q` represents any time-spectral graph in the query set, y represents the category label of Q`, and S... n This represents the support sample set consisting of N time-spectral maps selected from any category of the support set, where n represents the support sample set S. n Category labels; D pixel (Q′,S n ), D part (Q′,S n ) and D global (Q′,S n ) represent Q` and S respectively n The similarity between pixels is categorized into pixel-level, partial-level, and global-level features; where D global (Q′,S nThe result is the time-spectrum graph Q' and the support sample set S. n The KL divergence calculation results D KL (Q′,S n ).

[0128] The formula for calculating the loss based on the fault diagnosis results is as follows:

[0129]

[0130] Where α, β, γ represent hyperparameters, Q` represents any time-spectral graph in the query set, y represents the category label of Q`, and S... n This represents the support sample set consisting of N time-spectrum maps selected from any fault category in the support set, where n represents the support sample set S. n Category labels; D pixel (Q′,S n ), D part (Q′,S n ) and D global (Q′,S n ) represent Q` and S respectively n The similarity between pixels is calculated as pixel-level, partial-level, and global-level features, and J(·,·) is the cross-entropy loss function.

[0131] In one embodiment, in order to verify the effectiveness of the fault diagnosis and identification method disclosed in this invention, a comparative experiment was conducted using the vibration signal of DDS to simulate four states of fault diagnosis, including normal state, inner ring fault, outer ring fault and rolling element fault. Table 1 shows the four states of the gearbox.

[0132] Table 1 Health Status of Rolling Bearings

[0133]

[0134] The vibration signal was converted into a time-spectrum graph using wavelet packet transformation, and then divided into a support set, a query set, and a test set. Five, ten, and fifteen samples were randomly selected from each class, referred to as 4-way 5 / 10 / 15-shot. Simultaneously, 15 samples were randomly selected from each class, totaling 60 samples, as the query set. Finally, 400 samples were randomly selected from the test set to test the model accuracy, as shown in Table 2.

[0135] Table 2. Number of training and testing sets

[0136]

[0137] Table 3 provides detailed parameters for the network structure of this method. Furthermore, to ensure model convergence, the number of iterations was set to 100, Adam was set as the optimizer, the learning rate was set to 0.001, and the model parameters were randomly initialized. To reduce the impact of randomly initialized training parameters on model performance, the experiment was repeated 5 times for comprehensive evaluation.

[0138] Table 3 Network Structure Parameters

[0139]

[0140] This embodiment presents the diagnostic results using CNN, ProNet (CVPR., 2017, “Prototypical Networks for Few-shot Learning”), DN4 (CVPR., 2019, “Revisiting Local Descriptor-based Image-to-Class Measure for Few-shot Learning”), Multi-level Metric Network (MMN), and CoordinateAttention Multi-level Metric Network (CAMMN), respectively, and compares them with the diagnostic performance of the Scale Adaptive Metric Network (SAMN) proposed in this invention. To ensure fairness in the experiment, all methods will use the same feature extractor and hyperparameters, as well as the same training and test samples. The fault diagnosis results of several different methods on 5-15 support sets are shown below. Figure 6 As shown in Table 4, the average test accuracy and standard deviation are as follows.

[0141] from Figure 6 As can be seen, the traditional deep learning method CNN has the worst fault diagnosis performance. This is mainly because it cannot fully and completely reflect the true distribution of data in space under small sample conditions. With the increase of training samples, the accuracy of CNN is greatly improved. When there are 15 support set samples per class, the fault diagnosis recognition rate is about 17% higher than that of 5 samples per class.

[0142] Table 4 shows that DN4 and MMN are metric learning methods based on local descriptors. Compared with DN4, MMN has better overall classification performance. With 5, 10, and 15 samples, MMN's average classification rate is 4.4%, 3.3%, and 2.3% higher, respectively. This indicates that MMN, through a multi-level metric approach, can better improve the classification accuracy of rolling bearings. CAMMN also performs well, outperforming MMN by 2%, 2%, and 1.3% with 5, 10, and 15 samples per class, respectively. This demonstrates that coordinate attention effectively enhances important features. Finally, when using SAMN, more key information can be obtained, which is very helpful for fault feature extraction from complex vibration signals. It improves performance by approximately 3.5%, 3%, and 2.5% with 5, 10, and 15 samples per class, respectively. This shows that the addition of multi-frequency coordinate attention can better capture features from different sensors and improve fault diagnosis performance.

[0143] Table 4 Results of different methods on different tasks

[0144]

[0145] To provide a detailed comparison of the classifications of these methods across categories, this embodiment also presents confusion matrices for the diagnostic results of CNN, ProNet, DN4, MMN, CAMMN, and SAMN methods, such as... Figure 7 As shown, under small sample conditions, the query set has 100 test samples per category. The overall fault diagnosis reveals that misclassification is mainly concentrated in the fault categories of normal and rolling element fault. (Source: [Original Source Name]) Figure 7 (a) CNNs have relatively low classification accuracy, with most mislabeling concentrated between normal and inner circle faults. When trained with a small number of samples, CNNs cannot learn fault features well to complete classification. Furthermore, according to... Figure 7 (b) The prototype network of the few-shot learning method showed a certain improvement in classification performance compared to CNN, demonstrating the effectiveness of the few-shot method. Finally, based on the confusion matrix as follows... Figure 7 As shown in (f), compared with other methods, this method has significantly improved the SAMN fault diagnosis performance and enhanced the differentiation between normal and rolling element faults.

[0146] To improve the performance of deep learning methods for rolling bearing fault diagnosis under small sample conditions, this invention proposes a fault diagnosis method called Scale Adaptive Metric Network (SAMN). First, multi-sensor signals are simultaneously input into the feature extractor, and a scale adaptive attention mechanism is introduced to better fuse multi-sensor data and capture both spatial and channel dimensions of the temporal spectrogram, thereby obtaining richer fault features. Then, three different levels of similarity measurement modules are used to calculate the similarity between the query set and the support set from pixel-level, local-level, and global-level feature similarity, respectively, to obtain a more comprehensive similarity metric. Extensive experiments show that the average test accuracy of the proposed SAMN method outperforms CNN, ProNet, DN4, MMN, and CAMMN, improving accuracy by 3.5%–22.8%, 3%–17.7%, and 2.5%–13.1% on tasks with 5, 10, and 15 samples, respectively. Experimental results validate the effectiveness and superiority of this method, providing a promising tool for rolling bearing fault diagnosis.

[0147] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "setting," "connection," "fixing," "rotation," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal connection of two components or the interaction between two components. Unless otherwise explicitly limited, those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0148] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for rolling bearing fault diagnosis based on scale-adaptive metrics, characterized in that, The method comprises the following steps: S1. Collecting vibration signals of multiple sensors, cutting each vibration signal into a fault sample according to an equal sample length and marking a corresponding category label; S2. Converting each fault sample into a time-frequency spectrum graph by using a wavelet packet transform, and dividing a time-frequency spectrum graph set into a support set, a query set and a test set; S3. Constructing a scale adaptive measurement fault diagnosis model, and training the fault diagnosis model by using the support set, the query set and the test set; The scale adaptive measurement fault diagnosis model comprises a scale adaptive attention module and a multi-level measurement module; Training the scale adaptive measurement fault diagnosis model by using the support set, the query set and the test set comprises: S31. Any time-frequency spectrum graph obtains an intermediate feature map through a first convolution block; S32. The scale adaptive attention module is used to capture information of the intermediate feature map in a spatial dimension and a channel dimension, and an attention weighted feature map is obtained; S33. The attention weighted feature map is sequentially input into a second convolution block and a third convolution block, and corresponding feature representations are obtained and input into the multi-level measurement module; S34. The multi-level measurement module measures similarity of the feature representations of the query set and the support set from three different angles of a pixel level feature, a partial level feature and a global level feature; S35. A fusion layer is used to fuse the similarity measurement results of the three different angles to obtain a fault diagnosis result, calculate a loss and reversely propagate a model parameter for training; The scale adaptive attention module comprises a horizontal DCT transform unit, a vertical DCT transform unit, a splicing unit, a segmentation unit and a weight calculation unit; and a specific operation process of the scale adaptive attention module is as follows: S331. The horizontal DCT transform unit is used to perform a discrete cosine transform on the intermediate feature map in a horizontal direction to obtain a plurality of horizontal feature vectors, the plurality of horizontal feature vectors are weighted and summed, and a horizontal compression result is obtained through a convolution function; S332. The vertical DCT transform unit is used to perform a discrete cosine transform on the intermediate feature map in a vertical direction to obtain a plurality of vertical feature vectors, the plurality of vertical feature vectors are weighted and summed, and a vertical compression result is obtained through a convolution function; S333. The splicing unit is used to splice the horizontal compression result and the vertical compression result, and a 1x1 convolution is performed on the spliced result to obtain an encoded feature map; S334. The segmentation unit is used to segment the encoded feature map into a height vector and a width vector, and a 1x1 convolution is performed on the height vector and the width vector to obtain a height feature map and a width feature map respectively; S335. The weight calculation unit is used to process the height feature map and the width feature map by using a sigmoid function, and finally an attention weighted feature map is obtained; S4. A rolling bearing fault sample data is obtained and input into the trained fault diagnosis model after processing, and a fault diagnosis result is calculated.

2. The scale-adaptive metric-based rolling bearing fault diagnosis method according to claim 1, characterized in that, The multi-level measurement module comprises a pixel level feature measurement unit, a partial level feature measurement unit and a global level feature measurement unit.

3. The scale-adaptive metric-based rolling bearing fault diagnosis method according to claim 1, characterized in that, The fusion layer is used to fuse the similarity measurement results of the three different angles to obtain the fault diagnosis result, and the fault diagnosis result is represented as: Where α, β, γ represent hyperparameters, Q` represents any time-spectral graph in the query set, y represents the category label of Q`, and S... n This represents the support sample set consisting of N time-spectral maps selected from any category of the support set, where n represents the support sample set S. n Category labels; D pixel (Q′,S n ), D part (Q′,S n ) and D global (Q′,S n ) represent Q` and S respectively n Pixel-level feature similarity, partial-level feature similarity, and global-level feature similarity.

4. The scale-adaptive metric-based rolling bearing fault diagnosis method according to claim 1, characterized in that, A formula for calculating the loss in step S35 is: wherein, α, β, γ represent super parameters, Q` represents any time-frequency spectrogram in the query set, y represents the class label of Q`, S n represents a support sample set composed of N time-frequency spectrograms selected from any class of the support set, n represents the class label of the support sample set S n ; D pixel (Q′, S n ), D part (Q′, S n ) and D global (Q′, S n ) respectively represent the pixel-level feature similarity, the part-level feature similarity and the global-level feature similarity between Q` and S n , and J(·,·) is a cross-entropy loss function.

5. The scale-adaptive metric-based rolling bearing fault diagnosis method according to claim 2, characterized in that, A processing process of the pixel level feature measurement unit is as follows: Select one time-frequency spectrogram Q` in the query set, and select N time-frequency spectrograms in the support set which are of the same category as the time-frequency spectrogram Q` to form a support sample set S n ; The feature representation of the time-frequency spectrum Q' is obtained by performing steps S31-S33 and the support set S n of the feature representation where the feature representation has HxW C-dimensional local descriptors, the feature representation has NxHxW C-dimensional local descriptors; Computing a feature representation Correlation matrix between feature representations Correlation matrix between feature representations The formula is: The similarity between the time-frequency spectrum Q` and the support sample set S pixel is calculated by selecting the top k largest elements in each row of the correlation matrix R n , and the calculation formula is as follows: wherein, denotes the correlation matrix R pixel the set of elements of the i-th row.

6. The scale-adaptive metric-based rolling bearing fault diagnosis method according to claim 2, characterized in that, A processing process of the partial level feature measurement unit is as follows: Select one time-frequency spectrogram Q` in the query set, and select N time-frequency spectrograms in the support set which are of the same category as the time-frequency spectrogram Q` to form a support sample set S n ; The feature representation of the time-frequency spectrogram Q' is obtained by performing steps S31-S33 and the support set S n of the feature representation where the feature representation has C HxW dimensional local descriptors, the feature representation has CxN HxW dimensional local descriptors; Computing a feature representation Correlation matrix between the feature representation and the feature representation The formula is: The similarity between the time-frequency spectrum Q` and the support sample set S part is calculated by selecting the top k largest elements in each row of the correlation matrix R n to compute the similarity between the time-frequency spectrum Q` and the support sample set S wherein, represents the correlation matrix R part a set of elements of the ith row.

7. The scale-adaptive metric-based rolling bearing fault diagnosis method according to claim 2, characterized in that, The processing procedure of the global level feature metric unit is as follows: Select one time-frequency spectrogram Q` in the query set, and select N time-frequency spectrograms in the support set which are of the same category as the time-frequency spectrogram Q` to form a support sample set S n ; The feature representation of the time-frequency spectrum Q' is obtained by performing steps S31-S33 and the support set S n of the feature representation where the feature representation has HxW C-dimensional local descriptors, the feature representation has NxHxW C-dimensional local descriptors; The time-frequency spectrum Q' is calculated with the support sample set S n The similarity between the time-frequency spectrum Q' and the support sample set S is calculated, and the calculation formula is: wherein denotes the covariance matrix of the support set S n Q′ denotes the covariance matrix of the time-frequency spectrograms Q` in the query set, denotes the covariance matrix of the support set S n denotes the mean vector of the support set S n Q′ denotes the mean vector of the time-frequency spectrograms Q` in the query set, c denotes the feature dimension of the mean vector of the time-frequency spectrograms Q` in the query set, trace(·) denotes the trace operation of a matrix, ln(·) denotes the logarithm with base e, Det denotes the determinant of a square matrix.​​​