Cross-domain bearing fault diagnosis method based on prototype contrast learning
By using clustering and prototype contrastive learning methods, the features of the source and target domains are divided into different clusters, and the classifier is trained using pseudo-labeled samples. This solves the problems of feature matching errors and label dependence in traditional methods, and achieves high-precision cross-domain bearing fault diagnosis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2026-03-31
AI Technical Summary
Traditional cross-domain bearing fault diagnosis methods suffer from low diagnostic accuracy due to feature matching errors and heavily rely on a large number of labels in the source domain, making them difficult to apply in real-world industrial scenarios.
Clustering learning divides the features of the source and target domains into different clusters. Intra-domain prototype contrastive learning enhances the discriminative power of each cluster, and cross-domain prototype contrastive learning matches features on a cluster-by-cluster basis. Pseudo-labeled samples are used to assist in training the classifier, reducing the dependence on source domain labels.
It improves the accuracy of cross-domain bearing fault diagnosis, reduces the dependence on source domain labels, and adapts to actual industrial application scenarios.
Smart Images

Figure CN119760458B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of mechanical equipment fault diagnosis technology, and more specifically relates to a cross-domain bearing fault diagnosis method based on prototype comparative learning in the field of bearing fault diagnosis technology. This invention can be used for cross-domain bearing fault diagnosis under multiple operating conditions. Background Technology
[0002] As an important component of rotating machinery, bearings operate under high speed, high pressure, and heavy load conditions, making them prone to failure. This can cause serious economic losses and even threaten the lives of workers. Deep learning technology can reveal complex relationships between data and has been widely applied in the field of bearing fault diagnosis. Traditional deep learning-based fault diagnosis methods assume that training and test data are independent and identically distributed. However, in actual industrial scenarios, the working environment of bearings is complex and variable, and training and test data often follow different distributions, resulting in poor practical application of fault diagnosis models. To address this issue, different working conditions of bearings are considered as source or target domains. It is assumed that the data in the source domain are labeled and the data in the target domain are unlabeled. By reducing the data distribution differences between the source and target domains, the fault diagnosis model trained in the source domain can work in the target domain. However, this method ignores two problems: (1) Obtaining sufficient labels for source domain data requires professional knowledge and a lot of time, which cannot be met in practical applications. (2) Directly matching all features of the source and target domains to reduce data distribution differences will result in different samples of the same class being matched to different categories in another domain, leading to poor accuracy of the fault diagnosis model.
[0003] Yanshan University proposed a cross-domain bearing fault diagnosis method based on a multi-representation adaptive network in its patent application document "A Cross-Domain Bearing Fault Diagnosis Method Based on Multi-Representation Adaptive Network" (Patent Application No.: CN 202311364218.0, Publication No.: CN 117606801 A). The implementation steps of this method are as follows: (1) Collect the original vibration signals under different working conditions, and preprocess the collected signals to obtain source domain datasets and target domain datasets, which are divided into training data and test data for the source domain and target domain, respectively; (2) Construct a multi-representation adaptive network model, input the training data of the source domain and target domain into the model, extract the multiple representations of the source domain and target domain, minimize the joint distribution difference between the source domain and target domain based on the joint maximum mean difference and pseudo-label, thereby extracting the domain-invariant features of the source domain and target domain, and finally forming the domain joint distribution adaptive; (3) Input the test data into the trained feature extraction model to obtain the bearing fault diagnosis results. The drawback of this method is that it requires all the labels of the source domain training data to train the multi-representation adaptive network model, which makes the model performance dependent on a large number of labels and difficult to apply in practice.
[0004] Chongqing University of Posts and Telecommunications proposed a cross-domain bearing fault diagnosis method based on MSCNN-ACGAN in its patent application document "Transfer Learning Rolling Bearing Fault Diagnosis Method Based on MSCNN-ACGAN" (Patent Application No.: 202411098198.1, Publication No.: CN 118981683A). The implementation steps of this method are as follows: (1) Use sensors to collect rolling bearing fault vibration signals under different conditions, obtain signal samples, and perform preprocessing including non-overlapping moving average cutting and standardization; (2) Build a multi-scale convolutional neural network MSCNN, an auxiliary classifier generative adversarial network ACGAN, and a subdomain adaptive network; (3) Input the source domain signals and their corresponding labels into the network built in (2) for training, perform feature extraction, and generate a supplementary dataset of the source domain; (4) After the multi-scale convolutional neural network MSCNN and the auxiliary classifier generative adversarial network ACGAN are trained, use the subdomain adaptive network to perform rolling bearing fault diagnosis under multiple working conditions. The drawback of this method is that, while it aims to reduce the distributional differences between source and target domain data by making the covariance matrices of source and target domain features as similar as possible, it does not consider the semantic similarity of categories between the source and target domains, which can lead to incorrect matching between features of different categories with small differences. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of the existing technology by proposing a cross-domain bearing fault diagnosis method based on prototype contrastive learning. This method solves the problems of low fault diagnosis accuracy due to erroneous feature matching and heavy reliance on a large number of source domain labels in traditional cross-domain bearing fault diagnosis.
[0006] The core idea of this invention is to divide the features of training samples from the source and target domains into different clusters through clustering learning. Intra-domain prototype contrastive learning enhances the discriminative power of features within each cluster, while cross-domain prototype contrastive learning matches features from the source and target domains on a cluster-by-cluster basis, ensuring that features within the same cluster are matched to the same feature in another cluster, thereby improving the accuracy of cross-domain bearing fault diagnosis. Clustering is an unsupervised learning method in machine learning and data mining that divides samples into several clusters based on a certain similarity metric, resulting in high similarity among samples within the same cluster and low similarity between samples from different clusters. In this invention, the features of the source and target domains are respectively clustered using K-means to obtain several clusters. Each cluster is considered a category, represented by a centroid vector, i.e., the prototype of each category. Based on this, intra-domain prototype contrastive learning brings each feature in the domain closer to the prototype within the same cluster and further away from other clusters, thereby reducing the number of cluster boundary features, lowering the probability of feature misclassification, and making the features discriminative. Cross-domain prototype contrastive learning takes into account the semantic similarity between categories, matching features from the source and target domains in clusters to avoid features from the same cluster matching different clusters in another domain. This aligns features between the source and target domains, improving the accuracy of cross-domain fault diagnosis. Therefore, this invention accurately matches features between the source and target domains by performing clustering learning, intra-domain prototype contrastive learning, and cross-domain prototype contrastive learning on features from both domains, thus improving fault diagnosis accuracy. Furthermore, this invention uses pseudo-labeled samples from both the source and target domains to assist in training the classifier, thereby reducing the fault diagnosis model's dependence on source domain labels. After training the classifier with a small number of labeled samples in the source domain training set, predictions are made on other unlabeled samples in both the source and target domain training sets. Features of samples with prediction probabilities higher than a threshold are selected, and the average value of these features is used to update the classifier's classification weights, thus training a high-precision fault diagnosis model even in the absence of labels. Therefore, using pseudo-labeled samples to assist in training the cross-domain fault diagnosis model can reduce the model's dependence on labels.
[0007] The specific steps to achieve the objective of this invention are as follows:
[0008] Step 1: Generate a cross-domain training set for the source and target domains based on the original training set;
[0009] Step 2: Train a cross-domain bearing fault diagnosis network based on prototype comparative learning:
[0010] Step 2.1: Construct a cross-domain bearing fault diagnosis network consisting of a residual sub-network and a classifier connected in series. Input the cross-domain training set into the residual sub-network and use K-means clustering to divide the features output by the residual sub-network into different clusters.
[0011] Step 2.2: Using cross-domain prototype contrastive learning, features of the same cluster in the source and target domains are matched to the same cluster in another domain;
[0012] Step 2.3: Update the classification weights of the classifier based on the pseudo-labels;
[0013] Step 2.4: Use stochastic gradient descent to iteratively update the network parameters until the loss function converges, and obtain the trained cross-domain bearing fault diagnosis network.
[0014] Step 3: Input the sample of the cross-domain bearing to be diagnosed into the trained cross-domain bearing fault diagnosis network, and output the cross-domain bearing fault diagnosis results.
[0015] Furthermore, the steps for generating the original training set are as follows:
[0016] The first step is to select at least two working conditions that are the same in category, and each working condition contains at least 3 categories;
[0017] The second step is to use the sliding window technique to cut the bearing vibration signal of each category into at least 210 one-dimensional time series data, and to normalize each one-dimensional time series data to form a sample set.
[0018] The third step is to randomly select 210 samples from each category of the sample set for each working condition to form the original training set for each working condition.
[0019] Furthermore, different operating conditions refer to the different working conditions under which a bearing operates at different speeds or under different load conditions.
[0020] Further, the steps for generating the cross-domain training set are as follows: arbitrarily select two operating conditions in the original training set as the source domain and the target domain, respectively. Select up to 60 samples from each category in the original training set of the source domain and label them with fault type to form the labeled training set of the source domain; the remaining samples in the original training set are the unlabeled training set of the source domain. Combine the labeled training set of the source domain, the unlabeled training set of the source domain, and the original training set of the target domain to form the cross-domain training set.
[0021] Furthermore, the structure of the residual sub-network is as follows: convolutional layer, ReLU activation layer, pooling layer, first residual layer, second residual layer, third residual layer, fourth residual layer, global average pooling layer, and fully connected layer; the number of convolutional kernels in the convolutional layer is set to 64, the kernel size is set to 1×7, the ReLU activation layer is implemented using the ReLU function, the pooling kernel size in the pooling layer is set to 1×3, the pooling stride is set to 1×2, and the first to fourth residual layers each contain two convolutional layers with the same number of kernels, with the number of kernels set to 64, 128, 256, and 512 respectively.
[0022] Furthermore, the use of K-means clustering to divide the features output by the residual subnetwork into different clusters means that K-means clustering is used to group similar features in the source and target domains into the same cluster, with one cluster corresponding to one category. The category prototype is calculated from the average of all features within the cluster.
[0023]
[0024] in, This represents the result of K-means clustering of the k-th cluster in the source domain. The prototype, Indicates belonging to The sample characteristics.
[0025] Furthermore, the step of using cross-domain prototype contrastive learning to match features of the same cluster in the source and target domains to the same cluster in another domain is as follows:
[0026] The first step is to perform intra-domain prototype comparison learning for each feature in the source and target domains and all cluster prototypes in the same domain, so that each sample is close to the prototype of its own cluster and far away from the prototypes of other clusters, thereby reducing the number of features on the boundaries between clusters in each domain.
[0027] The second step is to perform cross-domain prototype comparison learning by matching the source domain and the target domain on a cluster basis. This ensures that each feature in one domain matches the prototype of its own cluster to the same cluster prototype in another domain, thus guaranteeing that features from the same cluster match the same cluster in another domain.
[0028] Furthermore, the method of updating the classification weights of the classifier based on pseudo-labels refers to inputting the features of the unlabeled training set in the source domain and the original training set in the target domain into the classifier, obtaining the class prediction probability of each sample feature, assigning features with a selection probability greater than 0.95 to pseudo-labels, obtaining the original classification weights of the classifier, calculating the average feature value of the pseudo-labeled samples, and updating the classification weights using the following formula:
[0029]
[0030] Where w(c)' represents the updated classification weight of the c-th category, c = 1, 2, ..., n, w(c) represents the original classification weight of the c-th category, α represents the momentum parameter with a value of 0.9, and f i This represents the sample features of the pseudo-label assigned to the c-th category.
[0031] Furthermore, the loss function is as follows:
[0032]
[0033] in, Represents the i-th feature in the source domain With the j-th cluster prototype in the target domain The contrast loss is calculated between the two clusters, where j ranges from [1, n] and n represents the total number of clusters; exp(·) represents mapping the input value to a positive range. Indicates calculation and The similarity between them, where τ represents the temperature parameter, and the value is set to 0.05, L total Represents the loss function. Let B represent the k-th cluster prototype in the target domain, where k ranges from [1, n]. Let B represent the batch size, set to 128. express The prototype of its cluster The comparison loss between them, where r takes values in the range [1, n]; Representing target domain features The prototype of its cluster The contrast loss between them; express The comparison loss distribution vector is calculated with all cluster prototypes in the target domain. express The comparison loss distribution vector is calculated with all cluster prototypes in the target domain. express The loss distribution vector compared with all cluster prototypes in the source domain. express The loss distribution vector compared with all cluster prototypes in the source domain. This represents the output of the classifier. The predicted probability of the category. express The true label is , where log represents the logarithmic operation to the base 10.
[0034] Compared with the prior art, the present invention has the following advantages:
[0035] First, this invention uses K-means clustering to divide the features of the source domain and the target domain into different clusters. It improves the feature discriminativeness of each cluster through intra-domain prototype contrastive learning and matches the features of the source domain and the target domain on a cluster-by-cluster basis. This allows the features of the same cluster to be matched to the same cluster in another domain, overcoming the shortcomings of existing technologies that directly match the features of the source domain and the target domain, resulting in low model accuracy. This invention has the advantage of accurately matching the features of the source domain and the target domain, thereby improving the accuracy of cross-domain bearing fault diagnosis.
[0036] Second, this invention selects pseudo-label samples based on the predicted probabilities of unlabeled samples in the training sets of the source and target domains, and updates the classification weights of the classifier by using the average feature value of the pseudo-label samples. This overcomes the shortcomings of existing technologies that rely heavily on a large number of source domain labels, enabling this invention to achieve high accuracy in cross-domain bearing fault diagnosis while using fewer source domain labels, making it more suitable for practical industrial application scenarios. Attached Figure Description
[0037] Figure 1 This is a flowchart of an embodiment of the present invention;
[0038] Figure 2 This is a framework diagram of the cross-domain bearing fault diagnosis network constructed in this invention;
[0039] Figure 3 This is a structural diagram of the residual subnetwork used in this invention. Detailed Implementation
[0040] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0041] Reference Figure 1 The specific implementation steps of the embodiments of the present invention will be described in further detail below.
[0042] Step 1: Generate a cross-domain training set for the source and target domains based on the original training set.
[0043] The dataset used in the embodiments of the present invention is the HUST-Bearing dataset from Huazhong University of Science and Technology. This dataset includes four speed conditions (65Hz, 70Hz, 75Hz, and 80Hz), and each condition includes nine types of bearing vibration signals from 0 to 8.
[0044] The steps to generate the original training set are as follows:
[0045] The first step is to select at least two operating conditions of the same category, with each operating condition containing at least three categories. Different operating conditions refer to the different working conditions under which the bearing operates at different speeds or under different load conditions.
[0046] The second step is to use the sliding window technique to cut the bearing vibration signal of each category into 300 one-dimensional time series data, and to normalize each one-dimensional time series data to form a sample set.
[0047] Normalize each sample in the sample set according to the following formula.
[0048]
[0049] Where, x jLet x represent the j-th one-dimensional time series data. j After normalization, we get x' j x jmin Indicates the composition of x j The minimum value of the data points, x jmax Indicates the composition of x j The maximum value of the data points.
[0050] The third step is to randomly select 210 samples from each category of the sample set for each working condition to form the original training set for each working condition.
[0051] The steps to generate a cross-domain training set based on the original training set are as follows: Randomly select two operating conditions from the original training set as the source domain and the target domain, respectively. Select at most 60 samples from each category in the original source domain training set and label them with fault type tags to form the labeled training set for the source domain. The remaining samples in the original training set constitute the unlabeled training set for the source domain. Combine the labeled training set, the unlabeled training set, and the original target domain training set to form the cross-domain training set.
[0052] Step 2: Construct a cross-domain bearing fault diagnosis network.
[0053] Reference Figure 2 The cross-domain bearing fault diagnosis network constructed in this invention will be further described.
[0054] The cross-domain bearing fault diagnosis network is composed of a residual subnetwork and a classifier connected in series.
[0055] In the embodiments of this invention, the residual subnetwork is a one-dimensional residual neural network using existing technology, and its structure is as follows: convolutional layer, ReLU activation layer, first pooling layer, first residual layer, second residual layer, third residual layer, fourth residual layer, global average pooling layer, and fully connected layer, as shown below. Figure 3 As shown in (a), the fully connected layer serves as a classifier.
[0056] The structure of the first to fourth residual layers is as follows: first convolutional layer, first batch normalization layer, ReLU activation layer, second convolutional layer, second batch normalization layer, as shown below. Figure 3 As shown in (b).
[0057] The parameters for the one-dimensional residual neural network are set as follows:
[0058] The number of convolutional kernels in the convolutional layer is set to 64, the kernel size is set to 1×7, the kernel size of the first pooling layer is set to 1×3, and the pooling stride is set to 1×2. Among them, the number of convolutional kernels in the first and second convolutional layers in the first to fourth residual layers is equal, and the number of convolutional kernels is set to 64, 128, 256 and 512 respectively, and the kernel size is set to 1×3 for each.
[0059] Step 3: Train the cross-domain bearing fault diagnosis network.
[0060] Choose any two operating conditions as the source domain and target domain, respectively. Use 90 samples from each category's sample set (excluding the original training set) as the test set. The source domain, represented by the labeled training set, is... Represents the i-th sample in the source domain The labels, the source domain unlabeled training set is represented as The original training set of the target domain is represented as N sl Set to 60, N su Set to 150, N t Set it to 210.
[0061] The original training set D in the source domain s ={D sl D su} and the original training set D of the target domain t The input is fed into the cross-domain bearing fault diagnosis network built in step 2. Features are extracted through a one-dimensional residual neural network to obtain the source domain feature set. and target domain feature set Use K-means clustering to analyze F s Source domain features and F t The target domain features are divided into n clusters, where n refers to the number of fault categories. After K-means clustering, F... s Divided into n clusters F t Divided into n clusters any cluster This can be viewed as a category, whose prototype is represented by the average of all features within the cluster.
[0062] Intra-domain prototype contrastive learning refers to the process where each sample in the source or target domain is made as close as possible to the prototype of its own cluster, while moving away from the prototypes of other clusters within the same domain. This reduces the number of samples at the boundaries between clusters in each domain and lowers the probability of classification errors.
[0063] The in-domain prototype comparison loss is as follows:
[0064]
[0065] in, Represents the i-th feature in the source domain The prototype of its cluster The contrast loss is calculated between the two values, where r ranges from [1, n], n represents the total number of clusters, and exp(·) represents mapping the input values to a positive range. Indicates calculation and The similarity between them, where τ represents the temperature parameter, and the value is set to 0.05. Let L represent the k-th cluster prototype in the source domain, where k takes values in the range [1, n]. In This represents the in-domain prototype contrastive loss function, where B represents the batch size, set to 128. Representing target domain features The prototype of its cluster The difference between the two is the loss, where log represents the logarithmic operation to the base 10.
[0066] Cross-domain prototype contrastive learning will use each sample x in the source or target domain. i Match x with the prototype of each cluster in another domain and compute the contrastive loss distribution vector; i The prototype p of the cluster to which it belongs r The contrastive loss distribution vector is calculated by matching it against the prototype of each cluster in another domain. i With p r If they belong to the same cluster, they should match the prototype of the same cluster in another domain. Therefore, the cross-domain prototype contrast loss of the source domain and the cross-domain prototype contrast loss of the target domain are calculated based on the contrast loss distribution vector.
[0067] The cross-domain prototype contrast loss between the source and target domains is as follows:
[0068]
[0069] Among them, L Cross This represents the sum of cross-domain prototype contrast losses between the source and target domains. express The comparison loss distribution vector is calculated with all cluster prototypes in the target domain. express The comparison loss distribution vector is calculated with all cluster prototypes in the target domain. express The loss distribution vector compared with all cluster prototypes in the source domain. express The loss distribution vector compared with all cluster prototypes in the source domain.
[0070] D sl Input the features and labels of the source domain into the classifier and calculate the classification loss. Input the unlabeled training set D from the source domain. su and the original training set D of the target domain tThe features are input into the classifier, and the classifier outputs the predicted probability of each sample feature. A threshold of 0.95 is set to select high-confidence features for pseudo-labeling. The original classification weights of the classifier are obtained, the feature average of the pseudo-label samples is calculated, and the classification weights are updated using the following formula:
[0071]
[0072] Where w(c)' represents the updated classification weight of the c-th category, c = 1, 2, ..., n, w(c) represents the original classification weight of the c-th category, α represents the momentum parameter with a value of 0.9, and f i This represents the sample features of the pseudo-label assigned to the c-th category.
[0073] The classification loss function is as follows:
[0074]
[0075] Among them, L c Represents classification loss. This represents the output of the classifier. The predicted probability of the category. express The true label.
[0076] The overall loss function L of the cross-domain bearing fault diagnosis network total Calculated by the following formula:
[0077] L total =L In +L Cross +L c
[0078] Step 4: Diagnose the fault samples of the cross-domain bearing.
[0079] The test set of the target domain is input into the trained cross-domain bearing fault diagnosis network, and the cross-domain bearing fault diagnosis results are output.
[0080] The effects of this invention will be further illustrated below with simulation experiments:
[0081] 1. Simulation experimental conditions.
[0082] The hardware platform for the simulation experiment of this invention is: Intel(R) Xeon(R) Platinum 8272CL processor with a main frequency of 2.60GHz and 256GB of memory.
[0083] The software platform for the simulation experiment of this invention is: Ubuntu 18.04 operating system and Python 3.9.
[0084] The dataset used in the simulation experiments of this invention comes from the HUST Bearing public dataset from Huazhong University of Science and Technology. This dataset has four rotational speed conditions: 65Hz (condition A), 70Hz (condition B), 75Hz (condition C), and 80Hz (condition D), and nine health states: normal (N), moderate inner ring fault (MIF), severe inner ring fault (SIF), moderate outer ring fault (MOF), severe outer ring fault (SOF), moderate rolling element fault (MBF), severe rolling element fault (SBF), moderate combined outer and inner ring fault (MCF), and severe combined outer and inner ring fault (SCF). All faults are pre-set by the user, and the vibration signal for each health state contains 262,144 data points.
[0085] 2. Simulation content and result analysis.
[0086] The simulation experiments of this invention involve training and testing models on the HUSTBearing dataset using this invention and three existing technologies (DANN, DCORAL, and MMSD), respectively, to obtain the test results for the four methods. The simulation experiments consisted of a total of 150 training epochs, a learning rate of 0.001, and the Adam optimizer.
[0087] The three existing technologies used in the simulation experiment are:
[0088] The existing technology DANN refers to a domain adversarial training method proposed by Ganin et al. in their paper "Domain-adversarial training of neural networks. 2016", abbreviated as DANN.
[0089] The existing technology DCORAL refers to a method proposed by Sun et al. in their paper "Deep coral: Correlationalignment for deep domain adaptation. 2016", which measures the difference between the source domain and the target domain.
[0090] The existing technology MMSD refers to a method proposed by Qian et al. in their paper "Maximum mean square discrepancy: a new discrepancy representation metric for mechanical fault transfer diagnosis. 2023", which measures the difference between the source and target domains.
[0091] To verify the effectiveness of the simulation experiment of this invention, the fault diagnosis effects of the four methods were evaluated using accuracy, and the calculation results of all evaluations were plotted in Table 1.
[0092] Table 1. Summary of training results of the present invention and three prior art technologies in the simulation experiment.
[0093]
[0094]
[0095] As shown in Table 1, DANN reduces the difference between the source and target domains by creating an adversarial relationship between the feature extractor and the domain classifier, thus confusing the samples from both domains. Its fault diagnosis accuracy is generally higher than DCORAL. DCORAL and MMSD design a new metric to measure the difference between the source and target domains, aiming to reduce this difference and directly align the features of the source and target domains. MMSD is an improvement on the maximum mean difference, and its fault diagnosis accuracy is higher than DCORAL. The method of this invention is based on cross-domain prototype contrastive learning, matching features of the source and target domains on a cluster basis, rather than directly matching features from both domains. This ensures that features from the same cluster are matched to the same cluster in the other domain. Furthermore, updating the classifier weights based on pseudo-labeled samples reduces the method's dependence on labels. The method of this invention achieves the highest accuracy across all tasks, demonstrating that it improves the accuracy of the fault diagnosis model.
Claims
1. A cross-domain bearing fault diagnosis method based on prototype contrast learning, characterized in that, The features of the training set samples in the source domain and the target domain are divided into different clusters using cluster learning, the features of the same cluster are matched to the same cluster in another domain based on prototype contrast learning, and the classification weights of the classifier are updated based on the feature average value of the pseudo-label samples, and the steps of the method include the following: Step 1, generating a cross-domain training set of the source domain and the target domain based on the original training set; The generation steps of the original training set are as follows: First step, select at least two working conditions with the same class, and each working condition contains at least three categories; Second step, using the sliding window technology, cutting the bearing vibration signal of each category into at least 210 one-dimensional time sequence data, and performing normalization operation on each one-dimensional time sequence data to form a sample set; Third step, randomly selecting 210 samples in each category sample set of each working condition to form an original training set of each working condition; Step 2, training the cross-domain bearing fault diagnosis network based on prototype contrast learning: Step 2.1, constructing a cross-domain bearing fault diagnosis network composed of a residual sub-network and a classifier in series, inputting the cross-domain training set into the residual sub-network, and using K-means clustering to divide the features output by the residual sub-network into different clusters; The structure of the residual sub-network is in turn: convolutional layer, ReLu activation layer, pooling layer, first residual layer, second residual layer, third residual layer, fourth residual layer, global average pooling layer, and fully connected layer; The structure of the first to fourth residual layers is: first convolutional layer, first batch normalization layer, ReLu activation layer, second convolutional layer, and second batch normalization layer; The number of convolutional kernels of the convolutional layer is set to 64, and the size of the convolutional kernel is set to 1x7, the ReLu activation layer uses ReLu function to realize, the size of the pooling kernel of the pooling layer is set to 1x3, and the pooling step is set to 1x2, the number of convolutional kernels of the first and second convolutional layers in the first to fourth residual layers is equal, and the number of convolutional kernels is set to 64, 128, 256 and 512 in turn, and the size of the convolutional kernel is set to 1x3; Step 2.2, using cross-domain prototype contrast learning to match the features of the same cluster in the source domain and the target domain to the same cluster in another domain; Step 2.3, updating the classification weights of the classifier based on pseudo-labels; Step 2.4, using the stochastic gradient descent method to iteratively update the network parameters until the loss function converges, and obtaining the trained cross-domain bearing fault diagnosis network; Step 3, inputting the sample of the cross-domain bearing to be fault diagnosed into the trained cross-domain bearing fault diagnosis network, and outputting the result of the cross-domain bearing fault diagnosis.
2. The cross-domain bearing fault diagnosis method based on the prototype contrast learning of claim 1, wherein, Different working conditions refer to different working conditions of the bearing under different rotating speeds or different load conditions.
3. The cross-domain bearing fault diagnosis method based on the prototype contrast learning of claim 1, wherein, The normalization operation is completed by the following formula: ; wherein, the normalized first one-dimensional time series data, represents the first one-dimensional time series data, represents the minimum value in the first one-dimensional time series data, represents the maximum value in the first one-dimensional time series data.
4. The cross-domain bearing fault diagnosis method based on the prototype contrast learning of claim 1, wherein, The generation step of the cross-domain training set in step 1 is as follows: two working conditions are randomly selected from the original training set as the source domain and the target domain, at most 60 samples of each class in the source domain original training set are selected and labeled with fault type to form the source domain labeled training set; the remaining samples in the original training set are the source domain unlabeled training set; the source domain labeled training set, the source domain unlabeled training set and the target domain original training set form the cross-domain training set.
5. The cross-domain bearing fault diagnosis method based on the prototype contrast learning of claim 1, wherein, The step of using K-means clustering to divide the features output by the residual subnetwork into different clusters in step 2.1 means that similar features in the source domain and the target domain are divided into the same cluster by using K-means clustering respectively, one cluster corresponds to one class, and the class prototype is calculated by the average value of all features in the cluster: ; wherein, represents a prototype of the i-th cluster in the source domain obtained by K-means clustering, represents a prototype of the i-th cluster in the source domain obtained by K-means clustering, represents a prototype of the i-th cluster in the source domain obtained by K-means clustering, represents a prototype of the i-th cluster in the source domain obtained by K-means clustering, represents a prototype of the i-th cluster in 6. The cross-domain bearing fault diagnosis method based on the prototype contrast learning of claim 1, wherein, The step of using cross-domain prototype contrast learning to match the features of the same cluster in the source domain and the target domain to the same cluster in the other domain in step 2.2 is as follows: First, for each feature in the source domain and the target domain, the intra-domain prototype contrast learning is performed with all cluster prototypes in the same domain, so that each sample is close to the prototype of the cluster to which it belongs and far away from the prototypes of other clusters, reducing the number of features on the boundary between clusters in each domain; Second, match the source domain and the target domain in the cluster unit to perform cross-domain prototype contrast learning, so that each feature in one domain matches the prototype of the cluster to which it belongs to the prototype of the same cluster in the other domain, ensuring that the features of the same cluster are matched to the same cluster in the other domain.
7. The prototype contrastive learning based cross-domain bearing fault diagnosis method according to claim 1, characterized in that, The classification weight of the classifier based on the pseudo label in step 2.3 is that the features of the source domain unlabeled training set and the target domain original training set are input into the classifier to obtain the class prediction probability of each sample feature, and the features with a selection probability greater than 0.95 are assigned to the pseudo label; the original classification weight of the classifier is obtained, the average value of the features of the pseudo label samples is calculated, and the classification weight is updated by using the following formula: ; wherein, represents the updated classification weight of the i-th class, represents the classification weight of the i-th class, represents the classification weight of the i-th class, represents the classification weight of the i-th class, represents a momentum parameter, taking a value of 0.9, represents a sample feature belonging to the i-th class, represents a sample feature belonging to the i-th class.
8. The cross-domain bearing fault diagnosis method based on the prototype contrast learning of claim 1, wherein, The loss function in step 2.4 is as follows: ; ; in, Indicates the first in the source domain Features With the first in the target domain Cluster prototype The difference in loss between them The range of values for is [1, ...]. ], Indicates the total number of clusters; This means mapping the input value to a range of positive numbers. Indicates calculation and Similarity between them This represents the temperature parameter, with a value set to 0.
05. Represents the loss function. Indicates the first in the target domain A cluster prototype, The range of values for is [1, ...]. ], This indicates the batch size; the value is set to 128. express The prototype of its cluster The difference in loss between them The range of values for is [1, ...]. ]; Representing target domain features The prototype of its cluster The contrast loss between them; express The comparison loss distribution vector is calculated with all cluster prototypes in the target domain. express The comparison loss distribution vector is calculated with all cluster prototypes in the target domain. express The loss distribution vector compared with all cluster prototypes in the source domain. express The loss distribution vector compared with all cluster prototypes in the source domain. This represents the output of the classifier. The predicted probability of the category. express The true label, This represents a logarithmic operation with base 10.
Citation Information
Patent Citations
Cross-domain bearing fault diagnosis method based on multi-representation adaptive network
CN117606801A
Migration learning rolling bearing fault diagnosis method based on MSCNN-ACGAN
CN118981683A
Rolling bearing fault diagnosis method based on few-label data feature migration
CN113988126A