Small sample bearing fault diagnosis method based on hierarchical contrast learning optimization

By adopting the CMBDC model based on hierarchical comparison learning optimization under small sample conditions, the problem of insufficient accuracy of traditional fault diagnosis methods under small sample conditions is solved, and a higher fault diagnosis accuracy is achieved.

CN119469767AActive Publication Date: 2025-02-18GUANGZHOU YIZHI INTELLECTUAL PROPERTY OPERATION CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411262953.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-02-18
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

Under small sample conditions, traditional big data-based fault diagnosis methods are difficult to effectively utilize limited data, resulting in insufficient accuracy of fault diagnosis.

Method used

A small sample bearing fault diagnosis method based on hierarchical comparison learning optimization is adopted. Through hierarchical comparison learning module, parallel attention fusion module, stacked activation function and BDC measurement module, CMBDC model is built to optimize network parameters to improve the accuracy of fault diagnosis.

Benefits of technology

Through comparative learning, the distance between similar samples is reduced, the distance between different samples is increased, the feature extraction ability and classification accuracy of the model are improved, and the accuracy of small sample bearing fault diagnosis is effectively improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119469767A_ABST
    Figure CN119469767A_ABST
Patent Text Reader

Abstract

The invention discloses a small sample bearing fault diagnosis method based on hierarchical contrast learning optimization, and relates to the technical field of fault diagnosis. The method comprises the following steps: collecting bearing vibration signals of different fault types through a sensor, extracting samples according to the length N of the signals, and obtaining time-frequency domain characteristics of the signals by using short-time Fourier transform; designing a hierarchical contrast learning module and a parallel attention fusion module, introducing a stacking activation function and a Brownian distance covariance measurement method, and constructing a small sample bearing fault diagnosis model (CMBDC) based on hierarchical contrast learning optimization; inputting training set data into the CMBDC model, calculating a gradient by using a back propagation algorithm, and continuously optimizing network parameters through a plurality of training iteration cycles to obtain a final model; inputting test set data into the trained model to obtain a prediction result of the test set data; according to the method, fault diagnosis can be carried out under the condition that the number of samples is limited, and an excellent experimental result is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of bearing fault diagnosis, and in particular to a small sample bearing fault diagnosis method based on hierarchical contrast learning optimization. Background Art

[0002] As a key technical means, fault diagnosis plays a vital role in many fields such as industrial production, transportation, energy and electricity. With the rapid development of science and technology, various mechanical equipment and systems are becoming increasingly complex and the degree of automation is constantly improving. Once a failure occurs, it may cause serious economic losses or even safety accidents. Therefore, the study of fault diagnosis technology is of great significance to ensure the safe operation of equipment, improve production efficiency and promote the sustainable and healthy development of the national economy.

[0003] In recent years, deep learning has been widely used in the field of fault diagnosis due to its advantages of high precision, powerful feature extraction and generalization capabilities. However, deep learning often requires a large amount of data to train the model. In actual application scenarios, it is difficult to obtain a large amount of fault data due to expensive equipment, low fault frequency or difficulty in data collection. This makes traditional fault diagnosis methods based on big data difficult to apply. Therefore, it is crucial to study fault diagnosis methods under small sample conditions. Under limited sample conditions, how to effectively use existing data and improve the accuracy of fault diagnosis has become an urgent problem to be solved in the current field of fault diagnosis. Summary of the invention

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: a small sample bearing fault diagnosis method based on hierarchical contrast learning optimization, comprising the following steps:

[0005] S1: Use sensors to collect bearing vibration signals of different fault types under different loads, extract sample data according to fixed signal length and sliding window, and then use short-time Fourier transform to obtain the time-frequency domain characteristics of the signal;

[0006] S2: Divide the data set into a training data set and a test data set according to the different loads, and build multiple tasks for the training data set and the test data set respectively. Each task contains a support set and a query set.

[0007] S3: Construct a small sample bearing fault diagnosis model CMBDC based on hierarchical contrastive learning optimization;

[0008] S4: Input the training data set into the CMBDC model, weight the shallow contrast loss, deep contrast loss, and classification loss calculated by the BDC metric module to obtain the total loss of the model, calculate the gradient using the back propagation algorithm, and update the network parameters using the optimization algorithm. Continuously optimize the network parameters through multiple training iterations to obtain the final model.

[0009] S5: Input the test data set into the trained CMBDC model to classify the test data set.

[0010] The beneficial effects of adopting the above technical solution are:

[0011] The method of the present invention utilizes the characteristic of contrastive learning that can reduce the distance between samples of the same type and increase the distance between samples of different types, introduces contrastive learning into the feature extraction part, so that the model learns to distinguish the features of positive and negative samples; the designed parallel attention fusion module does not input each sample of the support set into the parallel attention fusion module separately, but splices all samples of this type of support set into a large tensor, and then inputs it into the parallel attention fusion module, so that the attention mechanism can learn the features of this category of samples more comprehensively, and each attention mechanism can learn different spatial relationships and attention weight distributions to obtain richer attention expressions; the introduction of stacked activation functions enhances the nonlinear expression ability of the model; the BDC measurement method obtains more accurate similarity by measuring the joint distribution between samples; and effectively improves the classification accuracy of small sample bearing fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0013] Figure 1 A flowchart of the method according to an embodiment of the present invention;

[0014] Figure 2 A model diagram of the method described in an embodiment of the present invention. DETAILED DESCRIPTION

[0015] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0016] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0017] like Figure 1 As shown, the present invention discloses a small sample bearing fault diagnosis method based on hierarchical contrast learning optimization, which specifically includes the following steps:

[0018] S1: Use sensors to collect bearing vibration signals of different fault types under different loads, extract sample data according to fixed signal length and sliding window, and then use short-time Fourier transform to obtain the time-frequency domain characteristics of the signal;

[0019] First, the original vibration signal is sampled using a sliding window, with each sample containing 2500 sampling points and a step size of 500. Then, short-time Fourier transform is used to obtain the time-frequency domain characteristics of the signal.

[0020] S2: Divide the data set into a training data set and a test data set according to the different loads, and build multiple tasks for the training data set and the test data set respectively. Each task contains a support set and a query set.

[0021] This example uses the Case Western Reserve University bearing data set (CWRU) for experiments. The drive end with a sampling frequency of 12kHz is selected to construct the data set. A total of three loads are selected, namely 1hp, 2hp, and 3hp. Each load contains four health states, including health state, inner ring fault, outer ring fault, and rolling element fault. Each fault contains three different sizes, a total of 10 categories. The experimental data used in the experiment are shown in Table 1:

[0022] Table 1 CWRU data

[0023]

[0024] Under each load, each type of data contains 500 samples, and the length of each sample is 2500. Training data set A total of 5000 samples, test data set A total of 5000 samples.

[0025] The training dataset consists of 200 tasks per training round. Each task consists of a support set and a query set. Randomly select N categories from the dataset, randomly select K samples from each category, and construct a support set , and then randomly select L samples from the remaining samples of N categories to construct the query set .

[0026] The test dataset constructs 20 tasks in each training round, each task contains a support set and a query set. Randomly select N categories from the dataset, randomly select K samples from each category, and construct a support set , and then randomly select L samples from the remaining samples of N categories to construct the query set .

[0027] In order to verify the performance of the CMBDC model based on hierarchical contrastive learning optimization proposed in the present invention, 6 cross-load experiments were designed: 1hp→2hp, 1hp→3hp, 2hp→3hp, 2hp→1hp, 3hp→1hp, and 3hp→2hp, where 1hp→2hp means using the data under 1hp to train the model and using the data under 2hp to test the model.

[0028] S3: Construct a small sample bearing fault diagnosis model CMBDC based on hierarchical contrastive learning optimization;

[0029] The CMBDC model structure is shown in the figure below. Figure 2 As shown. The CMBDC model includes: hierarchical contrastive learning module, parallel attention fusion module, stacked activation function, and Brownian distance covariance (BDC) measurement module. Among them, the hierarchical contrastive learning module is used to construct positive and negative sample pairs and calculate the contrast loss in the process of feature extraction, so that the distance between samples of the same type is closer and the distance between samples of different types is farther; the parallel attention fusion module enhances the distinction between categories by fusing multiple attention mechanisms and learns more comprehensive feature information; the stacked activation function replaces the ordinary activation function when extracting features to enhance the nonlinear expression ability of the network; the BDC measurement module is used to calculate the similarity between the query sample and each category of the support set, and the one with the largest similarity is used as the classification result of the query sample.

[0030] The constructed hierarchical contrastive learning module has a total of 6 layers, including 4 convolutional blocks and two contrastive learning modules, among which the 1st and 2nd layers are convolutional blocks, the third layer is a shallow contrastive learning module, the 4th and 5th layers are convolutional blocks, and the 6th layer is a deep contrastive learning module.

[0031] The constructed parallel attention fusion module has 6 layers in each attention mechanism. The 1st and 2nd layers are adaptive average pooling layers, the 3rd layer is a convolution block, and the 4th and 5th layers are attention generation layers. The compressed feature vector is expanded to the original number of channels through the convolution operation, and the attention weight is generated through the Sigmoid activation function. The 6th layer calculates the product of the attention weight and the input feature and outputs the final feature.

[0032] The introduced stacking activation function is defined as follows:

[0033]

[0034] In the formula, n represents the number of stacked activation functions, and Represents the scale and bias of each activation function, scaling and translating the output of the activation function to avoid simple accumulation.

[0035] The introduced BDC measurement model is defined as follows:

[0036] Calculate the Euclidean distance matrix between each feature X of the support set and the query sample feature Y. The calculation expression is as follows:

[0037]

[0038]

[0039] In the formula, , Represent the two observations of feature X, that is, the two columns of the feature vector, and calculate the Euclidean distance between the xth column and the lth column.

[0040] Calculate the BDC matrix after the centering of X and Y. The calculation expression is as follows:

[0041]

[0042] The last three terms represent The row average of The column mean of The mean of all vectors.

[0043] Calculate the value of the BDC metric , and its calculation expression is as follows:

[0044]

[0045] Where X and Y represent the BDC matrices of the support set feature X and the query set sample Y respectively.

[0046] S4: Input the training data set into the CMBDC model, weight the shallow contrast loss, deep contrast loss, and classification loss calculated by the BDC metric module to obtain the total loss of the model, calculate the gradient using the back propagation algorithm, and update the network parameters using the optimization algorithm. Continuously optimize the network parameters through multiple training iterations to obtain the final model.

[0047] The calculation formulas for shallow contrast loss and deep contrast loss are as follows:

[0048]

[0049] In the formula, , represents a positive sample, represents a negative sample, and sim represents calculating the similarity between two samples.

[0050] The classification loss is calculated as follows:

[0051]

[0052] Where x is the actual fault category and y is the fault category predicted by the model.

[0053] The total loss is calculated as follows:

[0054]

[0055] Where α is the weight corresponding to the contrast loss, and β is the weight corresponding to the classification loss.

[0056] In this example, the number of training rounds is set to 20, each of which contains 200 tasks. The loss function is a weighted fusion of contrast loss and classification loss. The SGD optimizer is used with a learning rate of 0.001. During the training process, the loss value gradually decreases, and the network model eventually reaches a stable state.

[0057] The CMBDC model training process is as follows:

[0058] (1) Input the training data set into the hierarchical contrastive learning module according to the task, and obtain the support set features after shallow contrastive learning and deep contrastive learning. , shallow contrast loss , deep contrast loss ; The query sample does not need to calculate the contrast loss, and the query sample features are obtained ;

[0059] (2) The support set features , query sample features Input to the parallel attention fusion module to obtain the features after attention selection , ;

[0060] (3) Calculate the BDC matrix of the support set features , calculate the BDC matrix of the query sample , and finally calculate Get the classification result of query sample Y.

[0061] (4) Compare the classification results with the prediction results and calculate the classification loss , the classification loss , shallow contrast loss , deep contrast loss Weighted fusion to get the total loss , use the back-propagation algorithm to calculate the gradient, use the optimization algorithm to update the network parameters, and train the model until the model converges.

[0062] S5: Input the test data set into the trained CMBDC model to classify the test data set.

[0063] The specific process of fault diagnosis using the trained CMBDC model is as follows:

[0064] (1) Input the test data set into the hierarchical contrastive learning module according to the task, without calculating the shallow contrast loss and the deep contrast loss, to obtain the support set features of each task , query set features ;

[0065] (2) The support set features , query sample features Input to the parallel attention fusion module to obtain the features after attention selection , ;

[0066] (3) Calculate the BDC matrix of the support set features , calculate the BDC matrix of the query sample , and finally calculate Get the classification result of query sample Y.

[0067] In order to illustrate the effectiveness of the model of the present invention, K-Nearest Neighbors (KNN), ResNet, Matching Networks, MLFD, and Prototypical Networks methods are selected for comparison, and 6 cross-load experiments are performed. The comparative experimental results under the 10-way 5-shot condition are shown in Table 2:

[0068] Table 2 Experimental accuracy of different models under cross-load conditions

[0069]

Claims

1. A small sample bearing fault diagnosis method based on hierarchical contrast learning optimization, the steps are as follows: S1: Use sensors to collect bearing vibration signals of different fault types under different loads, extract sample data according to fixed signal length and sliding window, and then use short-time Fourier transform to obtain the time-frequency domain characteristics of the signal; S2: Divide the data set into a training data set and a test data set according to the different loads, and build multiple tasks for the training data set and the test data set respectively. Each task contains a support set and a query set. S3: Construct a small sample bearing fault diagnosis model CMBDC based on hierarchical contrastive learning optimization; S4: Input the training data set into the CMBDC model, weight the shallow contrast loss, deep contrast loss, and classification loss calculated by the metric module to obtain the total loss of the model, calculate the gradient using the back-propagation algorithm, and update the network parameters using the optimization algorithm. Continuously optimize the network parameters through multiple training iterations to obtain the final model. S5: Input the test data set into the trained CMBDC model to classify the test data set.

2. The small sample bearing fault diagnosis method based on hierarchical contrast learning optimization according to claim 1 is characterized in that: Step S1 is specifically as follows: (1) Use sensors to collect bearing vibration signals of different fault types under different loads; (2) Set the sample length N, the sliding window size W, and extract signal samples; (3) Perform short-time Fourier transform on the extracted signal to obtain the time-frequency domain characteristics of the signal.

3. The small sample bearing fault diagnosis method based on hierarchical contrast learning optimization according to claim 1 is characterized in that: The specific requirements of step S2 are as follows: (1) According to the load, the data is divided into training data set D train , test data set D test ; (2) Construct multiple tasks for the training dataset and the test dataset respectively. Each task contains a support set and a query set. The construction method is as follows: Adopting the N-way K-shot method, multiple tasks are constructed for the training data set, and support sets and query sets are constructed for each task. N categories are randomly selected from the total fault categories in the training data set, and K samples are randomly selected from each category to form the support set of this task. Where i represents the i-th task, (x i,j ,y i,j ) represents the jth sample of the i-th task, y i,j is the corresponding label, k is the number of samples for each task; then L samples are randomly selected from the remaining samples of these N classes to form the query set of this task Where l represents the number of query samples; In the same way, we construct multiple tasks for the test dataset, build support sets and query sets for each task, randomly select N classes from the total fault categories in the test dataset, and randomly select K samples from each class to form the support set of this task. Then randomly select L samples from the remaining samples of these N classes to form the query set of this task 4. The small sample bearing fault diagnosis method based on hierarchical contrast learning optimization according to claim 1 is characterized in that: The specific requirements of step S3 are as follows: (1) The CMBDC model includes: a hierarchical contrastive learning module, a parallel attention fusion module, a stacked activation function, and a Brownian distance covariance measurement module, referred to as BDC; wherein the hierarchical contrastive learning module is used to construct positive and negative sample pairs and calculate the contrast loss during the feature extraction process, so that the distance between samples of the same type is closer and the distance between samples of different types is farther; the parallel attention fusion module enhances the distinction between categories by fusing multiple attention mechanisms and learns more comprehensive feature information; the stacked activation function replaces the ordinary activation function during feature extraction to enhance the nonlinear expression ability of the network; the BDC measurement module is used to calculate the similarity between the query sample and each category of the support set, and the one with the largest similarity is used as the classification result of the query sample; (2) The constructed hierarchical contrastive learning module first constructs positive and negative sample pairs, randomly selects one class from the N classes in the support set, and randomly selects two samples to form a positive sample pair Where N i represents a randomly selected category, p represents a positive sample pair, x i,1 , x i,2 Respectively represent the first positive sample and the second positive sample, y i is the corresponding label; then from other categories, select samples different from the current sample category to form N-1 negative sample pairs Where n represents the negative sample pair, x i,1 represents a positive sample, x j,k represents negative samples, y i ,y j Represent the corresponding labels respectively; use InfoNCE contrast loss to maximize the similarity score between positive sample pairs and minimize the similarity score between negative sample pairs. The calculation formula of InfoNCE contrast loss is as follows: In the formula, x i,1 , x i,2 represents a positive sample, x j,k represents a negative sample, and sim represents calculating the similarity between two samples; The hierarchical contrastive learning module has 6 layers, including 4 convolutional blocks and 2 contrastive learning modules. The first and second layers are convolutional blocks, the third layer is a shallow contrastive learning module, the fourth and fifth layers are convolutional blocks, and the sixth layer is a deep contrastive learning module. (3) The constructed parallel attention fusion module is composed of three coordinate attention mechanisms in parallel. Each coordinate attention mechanism decomposes the input features along the spatial dimension into two one-dimensional feature vectors, representing the vertical and horizontal information respectively, and aggregates the features along the vertical and horizontal directions; the support set features extracted by the hierarchical contrastive learning module are spliced ​​into an overall vector. The size of a feature map is c×h×w. The k maps of each class are combined into k×c×h×w, and then the tensor is reshaped into c×(k×h)×w through the axis transformation operation; the transformed features are input into the three attention mechanisms respectively, and the results selected by the three attention mechanisms are weighted averaged and output; Each attention mechanism has 6 layers. The first and second layers are adaptive average pooling layers, the third layer is a convolution block, and the fourth and fifth layers are attention generation layers. The compressed feature vector is expanded to the original number of channels through the convolution operation, and the attention weight is generated through the Sigmoid activation function. The sixth layer calculates the product of the attention weight and the input feature and outputs the final feature. (4) The definition of the stacking activation function is as follows: In the formula, n represents the number of stacked activation functions, a i and b i Represent the scale and bias of each activation function, scale and translate the output of the activation function to avoid simple accumulation; (5) The definition of the BDC measurement module is as follows: 1) Calculate the Euclidean distance matrix for each feature X of the support set and the feature vector Y of the query sample. The calculation expression is as follows: In the formula, x k 、x l Represent the two observed values ​​of feature X, that is, the two columns of the feature vector, and calculate the Euclidean distance between the xth column and the lth column; 2) Calculate the BDC matrix after the centering of X and Y. The calculation expression is as follows: The last three terms represent The row average of The column mean of The average of all vectors; 3) Calculate the value of the BDC metric ρ(X, Y), which is calculated as follows: ρ(X,Y)=tr(X T ,AND), Where X and Y represent the BDC matrices of the support set feature X and the query set sample Y respectively.

5. The small sample bearing fault diagnosis method based on hierarchical contrast learning optimization according to claim 1 is characterized in that: The specific requirements of step S4 are as follows: (1) Input the training data set into the hierarchical contrastive learning module according to the task, and obtain the support set features after shallow contrastive learning and deep contrastive learning. Shallow contrast loss L s , deep contrast loss L d ; The query sample does not need to calculate the contrast loss, and the query sample feature is obtained as (2) The support set features Query sample characteristics Input to the parallel attention fusion module to obtain the features after attention selection (3) Calculate the BDC matrix of each type of feature in the support set Calculate the BDC matrix of the query sample Finally calculate Get the classification result of query sample Y; (4) Compare the classification results with the prediction results and calculate the classification loss L c , the classification loss L c , shallow contrast loss L s , deep contrast loss L d Weighted fusion, get the total loss L total , use the back-propagation algorithm to calculate the gradient, use the optimization algorithm to update the network parameters, and train the model until the model converges.

6. The small sample bearing fault diagnosis method based on hierarchical contrast learning optimization according to claim 1 is characterized in that: The specific requirements of step S5 are as follows: (1) Input the test data set into the hierarchical contrastive learning module according to the task, without calculating the shallow contrast loss and the deep contrast loss, to obtain the support set features of each task Query set features (2) The support set features Query sample characteristics Input to the parallel attention fusion module to obtain the features after attention selection (3) Calculate the BDC matrix of the support set features Calculate the BDC matrix of the query sample Finally calculate Get the classification result of query sample Y.

Citation Information

Patent Citations

  • Procedure for diagnosing a bearing.

    CH717054A2

  • Transform encoder and depth perception fused image enhancement method

    CN116935019A

  • Rolling bearing fault diagnosis method and device under sample imbalance condition

    CN117312941A

  • Supervised contrast learning network model training multivariate time series data classification method and system

    CN117407772A

  • Neural network model training method and related device

    CN117649585A