A method and system for intelligent fault diagnosis of a marine propulsion shafting
By combining a transformer Brownian covariance module and a prototype comparison and alignment module with an adaptive prototype classifier, the problem of fault diagnosis of ship propulsion shafting under varying operating conditions with limited labeled data is solved, achieving high-precision fault diagnosis, which is suitable for intelligent fault diagnosis of ship propulsion shafting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies struggle to diagnose faults in ship propulsion shafting systems under varying operating conditions, especially with limited labeled sample data, resulting in insufficient precision and accuracy in fault diagnosis.
A transformer Brownian covariance module is used to extract the Brownian distance covariance feature matrix. Combined with a prototype comparison alignment module and an adaptive prototype classifier, a transformer fault diagnosis network is trained using intra-domain and cross-domain loss functions, and fault diagnosis is performed using a small amount of labeled data.
With a small amount of labeled data, cross-condition fault diagnosis of ship propulsion shafting can be achieved, improving the accuracy and precision of fault diagnosis, reducing the workload of data labeling, and adapting to changes in operating conditions in industrial applications.
Smart Images

Figure CN119669854B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of fault diagnosis, and more particularly relates to a ship propulsion shafting intelligent fault diagnosis method and system. BACKGROUND
[0002] The propulsion shafting is a core component of a large ship, and once it appears abnormal or fails, it will directly affect the service reliability and safety of the ship. During the service life of the ship propulsion shafting, due to the complex and harsh use environment and the continuous effect of alternating load, the propulsion shafting may appear problems such as bearing wear and shaft misalignment, which seriously affects the safety performance of the ship sailing. Therefore, in order to ensure the long-term reliability of the propulsion shafting, it is necessary to carry out intelligent fault diagnosis of the ship propulsion shafting.
[0003] In recent years, with the development of sensors and artificial intelligence technology, deep learning is more and more applied to propulsion shafting fault diagnosis, and good results have been achieved. Common diagnostic models include convolutional neural networks, recurrent neural networks and autoencoders. The most critical element of the deep learning-based fault diagnosis method is to automatically extract representative fault features, which greatly reduces the dependence on professional knowledge. However, these deep learning models with good results are inseparable from sufficient labeled training samples. That is, the existing intelligent fault diagnosis technology relies on sufficient labeled training data. In addition, the collected samples need to meet the same distribution condition.
[0004] However, in actual industrial applications, a large amount of unlabeled data is generated during the operation of the ship propulsion shafting. Due to the lack of expert knowledge, it is often difficult and uneconomical to label the training samples. In addition, due to the changes in load and speed conditions, the samples collected from the propulsion shafting usually obey different distributions. The current difficulties in obtaining labeled sample data and the diagnosis of variable working conditions are the problems faced by intelligent fault diagnosis. How to realize the fault diagnosis of variable working conditions under the premise of limited labeled sample data is a key problem that needs to be solved in intelligent fault diagnosis. SUMMARY
[0005] In view of the above defects or improvement needs of the prior art, the application provides a ship propulsion shafting intelligent fault diagnosis method and system, which is used to solve the problem that it is difficult to realize the fault diagnosis of variable working conditions under the premise of limited labeled sample data.
[0006] To achieve the above purpose, according to one aspect of the application, a ship propulsion shafting intelligent fault diagnosis method is provided, which comprises:
[0007] Offline data processing and training stage:
[0008] S1, select part of the sample labeled source domain data and unlabeled target domain data, and convert the source domain data and the target domain data into two-dimensional time-frequency graph respectively;
[0009] S2, the two-dimensional time-frequency graph is extracted by the transformer Brown covariance module, and the BDC feature matrix corresponding to the source domain data and the target domain data is obtained respectively, wherein BDC is Brown distance covariance;
[0010] S3, a prototype contrast alignment module and a classifier are constructed: the prototype contrast alignment module clusters and normalizes the BDC feature matrix corresponding to the source domain data and the target domain data respectively by a clustering algorithm, and obtains the source domain clustering prototype and the target domain clustering prototype; the BDC feature matrix and the clustering prototype of the same domain are aligned to obtain the intra-domain prototype contrast loss function; the BDC feature matrix and the clustering prototype of different domains are aligned to obtain the cross-domain prototype contrast loss function;
[0011] The classifier is used for fault classification prediction of the source domain data and the target domain data, the cross-entropy loss function is obtained according to the prediction result of the labeled sample, and the mutual information loss function of the feature is obtained;
[0012] S4, the transformer Brown covariance module, the prototype contrast alignment module and the classifier form a transformer fault diagnosis network, and the transformer fault diagnosis network is trained according to the obtained intra-domain prototype contrast loss function, cross-domain prototype contrast loss function, cross-entropy loss function and mutual information loss function;
[0013] Online fault diagnosis stage:
[0014] S5, the trained transformer fault diagnosis network is used for ship propulsion shaft fault diagnosis of the target domain data to be tested.
[0015] According to the ship propulsion shaft intelligent fault diagnosis method provided by the application, S1 specifically includes:
[0016] Randomly select a working condition of the ship propulsion shaft to collect one-dimensional vibration data, and classify the collected one-dimensional vibration data into source domain data, wherein a plurality of data samples contain labels, and the others do not contain labels;
[0017] Collect vibration data of another random working condition, and classify the collected one-dimensional vibration data into target domain data, wherein the target domain data is unlabeled data;
[0018] The one-dimensional vibration data in the source domain data and the target domain data are wavelet transformed to obtain two-dimensional time-frequency graph.
[0019] The ship propulsion shafting intelligent fault diagnosis method provided by the application, the transformer Brown covariance module includes a transformer encoder and a BDC pooling layer, the transformer encoder includes a multi-head attention layer and a multi-layer perceptron, and the multi-layer perceptron is composed of a full connection layer and a GELU activation function;
[0020] In the transformer Brown covariance module, a two-dimensional time-frequency graph is first converted into a three-dimensional feature tensor, position encoding is performed, and then the feature tensor with position information is processed through a multi-head attention mechanism; the result of the multi-head attention is input into a multi-layer perceptron to extract features; and the multi-dimensional feature vector extracted by the multi-layer perceptron is input into a BDC pooling layer to extract a BDC feature matrix related to a fault.
[0021] The extraction formula of the BDC feature matrix A according to the ship propulsion shafting intelligent fault diagnosis method provided by the application is as follows:
[0022]
[0023] Wherein, X is a feature tensor, 1 represents a matrix in which each element is 1, I represents an identity matrix, represents a Hadamard product, represents the square of a Euclidean distance matrix, represents a Euclidean distance matrix, d represents a regularization parameter, and (·) sym represents a symmetrization operation.
[0024] In the ship propulsion shafting intelligent fault diagnosis method provided by the application, the BDC feature matrix and the clustering prototype in the same domain are aligned in S3 to obtain an intra-domain prototype contrast loss function; and the BDC feature matrix and the clustering prototype in different domains are aligned to obtain a cross-domain prototype contrast loss function; specifically including:
[0025] The similarity distribution vector of the source domain BDC feature matrix and the source domain clustering prototype is calculated to obtain a cross-entropy function between the similarity distribution vector and the source domain clustering pseudo-label from a clustering algorithm; similarly, the similarity distribution vector of the target domain BDC feature matrix and the target domain clustering prototype is calculated to obtain a cross-entropy function between the similarity distribution vector and the target domain clustering pseudo-label from a clustering algorithm; and the intra-domain prototype contrast loss function is obtained according to the two cross-entropy functions;
[0026] The similarity distribution vector of the source domain BDC feature matrix and the target domain clustering prototype is calculated to obtain an entropy function of the similarity distribution vector; similarly, the similarity distribution vector of the target domain BDC feature matrix and the source domain clustering prototype is calculated to obtain an entropy function of the similarity distribution vector; and the cross-domain prototype contrast loss function is obtained according to the two entropy functions.
[0027] The ship propulsion shafting intelligent fault diagnosis method provided by the application, the domain prototype comparison loss function L Local The calculation formula is:
[0028]
[0029] Wherein, n s And n us Respectively represent the number of labeled and unlabeled samples in the source domain data, n t Is the number of samples in the target domain data; And Respectively are the source domain and target domain clustering pseudo labels from the clustering algorithm; L CE (·) is the cross-entropy function; Is the similarity distribution vector of the source domain BDC feature matrix and the source domain clustering prototype; Is the similarity distribution vector of the target domain BDC feature matrix and the target domain clustering prototype;
[0030] The calculation formula of the cross-domain prototype comparison loss function L Global Is:
[0031]
[0032] Wherein, Is the similarity distribution vector of the source domain BDC feature matrix and the target domain clustering prototype; Is the similarity distribution vector of the target domain BDC feature matrix and the source domain clustering prototype; k is the cluster of clustering; H(·) is the entropy function.
[0033] The ship propulsion shafting intelligent fault diagnosis method provided by the application, the classifier is an adaptive prototype classifier, and the prediction label p(x) of the adaptive prototype classifier is:
[0034]
[0035] Wherein, sigma(·) is a softmax function, W is a weight matrix, T is a proportion factor, f is an extracted feature, and x is input data; wherein the weight matrix w i At the i-th prediction is:
[0036]
[0037] Wherein, T prototype Is a set threshold, Is the network weight represented by the source domain, Is the network weight represented by the target domain, Is the target domain data.
[0038] According to the ship propulsion shafting intelligent fault diagnosis method provided by the application, the cross-entropy loss function L cls Specifically,
[0039]
[0040] Wherein, x is input data, y is a real label, p(x) is a predicted label, n s Indicates the number of labeled samples in the source domain data;
[0041] The maximum mutual information loss function L MIM Specifically,
[0042] L MIM = E x [H(p(y|x; theta))]-H(p0);
[0043] Wherein, theta is a learned parameter; E x [·] is an expected value function; H(p(y|x; theta)) is conditional entropy; Prior distribution p0 is obtained by E x [p(y|x; theta)].
[0044] According to the ship propulsion shafting intelligent fault diagnosis method provided by the application, the transformer fault diagnosis network is trained according to the obtained intra-domain prototype contrast loss function, cross-domain prototype contrast loss function, cross-entropy loss function and mutual information loss function, and specifically includes:
[0045] According to the obtained intra-domain prototype contrast loss function, cross-domain prototype contrast loss function, cross-entropy loss function and mutual information loss function, the total loss function is obtained, and the transformer fault diagnosis network is trained according to the total loss function;
[0046] The total loss function L total Specifically,
[0047] L total = L cls + lambda1*(L Local + L Global )+ lambda2*L MIM ;
[0048] Wherein, L Global is the cross-domain prototype contrast loss function, L Local is the intra-domain prototype contrast loss function, L cls is the cross-entropy loss function, L MIM is the maximum mutual information loss function, and lambda1 and lambda2 are compromise parameters.
[0049] According to another aspect of the present application, there is provided a ship propulsion shafting intelligent fault diagnosis system, comprising a memory and a processor, the memory stores a computer program, and the processor executes the computer program to execute the ship propulsion shafting intelligent fault diagnosis method according to any one of the above aspects.
[0050] Overall, compared with the prior art, the ship propulsion shafting intelligent fault diagnosis method and system provided by the present application have the following advantages:
[0051] 1. A transformer Brown covariance module is established to extract a BDC feature matrix, and a deeper hidden feature is extracted by using the Brown distance covariance principle, which can reveal the nonlinear relationship in the data; a prototype contrast alignment module is used, a feature prototype is obtained based on a clustering algorithm, and intra-domain feature and feature prototype alignment and cross-domain feature and feature prototype alignment are performed, and an intra-domain prototype contrast loss function and a cross-domain prototype contrast loss function are calculated; a cross-entropy loss function and a mutual information loss function are calculated according to the prediction result of the classifier; and the transformer fault diagnosis network is trained based on the four kinds of loss functions, and the trained network can perform variable working condition fault diagnosis on the ship propulsion shafting under a small amount of labeled data, greatly reducing the task amount of data labeling in industrial fault diagnosis;
[0052] 2. The specific calculation process of the intra-domain prototype contrast loss function and the cross-domain prototype contrast loss function is provided, and the prototype contrast alignment module constructed based on the two kinds of loss functions is used to accurately align the data distribution in the source domain and the target domain, realize synchronous domain alignment of local prototypes and global prototypes, and help the network to extract discriminative feature representation under a small amount of labeled data and variable working conditions, thereby improving the fault diagnosis precision;
[0053] 3. An adaptive prototype classifier is constructed, the classifier parameters are trained through a small amount of labeled source domain data, and a threshold is set to screen high-confidence target domain data for updating the classifier weight, which is beneficial to improve the fault diagnosis precision and realize the cross-condition fault diagnosis of the ship propulsion shafting under a small amount of labeling;
[0054] 4. The method can perform cross-condition precise fault diagnosis on the ship propulsion shafting under the condition that the labeled source data is limited (at least 9), solve the variable working condition problem in industrial application, meet the needs of industrial application, and can realize fault diagnosis on the ship propulsion shafting under any working condition regardless of the change of the working condition of the ship propulsion shafting, which has engineering application value. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 is the ship propulsion shafting fault intelligent diagnosis method framework based on the adaptive prototype contrast transformer network provided by the embodiment of the present application;
[0056] Figure 2 is a ship propulsion shafting fault intelligent diagnosis method flowchart based on an adaptive prototype contrast transformer network provided by an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the objectives, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0058] Please refer to Figure 1 and Figure 2 , the present embodiment provides a ship propulsion shafting intelligent fault diagnosis method, which comprises:
[0059] Offline data processing and training stage:
[0060] S1, select part of sample labeled source domain data and unlabeled target domain data, and convert the source domain data and the target domain data into two-dimensional time-frequency graph respectively;
[0061] S2, the two-dimensional time-frequency graph is extracted by the transformer Brown covariance module, and the BDC feature matrix corresponding to the source domain data and the target domain data is obtained, wherein BDC is Brown distance covariance;
[0062] S3, a prototype contrast alignment module and a classifier are constructed: the prototype contrast alignment module clusters and normalizes the BDC feature matrix corresponding to the source domain data and the target domain data respectively by clustering algorithm, and obtains the source domain clustering prototype and the target domain clustering prototype; align the BDC feature matrix and the clustering prototype of the same domain to obtain the intra-domain prototype contrast loss function; align the BDC feature matrix and the clustering prototype of different domains to obtain the cross-domain prototype contrast loss function;
[0063] The classifier is used for fault classification and prediction of the source domain data and the target domain data, the cross-entropy loss function is obtained according to the prediction result of the labeled sample, and the mutual information loss function of the feature is obtained;
[0064] S4, the transformer Brown covariance module, the prototype contrast alignment module and the classifier form a transformer fault diagnosis network, and the transformer fault diagnosis network is trained according to the obtained intra-domain prototype contrast loss function, cross-domain prototype contrast loss function, cross-entropy loss function and mutual information loss function;
[0065] Online fault diagnosis stage:
[0066] S5, using the trained transformer fault diagnosis network to perform ship propulsion shaft fault diagnosis on the target domain data to be tested.
[0067] In this embodiment, the source domain data and the target domain data are first converted into two-dimensional time-frequency graphs; then the transformer Brown covariance module is used to extract corresponding representative high-dimensional features and convert them into a Brown distance covariance (BDC) feature matrix; the prototype contrast alignment module is used to align the intra-domain distribution and the cross-domain distribution of the BDC feature matrix, and the intra-domain prototype contrast loss function and the cross-domain prototype contrast loss function are calculated; the intra-domain prototype contrast loss function is specifically a cross-entropy loss function on the similarity distribution of the intra-domain features and the same domain feature prototype; and the cross-domain prototype contrast loss function is specifically an entropy loss function on the similarity distribution of the intra-domain features and the different domain feature prototype.
[0068] The BDC feature matrices of the source domain and the target domain extracted by the transformer Brown covariance module are simultaneously input into the classifier, the source domain and the target domain data are predicted by the classifier, the maximum mutual information loss function and the cross-entropy loss function are calculated; and the obtained loss function is taken as the optimization object of the transformer fault diagnosis network to train the transformer fault diagnosis network. That is, the optimization objects of the transformer fault diagnosis network include the following four:
[0069] The cross-entropy loss function on the similarity distribution of the intra-domain features and the same domain feature prototype is minimized as optimization object 1; the entropy loss function on the similarity distribution of the intra-domain features and the different domain feature prototype is minimized as optimization object 2; the cross-entropy loss function of the real label and the predicted label of the labeled sample is minimized as optimization object 3; and the mutual information loss function of the features is maximized as optimization object 4.
[0070] The four network optimization objects are calculated, specifically including: the BDC feature matrix with a size of 1x512 tensor is extracted by the transformer Brown covariance module, the feature prototypes of the source domain and the target domain are obtained by the prototype contrast alignment module, the cross-entropy loss function on the similarity distribution of the intra-domain features and the same domain feature prototype is calculated, the entropy loss function on the similarity distribution of the intra-domain features and the different domain prototype is calculated, the cross-entropy loss function of the real label and the predicted label of the labeled feature is calculated by the classifier, and the mutual information loss function of the features is calculated.
[0071] The technical effects of the embodiments of the present application will be further described in combination with specific embodiments.
[0072] The embodiment provides a ship propulsion shaft system fault intelligent diagnosis method based on an adaptive prototype contrast transformer fault diagnosis network. The adaptive prototype contrast transformer fault diagnosis network comprises a transformer Brown covariance module, a prototype contrast alignment module and an adaptive prototype classifier. The transformer Brown covariance module is used for extracting high-dimensional features of source domain and target domain data and converting the high-dimensional features into a Brown distance covariance (BDC) feature matrix. The prototype contrast alignment module is used for aligning intra-domain distribution and cross-domain distribution of the BDC feature matrix respectively. The adaptive prototype classifier is used for adaptively learning discriminative features and accurately predicting data. Figure 1 The method specifically processes a flow, and mainly comprises the following steps.
[0073] Step 1, the source domain and target domain data are selected, which comprises the following steps.
[0074] The source domain data and the target domain data are converted into two-dimensional time-frequency diagrams. Specifically, the sampling points of each sample in the one-dimensional vibration data of the source domain and the target domain can be 8000. The two-dimensional time-frequency diagram obtained by wavelet transform of the one-dimensional vibration data is obtained.
[0075] Specifically, the source domain data set D S The source domain samples are divided into two parts, the labeled source domain samples and the unlabeled source domain samples Wherein, n s and n us respectively represent the number of labeled and unlabeled source domain samples, represents the label of the source domain sample, represents the labeled sample data, represents the unlabeled sample data. Further, the target domain data set is composed of n t unlabeled samples, represents the target domain sample data. The marginal probability distributions of the source domain and the target domain are different, denoted as P(D S ) and P(D T ), wherein P(D S )≠P(D T ).
[0076] Step 2, the two-dimensional time-frequency diagrams of the source domain and the target domain are converted Figure 1The transformer Brownian covariance module inputs the extracted feature tensor to extract corresponding feature tensors. The transformer Brownian covariance module is a feature extraction network with a BDC pooling layer.
[0077] Specifically, the transformer Brownian covariance module includes a transformer encoder and a BDC pooling layer. The transformer Brownian covariance module inputs a two-dimensional size of 224*224, and after the transformer encoder and the BDC pooling layer, outputs a one-dimensional feature tensor with a size of 512 neurons. The transformer encoder includes a multi-head attention layer and a multi-layer perceptron (MLP). In the transformer Brownian covariance module, the two-dimensional time-frequency graph is converted into a three-dimensional feature tensor, and then position encoding is performed. Then, the tensors with position information are processed through the multi-head attention mechanism. Then, the result of the multi-head attention is input into the MLP composed of two fully connected layers and a GELU activation function to extract features. The details of the MLP are as follows:
[0078] MLP(x) = GELU(0, xW1 + b1)W2 + b2
[0079] where W1 and W2 are weight matrices, b1 and b2 are bias vectors, and x is a feature vector. Finally, the multi-dimensional feature vector output extracted by the MLP is sent to the BDC pooling layer to extract the BDC feature matrix A related to the fault, which can be formulated as:
[0080]
[0081] where X is a feature tensor, 1 represents a matrix with each element being 1, I represents an identity matrix, represents a Hadamard product, represents the square of the Euclidean distance matrix, represents the Euclidean distance matrix, d represents a regularization parameter, and (·) sym represents a symmetrization operation.
[0082] Step 3, in the prototype contrast alignment module, the BDC feature matrix is clustered by a spectral clustering algorithm or a K-means clustering algorithm. The source domain clustering and the target domain clustering are obtained and normalized, respectively, to obtain the source domain clustering prototype and the target domain clustering prototype, respectively. Next, the intra-domain prototype contrast loss function L Local is calculated. At the same time, the cross-domain prototype contrast loss function L Global is calculated.
[0083] Specifically, the BDC feature matrix is clustered and normalized to obtain the source domain clustering prototype and the target domain clustering prototype where k is the cluster of spectral clustering. The source domain BDC feature matrix {f i s+us} and source domain clustering prototype The similarity distribution vector can be represented as:
[0084]
[0085] in, This is the temperature parameter, and exp(·) is an exponential function. Similarly, the similarity distribution vector between the target domain BDC feature matrix and the target domain clustering prototype is... Right now It can be computed. Furthermore, the intra-domain prototype contrastive loss function L... Local Formulated as
[0086]
[0087] Where, n s and n us n represents the number of labeled and unlabeled samples in the source domain data, respectively. t The number of samples in the target domain data; and These are the pseudo-cluster labels from the source and target domains of the spectral clustering algorithm, respectively; L CE (·) represents the cross-entropy function; This represents the similarity distribution vector between the source domain BDC feature matrix and the source domain clustering prototype. Let f be the similarity distribution vector between the target domain BDC feature matrix and the target domain clustering prototype. Simultaneously, let f be the source domain BDC feature matrix. i s+us Similarity distribution vector between the target domain clustering prototype and the target domain It can be represented as:
[0088]
[0089] in, This serves as a prototype for target domain clustering; in this way, the target domain BDC feature matrix {f i t} and source domain clustering prototype Similarity distribution vector This can be obtained. Next, minimize the similarity distribution vectors respectively. Entropy function and similarity distribution vector The entropy function, the cross-domain prototype contrast loss function L Global Formulated as:
[0090]
[0091] Where H(·) is the entropy function.
[0092] That is, the BDC feature matrix and the clustering prototype of the same domain are aligned to obtain the intra-domain prototype contrast loss function; the BDC feature matrix and the clustering prototype of different domains are aligned to obtain the cross-domain prototype contrast loss function; specifically including:
[0093] The similarity distribution vector of the source domain BDC feature matrix and the source domain clustering prototype is calculated to obtain the cross entropy function between the similarity distribution vector and the source domain clustering pseudo label from the clustering algorithm; similarly, the similarity distribution vector of the target domain BDC feature matrix and the target domain clustering prototype is calculated to obtain the cross entropy function between the similarity distribution vector and the target domain clustering pseudo label from the clustering algorithm; the intra-domain prototype contrast loss function is obtained according to the two cross entropy functions;
[0094] The similarity distribution vector of the source domain BDC feature matrix and the target domain clustering prototype is calculated to obtain the entropy function of the similarity distribution vector; similarly, the similarity distribution vector of the target domain BDC feature matrix and the source domain clustering prototype is calculated to obtain the entropy function of the similarity distribution vector; the cross-domain prototype contrast loss function is obtained according to the two entropy functions.
[0095] Step 4, the classifier is an adaptive prototype classifier, and the network weight is adaptively updated by the adaptive prototype classifier to accurately predict the data. The adaptive prototype classifier updates the network weight using a small amount of labeled data and high confidence data. The adaptive prototype classifier consists of a full connection layer without bias and a soft threshold layer. The predicted label p(x) of the adaptive prototype classifier is:
[0096]
[0097] Where σ(·) is the softmax function, W is the weight matrix, T is the proportion factor, f is the extracted feature, and x is the input data. A threshold is set to select data with high prediction probability to train the adaptive prototype classifier. In the early stage of training, the source domain data with a small amount of labels is more robust, so the source domain data with labels is used to update the network weight; in the later stage of training, the samples in the target domain are more representative, so the target domain data is used to update the network weight. For convenience of description, whether the weight is robust is determined by the target domain data , where the weight matrix w i represents:
[0098]
[0099] Where T prototype is the threshold, is the network weight represented by the source domain, is the network weight represented by the target domain.
[0100] The cross-entropy loss function L of the true label y and the predicted label p(x) of the input data x cls is formulated as:
[0101]
[0102] where n s represents the number of labeled samples in the source domain data. Then, all features are calculated mutual information, and the mutual information of variables X and Y is calculated as:
[0103] I(X;Y) = H(X) - H(X|Y)
[0104] where H(X) is the information entropy, and H(X|Y) is the conditional entropy. The maximum mutual information loss function L MIM can be formulated as:
[0105] L MIM = -I(X;Y)
[0106] L MIM = E x [H(p(y|x; theta))]-H(p0)
[0107] where theta is the learned parameter, E x [·] is the expectation function; H(p(y|x; theta)) is the conditional entropy; p(y|x; theta) is the probability distribution predicted by the classifier; and the prior distribution p0 is obtained by E x [p(y|x; theta)].
[0108] Step 5, the loss function L Local , L Global , L cls and L MIM provided by the embodiment of the application are used as the optimization object of the adaptive prototype contrast transformer network, and the adaptive prototype contrast transformer fault diagnosis network is trained, including:
[0109] The loss function L Local , L Global , L cls and L MIM are used as the optimization object, the adaptive prototype contrast transformer fault diagnosis network is trained by using the small batch random gradient descent algorithm, and when the loss function is minimum, the trained adaptive prototype contrast transformer network is obtained.
[0110] According to the obtained intra-domain prototype contrast loss function, cross-domain prototype contrast loss function, cross-entropy loss function and mutual information loss function, the transformer fault diagnosis network is trained, specifically including:
[0111] According to the obtained intra-domain prototype contrast loss function, the cross-domain prototype contrast loss function, the cross-entropy loss function and the mutual information loss function, a total loss function is obtained, and the transformer fault diagnosis network is trained according to the total loss function; the total loss function L total is expressed as:
[0112] L total = L cls + λ1*(L Local + L Global + λ2*L MIM
[0113] An optimizer using a small batch random gradient descent algorithm is used to adjust the parameters of the model, so that the model can better fit the loss function on the training data and converge to the optimal solution. The learning rate of the classifier is set to 0.01, the momentum is set to 0.9, the batch is set to 64, and the compromise parameters λ1 and λ2 are set to 0.5 and 0.01.
[0114] Step 6: input the target domain data to be tested into the trained adaptive prototype contrast transformer network, and after passing through the transformer Brown covariance module, the prototype contrast alignment module and the adaptive prototype classifier, the target domain data can be diagnosed.
[0115] The embodiment of the application also provides a ship propulsion shafting intelligent fault diagnosis system, which comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to execute the ship propulsion shafting intelligent fault diagnosis method of any one of the above.
[0116] In order to further illustrate the embodiment of the application, the propulsion shafting fault simulation test bed data is used to verify the embodiment of the application. The experimental data set is generated by the propulsion shafting fault simulation test bed. The acceleration sensor of the test bed is installed on the bearing seat to collect vibration signals; the sampling frequency is set to 2khz, and vibration data under 3 different working conditions are collected, respectively at 200r / min, 250r / min and 400r / min. The test bed simulates three fault modes, namely normal, shafting misalignment and shafting imbalance. Among them, the test bed simulates shafting misalignment by adjusting the pre-tightening force of the nut on the bearing seat. The shafting imbalance is simulated by adding an eccentric block in the coupling. Each source domain data set and target domain data set consists of 240 data samples, and the number of labeled source domain samples is set to 9. The diagnosis task is divided according to the speed of the source domain data and the target domain, and the specific data description is shown in Table 1.
[0117] Table 1 Diagnosis task data
[0118] Number of labeled source domain samples Diagnostic task Source domain dataset Target domain dataset 9 T1 240 (200 r / min) 240 (250 r / min) 9 T2 240 (200 r / min) 240 (400 r / min) 9 T3 240 (250 r / min) 240 (200 r / min) 9 T4 240 (250 r / min) 240 (400 r / min) 9 T5 240 (400 r / min) 240 (200 r / min) 9 T6 240 (400 r / min) 240 (250 r / min)
[0119] Based on the above laboratory data, the specific verification process of the application is as follows:
[0120] Step 1: For 3 operating conditions of the ship propulsion shafting, 6 transfer diagnosis tasks are set, and the number of labeled source domain samples is 9. The data of the source domain and the data of the target domain are all converted into two-dimensional time-frequency diagrams;
[0121] Step 2: The data of the source domain and the data of the target domain are input into the transformer Brown covariance module together to extract the corresponding feature tensor;
[0122] Step 3: In the prototype contrast alignment module, the domain-internal prototype contrast loss function L Local And the cross-domain prototype contrast loss function L Global ;
[0123] Step 4: The source domain data and the target domain data are predicted by the adaptive prototype classifier, and the maximum mutual information loss function L MIM And the cross-entropy loss function L cls ;
[0124] Step 5: The target domain data to be tested is input into the trained adaptive prototype contrast transformer network, and after the transformer Brown covariance module, the prototype contrast alignment module and the adaptive prototype classifier, the target domain data can be fault diagnosed.
[0125] In order to highlight the advantages of the method of the application in fault diagnosis, the diagnostic accuracy of the application and the existing popular methods is compared, and the popular methods include: deep residual shrinkage network with shared channel threshold (DRSN-CS), deep residual shrinkage network with channel threshold (DRSN-CW), global multi-attention deep residual shrinkage network (GMA-DRSNs), domain adversarial neural network (DANN), deep sub-domain adaptive network (DSAN), and multi-domain adaptive adversarial network (MDAAN). Ten experiments were carried out on a set of data, and comparative experiments were carried out with six methods. Table 2 shows the diagnostic accuracy comparison results between them. From the table, it can be seen that the fault diagnosis accuracy of the application is obviously higher than that of the other six methods.
[0126] Table 2 Comparison of experimental results
[0127]
[0128] The model trained by the application can perform cross-condition fault diagnosis on the ship propulsion shafting under the condition of limited labeled source data (at least 9), and solve the problems of limited labeled data and variable working conditions in industrial applications.
[0129] Those skilled in the art can easily understand that the above description is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for intelligent fault diagnosis of ship propulsion shafting, characterized in that, include: Offline data processing and training phase: S1, Select a portion of labeled source domain data and unlabeled target domain data, and convert the source domain data and the target domain data into two-dimensional time-frequency diagrams respectively; S2, the two-dimensional time-frequency graph is used to extract features through the transformer Brownian covariance module to obtain the BDC feature matrices corresponding to the source domain data and the target domain data, respectively, where BDC is the Brownian distance covariance; S3, Construct the prototype comparison and alignment module and classifier: The prototype comparison and alignment module uses a clustering algorithm to cluster and normalize the BDC feature matrices corresponding to the source domain data and the target domain data respectively to obtain the source domain clustering prototype and the target domain clustering prototype; it aligns the BDC feature matrices and clustering prototypes of the same domain to obtain the intra-domain prototype comparison loss function; it aligns the BDC feature matrices and clustering prototypes of different domains to obtain the cross-domain prototype comparison loss function. Fault classification prediction is performed on source domain data and target domain data using a classifier. The cross-entropy loss function is obtained based on the prediction results of labeled samples, and the mutual information loss function of the features is also obtained. S4, the transformer Brownian covariance module, the prototype comparison alignment module and the classifier form a transformer fault diagnosis network, and the transformer fault diagnosis network is trained according to the obtained intra-domain prototype comparison loss function, cross-domain prototype comparison loss function, cross-entropy loss function and mutual information loss function. Online fault diagnosis phase: S5. Use the trained transformer fault diagnosis network to perform ship propulsion shaft system fault diagnosis on the target domain data to be tested. The transformer Brownian covariance module includes a transformer encoder and a BDC pooling layer. The transformer encoder includes a multi-head attention layer and a multilayer perceptron. The multilayer perceptron consists of a fully connected layer and a GELU activation function. In the transformer Brownian covariance module, the two-dimensional time-frequency diagram is first converted into a three-dimensional feature tensor and then position-encoded. The feature tensor with position information is then processed by a multi-head attention mechanism. The result of the multi-head attention is input into a multilayer perceptron to extract features. The multi-dimensional feature vector extracted by the multilayer perceptron is then fed into the BDC pooling layer to extract the fault-related BDC feature matrix. The results of multi-head attention are input into an MLP consisting of two fully connected layers and a GELU activation function to extract features. The MLP is as follows: in, and It is a weight matrix. and For bias vectors, These are the eigenvectors.
2. The intelligent fault diagnosis method for ship propulsion shafting as described in claim 1, characterized in that, S1 specifically includes: One-dimensional vibration data was collected under a random working condition of the ship's propulsion shaft system. The collected one-dimensional vibration data was classified as source domain data. Among them, some data samples contained labels, while others did not. Vibration data from another random working condition is collected, and the collected one-dimensional vibration data is classified into target domain data, which is unlabeled data; A two-dimensional time-frequency diagram is obtained by wavelet transforming the one-dimensional vibration data in the source domain data and the target domain data.
3. The intelligent fault diagnosis method for ship propulsion shafting as described in claim 1, characterized in that, BDC Feature Matrix The extraction formula is as follows: ; ; in, For the characteristic tensor, This represents a matrix where each element is 1. Represents the identifier matrix. Represents the Hadama product. Represents the square of the Euclidean distance matrix. Represents the Euclidean distance matrix. Represents the regularization parameter. This represents the symmetry operation.
4. The intelligent fault diagnosis method for ship propulsion shafting as described in claim 1, characterized in that, In S3, BDC feature matrices and cluster prototypes within the same domain are aligned to obtain the intra-domain prototype contrast loss function; BDC feature matrices and cluster prototypes from different domains are aligned to obtain the cross-domain prototype contrast loss function; specifically including: Calculate the similarity distribution vector between the source domain BDC feature matrix and the source domain clustering prototype, and obtain the cross-entropy function between the similarity distribution vector and the source domain clustering pseudo-labels from the clustering algorithm; similarly, calculate the similarity distribution vector between the target domain BDC feature matrix and the target domain clustering prototype, and obtain the cross-entropy function between the similarity distribution vector and the target domain clustering pseudo-labels from the clustering algorithm; obtain the intra-domain prototype contrast loss function based on the two cross-entropy functions. Calculate the similarity distribution vector between the source domain BDC feature matrix and the target domain cluster prototype, and obtain the entropy function of the similarity distribution vector; similarly, calculate the similarity distribution vector between the target domain BDC feature matrix and the source domain cluster prototype, and obtain the entropy function of the similarity distribution vector; obtain the cross-domain prototype comparison loss function based on the two entropy functions.
5. The intelligent fault diagnosis method for ship propulsion shafting as described in claim 4, characterized in that, Intradomain prototype contrast loss function The calculation formula is: ; in, and These represent the number of labeled and unlabeled samples in the source domain data, respectively. The number of samples in the target domain data; and These are the pseudo-labels of the clustering algorithm, representing the source and target domains respectively. It is the cross-entropy function; This represents the similarity distribution vector between the source domain BDC feature matrix and the source domain clustering prototype. This represents the similarity distribution vector between the target domain BDC feature matrix and the target domain clustering prototype. Cross-domain prototype contrast loss function The calculation formula is: ; ; ; in, This is the similarity distribution vector between the source domain BDC feature matrix and the target domain clustering prototype; This is the similarity distribution vector between the target domain BDC feature matrix and the source domain clustering prototype; Clusters that are clustered; It is the entropy function.
6. The intelligent fault diagnosis method for ship propulsion shafting as described in claim 1, characterized in that, The classifier is an adaptive prototype classifier, and the predicted label of the adaptive prototype classifier is... for: ; in, For the softmax function, This is the weight matrix. As a scaling factor, For the extracted features, For input data; where the first... i Weight matrix during the second prediction for: ; in, To set a threshold, The network weights represented by the source domain. The network weights represent the target domain. For target domain data.
7. The intelligent fault diagnosis method for ship propulsion shafting as described in claim 1, characterized in that, Cross-entropy loss function Specifically: ; in, For input data, For real labels, For predicting labels, Indicates the number of labeled samples in the source domain data; Maximize mutual information loss function Specifically: ; in, For the parameters to be learned; It is the expected value function; Conditional entropy; prior distribution Depend on get.
8. The intelligent fault diagnosis method for ship propulsion shafting as described in claim 1, characterized in that, The transformer fault diagnosis network is trained based on the obtained intra-domain prototype comparison loss function, cross-domain prototype comparison loss function, cross-entropy loss function, and mutual information loss function, specifically including: The total loss function is obtained by using the intra-domain prototype comparison loss function, cross-domain prototype comparison loss function, cross-entropy loss function and mutual information loss function, and the transformer fault diagnosis network is trained based on the total loss function. The total loss function Specifically: ; in, For cross-domain prototype comparison loss function, For in-domain prototype contrast loss function, Let cross-entropy be the loss function. To maximize the mutual information loss function, and This is a compromise parameter.
9. An intelligent fault diagnosis system for ship propulsion shafting, characterized in that, The system includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it performs the intelligent fault diagnosis method for ship propulsion shafting as described in any one of claims 1-8.
Citation Information
Patent Citations
Rolling bearing fault diagnosis method based on few-label data feature migration
CN113988126A
Small sample image classification method, system and device based on coordinate attention and BDC measurement and medium
CN117095222A