Bearing fault diagnosis method based on time-frequency domain contrast learning under small sample
By using the time frequency domain comparison learning method under small sample conditions, the consistency of the time domain and frequency domain characteristics of bearing fault signals is extracted, and the problem of insufficient marking samples is solved, and efficient fault diagnosis is achieved in small sample scenarios is improved. The robustness and classification performance of the model are achieved.
Patent Information
- Application Number
- CN202411360127.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-03
AI Technical Summary
Under small sample conditions, it is difficult to effectively classify bearing fault diagnosis of mechanical equipment, mainly because insufficient marking samples and lack of data limit the training difficulty and diagnostic performance of the model.
Using a method based on time-frequency domain comparison learning under small samples, pre-training on labelless data through comparative learning technology, extract the consistency of the time domain and frequency domain characteristics, reduce the dependence on a large number of labeled data, and fine-tuning the process in the subsequent fine-tuning process Classification training is carried out in combination with multi-layer perceptrons.
In small sample scenarios, the generalization ability and accuracy of bearing fault diagnosis is significantly improved, and the efficient fault classification performance can be maintained under limited labeled data, enhancing the robustness and adaptability of the model.
Smart Images

Figure CN119249229A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of mechanical fault diagnosis, and specifically is a bearing fault diagnosis method based on time-frequency domain contrast learning under small sample conditions, which can perform effective fault classification under small sample conditions. Background Art
[0002] The harsh working environment and complex equipment structure in engineering lead to a high failure rate of rotating equipment. Once a fault occurs, it is often difficult to eliminate it in a timely and effective manner, which greatly affects safety and economic benefits. In recent years, with the rapid development of modern manufacturing towards digitalization and intelligence, the intelligent operation and health management technology of mechanical equipment has also been significantly improved. As a powerful intelligent diagnostic tool, deep learning can automatically extract complex features from massive data and show excellent accuracy and robustness in fault diagnosis of complex mechanical systems. Compared with traditional artificial feature extraction methods, deep learning can not only process high-dimensional and diverse data, but also capture nonlinear relationships and potential features in the data through its multi-layer network structure, which significantly improves the intelligence level of fault diagnosis.
[0003] However, in actual industrial applications, obtaining enough labeled fault data is still a huge challenge. When the mechanical equipment of many companies is operating normally, fault data is scarce, and the collection and labeling of fault data is expensive. Especially when facing complex or new equipment, the frequency of failure is low, resulting in a lack of data that severely limits the application of traditional supervised learning methods. In addition, insufficient data makes model training more difficult, and it is usually impossible to achieve ideal fault classification results with small samples.
[0004] In order to cope with the challenges brought by insufficient labeled samples in the prior art, the present invention proposes a fault diagnosis method based on time-frequency domain contrastive learning suitable for small sample scenarios. This method uses contrastive learning technology to perform pre-training on unlabeled data, fully exploring the contrast consistency between time domain and frequency domain features, thereby enhancing the generalization ability and robustness of the model. By extracting deep time-frequency features in the pre-training stage, the model greatly reduces its dependence on a large amount of labeled data in the subsequent fine-tuning process, and can maintain efficient fault diagnosis performance even when the labeled samples are limited. This solution shows great potential in industrial applications such as bearing fault diagnosis and has important application prospects. Summary of the invention
[0005] In view of the above problems, the present invention discloses a bearing fault diagnosis method based on time-frequency domain contrast learning under small sample conditions. The purpose of the present invention is to provide a method for constructing a time-frequency domain contrast learning model, thereby solving the problem of bearing fault classification and diagnosis under small sample data conditions.
[0006] A bearing fault diagnosis method based on time-frequency domain contrast learning under small sample conditions, the method comprising the following steps:
[0007] S1: Collect the vibration acceleration signal of the rolling bearing and pre-process the collected signal;
[0008] S2: Construct a network model for pre-training fault diagnosis using contrastive learning in the time-frequency domain;
[0009] S3: Design contrastive learning loss function;
[0010] S4: Model fine-tuning and classification;
[0011] S5: Performance evaluation.
[0012] Furthermore, step S1 is specifically as follows:
[0013] S1-1: Monitor the measured signals during the actual operation of the rolling bearing and the parameters under different working conditions and obtain the measured vibration data x(t);
[0014] S1-2: Label some of the measured data to form a labeled dataset x(T). Then, divide the labeled dataset into a fine-tuning training set x t (T) and the test set x v (T), used for model fine-tuning training and performance evaluation.
[0015] Furthermore, step S2 is specifically as follows:
[0016] S2-1: Constructing a time domain encoder (G T )
[0017] Time Domain Coder (G T ) First, the time series data x(t) is taken as input, and the time domain features h are extracted through multi-layer convolution. T , and combined with residual connections to improve the gradient propagation ability of deep networks. The encoder also combines multiple data enhancement methods (such as jitter, scaling, etc.) to generate different enhanced views , so that the model can better adapt to diverse inputs and improve its resistance to noise and generalization capabilities.
[0018] S2-1-1: Input time series data
[0019] The input is time series data x(t), which represents the raw data of the bearing vibration signal in the time domain. The dimension of the input data is T×d, where T is the length of the time series and d is the number of channels of the signal. The input data can be single-channel or multi-channel, depending on the complexity of the signal.
[0020] S2-1-2: Constructing convolutional layers and residual connections
[0021] The time domain encoder uses multiple convolutional layers to extract the features of the time series. Each convolutional layer passes through the convolution kernel W (l) and the bias term b (l) Calculate to capture local time series patterns. The output calculation formula of the lth layer is:
[0022]
[0023] Among them, when l = 1, X (l) =x(t), × represents the convolution operation, and ReLU is the activation function. After each convolution layer, the feature map is downsampled using the pooling layer to reduce the size of the feature map and retain the most significant features. Assuming that the maximum pooling is used, the output of the pooling layer is:
[0024]
[0025] In order to improve the feature extraction ability of the model, the time domain encoder adopts residual connection to allow cross-layer feature transfer to capture complex changes in time series. Assume that the input of the lth layer convolution is The output after convolution and pooling is P i (l) , the output of the residual connection is:
[0026]
[0027] The residual connection allows for better gradient propagation in deep networks, prevents gradient vanishing, and is able to capture complex time series changes. The output of the encoder is a time domain feature vector h T , which is a low-dimensional representation after multiple layers of convolution and pooling operations. The output after l layers of convolution and pooling is:
[0028]
[0029] S2-1-3: Multi-view data enhancement mechanism
[0030] The temporal encoder combines a variety of data augmentation methods, such as jitter, scaling, time offset, and neighborhood segmentation. Data augmentation generates multiple different views by randomly perturbing the time series data x(t). Processed through the same convolutional network, an enhanced time domain feature vector is generated:
[0031]
[0032] This enhancement mechanism enables the model to better adapt to diverse input data and improve its resistance to noise and generalization ability.
[0033] S2-2: Constructing a frequency domain encoder (G F )
[0034] Frequency Domain Encoder (G F ) First, the time series data x(t) is converted into frequency domain representation x(f), and the frequency characteristics h of the bearing vibration signal are extracted by taking advantage of the frequency domain analysis. F ,Right now Similar to the time domain encoder, the frequency domain encoder extracts features through multi-layer convolution and combines residual connections and a variety of data augmentation techniques to enhance the model's feature extraction ability, generalization ability, and robustness to noise.
[0035] S2-2-1: Input frequency domain data
[0036] The time series data x(t) is used for fast Fourier transform to generate spectrum data x(f), and x(f) is used as frequency domain data input. The dimension of the input data is N×d, where N represents the number of frequency points. Different from the signal representation in the time domain, the data in the frequency domain can reflect the frequency components and their energy distribution in the vibration signal.
[0037] S2-2-2: Constructing convolutional layers and residual connections
[0038] Frequency Domain Encoder (G F ) and the time domain encoder (G T ) uses the same convolutional layer and residual connection, and its calculation formula can be expressed as:
[0039] F i (l) =ReLU(W (l) ×F i (l-1) +b (l) )
[0040] P i (l) =MaxPool(F i (l) )
[0041] R i (l) =P i (l) +F i (l-1)
[0042]
[0043] Among them, when l = 1, F (l) =x(f).
[0044] S2-2-3: Multi-view data enhancement mechanism
[0045] Frequency Domain Encoder (G F ) combines a variety of frequency domain data enhancement methods, such as spectrum jittering, frequency scaling, bandpass filtering, and frequency band shifting. These enhancement methods generate multiple enhanced views by randomly perturbing the frequency domain data x(f) , and then processed by the same convolutional network to generate different enhanced frequency domain feature vectors:
[0046]
[0047] This multi-view enhancement mechanism can enhance the model's sensitivity to different frequency features, adapt it to data input under different noise conditions in the frequency domain, and improve its resistance to noise and generalization capabilities.
[0048] S2-3: Building a domain projector (R)
[0049] The domain projector (R) is used to map the features of the time domain and the frequency domain into the same space z (assuming there is a potential time-frequency space) so as to perform contrastive feature learning in the shared space. The present invention designs two cross-domain projectors, namely the time domain projector (R T ) and the frequency domain projector (R F ). Both projectors use a multi-layer fully connected network to map high-dimensional time domain and frequency domain features into lower-dimensional embedding spaces, respectively, and enhance the expressiveness of the model through batch normalization and nonlinear activation functions.
[0050] S2-3-1: Input time domain and frequency domain features
[0051] The input is from the time domain encoder (G T ) and the frequency domain encoder (G F ) are the high-dimensional features extracted, namely the time domain features h T , And the frequency domain feature h F , .
[0052] S2-3-2: Constructing time domain projectors and frequency domain projectors
[0053] The domain projector maps the time domain features and frequency domain features into the shared space z respectively. The specific construction is as follows:
[0054] Time Domain Projector (R T ): Use the fully connected layer to encode the time domain (G F ) The generated feature vector h T and the enhanced feature vector Perform dimensionality reduction to generate an embedded vector z T , The projected shared domain feature z T , It is expressed as:
[0055] z T =ReLU(BN(Linear(h T )))
[0056]
[0057] Among them, Linear represents the fully connected layer, and BN represents the batch normalization operation.
[0058] Frequency Domain Projector (R F ): Similar to the time domain projector (R T ), frequency domain feature h F , After processing by the fully connected layer, the embedding vector z is generated F , :
[0059] z F =ReLU(BN(Linear(h F )))
[0060]
[0061] Furthermore, step S3 is specifically as follows:
[0062] The core of the TF-C model is to achieve time-frequency consistency through contrastive learning. The goal of the model is to ensure that the representation of the same data in the time domain and frequency domain is consistent by minimizing the distance between the representations in the time domain and frequency domain under the framework of self-supervision. In terms of specific implementation, the model uses a contrastive loss function to learn time-frequency consistency. By constructing positive and negative sample pairs, the model maximizes the similarity of positive sample pairs and minimizes the similarity of negative sample pairs.
[0063] S3-1: Constructing positive and negative sample pairs
[0064] In the TF-C model, in order to achieve time-frequency consistency, the construction of positive and negative sample pairs is carried out through the features of the time domain and the frequency domain. The specific steps of sample pair construction are as follows:
[0065] S3-1-1: Constructing time domain sample pairs
[0066] (1) The time domain feature h of the same signal x(t) T and time domain enhancement features is considered as a positive sample pair. This pair aims to capture similar features of the same input sample under different temporal enhancements.
[0067]
[0068] (2) Extract the time domain features h of different samples from x(t) T , when i≠j, it is regarded as a negative sample pair. This pair aims to capture the differences between different samples in the time domain space.
[0069]
[0070] S3-1-2: Constructing frequency domain sample pairs
[0071] (1) The frequency domain feature h of the same signal x(t) F and frequency domain enhancement features is considered as a positive sample pair. This pair is designed to ensure the feature consistency between the sample in the frequency domain and its frequency domain enhanced sample.
[0072]
[0073] (2) Extract the frequency domain features h of different samples from x(t) F , when i≠j, it is regarded as a negative sample pair. This pair aims to capture the feature differences of different samples in the frequency domain space.
[0074]
[0075] S3-1-3: Constructing time-frequency consistent sample pairs
[0076] (1) To ensure that the embeddings in the time and frequency domains are consistent, a domain projector (R) is used to map the embeddings in the time and frequency space to a joint time-frequency space z. For each input sample x i (t), we get four embeddings: z i T (Time Domain Embedding), (Enhanced Time Domain Embedding), z i F (frequency domain embedding), and (Enhanced Frequency Domain Embedding).
[0077] (2) Set the positive sample pair to and ,These pairs ensure that the characteristics of the original samples and their enhanced samples remain similar in the time-frequency space.
[0078] The negative sample pair is as well as These pairs of samples come from different input samples or their enhanced views, thereby increasing the model's ability to distinguish different samples.
[0079] S3-2: Constructing contrast loss function
[0080] Temporal contrast loss L T To ensure that the time domain data h T With its enhanced features The consistency formula is:
[0081]
[0082] Frequency domain contrast loss L F To ensure that the frequency domain data h F With its enhanced features The consistency formula is:
[0083]
[0084] Consistency loss L C Used to ensure the same data is represented in the time domain T and frequency domain representation z F The distance in the time-frequency space z is minimized, and the formula is:
[0085]
[0086] Among them, S TF Indicates the time domain z T and frequency domain representation z F The distance between pair represents the distance between other enhanced sample pairs, and δ is a constant used to ensure that the distance between negative sample pairs is large.
[0087] S3-3: Construction of total loss function
[0088] The model jointly optimizes the time domain contrast loss L T , frequency domain contrast loss L F and the time-frequency consistency loss L C To achieve overall learning, the formula is:
[0089] L total =λ T L T +λ F L F +λ C L C
[0090] Among them, λ T , F and λ Cis the weight coefficient of each loss term. Through such design and optimization, the TF-C model can extract time-frequency consistent feature representations from unlabeled data. These features are of great help to small sample fault diagnosis tasks in the subsequent fine-tuning stage.
[0091] Furthermore, step S4 is specifically as follows:
[0092] After the pre-training phase is completed, the model has learned the consistent representation of time domain and frequency domain features. Next, the pre-trained TF-C model is combined with the multi-layer perceptron (MLP) classifier, and the model is fine-tuned using a small sample labeled dataset x(T) so that the model can achieve better performance on specific tasks. The Adam optimizer will be responsible for optimizing the trainable parameters during the fine-tuning process.
[0093] S4-1: Fine-tuning data preparation
[0094] In the model fine-tuning stage, a small amount of labeled bearing dataset x(T) is used. This dataset contains samples of different fault types, each with a fault label. In order to ensure the generalization ability and evaluation effect of the model during the fine-tuning process, the dataset x(T) is divided into a training set x t (T) and the test set x v (T). Among them, the training set x t (T) is used for fine-tuning training of the model, and the test set x v (T) is used to verify the performance of the model, prevent the model from overfitting and ensure its robustness and accuracy on specific tasks.
[0095] S4-2: Using the labeled training set x t (T)
[0096] During fine-tuning, the model is trained by labeling the dataset x t The label information in (T) is used to calculate the difference between the predicted result and the actual label to obtain the loss value. For the classification task in this model, the cross-entropy loss (Cross-EntropyLoss) is used:
[0097]
[0098] in, is the predicted probability of the model, y i is the one-hot encoding of the true label.
[0099] S4-3: Freeze some parameters
[0100] In the early stage of fine-tuning, in order to maintain the stability of the model, the temporal encoder G is usually frozen. T and frequency domain encoder G FSome parameters of are adjusted to keep the time-frequency consistency features learned in the pre-training stage unaffected.
[0101] S4-4: Adjustable parameter settings
[0102] In each iteration, the Adam optimizer updates the parameters of the domain projector (R) and the MLP classifier based on the calculated loss function value and gradient. Specifically, the optimizer uses the gradient information to adjust the weights W and bias b so that the prediction results in the next iteration are closer to the true label.
[0103] Adam's parameter update formula is as follows:
[0104]
[0105] Among them, θ t is the current parameter, α is the learning rate, and are the bias correction values for the first-order and second-order moment estimates, respectively.
[0106] S4-5: Designing an MLP classifier
[0107] The MLP classifier receives the TF-C model from the training dataset x t (T) Extracted joint feature representation Where [;] represents the concatenation operation of the vector. The input layer receives the joint feature z i , through linear transformation and nonlinear activation function, we get the output of the first layer Z1 = ReLU (W1H + b1). Where: W1 is the weight matrix of the first layer, b1 is the bias vector of the first layer. For each intermediate layer, the input of the first layer is the output Z of the previous layer. l-1 , after linear transformation and activation function, we get the output of layer l: Z l =ReLU(W l Z l-1 +b l Finally, classification prediction is performed in the output layer, which usually uses a softmax activation function to output the probability distribution of the category: y = softmax(W l Z l-1 +b l ). The entire MLP classifier process can be expressed as a combination of a series of linear transformations and nonlinear activation functions. Finally, the prediction results are mapped to probability distributions through the softmax layer for classification tasks.
[0108] Furthermore, step S5 is specifically as follows:
[0109] On the test set x vIn (T), the trained model is tested to evaluate its fault diagnosis performance under different working conditions and noise environments.
[0110] Compared with the prior art, the present invention has the following effects:
[0111] The time domain feature encoder and the frequency domain feature encoder are designed respectively to extract the time series features and spectrum features in the signal. In the pre-training stage, through contrastive learning, the model can autonomously learn the deep feature representations of the time domain and frequency domain from a large amount of unlabeled data, and use the domain projector to map these features into a shared time-frequency feature space to ensure the consistency of the time domain and frequency domain features. This process effectively enhances the robustness of the features, enabling the model to capture deeper feature structures in the data. After the pre-training is completed, the model is fine-tuned on a small sample labeled data set. At this time, the pre-trained model based on time-frequency contrastive learning is combined with a multi-layer perceptron classifier, and the model is end-to-end optimized and trained using labeled data. During the fine-tuning process, the model further adjusts its learned feature representations through gradient updates to make it more suitable for specific fault classification tasks. Finally, the model is evaluated using a test set to verify its fault classification performance in a small sample scenario. The present invention uses time-frequency contrastive learning pre-training to enable the model to autonomously learn and extract deep features from the data under unsupervised conditions. This process provides the model with rich feature representation, enabling it to more effectively adapt to classification tasks when subsequently fine-tuned using a small amount of labeled data, thereby significantly improving the generalization ability and fault diagnosis accuracy in small sample scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0112] Figure 1 This is a flow chart of the bearing fault diagnosis method based on time-frequency domain comparative learning under small samples of the present invention.
[0113] Figure 2 A schematic diagram of constructing a pre-training model for time-frequency domain contrast learning in the present invention.
[0114] Figure 3 This is the diagnostic accuracy result of the bearing vibration data provided by the method of the present invention in a small sample situation. DETAILED DESCRIPTION
[0115] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. 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.
[0116] A bearing fault diagnosis method based on time-frequency domain contrast learning under small sample conditions, the method comprising the following steps:
[0117] S1: Collect the vibration acceleration signal of the rolling bearing and pre-process the collected signal.
[0118] S1-1: Monitor the measured signals during the actual operation of the rolling bearing and the parameters under different working conditions and obtain the measured vibration data x(t);
[0119] S1-2: Label some of the measured data to form a labeled dataset x(T). Then, divide the labeled dataset into a fine-tuning training set x t (T) and the test set x v (T), used for model fine-tuning training and performance evaluation.
[0120] S2: Constructing a network model for pre-training fault diagnosis using time-frequency domain contrastive learning
[0121] This paper proposes a time-frequency domain contrast learning (TF-C) model architecture, which aims to extract consistent and robust feature representations during pre-training by jointly learning features in the time domain and frequency domain. The design of this model includes four core components: the time domain encoder (G T ), frequency domain encoder (G F ), time domain projector (R T ), frequency domain projector (R F ).
[0122] The specific steps are as follows:
[0123] S2-1: Constructing a time domain encoder (G T )
[0124] Time Domain Coder (G T ) First, the time series data x(t) is taken as input, and the time domain features h are extracted through multi-layer convolution. T , and combined with residual connections to improve the gradient propagation ability of deep networks. The encoder also combines multiple data enhancement methods (such as jitter, scaling, etc.) to generate different enhanced views , so that the model can better adapt to diverse inputs and improve its resistance to noise and generalization capabilities.
[0125] S2-1-1: Input time series data
[0126] The input is time series data x(t), which represents the raw data of the bearing vibration signal in the time domain. The dimension of the input data is T×d, where T is the length of the time series and d is the number of channels of the signal. The input data can be single-channel or multi-channel, depending on the complexity of the signal.
[0127] S2-1-2: Constructing convolutional layers and residual connections
[0128] The time domain encoder uses multiple convolutional layers to extract the features of the time series. Each convolutional layer passes through the convolution kernel W (l) and the bias term b (l) Calculate to capture local time series patterns. The output calculation formula of the lth layer is:
[0129]
[0130] Among them, when l = 1, X (l) =x(t), × represents the convolution operation, and ReLU is the activation function. After each convolution layer, the feature map is downsampled using the pooling layer to reduce the size of the feature map and retain the most significant features. Assuming that the maximum pooling is used, the output of the pooling layer is:
[0131]
[0132] In order to improve the feature extraction ability of the model, the time domain encoder adopts residual connection to allow cross-layer feature transfer to capture complex changes in time series. Assume that the input of the lth layer convolution is The output after convolution and pooling is P i (l) , the output of the residual connection is:
[0133]
[0134] The residual connection allows for better gradient propagation in deep networks, prevents gradient vanishing, and is able to capture complex time series changes. The output of the encoder is a time domain feature vector h T , which is a low-dimensional representation after multiple layers of convolution and pooling operations. The output after l layers of convolution and pooling is:
[0135]
[0136] S2-1-3: Multi-view data enhancement mechanism
[0137] The temporal encoder combines a variety of data augmentation methods, such as jitter, scaling, time offset, and neighborhood segmentation. Data augmentation generates multiple different views by randomly perturbing the time series data x(t). Processed through the same convolutional network, an enhanced time domain feature vector is generated:
[0138]
[0139] This enhancement mechanism enables the model to better adapt to diverse input data and improve its resistance to noise and generalization ability.
[0140] S2-2: Constructing a frequency domain encoder (G F )
[0141] Frequency Domain Encoder (G F ) First, the time series data x(t) is converted into frequency domain representation x(f), and the frequency characteristics h of the bearing vibration signal are extracted by taking advantage of the frequency domain analysis. F ,Right now Similar to the time domain encoder, the frequency domain encoder extracts features through multi-layer convolution and combines residual connections and a variety of data augmentation techniques to enhance the model's feature extraction ability, generalization ability, and robustness to noise.
[0142] S2-2-1: Input frequency domain data
[0143] The time series data x(t) is used for fast Fourier transform to generate spectrum data x(f), and x(f) is used as frequency domain data input. The dimension of the input data is N×d, where N represents the number of frequency points. Different from the signal representation in the time domain, the data in the frequency domain can reflect the frequency components and their energy distribution in the vibration signal.
[0144] S2-2-2: Constructing convolutional layers and residual connections
[0145] Frequency Domain Encoder (G F ) and the time domain encoder (G T ) uses the same convolutional layer and residual connection, and its calculation formula can be expressed as:
[0146] F i (l) =ReLU(W (l) ×F i (l-1) +b (l) )
[0147] P i (l) =MaxPool(F i (l) )
[0148]
[0149] Among them, when l = 1, F (l) =x(f).
[0150] S2-2-3: Multi-view data enhancement mechanism
[0151] Frequency Domain Encoder (G F ) combines a variety of frequency domain data enhancement methods, such as spectrum jittering, frequency scaling, bandpass filtering, and frequency band shifting. These enhancement methods generate multiple enhanced views by randomly perturbing the frequency domain data x(f) , and then processed by the same convolutional network to generate different enhanced frequency domain feature vectors:
[0152]
[0153] This multi-view enhancement mechanism can enhance the model's sensitivity to different frequency features, adapt it to data input under different noise conditions in the frequency domain, and improve its resistance to noise and generalization capabilities.
[0154] S2-3: Building a domain projector (R)
[0155] The domain projector (R) is used to map the features of the time domain and the frequency domain into the same space z (assuming there is a potential time-frequency space) so as to perform contrastive feature learning in the shared space. The present invention designs two cross-domain projectors, namely the time domain projector (R T ) and the frequency domain projector (R F ). Both projectors use a multi-layer fully connected network to map high-dimensional time domain and frequency domain features into lower-dimensional embedding spaces, respectively, and enhance the expressiveness of the model through batch normalization and nonlinear activation functions.
[0156] S2-3-1: Input time domain and frequency domain features
[0157] The input is from the time domain encoder (G T ) and the frequency domain encoder (G F ) are the high-dimensional features extracted, namely the time domain features h T , And the frequency domain feature h F ,
[0158] S2-3-2: Constructing time domain projectors and frequency domain projectors
[0159] The domain projector maps the time domain features and frequency domain features into the shared space z respectively. The specific construction is as follows:
[0160] Time Domain Projector (R T ): Use the fully connected layer to encode the time domain (G F ) The generated feature vector h T and the enhanced feature vector Perform dimensionality reduction to generate an embedded vector z T , The projected shared domain feature z T , It is expressed as:
[0161] z T =ReLU(BN(Linear(h T )))
[0162]
[0163] Among them, Linear represents the fully connected layer, and BN represents the batch normalization operation.
[0164] Frequency Domain Projector (R F ): Similar to the time domain projector (R T ), frequency domain feature h F , After processing by the fully connected layer, the embedding vector z is generated F , :
[0165] z F =ReLU(BN(Linear(h F )))
[0166]
[0167] S3: Designing Contrastive Learning Loss Function
[0168] The core of the TF-C model is to achieve time-frequency consistency through contrastive learning. The goal of the model is to ensure that the representation of the same data in the time domain and frequency domain is consistent by minimizing the distance between the representations in the time domain and frequency domain under the framework of self-supervision. In terms of specific implementation, the model uses a contrastive loss function to learn time-frequency consistency. By constructing positive and negative sample pairs, the model maximizes the similarity of positive sample pairs and minimizes the similarity of negative sample pairs.
[0169] S3-1: Constructing positive and negative sample pairs
[0170] In the TF-C model, in order to achieve time-frequency consistency, the construction of positive and negative sample pairs is carried out through the features of the time domain and the frequency domain. The specific steps of sample pair construction are as follows:
[0171] S3-1-1: Constructing time domain sample pairs
[0172] (1) The time domain feature h of the same signal x(t) T and time domain enhancement features is considered as a positive sample pair. This pair aims to capture similar features of the same input sample under different temporal enhancements.
[0173]
[0174] (2) Extract the time domain features h of different samples from x(t) T , when i≠j, it is regarded as a negative sample pair. This pair aims to capture the differences between different samples in the time domain space.
[0175]
[0176] S3-1-2: Constructing frequency domain sample pairs
[0177] (1) The frequency domain feature h of the same signal x(t) F and frequency domain enhancement features is considered as a positive sample pair. This pair is designed to ensure the feature consistency between the sample in the frequency domain and its frequency domain enhanced sample.
[0178]
[0179] (2) Extract the frequency domain features h of different samples from x(t) F , when i≠j, it is regarded as a negative sample pair. This pair aims to capture the feature differences of different samples in the frequency domain space.
[0180]
[0181] S3-1-3: Constructing time-frequency consistent sample pairs
[0182] (1) To ensure that the embeddings in the time and frequency domains are consistent, a domain projector (R) is used to map the embeddings in the time and frequency space to a joint time-frequency space z. For each input sample x i (t), we get four embeddings: z i T (Time Domain Embedding), (Enhanced Time Domain Embedding), z i F (frequency domain embedding), and (Enhanced Frequency Domain Embedding).
[0183] (2) Set the positive sample pair to and ,These pairs ensure that the characteristics of the original samples and their enhanced samples remain similar in the time-frequency space.
[0184] The negative sample pair is ,as well as These pairs of samples come from different input samples or their enhanced views, thereby increasing the model's ability to distinguish different samples.
[0185] S3-2: Constructing contrast loss function
[0186] Temporal contrast loss L T To ensure that the time domain data h T With its enhanced features The consistency formula is:
[0187]
[0188] Frequency domain contrast loss L F To ensure that the frequency domain data h F With its enhanced features The consistency formula is:
[0189]
[0190] Consistency loss L C Used to ensure the same data is represented in the time domain T and frequency domain representation z F The distance in the time-frequency space z is minimized, and the formula is:
[0191]
[0192] Among them, S TF Indicates the time domain z T and frequency domain representation z F The distance between pair represents the distance between other enhanced sample pairs, and δ is a constant used to ensure that the distance between negative sample pairs is large.
[0193] S3-3: Construction of total loss function
[0194] The model jointly optimizes the time domain contrast loss L T , frequency domain contrast loss L F and the time-frequency consistency loss L C To achieve overall learning, the formula is:
[0195] L total =λ T L T +λ F L F +λ C L C
[0196] Among them, λ T , F and λ Cis the weight coefficient of each loss term. Through such design and optimization, the TF-C model can extract time-frequency consistent feature representations from unlabeled data. These features are of great help to small sample fault diagnosis tasks in the subsequent fine-tuning stage.
[0197] S4: Model fine-tuning and classification
[0198] After the pre-training phase is completed, the model has learned the consistent representation of time domain and frequency domain features. Next, the pre-trained TF-C model is combined with the multi-layer perceptron (MLP) classifier, and the model is fine-tuned using a small sample labeled dataset x(T) so that the model can achieve better performance on specific tasks. The Adam optimizer will be responsible for optimizing the trainable parameters during the fine-tuning process.
[0199] S4-1: Fine-tuning data preparation
[0200] In the model fine-tuning stage, a small amount of labeled bearing dataset x(T) is used. This dataset contains samples of different fault types, each with a fault label. In order to ensure the generalization ability and evaluation effect of the model during the fine-tuning process, the dataset x(T) is divided into a training set x t (T) and the test set x v (T). Among them, the training set x t (T) is used for fine-tuning training of the model, and the test set x v (T) is used to verify the performance of the model, prevent the model from overfitting and ensure its robustness and accuracy on specific tasks.
[0201] S4-2: Using the labeled training set x t (T)
[0202] During fine-tuning, the model is trained by labeling the dataset x t The label information in (T) is used to calculate the difference between the predicted result and the actual label to obtain the loss value. For the classification task in this model, the cross-entropy loss (Cross-EntropyLoss) is used:
[0203]
[0204] in, is the predicted probability of the model, y i is the one-hot encoding of the true label.
[0205] S4-3: Freeze some parameters
[0206] In the early stage of fine-tuning, in order to maintain the stability of the model, the temporal encoder G is usually frozen. T and frequency domain encoder G FSome parameters of are adjusted to keep the time-frequency consistency features learned in the pre-training stage unaffected.
[0207] S4-4: Adjustable parameter settings
[0208] In each iteration, the Adam optimizer updates the parameters of the domain projector (R) and the MLP classifier based on the calculated loss function value and gradient. Specifically, the optimizer uses the gradient information to adjust the weights W and bias b so that the prediction results in the next iteration are closer to the true label.
[0209] Adam's parameter update formula is as follows:
[0210]
[0211] Among them, θ t is the current parameter, α is the learning rate, and are the bias correction values for the first-order and second-order moment estimates, respectively.
[0212] S4-5: Designing an MLP classifier
[0213] The MLP classifier receives the TF-C model from the training dataset x t (T) Extracted joint feature representation Where [;] represents the concatenation operation of the vector. The input layer receives the joint feature z i , through linear transformation and nonlinear activation function, we get the output of the first layer Z1 = ReLU (W1H + b1). Where: W1 is the weight matrix of the first layer, b1 is the bias vector of the first layer. For each intermediate layer, the input of the first layer is the output Z of the previous layer. l-1 , after linear transformation and activation function, we get the output of layer l: Z l =ReLU(W l Z l-1 +b l Finally, classification prediction is performed in the output layer, which usually uses a softmax activation function to output the probability distribution of the category: y = softmax(W l Z l-1 +b l ). The entire MLP classifier process can be expressed as a combination of a series of linear transformations and nonlinear activation functions. Finally, the prediction results are mapped to probability distributions through the softmax layer for classification tasks.
[0214] S5: Performance Evaluation
[0215] On the test set x v(T) The trained model is tested to evaluate its fault diagnosis performance under different working conditions and noise environments. The bearing fault diagnosis method based on time-frequency domain contrast learning of the present invention is applied to a specific example to illustrate the effectiveness of the method of the present invention. Figure 3 As shown, it is a diagram of the diagnosis result of the invented method for the provided bearing vibration data in a small sample case, wherein a is the ACC curve diagram and b is the confusion matrix diagram.
[0216] The present invention uses self-supervised contrastive learning as a design factor, and takes improving feature robustness and time-frequency consistency as an optimization goal. It uses a time-frequency encoder and domain projection technology to calculate the similarity of time domain and frequency domain features. By designing a time domain encoder and a frequency domain encoder, the time series features and spectrum features in the signal are extracted respectively, and the consistency of the time-frequency features is achieved through contrastive learning. Combined with a cross-domain projector, the features of the time domain and frequency domain are mapped to a unified time-frequency feature space, thereby enhancing the robustness of the features. Then, fine-tuning is performed on a small sample labeled data set, and optimization training is performed in combination with a multi-layer perceptron classifier. Finally, the fused features are used for fault diagnosis, and accurate classification results are obtained through the classifier.
[0217] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and improved concepts of the present invention within the technical scope disclosed by the present invention, and they should be covered by the protection scope of the present invention.
Claims
1. A bearing fault diagnosis method based on time-frequency domain contrast learning under small sample conditions, characterized in that: The method comprises the following steps: S1: Collect the vibration acceleration signal of the rolling bearing and pre-process the collected signal; S2: Construct a network model for pre-training fault diagnosis using contrastive learning in the time-frequency domain; S3: Design contrastive learning loss function; S4: Model fine-tuning and classification; S5: Performance evaluation.
Citation Information
Cited By
Fault diagnosis method based on multi-mode cross-sensor Transform
CN120086679A
