Intelligent fault diagnosis method and system for ship propulsion shafting

By building a transformer fault diagnosis network, the transformer Brownian covariance module and prototype comparison and alignment module are used to extract features, and trained through an adaptive prototype classifier, the problem of difficulty in achieving variable working condition fault diagnosis under limited label sample data is solved, and the fault diagnosis of cross-work condition of ship propulsion shaft system under a small amount of label data is realized.

CN119669854AActive Publication Date: 2025-03-21HUAZHONG UNIV OF SCI & TECH

Patent Information

Application Number
CN202411736787.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-21
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

The existing intelligent fault diagnosis technology relies on sufficient labeled training data, and in actual industrial applications, it is difficult to obtain labeled data generated by ship propulsion shaft systems, making it difficult to achieve variable working condition fault diagnosis under limited labeled sample data.

Method used

The transformer Brownian covariance module, prototype comparison and alignment module and adaptive prototype classifier are used to build a transformer fault diagnosis network. The network is trained by extracting the BDC feature matrix, the in-domain prototype comparison loss function, the cross-domain prototype comparison loss function, the cross-entropy loss function and the mutual information loss function to achieve variable operating condition fault diagnosis under a small amount of labeled data.

Benefits of technology

With a small amount of labeled data, the cross-working fault diagnosis of the ship propulsion shaft system is realized, the task volume of data labeling is reduced, the accuracy of fault diagnosis is improved, and the problem of variable working condition diagnosis in industrial applications is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669854A_ABST
    Figure CN119669854A_ABST
Patent Text Reader

Abstract

The invention belongs to the related technical field of fault diagnosis, and discloses an intelligent fault diagnosis method and system for a ship propulsion shafting, and the method comprises the steps: converting source domain data and target domain data into two-dimensional time-frequency diagrams; extracting representative high-dimensional features by using a transformer Brownian covariance module, and converting the representative high-dimensional features into a Brownian distance covariance (BDC) feature matrix; then, the BDC characteristic matrix is input into a prototype comparison and alignment module, and intra-domain distribution and cross-domain distribution of the BDC characteristic matrix are aligned respectively; and the classifier is used to predict source domain and target domain data, the network is trained based on the four loss functions, and the trained transformer fault diagnosis network is used to carry out ship propulsion shafting fault diagnosis on the target domain data. The obtained trained network can carry out variable working condition fault diagnosis on the ship propulsion shafting under a small amount of annotation data, the task load of data annotation in industrial fault diagnosis is greatly reduced, and the variable working condition problem is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field related to fault diagnosis, and more specifically, relates to an intelligent fault diagnosis method and system for a ship propulsion shaft system. Background Art

[0002] The propulsion shaft system is a core component of large ships. Once it is abnormal or fails, it will directly affect the service reliability and safety of the ship. During the service life of the ship's propulsion shaft system, due to the complex and harsh use environment and the continuous action of alternating loads, the propulsion shaft system may have problems such as bearing wear and shaft misalignment, which seriously affect the safety performance of the ship's navigation. Therefore, in order to ensure the long-term reliability of the propulsion shaft system, it is very necessary to carry out intelligent diagnosis of ship propulsion shaft system faults.

[0003] In recent years, with the development of sensors and artificial intelligence technology, deep learning has been increasingly used to promote shaft fault diagnosis and has achieved good results. Commonly used diagnostic models include convolutional neural networks, recursive neural networks, and autoencoders. The most critical element of deep learning-based fault diagnosis methods is the automatic extraction of representative fault features, which greatly reduces the dependence on professional knowledge. However, these effective deep learning models are inseparable from sufficient labeled training samples. That is, existing intelligent fault diagnosis technologies rely on sufficient labeled training data. In addition, the collected samples need to meet the same distribution condition.

[0004] In actual industrial applications, ship propulsion shafting generates a large amount of unlabeled data during operation. Due to the lack of expert knowledge, labeling training samples is often difficult and uneconomical. In addition, due to changes in load and speed conditions, samples collected from propulsion shafting usually follow different distributions. At present, the difficulty in obtaining labeled sample data and variable operating condition diagnosis are the challenges faced by intelligent fault diagnosis. How to realize variable operating condition fault diagnosis under the premise of limited labeled sample data is a key problem that intelligent fault diagnosis urgently needs to solve. Summary of the invention

[0005] In response to the above defects or improvement needs of the prior art, the present invention provides a method and system for intelligent fault diagnosis of ship propulsion shafting, which is used to solve the problem that it is difficult to obtain labeled sample data and it is difficult to realize variable operating condition fault diagnosis under the premise of limited labeled sample data.

[0006] To achieve the above object, according to one aspect of the present invention, a method for intelligent fault diagnosis of a ship propulsion shaft system is provided, comprising:

[0007] Offline data processing and training phase:

[0008] S1, selecting some sample source domain data with labels and target domain data without labels, and converting the source domain data and the target domain data into two-dimensional time-frequency graphs respectively;

[0009] S2, extracting features from the two-dimensional time-frequency graph through a transformer Brownian covariance module to obtain BDC feature matrices corresponding to the source domain data and the target domain data, respectively, where BDC is Brownian distance covariance;

[0010] S3, constructing a prototype comparison and alignment module and a 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 cluster prototype and the target domain cluster prototype; aligns the BDC feature matrix and cluster prototype of the same domain to obtain the intra-domain prototype comparison loss function; aligns the BDC feature matrix and cluster prototype of different domains to obtain the cross-domain prototype comparison loss function;

[0011] Perform fault classification prediction on source domain data and target domain data through classifiers, obtain the cross entropy loss function based on the prediction results of labeled samples, and obtain the mutual information loss function of features;

[0012] S4, the transformer Brownian 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, using the trained transformer fault diagnosis network to perform ship propulsion shaft fault diagnosis on the target domain data to be tested.

[0015] According to the ship propulsion shafting intelligent fault diagnosis method provided by the present invention, S1 specifically includes:

[0016] A working condition is randomly selected in the ship propulsion shaft system to collect one-dimensional vibration data, and the collected one-dimensional vibration data is classified as source domain data, among which several data samples contain labels and others do not contain labels;

[0017] Collect vibration data of another random working condition, and classify the collected one-dimensional vibration data as target domain data, where the target domain data is unlabeled data;

[0018] 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.

[0019] According to the ship propulsion shafting intelligent fault diagnosis method provided by the present invention, 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 multi-layer perceptron, and the multi-layer perceptron is composed of a fully connected layer and a GELU activation function;

[0020] In the transformer Brownian covariance module, the two-dimensional time-frequency diagram is first converted into a three-dimensional feature tensor and position encoded, 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; the multi-dimensional feature vector extracted by the multi-layer perceptron is sent to the BDC pooling layer to extract the BDC feature matrix related to the fault.

[0021] According to the ship propulsion shafting intelligent fault diagnosis method provided by the present invention, the extraction formula of the BDC characteristic matrix A is as follows:

[0022]

[0023] Among them, X is the feature tensor, 1 represents a matrix with each element being 1, and I represents the identity matrix. represents the Hadamard product, represents the square of the Euclidean distance matrix, represents the Euclidean distance matrix, d represents the regularization parameter, (·) sym Represents a symmetrization operation.

[0024] According to the ship propulsion shafting intelligent fault diagnosis method provided by the present invention, in S3, the BDC feature matrix and cluster prototype of the same domain are aligned to obtain the intra-domain prototype comparison loss function; the BDC feature matrix and cluster prototype of different domains are aligned to obtain the cross-domain prototype comparison loss function; specifically including:

[0025] 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-label 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-label from the clustering algorithm; obtain the domain prototype comparison loss function based on the two cross entropy functions;

[0026] Calculate the similarity distribution vector between the source domain BDC feature matrix and the target domain cluster prototype to 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 to obtain the entropy function of the similarity distribution vector; obtain the cross-domain prototype comparison loss function based on the two entropy functions.

[0027] According to the ship propulsion shafting intelligent fault diagnosis method provided by the present invention, the domain prototype comparison loss function L Local The calculation formula is:

[0028]

[0029] Among them, 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 are the cluster pseudo labels of the source domain and target domain from the clustering algorithm; L CE (·) is the cross entropy function; is the similarity distribution vector between the source domain BDC feature matrix and the source domain clustering prototype; is the similarity distribution vector between the target domain BDC feature matrix and the target domain clustering prototype;

[0030] Cross-domain prototype comparison loss function L Global The calculation formula is:

[0031]

[0032] in, is the similarity distribution vector between the BDC feature matrix of the source domain and the clustering prototype of the target domain; is the similarity distribution vector between the target domain BDC feature matrix and the source domain clustering prototype; k is the cluster; H(·) is the entropy function.

[0033] According to the ship propulsion shafting intelligent fault diagnosis method provided by the present invention, the classifier is an adaptive prototype classifier, and the prediction label p(x) of the adaptive prototype classifier is:

[0034]

[0035] Among them, σ(·) is the softmax function, W is the weight matrix, T is the scale factor, f is the extracted feature, and x is the input data; the weight matrix w for the i-th prediction i for:

[0036]

[0037] Among them, T prototype To set the threshold, is the network weight of the source domain representative, is the network weight of the target domain representative, The target domain data.

[0038] According to the ship propulsion shafting intelligent fault diagnosis method provided by the present invention, the cross entropy loss function L cls Specifically:

[0039]

[0040] Among them, x is the input data, y is the true label, p(x) is the predicted label, and n s Represents the number of labeled samples in the source domain data;

[0041] Maximize the mutual information loss function L MIM Specifically:

[0042] L MIM =E x [H(p(y|x;θ))]-H(p0);

[0043] Among them, θ is the learning parameter; E x [·] is the expected value function; H(p(y|x; θ)) is the conditional entropy; the prior distribution p0 is given by E x [p(y|x;θ)] is obtained.

[0044] According to the ship propulsion shafting intelligent fault diagnosis method provided by the present invention, 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, specifically including:

[0045] The total loss function is obtained 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 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 +λ1*(L Local +L Global )+λ2*L MIM ;

[0048] Among them, L Global is the cross-domain prototype comparison loss function, L Local is the prototype contrast loss function in the domain, L cls is the cross entropy loss function, L MIM To maximize the mutual information loss function, λ1 and λ2 are trade-off parameters.

[0049] According to another aspect of the present invention, there is provided a ship propulsion shaft system intelligent fault diagnosis system, the system comprising a memory and a processor, the memory storing a computer program, and the processor executing any one of the above-mentioned ship propulsion shaft system intelligent fault diagnosis methods when executing the computer program.

[0050] In general, compared with the prior art, the above technical solutions conceived by the present invention provide a method and system for intelligent fault diagnosis of a ship propulsion shaft system:

[0051] 1. Establish a transformer Brownian covariance module to extract the BDC feature matrix, and use the Brownian distance covariance principle to extract deeper hidden features, which can reveal the nonlinear relationship in the data; adopt a prototype comparison and alignment module, obtain feature prototypes based on a clustering algorithm, align intra-domain features and feature prototypes and cross-domain features and feature prototypes, and calculate the intra-domain prototype comparison loss function and cross-domain prototype comparison loss function; calculate the cross entropy loss function and mutual information loss function based on the prediction results of the classifier; train the transformer fault diagnosis network based on the four loss functions, and the trained network can perform variable condition fault diagnosis on the ship propulsion shaft system with a small amount of labeled data, greatly reducing the amount of data labeling tasks in industrial fault diagnosis;

[0052] 2. The specific calculation process of the intra-domain prototype comparison loss function and the cross-domain prototype comparison loss function is provided. The prototype comparison alignment module constructed based on the two loss functions is used to accurately align the data distribution in the source domain and the target domain, and realize the synchronous domain alignment of the local prototype and the global prototype, thereby helping the network to extract discriminative feature representations under a small amount of labeled data and variable working conditions, thereby improving the accuracy of fault diagnosis;

[0053] 3. An adaptive prototype classifier was constructed. The classifier parameters were trained by a small amount of labeled source domain data, and a threshold was set to filter high-confidence target domain data to participate in updating the classifier weights, which is conducive to improving the fault diagnosis accuracy and realizing cross-operating fault diagnosis of ship propulsion shafting with few annotations;

[0054] 4. The proposed method can perform accurate fault diagnosis of the ship propulsion shaft system across operating conditions when the annotated source data is limited (at least 9), solve the problem of variable operating conditions in industrial applications, and meet the needs of industrial applications. No matter how the operating conditions of the ship propulsion shaft system change, the method of the present invention can realize fault diagnosis of the ship propulsion shaft system under any operating condition, and has engineering application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 It is a framework diagram of a method for intelligent diagnosis of ship propulsion shafting faults based on an adaptive prototype comparison transformer network provided by an embodiment of the present invention;

[0056] Figure 2 It is a flow chart of an intelligent diagnosis method for ship propulsion shafting faults based on an adaptive prototype comparison transformer network provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0058] See also Figure 1 and Figure 2 This embodiment provides a method for intelligent fault diagnosis of a ship propulsion shaft system, the method comprising:

[0059] Offline data processing and training phase:

[0060] S1, selecting some sample source domain data with labels and target domain data without labels, and converting the source domain data and the target domain data into two-dimensional time-frequency graphs respectively;

[0061] S2, extracting features from the two-dimensional time-frequency graph through a transformer Brownian covariance module to obtain BDC feature matrices corresponding to the source domain data and the target domain data, respectively, where BDC is Brownian distance covariance;

[0062] S3, constructing a prototype comparison and alignment module and a 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 cluster prototype and the target domain cluster prototype; aligns the BDC feature matrix and cluster prototype of the same domain to obtain the intra-domain prototype comparison loss function; aligns the BDC feature matrix and cluster prototype of different domains to obtain the cross-domain prototype comparison loss function;

[0063] Perform fault classification prediction on source domain data and target domain data through classifiers, obtain the cross entropy loss function based on the prediction results of labeled samples, and obtain the mutual information loss function of features;

[0064] S4, the transformer Brownian 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 a two-dimensional time-frequency graph; then the transformer Brownian covariance module is used to extract the corresponding representative high-dimensional features and convert them into a Brownian distance covariance (BDC) feature matrix; the prototype contrast alignment module is used to align the intra-domain distribution and cross-domain distribution of the BDC feature matrix respectively, and calculate the intra-domain prototype contrast loss function and the cross-domain prototype contrast loss function; the intra-domain prototype contrast loss function is specifically a cross-entropy loss function on the similarity distribution between the intra-domain features and the feature prototypes of the same domain; the cross-domain prototype contrast loss function is specifically an entropy loss function on the similarity distribution between the intra-domain features and the feature prototypes of different domains.

[0068] The BDC feature matrices of the source domain and the target domain extracted by the transformer Brownian covariance module are simultaneously input into the classifier, and the source domain and target domain data are predicted by the classifier to calculate the maximum mutual information loss function and the cross entropy loss function; the obtained loss function is used 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 are the following four:

[0069] By minimizing the cross entropy loss function on the similarity distribution between the in-domain features and the prototype features of the same domain as optimization object 1; by minimizing the entropy loss function on the similarity distribution between the in-domain features and the prototype features of different domains as optimization object 2; by minimizing the cross entropy loss function between the true label and the predicted label of the labeled sample as optimization object 3; by maximizing the mutual information loss function of the features as optimization object 4.

[0070] Calculate 4 network optimization objects, including: extracting the BDC feature matrix of size 1×512 tensor in the transformer Brownian covariance module, obtaining the feature prototypes of the source domain and the target domain through the prototype comparison and alignment module, calculating the cross entropy loss function on the similarity distribution between the features in the domain and the feature prototypes in the same domain, calculating the entropy loss function on the similarity distribution between the features in the domain and the prototypes in different domains, calculating the cross entropy loss function of the true label and the predicted label of the marked feature in the classifier, and calculating the mutual information loss function of the feature.

[0071] The technical effects of the embodiments of the present invention are further described below in conjunction with specific embodiments.

[0072] The present embodiment provides an intelligent diagnosis method for ship propulsion shafting faults based on an adaptive prototype comparison transformer fault diagnosis network. The adaptive prototype comparison transformer fault diagnosis network provided by the present embodiment is composed of a transformer Brownian covariance module, a prototype comparison alignment module and an adaptive prototype classifier; the transformer Brownian covariance module is used to extract high-dimensional features of source domain and target domain data, and convert them into a Brownian distance covariance (BDC) feature matrix; the prototype comparison alignment module is used to align the intra-domain distribution and cross-domain distribution of the BDC feature matrix respectively; the adaptive prototype classifier is used to adaptively learn discriminative features and accurately predict data. Figure 1 The specific processing flow of this method mainly includes the following steps:

[0073] Step 1, the source domain and target domain data are selected, including: a data set collected under any operating condition of the ship propulsion shaft system, a data set collected under a random operating condition, a data sample is one-dimensional vibration data, and the collected one-dimensional vibration data is classified as source domain data as the source domain. Among them, several data samples contain labels, for example, 9 data samples contain labels, and the others do not contain labels. Vibration data of another random operating condition is collected, and the collected one-dimensional vibration data is classified as the target domain, and the target domain data is unlabeled data.

[0074] The source domain data and the target domain data are converted into a two-dimensional time-frequency diagram. Specifically, the sampling points of each sample in the one-dimensional vibration data of the source domain and the target domain can be 8000, and the two-dimensional time-frequency diagram is obtained by wavelet transforming the one-dimensional vibration data.

[0075] Specifically, the source domain dataset D S It consists of two parts: labeled source domain samples and unlabeled source domain samples Among them, n s and n us denote the number of labeled and unlabeled source domain samples, respectively, represents the label of the source domain sample, represents the labeled sample data, represents unlabeled sample data. Furthermore, the target domain dataset By t unlabeled samples, represents the target domain sample data. The marginal probability distribution of the source domain and the target domain is different, denoted as P(D S ) and P(D T ), where P(D S )≠P(D T ).

[0076] Step 2: Convert the source domain and target domain into two-dimensional time-frequency Figure 1The output is then fed into the transformer Brownian covariance module to extract the corresponding feature tensor. The transformer Brownian covariance module is a feature extraction network with a BDC pooling layer added.

[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, passes through the transformer encoder and the BDC pooling layer, and finally outputs a one-dimensional feature tensor of size 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 encoded. Then, these tensors with position information are processed by a multi-head attention mechanism. Then, the results of the multi-head attention are input into an 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] Among them, 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 MLP is fed into the BDC pooling layer to extract the BDC feature matrix A related to the fault, which can be formulated as:

[0080]

[0081] Among them, X is the feature tensor, 1 represents a matrix with each element being 1, and I represents the identity matrix. represents the Hadamard product, represents the square of the Euclidean distance matrix, represents the Euclidean distance matrix, d represents the regularization parameter, (·) sym Represents a symmetrization operation.

[0082] Step 3: In the prototype comparison and alignment module, the BDC feature matrix is ​​clustered by using a spectral clustering algorithm or a K-means clustering algorithm. The source domain clusters and the target domain clusters are obtained and normalized respectively, thereby obtaining the source domain cluster prototype and the target domain cluster prototype respectively. Next, the intra-domain prototype comparison loss function L is calculated. Local At the same time, the cross-domain prototype comparison loss function L is calculated Global .

[0083] Specifically, the BDC feature matrix Clustered and normalized to obtain the source domain cluster 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 expressed as:

[0084]

[0085] in, is the temperature parameter, and exp(·) is the exponential function. Similarly, the similarity distribution vector between the target domain BDC feature matrix and the target domain clustering prototype is Right now can be calculated. Further, the prototype contrast loss function L Local Formulated as

[0086]

[0087] Among them, 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 are the cluster pseudo labels of the source domain and the target domain from the spectral clustering algorithm; L CE (·) is the cross entropy function; is the similarity distribution vector between the source domain BDC feature matrix and the source domain clustering prototype; is the similarity distribution vector between the target domain BDC feature matrix and the target domain clustering prototype. At the same time, the source domain BDC feature matrix {f i s+us} and the similarity distribution vector of the target domain cluster prototype can be expressed as:

[0088]

[0089] in, is the target domain clustering prototype; in this way, the target domain BDC feature matrix {f i t} and source domain clustering prototype The similarity distribution vector can be obtained. Then, minimize the similarity distribution vector Entropy function and similarity distribution vector Entropy function, cross-domain prototype comparison loss function L Global is formulated as:

[0090]

[0091] Where H(·) is the entropy function.

[0092] That is, align the BDC feature matrix and cluster prototype of the same domain to obtain the intra-domain prototype comparison loss function; align the BDC feature matrix and cluster prototype of different domains to obtain the cross-domain prototype comparison loss function; specifically include:

[0093] 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-label 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-label from the clustering algorithm; obtain the domain prototype comparison loss function based on the two cross entropy functions;

[0094] Calculate the similarity distribution vector between the source domain BDC feature matrix and the target domain cluster prototype to 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 to obtain the entropy function of the similarity distribution vector; obtain the cross-domain prototype comparison loss function based on the two entropy functions.

[0095] Step 4: The classifier is an adaptive prototype classifier, which adaptively updates the network weights to accurately predict the data. The adaptive prototype classifier uses a small amount of labeled data and high confidence data to update the network weights. The adaptive prototype classifier consists of a fully connected layer without a bias term 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 scaling factor, f is the extracted feature, and x is the input data. Set the threshold and select data with high prediction probability to train the adaptive prototype classifier. In the early stage of training, since a small amount of labeled source domain data is more robust, the labeled source domain data is used to update the network weights; in the later stage of training, since the samples in the target domain are more representative, the target domain data is used to update the network weights. For the convenience of description, the target domain data is used. To determine whether the weights are robust, the weight matrix w is the i-th prediction of the classifier i It is expressed as:

[0098]

[0099] Among them, T prototype is the threshold value, is the network weight of the source domain representative, is the network weight of the target domain representative.

[0100] The cross entropy loss function L between the true label y and the predicted label p(x) of the input data x cls is formulated as:

[0101]

[0102] Among them, n s Represents the number of labeled samples in the source domain data. Then, all features are calculated for mutual information, and the mutual information calculation formula of variables X and Y is:

[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. Calculate 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;θ))]-H(p0)

[0107] Where θ is the learning parameter, E x [·] is the expected value function; H(p(y|x; θ)) is the conditional entropy; p(y|x; θ) is the probability distribution predicted by the classifier; the prior distribution p0 is given by E x [p(y|x;θ)] is obtained.

[0108] Step 5: the loss function L provided in the embodiment of the present invention Local , L Global , L cls and L MIM Training the adaptive prototype contrast transformer fault diagnosis network as an optimization object of the adaptive prototype contrast transformer network includes:

[0109] The loss function L Local , L Global , L cls and L MIM As the optimization object, the adaptive prototype contrast transformer fault diagnosis network is trained using the small batch stochastic gradient descent algorithm. When the loss function is minimized, the trained adaptive prototype contrast transformer network is obtained.

[0110] 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, including:

[0111] The total loss function is obtained 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 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] It uses the optimizer of the mini-batch stochastic gradient descent algorithm 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 trade-off 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. After the transformer Brownian covariance module, the prototype contrast alignment module and the adaptive prototype classifier, the target domain data can be diagnosed for faults.

[0115] An embodiment of the present invention further provides a ship propulsion shaft system intelligent fault diagnosis system, the system comprising a memory and a processor, the memory storing a computer program, and the processor executing any one of the above-mentioned ship propulsion shaft system intelligent fault diagnosis methods when executing the computer program.

[0116] In order to further explain the embodiment of the present invention in detail, the propulsion shaft fault simulation test bench data is used to verify the embodiment of the present invention. The experimental data set is generated by the propulsion shaft fault simulation test bench. The acceleration sensor of the test bench is installed on the bearing seat to collect vibration signals; the sampling frequency is set to 2khz, and vibration data under three different working conditions are collected, respectively, at speeds of 200r / min, 250r / min, and 400r / min. The test bench simulates three fault modes, namely normal, shaft misalignment, and shaft imbalance. Among them, the test bench simulates shaft misalignment by adjusting the preload of the nut on the bearing seat. Shaft imbalance is simulated by adding an eccentric block to 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 diagnostic tasks are divided according to the speed of the source domain data and the target domain. The specific data description is shown in Table 1.

[0117] Table 1 Diagnostic task data

[0118] The number of labeled source domain samples Diagnostic tasks Source domain dataset Target domain dataset 9 T1 240(200r / min) 240(250r / min) 9 T2 240(200r / min) 240(400r / min) 9 T3 240(250r / min) 240(200r / min) 9 T4 240(250r / min) 240(400r / min) 9 T5 240(400r / min) 240(200r / min) 9 T6 240(400r / min) 240(250r / min)

[0119] Based on the above laboratory data, the specific verification process of the present invention is as follows:

[0120] Step 1: For the three operating conditions of the ship propulsion shaft system, six migration diagnosis tasks are set, of which the number of labeled source domain samples is 9. Both the source domain data and the target domain data are converted into two-dimensional time-frequency graphs;

[0121] Step 2: Input the data of the source domain and the data of the target domain into the transformer Brownian covariance module together to extract the corresponding feature tensor;

[0122] Step 3: In the prototype comparison and alignment module, the prototype comparison loss function L in the domain is calculated Local Compared with the cross-domain prototype loss function L Global ;

[0123] Step 4: Use the adaptive prototype classifier to predict the source domain data and the target domain data, and calculate the maximum mutual information loss function L MIM And the cross entropy loss function L cls ;

[0124] Step 5: Input the target domain data to be tested into the trained adaptive prototype contrast transformer network. After the transformer Brownian covariance module, prototype contrast alignment module and adaptive prototype classifier, fault diagnosis can be performed on the target domain data.

[0125] In order to highlight the advantages of the method of the present invention in fault diagnosis, the present invention is compared with the existing popular methods in terms of diagnostic accuracy, and the popular methods are: Deep Residual Shrinkage Network with Shared Channel Threshold (DRSN-CS), Deep Residual Shrinkage Network with Channelized Threshold (DRSN-CW), Global Multi-Attention Deep Residual Shrinkage Network (GMA-DRSNs), Domain Adversarial Neural Network (DANN), Deep Subdomain Adaptation Network (DSAN), Multi-Domain Adaptive Adversarial Network (MDAAN). Ten experiments were conducted on a set of data, and comparative experiments were conducted with six methods. Table 2 shows the comparison results of their diagnostic accuracy. It can be seen from the table that the fault diagnosis accuracy of the present invention is significantly higher than that of the other six methods.

[0126] Table 2 Comparison of experimental results

[0127]

[0128] The model trained by the present invention can perform cross-operating condition fault diagnosis on the ship propulsion shaft system when the annotated source data is limited (at least 9), thus solving the problems of limited annotated data and variable operating conditions in industrial applications.

[0129] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for intelligent fault diagnosis of a ship propulsion shaft system, characterized in that: include: Offline data processing and training phase: S1, selecting some sample source domain data with labels and target domain data without labels, and converting the source domain data and the target domain data into two-dimensional time-frequency graphs respectively; S2, extracting features from the two-dimensional time-frequency graph through a transformer Brownian covariance module to obtain BDC feature matrices corresponding to the source domain data and the target domain data, respectively, where BDC is Brownian distance covariance; S3, constructing a prototype comparison and alignment module and a 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 cluster prototype and the target domain cluster prototype; aligns the BDC feature matrix and cluster prototype of the same domain to obtain the intra-domain prototype comparison loss function; aligns the BDC feature matrix and cluster prototype of different domains to obtain the cross-domain prototype comparison loss function; Perform fault classification prediction on source domain data and target domain data through classifiers, obtain the cross entropy loss function based on the prediction results of labeled samples, and obtain the mutual information loss function of features; S4, the transformer Brownian 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; Online fault diagnosis stage: S5, using the trained transformer fault diagnosis network to perform ship propulsion shaft fault diagnosis on the target domain data to be tested.

2. The ship propulsion shafting intelligent fault diagnosis method according to claim 1, characterized in that: S1 specifically includes: A working condition is randomly selected in the ship propulsion shaft system to collect one-dimensional vibration data, and the collected one-dimensional vibration data is classified as source domain data, among which several data samples contain labels and others do not contain labels; Collect vibration data of another random working condition, and classify the collected one-dimensional vibration data as target domain data, where the target domain data 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 ship propulsion shafting intelligent fault diagnosis method according to claim 1, characterized in that: 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 multi-layer perceptron, and the multi-layer 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 position encoded, 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; the multi-dimensional feature vector extracted by the multi-layer perceptron is sent to the BDC pooling layer to extract the BDC feature matrix related to the fault.

4. The ship propulsion shafting intelligent fault diagnosis method according to claim 3, characterized in that: The extraction formula of BDC feature matrix A is as follows: Among them, X is the feature tensor, 1 represents a matrix with each element being 1, and I represents the identity matrix. represents the Hadamard product, represents the square of the Euclidean distance matrix, represents the Euclidean distance matrix, d represents the regularization parameter, (·) sym Represents a symmetrization operation.

5. The ship propulsion shafting intelligent fault diagnosis method according to claim 1, characterized in that: In S3, the BDC feature matrix and cluster prototype of the same domain are aligned to obtain the intra-domain prototype comparison loss function; the BDC feature matrix and cluster prototype of different domains are aligned to obtain the cross-domain prototype comparison loss function; specifically, it includes: 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-label 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-label from the clustering algorithm; obtain the domain prototype comparison 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 to 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 to obtain the entropy function of the similarity distribution vector; obtain the cross-domain prototype comparison loss function based on the two entropy functions.

6. The ship propulsion shafting intelligent fault diagnosis method according to claim 5, characterized in that: In-domain prototype contrast loss function L Local The calculation formula is: Among them, 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 are the clustering pseudo labels of the source domain and target domain from the clustering algorithm; L CE (·) is the cross entropy function; is the similarity distribution vector between the source domain BDC feature matrix and the source domain clustering prototype; is the similarity distribution vector between the target domain BDC feature matrix and the target domain clustering prototype; Cross-domain prototype comparison loss function L Global The calculation formula is: in, is the similarity distribution vector between the BDC feature matrix of the source domain and the clustering prototype of the target domain; is the similarity distribution vector between the target domain BDC feature matrix and the source domain clustering prototype; k is the cluster; H(·) is the entropy function.

7. The ship propulsion shafting intelligent fault diagnosis method according to claim 1, characterized in that: The classifier is an adaptive prototype classifier, and the predicted label p(x) of the adaptive prototype classifier is: Among them, σ(·) is the softmax function, W is the weight matrix, T is the scale factor, f is the extracted feature, and x is the input data; the weight matrix w for the i-th prediction i for: Among them, T prototype To set the threshold, is the network weight of the source domain representative, is the network weight of the target domain representative, The target domain data.

8. The ship propulsion shafting intelligent fault diagnosis method according to claim 1, characterized in that: Cross entropy loss function L cls Specifically: Among them, x is the input data, y is the true label, p(x) is the predicted label, and n s Represents the number of labeled samples in the source domain data; Maximize the mutual information loss function L MIM Specifically: L MIM =E x [H(p(y|x;θ))]-H(p0); Among them, θ is the learning parameter; E x [·] is the expected value function; H(p(y|x; θ)) is the conditional entropy; the prior distribution p0 is given by E x [p(y|x;θ)] is obtained.

9. The ship propulsion shafting intelligent fault diagnosis method according to claim 1, characterized in that: 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, including: The total loss function is obtained 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 the transformer fault diagnosis network is trained according to the total loss function; The total loss function L total Specifically: L total =L cls +λ1*(L Local +L Global )+λ2*L MIM ; Among them, L Global is the cross-domain prototype comparison loss function, L Local is the prototype contrast loss function in the domain, L cls is the cross entropy loss function, L MIM To maximize the mutual information loss function, λ1 and λ2 are trade-off parameters.

10. An intelligent fault diagnosis system for ship propulsion shafting, characterized in that: The system includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the intelligent fault diagnosis method for ship propulsion shafting according to any one of claims 1 to 9 is executed.

Citation Information

Patent Citations

  • Rolling bearing fault diagnosis method based on few-label data feature migration

    CN113988126A

  • Gear fault diagnosis method based on enhanced relation network

    CN116907838A

  • Small sample image classification method, system and device based on coordinate attention and BDC measurement and medium

    CN117095222A

  • Remote sensing image scene classification method based on mixed attention and position coding

    CN117152632A

  • Adaptive cross-working-condition fault diagnosis method for rotary machinery based on depth discrimination and unsupervised field

    CN118643324A

Cited By

  • Cross-working-condition bearing fault diagnosis method based on prototype domain alignment feature coding

    CN120541740A