A method for constructing a bearing fault diagnosis model
By constructing a bearing fault diagnosis model that includes an operating condition attribute encoding layer and a multi-scale cascaded attention module, the problem of low diagnostic accuracy under varying operating conditions is solved, and more accurate fault identification and classification are achieved.
Patent Information
- Application Number
- CN202311092036.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-28
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-08-28
AI Technical Summary
Existing bearing fault diagnosis models have low accuracy and reliability under varying operating conditions and cannot effectively distinguish fault characteristics under different operating conditions.
A bearing fault diagnosis model is constructed by acquiring bearing vibration signal training data, introducing a working condition attribute encoding layer and a multi-scale cascaded attention module, and using a quadruplet loss function and a three-stage training process to gradually improve feature extraction and classification capabilities.
It improves the accuracy and reliability of bearing fault diagnosis, enables better extraction and identification of fault features under varying operating conditions, and enhances the model's generalization ability and fault classification performance.
Smart Images

Figure CN117056707B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of bearing fault diagnosis, and particularly relates to a bearing fault diagnosis model construction method. BACKGROUND
[0002] Bearing, as a very important part in modern mechanical equipment, is widely used. At present, with the rapid development of modern industrial technology, various machine tools are developing towards precision, automation and large-scale. Once the various bearing parts play an important role, the running of the machine tool will be affected, which may increase the product rejection rate, reduce the precision of the product, cause the machine tool to be damaged and stop, delay the work period, cause great economic loss, and even endanger the life safety of workers. Therefore, it is of great significance to explore and develop a method which can quickly and accurately diagnose bearing faults in various production scenes.
[0003] Since the bearing vibration signal contains a large amount of bearing state information, the bearing fault diagnosis method based on vibration signal has been widely concerned by researchers.
[0004] The existing variable working condition fault diagnosis model training sample usually includes the data of each working condition without distinction, and the model is usually obtained by one-time training and optimization of the fault model. Therefore, the fault diagnosis model obtained by the fault diagnosis model construction method of the prior art usually has low diagnosis accuracy and reliability. SUMMARY
[0005] In view of the above analysis, the embodiments of the present application aim to provide a bearing fault diagnosis model construction method to solve the problem of low diagnosis accuracy and reliability of the fault diagnosis model obtained by the existing method.
[0006] The main purpose of the present application is achieved by the following technical solutions:
[0007] The present application provides a bearing fault diagnosis model construction method, comprising:
[0008] Step 1, obtaining bearing vibration signal training data at several time points to construct four time sequence training data sets with the same length; wherein the training data includes bearing working condition attributes, bearing vibration data and bearing fault category labels;
[0009] Step 2, constructing four-tuple sample pairs according to the four time sequence training data sets with the same length;
[0010] Step 3, the data input layer receives the four-tuple sample pairs to preliminarily train a feature extractor model to obtain a preliminarily trained feature extractor model; wherein the feature extractor model comprises a feature extraction layer and a feature extractor tail;
[0011] Step 4, the data input layer receives the four-tuple sample pair to simultaneously train the feature extractor model preliminarily trained in step 3 and the bearing fault diagnosis model, and obtains a trained feature extraction layer; wherein the bearing fault diagnosis model comprises a data input layer, a feature extraction layer shared with the feature extractor model, and a fault classifier tail;
[0012] Step 5, the data input layer receives at least one time series training data set to train the fault classifier tail of the bearing fault diagnosis model trained in step 4, and obtains a trained fault classifier tail; based on the data input layer, the feature extraction layer trained in step 4, and the fault classifier tail trained in step 5, a trained bearing fault diagnosis model is obtained.
[0013] Further, the feature extraction layer comprises a data fusion layer and a plurality of multi-scale cascade group attention modules connected in sequence;
[0014] The data fusion layer is used to obtain fused feature encoding data based on bearing working condition attributes and bearing vibration data;
[0015] The number of multi-scale cascade group attention modules is obtained by training; each multi-scale cascade group attention module comprises a multi-scale segmentation layer and a cascade group attention module layer, and is used to fuse and output the fused feature encoding data after multi-scale segmentation;
[0016] The feature extractor tail comprises a full connection layer, which is used to output the extracted features;
[0017] The fault classifier tail comprises a full connection layer, which is used to output the fault category.
[0018] Further, the data fusion layer comprises a working condition attribute encoding layer, a vibration data embedding layer, and a position embedding layer;
[0019] The working condition attribute encoding layer comprises a full connection layer and an activation layer, and is used to encode the bearing working condition attributes in the data received by the data input layer to obtain a bearing working condition attribute encoding value;
[0020] The vibration data embedding layer comprises a full connection layer and an activation layer, and is used to encode and embed the bearing vibration data in the data received by the data input layer to obtain a vibration data embedding value;
[0021] The position embedding layer is used to multiply the vibration data encoding value obtained by multiplying the bearing working condition attribute encoding value and the vibration data embedding value by position, and add the position weight matrix to obtain the feature encoding data, wherein the position weight matrix is calculated by a position vector in the data received by the data input layer through a sine and cosine function.
[0022] Further, the multi-scale segmentation layer is used to segment data input into the multi-scale segmentation layer into two groups of half-scale feature transformation data and one group of original-scale feature transformation data.
[0023] The cascade group attention module layer includes three heads of attention modules and a splicing mapping layer, wherein the first head of attention module is used to perform self-attention calculation on the first group of half-scale feature transformation data to obtain a calculation result o1.
[0024] The second head of attention module is used to perform self-attention calculation on the calculation result o1 and the second group of half-scale feature transformation data after bit-by-bit addition.
[0025] The third head of attention module is used to splice the calculation result o1 and the calculation result o2 to obtain a calculation result o3; and perform self-attention calculation on the calculation result o3 and the original-scale feature transformation data after bit-by-bit addition to obtain a calculation result o4.
[0026] The splicing mapping layer is used to splice the calculation result o1 and the calculation result o2, and then perform bit-by-bit addition with the calculation result o4 to obtain output data of the multi-scale cascade group attention module.
[0027] Further, the bearing vibration signal training data at the plurality of time points is used to construct four time sequence training data sets with the same length, including:
[0028] (1) constructing a group of time sequence training data sets from bearing vibration signal training data of the same fault category under different working conditions;
[0029] (2) constructing another group of time sequence training data sets from bearing vibration signal training data of the same fault category under the same working condition;
[0030] (3) constructing another group of time sequence training data sets from bearing vibration signal training data of different fault categories under different working conditions;
[0031] (4) constructing another group of time sequence training data sets from bearing vibration signal training data of different fault categories under the same working condition.
[0032] Further, the four-tuple sample pair is constructed, including the following steps:
[0033] S101, randomly selecting a time sequence training data set from the four time sequence training data sets as an anchor point a;
[0034] S102. Select another time series training dataset of vibration data of the same fault category as anchor point a from the four time series training datasets as positive sample p;
[0035] S103. Select one time series training dataset of vibration data with a different fault category from anchor point a from the four time series training datasets as negative sample n1.
[0036] S104. From the four time series training datasets, select another time series training dataset of vibration data with a different fault category than anchor point a as negative sample n2.
[0037] Furthermore, the data input layer receives the quadruple sample pairs to perform preliminary training on the feature extractor model, obtaining a pre-trained feature extractor model, including:
[0038] Load the quadruplet sample pairs, train the feature extractor model using the quadruplet loss function, update the feature extraction layer parameters and the tail parameters of the feature extractor using gradient backpropagation, and save the feature extraction layer parameters and the tail parameters of the feature extractor after training.
[0039] The further data input layer receives the quadruple sample pairs and simultaneously trains the feature extractor model and the bearing fault diagnosis model, including:
[0040] Load the quadruplet sample pairs, and simultaneously train the feature extractor model and the bearing fault diagnosis model using a weighted combination of the quadruplet loss function and the multi-classification loss function. Update the feature extraction layer parameters, the tail parameters of the feature extractor, and the tail parameters of the fault classifier using gradient backpropagation. After training, save the feature extraction layer parameters, the tail parameters of the feature extractor, and the tail parameters of the fault classifier.
[0041] Furthermore, the data input layer receives at least one time-series training dataset to train the tail of the fault classifier of the bearing fault diagnosis model, including:
[0042] Load the training dataset, fix the weight parameters of the feature extraction layer, train the fault classifier tail of the bearing fault diagnosis model using a multi-class loss function, update the fault classifier tail parameters using gradient backpropagation, save the fault classifier tail parameters after training, and obtain the final bearing fault diagnosis model based on the data input layer, the feature extraction layer, and the fault classifier tail.
[0043] Furthermore, the quadruple loss function is calculated using the following formula:
[0044] L q =(da,p -d a,n1 +α) + +(d a,p -d n1,n2 +β) +
[0045] wherein, d a,p is the distance between the anchor point a and the positive sample p in the four-tuple sample pair; d a,n1 is the distance between the anchor point a and the negative sample n1 in the four-tuple sample pair; d n1,n2 is the distance between the negative sample n1 and the negative sample n2 in the four-tuple sample pair; and α and β are hyperparameters.
[0046] The multi-classification loss function comprises a softmax activation function and a cross-entropy loss function.
[0047] Compared with the prior art, the present application can achieve at least one of the following beneficial effects:
[0048] 1. In the technical scheme of the present application, the working condition information is integrated into the vibration data when constructing the bearing fault diagnosis model, and the working condition attribute coding layer is introduced to achieve the effect of working condition decoupling. This reduces the interference of vibration data under variable working conditions, so that the model trained is more focused on the features related to faults in the vibration data. Through working condition decoupling, the model trained can more accurately extract and identify fault features, improving the accuracy and reliability of fault diagnosis in the application process.
[0049] 2. The technical scheme of the present application improves the multi-head attention module in the Transformer structure and introduces a multi-scale cascaded group attention module layer. This makes the model structure better able to extract key features. The multi-scale cascaded group attention module layer can capture features of different scales through the multi-head attention mechanism and cascaded design, and realize multi-level interaction and information transmission in the feature extraction process. Such an improvement in feature extraction capability helps to more accurately distinguish different fault categories in application, improving the performance of fault diagnosis.
[0050] 3. The technical scheme of the present application introduces a four-tuple loss function for training in the training process. Through self-supervised learning, the domain-invariant representation of the sample is learned through the comparison of intra-class and inter-class distances between samples. This can improve the discriminability of the features, so that the model trained can better distinguish different categories of vibration data.
[0051] 4. The technical scheme of the present application uses a three-stage training process in the training process. The feature extractor and the bearing fault diagnosis model are trained respectively, gradually improving the feature representation capability and fault diagnosis performance of the model. Through this training method, the model can better learn the features of the vibration data and apply them to accurate fault classification.
[0052] In the present application, the above technical solutions can be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present application will be described in the subsequent specification, and some advantages will become apparent from the specification, or will be understood by those skilled in the art through implementation of the present application. The objects and other advantages of the present application can be achieved and obtained through the contents specifically indicated in the specification and the drawings. BRIEF DESCRIPTION OF DRAWINGS
[0053] The accompanying drawings are included to provide a further understanding of the present application, and are incorporated in and constitute a part of this specification, illustrate embodiments of the present application, and together with the description serve to explain the principles of the present application, and should not be considered limiting of the present application's scope.
[0054] Figure 1 A flowchart of a bearing fault diagnosis model construction method in an embodiment of the present application is shown in the figure.
[0055] Figure 2 A structure diagram of a bearing fault diagnosis model in an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0056] The preferred embodiments of the present application will be described in detail below with reference to the accompanying drawings, wherein the drawings constitute a part of this specification and serve to explain the embodiments of the present application together with the description, and are not considered limiting the scope of the present application.
[0057] One specific embodiment of the present application discloses a bearing fault diagnosis model construction method, as shown in the figure, comprising the following steps: Figure 1
[0058] Step 1, acquiring bearing vibration signal training data at several time points to construct four time series training data sets with the same length, wherein the training data includes bearing working condition attributes, bearing vibration data and bearing fault category labels;
[0059] Step 2, constructing four-tuple sample pairs according to the four time series training data sets with the same length;
[0060] Step 3, the data input layer receives the four-tuple sample pairs to preliminarily train the feature extractor model, and obtains the preliminarily trained feature extractor model; wherein the feature extractor model includes a feature extraction layer and a feature extractor tail;
[0061] Step 4, the data input layer receives the four-tuple sample pairs to simultaneously train the feature extractor model preliminarily trained in step 3 and the bearing fault diagnosis model, and obtains the trained feature extraction layer; wherein the bearing fault diagnosis model includes a data input layer, a feature extraction layer shared with the feature extractor model, and a fault classifier tail;
[0062] Step 5, the data input layer receives at least one time series training data set to train the fault classifier tail of the bearing fault diagnosis model trained in step 4, to obtain a trained fault classifier tail; based on the data input layer, the feature extraction layer trained in step 4, and the fault classifier tail trained in step 5, a trained bearing fault diagnosis model is obtained.
[0063] Specifically, as shown in the feature extractor model includes a feature extraction layer and a feature extractor tail; the bearing fault diagnosis model includes a data input layer, a feature extraction layer shared with the feature extractor model, and a fault classifier tail. Figure 2
[0064] Further, in order to improve the training effect of the model, it is necessary to organize the vibration data according to certain rules to construct the four-tuple sample pairs used for model training. In order to ensure the diversity and coverage of the sample pairs, the time series training data set is constructed according to the following rules:
[0065] (1) The bearing vibration signal training data of the same fault category under different working conditions is constructed into a group of time series training data sets;
[0066] Specifically, in fault diagnosis, the transformer may exhibit different vibration characteristics under different working conditions. Therefore, in order to make the model have generalization ability, it is necessary to ensure that the data samples of the same category are covered under different working conditions. By introducing different working conditions, the model can learn the commonness and difference of the vibration data of a specific category, and thus better perform fault classification.
[0067] (2) The bearing vibration signal training data of the same fault category under the same working condition is constructed into another group of time series training data sets;
[0068] Specifically, the model can learn the consistency features of the vibration data of the same category under the same working condition. By constructing the sample set, the model can capture the change pattern of the vibration data of the same category under the same working condition, further improving the accuracy of fault diagnosis.
[0069] (3) The bearing vibration signal training data of different fault categories under different working conditions is constructed into another group of time series training data sets;
[0070] Specifically, the model needs to learn the differences of the vibration data of different categories under different working conditions. By combining data of different categories with different working conditions, the model can distinguish the feature differences between different fault categories, and thus realize accurate fault classification.
[0071] (4) Construct another set of time series training data set from the bearing vibration signal training data of the same working condition of different fault categories.
[0072] Specifically, vibration data of different fault categories may exhibit similar characteristics under the same working condition. Therefore, in order to enable the model to accurately identify these similar characteristics, data of different fault categories need to be constructed and ensured to come from the same working condition. In this way, the model can learn to distinguish the subtle differences between different fault categories, thereby improving the robustness of fault diagnosis.
[0073] It should be noted that the fault categories include but are not limited to: non-fault, fatigue spalling, crack, indentation, wear, electric corrosion, scratch, burn, rust, cage damage, and gluing.
[0074] Further, four-tuple sample pairs are constructed according to the four time series training data sets of the same length, and the purpose of constructing the four-tuple sample pairs is to perform contrastive learning, so that similar time series are closer in embedding space, and dissimilar time series are farther apart. This contrastive learning method performs well in tasks such as anomaly detection and similarity matching of vibration data.
[0075] Specifically, the basic principle of constructing four-tuple sample pairs is that each sample pair is composed of four time series of vibration data, including three categories: Anchor (anchor point), Positive (positive sample), Negative1 (negative sample 1), and Negative2 (negative sample 2). Anchor (anchor point) and Positive (positive sample) belong to the same fault category, while Anchor (anchor point) and Negative1 (negative sample 1), Negative2 (negative sample 2) represent data of different fault categories. The process of constructing sample pairs helps the model learn the features of vibration data and can compare and classify in the fault diagnosis process. The model learns the similarity and difference between time series, thereby performing better in related tasks of vibration data.
[0076] Specifically, the construction includes the following steps:
[0077] S101, randomly select a time series training data set from the four time series training data sets as an anchor point a;
[0078] It should be noted that the anchor point is the basis for constructing sample pairs, and all sample pairs are based on the anchor point a.
[0079] S102, select another time series training data set of the same fault category vibration data as the anchor point a from the four time series training data sets as the positive sample p;
[0080] It should be noted that the positive sample p and the anchor point a belong to the same fault category or have similar vibration characteristics.
[0081] S103, selecting a time series training data set of vibration data of a different fault category from the anchor point a as a negative sample n1 in the four time series training data sets;
[0082] It should be noted that the negative sample n1 and the anchor point a come from different fault categories, which are used to help the bearing fault diagnosis model distinguish the differences between different categories.
[0083] S104, selecting a time series training data set of vibration data of a different fault category from the anchor point a as a negative sample n2 in the four time series training data sets.
[0084] It should be noted that the negative sample n2 and the anchor point a and the negative sample n1 also come from different fault categories, which are also used to increase the distinction between different fault categories.
[0085] Further, based on the four-tuple sample pair, the data features are fused and calculated through the feature extraction layer, and the extracted features are output at the tail of the feature extractor. The feature extraction layer includes a data fusion layer and a plurality of multi-scale cascade group attention modules connected in sequence.
[0086] Further, the data fusion layer includes a working condition attribute encoding layer, a vibration data embedding layer and a position embedding layer, which are used to calculate and combine the bearing working condition attributes and the bearing vibration data in the data set to obtain the fused feature encoding data.
[0087] Further, the working condition attribute encoding layer includes a full connection layer and an activation layer, which are used to encode the bearing working condition attributes in the four-tuple sample pair to obtain the bearing working condition attribute encoding value; by learning the representation of the working condition attribute, the model can better understand the changes of the vibration data under different working condition conditions.
[0088] Further, the vibration data embedding layer includes a full connection layer and an activation layer, which are used to encode and embed the bearing vibration data in the four-tuple sample pair to obtain the vibration data embedding value; in this way, the original vibration data can be converted into a representation with higher dimensions, which helps the model to extract more rich features.
[0089] Further, the position embedding layer is the position embedding layer of the Transformer model, which is used to multiply the bearing working condition attribute encoding value and the vibration data embedding value bit by bit to obtain the vibration data encoding value, and add the position weight matrix bit by bit to obtain the feature encoding data; this process helps the model to capture the time sequence information of the vibration data and preserve the position information in the feature extraction process.
[0090] Specifically, the position weight matrix of the Transformer model The calculation process is as follows:
[0091]
[0092]
[0093] wherein, PE is a position vector; pos is the position of the pos-th time point in the time sequence, starting from 0; d model is the dimension of the vibration data embedding value; i is the vector dimension, i [0, d model / 2].
[0094] Further, the number of the multi-scale cascade group attention modules is obtained through training; each of the multi-scale cascade group attention modules comprises a multi-scale segmentation layer and a cascade group attention module layer, and is configured to perform multi-scale segmentation on the fused feature encoding data and output the fused feature encoding data;
[0095] The multi-scale cascade group attention module connected with the data fusion layer performs multi-scale segmentation on the fused feature encoding data and outputs the fused feature encoding data as output data of the multi-scale cascade group attention module; the intermediate multi-scale cascade group attention module performs multi-scale segmentation on the output data of the previous multi-scale cascade group attention module and outputs the output data of the intermediate multi-scale cascade group attention module as output data of the intermediate multi-scale cascade group attention module; and the tail multi-scale cascade group attention module performs multi-scale segmentation on the output data of the previous multi-scale cascade group attention module and outputs the output data of the tail multi-scale cascade group attention module as output data of the feature extraction layer.
[0096] Specifically, the multi-scale segmentation layer comprises a convolution layer, an activation layer and a pooling layer combination, and is configured to segment the feature encoding data into two groups of half-scale feature transformation data and one group of original-scale feature transformation data; different scales of the transformation data can help the model extract features at different levels and realize nonlinear transformation of data.
[0097] Further, the cascade group attention module layer comprises three heads of attention modules and a splicing mapping layer, wherein the attention module of the first head is configured to perform self-attention calculation on the first group of half-scale feature transformation data to obtain a calculation result o1;
[0098] The attention module of the second head is configured to perform self-attention calculation on the calculation result o1 and the second group of half-scale feature transformation data after bitwise addition to obtain a calculation result o2;
[0099] The third head attention module is configured to splice the calculation result o1 and the calculation result o2 to obtain a calculation result o3, and perform self-attention calculation on the calculation result o3 after being added bit by bit with the original scale feature transformation data to obtain a calculation result o4.
[0100] The splicing mapping layer is configured to splice the calculation result o1 and the calculation result o2, and add the calculation result o4 bit by bit to obtain feature extraction layer output data.
[0101] Exemplarily, the calculation process of one of the samples in the sample pair is described as follows:
[0102] First, the size of the input data is (3, 4096), 3 representing 3 time points of data in the sample, and 4096 representing the data dimension of each time point.
[0103] Then, according to the diagram, three calculations are performed on the data in the multi-scale segmentation layer at the same time, using different convolution kernels and pooling kernels, to obtain three calculation results. The data size of the first two results is (3, 2048), and the size of the third result is (3, 4096). The three calculation results are denoted as x1, x2 and x3.
[0104] Then, x1, x2 and x3 are calculated in the cascaded group attention module layer according to the calculation process in the model structure diagram. x1 is calculated by self-attention to obtain a result o1, with a size of (3, 2048); o1 is added to x1 according to the same element position, and then o2 is obtained by self-attention calculation, with a size of (3, 2048); then o1 and o2 are spliced to obtain data with a size of (3, 4096), which is added to x3 element by element, and then o3 is obtained by self-attention calculation, with a size of (3, 4096).
[0105] Finally, o1 and o2 and o3 are spliced and added element by element to obtain the final output o, with a size of (3, 4096).
[0106] It should be noted that the output of the previous head attention module is fused and calculated with the input of the subsequent head attention module in a cascaded manner, realizing the interaction and information transmission between different scale data. This cascaded design can help the model better capture multi-scale features and improve the feature extraction capability.
[0107] Further, the feature extractor tail of the feature extractor model includes a fully connected layer for training the feature extraction layer parameters. In this layer, a four-tuple loss function is introduced, and the features extracted by the feature extraction layer in the sample pair are reorganized through similarity learning.
[0108] In this embodiment, the data input layer receives the quadruple sample pairs to perform preliminary training on the feature extractor model, obtaining a pre-trained feature extractor model, including:
[0109] Based on the aforementioned quadruplet sample pairs, the feature extractor model is trained using a quadruplet loss function. The parameters of the feature extraction layer and the tail parameters of the feature extractor are updated using gradient backpropagation. After training, the parameters of the feature extraction layer and the tail parameters of the feature extractor are saved. The purpose of this step is to enable the feature extractor to extract features from vibration data that are independent of the operating conditions.
[0110] Specifically, the goal of the quadruplet loss function is to achieve better feature discriminativeness by minimizing the feature distance between similar sample pairs and maximizing the feature distance between dissimilar sample pairs. This allows the model to better cluster similar samples together and separate dissimilar samples in the feature space. By introducing the quadruplet loss function, the tail of the feature extractor can improve the discriminativeness of features, thereby providing more accurate and reliable feature representations for subsequent fault identification.
[0111] Furthermore, the quadruplet loss function utilizes similarity learning to improve the model's ability to extract domain-invariant features. The quadruplet loss considers both intra-class and inter-class distances of samples, and its calculation formula is as follows:
[0112] L q =(d a,p -d a,n1 +α) + +(d a,p -d n1,n2 +β) +
[0113] Where, d a,p d is the distance between anchor point a and positive sample p in the quadruple sample pair; a,n1 d is the distance between anchor point a and negative sample n1 in the quadruple sample pair; n1,n2 The distance between negative sample n1 and negative sample n2 in the quadruple sample pair; α and β are hyperparameters;
[0114] It should be noted that (d a,p -d a,n1 +α) + The distance difference between positive and negative sample pairs is measured, aiming for the distance between the positive sample and the anchor point to be less than the distance between the negative sample and the anchor point, and the difference between them to be greater than α. (d) a,p -d n1,n2 +β) +It measures the relative distance between positive and negative samples, making the distance between positive and negative sample pairs larger while maintaining the distance difference between positive and negative sample pairs.
[0115] This loss function can facilitate closer proximity between positive samples of the same class and the anchor point, while simultaneously increasing the distance between positive and negative samples, thereby enhancing sample classification performance in metric learning. The hyperparameters α and β can be adjusted to control the distance difference between positive and negative samples, as well as the relative distance between pairs of positive and negative samples, thus achieving better model training and feature representation learning.
[0116] In this embodiment, the fault classifier includes a fully connected layer at the tail for outputting the predicted fault category.
[0117] Furthermore, the data input layer receives the quadruple sample pairs and simultaneously trains the feature extractor model and bearing fault diagnosis model preliminarily trained in step 3 to obtain a trained feature extraction layer, including:
[0118] Load the quadruplet sample pairs, and simultaneously train the feature extractor model and the bearing fault diagnosis model using a weighted combination of the quadruplet loss function and the multi-classification loss function. Update the feature extraction layer parameters, the tail parameters of the feature extractor, and the tail parameters of the fault classifier using gradient backpropagation. After training, save the feature extraction layer parameters, the tail parameters of the feature extractor, and the tail parameters of the fault classifier.
[0119] Specifically, at the end of the fault classifier, the fault category of a sample is predicted by calculating multi-class loss on the features extracted by the feature extraction layer. After outputting the probability value of each category through the Softmax function, the loss is calculated using cross-entropy.
[0120] It should be noted that the goal of the multi-class loss function is to enable the model to accurately map the input features to the corresponding fault categories. By minimizing the classification error, the model can learn the feature differences between different fault categories and achieve accurate fault identification.
[0121] Specifically, the design of the classifier tail combines feature extraction and classification tasks to achieve end-to-end fault diagnosis. Through the collaborative work of the feature extraction layer and the classifier tail, the model can transform vibration data into meaningful feature representations and perform accurate fault classification.
[0122] In this embodiment, the data input layer receives at least one time-series training dataset to train the tail of the fault classifier of the bearing fault diagnosis model trained in step 4, obtaining the trained fault classifier tail, including:
[0123] Load the training dataset, fix the weight parameters of the feature extraction layer, train the tail of the fault classifier of the bearing fault diagnosis model using a multi-class loss function, update the tail parameters of the fault classifier using gradient backpropagation, and save the tail parameters of the fault classifier after training.
[0124] The final bearing fault diagnosis model is obtained based on the data input layer, the feature extraction layer, and the fault classifier tail.
[0125] Another embodiment of the present invention provides a bearing fault diagnosis method based on the fault diagnosis model obtained by the above construction method, comprising: acquiring bearing vibration signal data including bearing operating condition attributes and bearing vibration data; inputting the bearing vibration signal data into a trained bearing fault diagnosis model to obtain a bearing fault category, comprising: the bearing vibration signal data being received by a data input layer, and the bearing operating condition attributes and bearing vibration data being fused through a data fusion layer of the feature extraction layer to obtain feature-encoded data; the feature-encoded data being scale-segmented and fused and output through several sequentially connected multi-scale cascaded attention modules of the feature extraction layer; and the features extracted by the feature extraction layer being output as a fault category through a softmax function at the tail of the fault classifier.
[0126] In summary, compared with existing technologies, this embodiment integrates operating condition information into vibration data by introducing operating condition information, achieving the effect of operating condition decoupling. This reduces interference from vibration data under varying operating conditions, allowing the model to focus more on fault-related features in the vibration data. Through operating condition decoupling, the model can more accurately extract and identify fault features, improving the accuracy and reliability of fault diagnosis.
[0127] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for constructing a bearing fault diagnosis model, characterized in that, include: Step 1: Obtain bearing vibration signal training data at several time points to construct four time series training datasets of the same length; wherein, the training data includes bearing operating condition attributes, bearing vibration data, and bearing fault category labels; Step 2: Construct quadruples based on the four time-series training datasets of the same length; Step 3: The data input layer receives the quadruple sample pairs and performs preliminary training on the feature extractor model to obtain the pre-trained feature extractor model; wherein, the feature extractor model includes a feature extraction layer and a feature extractor tail; Step 4: The data input layer receives the quadruple sample pairs and simultaneously trains the feature extractor model and bearing fault diagnosis model trained in Step 3 to obtain the trained feature extraction layer; wherein, the bearing fault diagnosis model includes a data input layer, a feature extraction layer shared with the feature extractor model, and a fault classifier tail; Step 5: The data input layer receives at least one time series training dataset to train the fault classifier tail of the bearing fault diagnosis model trained in Step 4, and obtains the trained fault classifier tail; based on the data input layer, the feature extraction layer trained in Step 4 and the fault classifier tail trained in Step 5, the trained bearing fault diagnosis model is obtained.
2. The method according to claim 1, characterized in that, The feature extraction layer includes a data fusion layer and several sequentially connected multi-scale cascaded attention modules; The data fusion layer is used to obtain fused feature-encoded data based on bearing operating condition attributes and bearing vibration data. The number of multi-scale cascaded attention modules is obtained through training; each multi-scale cascaded attention module includes a multi-scale segmentation layer and a cascaded attention module layer, which are used to perform multi-scale segmentation and then fuse the fused feature encoding data for output. The feature extractor includes a fully connected layer at the end for outputting the extracted features; The fault classifier includes a fully connected layer at the end for outputting fault categories.
3. The method according to claim 2, characterized in that, The data fusion layer includes a working condition attribute encoding layer, a vibration data embedding layer, and a location embedding layer; The operating condition attribute encoding layer includes a fully connected layer and an activation layer, which are used to encode the bearing operating condition attributes in the data received by the data input layer to obtain the bearing operating condition attribute encoded value. The vibration data embedding layer includes a fully connected layer and an activation layer, which are used to encode and embed the bearing vibration data in the data received by the data input layer to obtain the vibration data embedding value. The position embedding layer is used to multiply the bearing condition attribute encoding value and the vibration data embedding value bitwise to obtain the vibration data encoding value, and add the position weight matrix bitwise to obtain the feature encoding data, wherein the position weight matrix is calculated by the position vector in the data received by the data input layer through sine and cosine functions.
4. The method according to any one of claims 2 or 3, characterized in that, The multi-scale segmentation layer is used to segment the data input to the multi-scale segmentation layer into two sets of half-scale feature transformation data and one set of original-scale feature transformation data. The cascaded attention module layer includes a three-head attention module and a splicing mapping layer. The attention module of the first head is used to perform self-attention calculation on the first group of half-scale feature transformation data to obtain the calculation result o1. The attention module of the second head is used to perform self-attention calculation after bitwise addition of the calculation result o1 with the second group of half-scale feature transformation data to obtain the calculation result o2; The attention module of the third head is used to concatenate the calculation result o1 with the calculation result o2 to obtain the calculation result o3; after adding the calculation result o3 to the original scale feature transformation data bit by bit, self-attention calculation is performed to obtain the calculation result o4; The splicing mapping layer is used to splice the calculation result o1 and the calculation result o2, and then add them bitwise to the calculation result o4 to obtain the output data of the multi-scale cascaded attention module.
5. The method according to claim 1, characterized in that, The acquisition of bearing vibration signal training data at several time points constructs four time series training datasets of equal length, including: (1) Construct a time series training dataset by combining bearing vibration signal training data of the same fault category but different working conditions; (2) Construct another set of time series training datasets from the bearing vibration signal training data of the same fault category and the same working condition; (3) Construct another set of time series training datasets from the bearing vibration signal training data of different fault categories belonging to different working conditions; (4) Construct another set of time series training datasets by combining the bearing vibration signal training data of different fault categories that belong to the same working condition.
6. The method according to claim 5, characterized in that, The construction of quadruple sample pairs includes the following steps: S101. Randomly select one of the four time series training datasets as anchor point a; S102. Select another time series training dataset of vibration data of the same fault category as anchor point a from the four time series training datasets as positive sample p; S103. Select one time series training dataset of vibration data with a different fault category from anchor point a from the four time series training datasets as negative sample n1. S104. From the four time series training datasets, select another time series training dataset of vibration data with a different fault category than anchor point a as negative sample n2.
7. The method according to claim 1, characterized in that, The data input layer receives the quadruple sample pairs and performs preliminary training on the feature extractor model to obtain the pre-trained feature extractor model, including: Load the quadruplet sample pairs, train the feature extractor model using the quadruplet loss function, update the feature extraction layer parameters and the tail parameters of the feature extractor using gradient backpropagation, and save the feature extraction layer parameters and the tail parameters of the feature extractor after training.
8. The method according to claim 7, characterized in that, The data input layer receives the quadruple sample pairs and simultaneously trains the feature extractor model and the bearing fault diagnosis model, including: Load the quadruplet sample pairs, and simultaneously train the feature extractor model and the bearing fault diagnosis model using a weighted combination of the quadruplet loss function and the multi-classification loss function. Update the feature extraction layer parameters, the tail parameters of the feature extractor, and the tail parameters of the fault classifier using gradient backpropagation. After training, save the feature extraction layer parameters, the tail parameters of the feature extractor, and the tail parameters of the fault classifier.
9. The method according to claim 8, characterized in that, The data input layer receives at least one time-series training dataset to train the tail of the fault classifier of the bearing fault diagnosis model, including: Load the training dataset, fix the weight parameters of the feature extraction layer, train the fault classifier tail of the bearing fault diagnosis model using a multi-class loss function, update the fault classifier tail parameters using gradient backpropagation, save the fault classifier tail parameters after training, and obtain the final bearing fault diagnosis model based on the data input layer, the feature extraction layer, and the fault classifier tail.
10. The method according to claim 9, characterized in that, The formula for calculating the quadruple loss function is as follows: L q =(d a,p -d a,n1 +a) + +(d a,p -d n1,n2 +b) + Where, d a,p d is the distance between anchor point a and positive sample p in the quadruple sample pair; a,n1 d is the distance between anchor point a and negative sample n1 in the quadruple sample pair; n1,n2 The distance between negative sample n1 and negative sample n2 in the quadruple sample pair; α and β are hyperparameters; The multi-class loss function includes the softmax activation function and the cross-entropy loss function.
Citation Information
Patent Citations
Time sequence feature extraction method based on complicated network theory and applicable to classification
CN104408072A
Method for predicating financial time series based on news topic information retrieval
CN104573003A