Method for constructing graph attention ship engine fault diagnosis model based on feature fusion
By constructing a graph attention model based on feature fusion, data scarcity and complexity problems in ship engine fault diagnosis are solved, and the fault diagnosis accuracy is improved.
Patent Information
- Application Number
- CN202411092804.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-22
AI Technical Summary
Ship engine fault diagnosis faces the problems of scarce data, many types of faults, many data noise interference and insufficient label information, resulting in limited multi-information processing capabilities of the model and low accuracy of fault diagnosis results.
Using a graph attention model based on feature fusion, by obtaining sample feature data of ship engines, a probability similarity matrix and cosine similarity matrix are constructed, and fusion is carried out to generate a fusion similarity matrix and an adjacency matrix, and a graph attention aggregation layer is constructed for Troubleshooting.
It improves the ability to identify the complexity of multi-thermal parameters of ship engines and improves the accuracy of fault diagnosis results.
Smart Images

Figure CN119004375A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship engine fault diagnosis, and in particular to a method for constructing a feature fusion-based graph attention ship engine fault diagnosis model. Background Art
[0002] As the main power source for ship navigation and power generation, ship engines occupy an important position in the ship industry. Due to their importance, if the engine operation failure is not discovered in time, it will cause huge economic losses or even casualties. Therefore, timely monitoring and diagnosis of the engine's working status can effectively improve the reliability, economy and safety of normal ship operations. With the tide of the era of ship intelligence and the continuous development and improvement of artificial intelligence and algorithm computing power, more and more scholars are applying artificial intelligence to the field of state detection and fault diagnosis, and the fault diagnosis method of ship engines is also constantly improving.
[0003] However, ship engine fault diagnosis faces challenges such as data scarcity, multiple fault types, data noise interference, and insufficient label information. In addition, the relationship between the many thermal parameters of ship engines is not just a simple linear relationship, but is often very complex and unknowable. As a result, most current models have limited processing capabilities for uncertain or multivariate information, poor model interpretability, and lack the ability to identify the complexity of many thermal parameters of ship engines, which in turn leads to the problem of low accuracy of ship engine fault diagnosis results. Summary of the invention
[0004] The present invention provides a method for constructing a graph attention ship engine fault diagnosis model based on feature fusion to overcome the above technical problems.
[0005] In order to achieve the above object, the technical solution of the present invention is:
[0006] A method for constructing a graph attention ship engine fault diagnosis model based on feature fusion specifically includes the following steps:
[0007] S1: Obtain sample feature data of the ship engine in normal and faulty states, and set data category labels for the sample feature data to construct an initial data set;
[0008] The sample characteristic data at least includes temperature, pressure and rotation speed;
[0009] and performing normalization processing on the sample feature data in the initial data set to obtain an optimized data set;
[0010] S2: taking the sample feature data in the optimized data set as feature nodes, and using the t_SNE algorithm to obtain the probability similarity between the feature nodes to construct a probability similarity matrix;
[0011] The cosine similarity algorithm is used to obtain the cosine similarity matrix between each feature node;
[0012] S3: selecting an early fusion method as a similarity graph fusion method, fusing the probability similarity matrix and the cosine similarity matrix to obtain a fused similarity matrix containing different similarities;
[0013] Based on the quartile method, a fused similarity adjacency matrix of different similarities is obtained according to the fused similarity matrix to obtain a feature node relationship graph;
[0014] S4: constructing a ship engine fault diagnosis model, taking the feature node and the feature node relationship graph as input data, taking the data category label as output data, and performing model training on the ship engine fault diagnosis model;
[0015] And the ship engine fault diagnosis prediction is realized through the ship engine fault diagnosis model after model training.
[0016] Furthermore, the method for constructing a probability similarity adjacency matrix described in S2 specifically includes the following steps:
[0017] S21: Define the optimized data set as X = {x1, x2, x3 ... x n}, where x n Represents the nth sample feature data;
[0018] S22: Obtain any two sample feature data x according to the optimized data set i With x j The conditional probability p ij , and the conditional probability p ij The expression is
[0019]
[0020] Where: x k Indicates the optimization of the data set except for the sample feature data x i Sample characteristic data other than σ i Represents sample feature data x i The Gaussian variance centered at
[0021] S23: Based on the binary search method, and through the definition of perplexity Per(P i ) to obtain σ i The value of the perplexity Per(P i ) is expressed as
[0022]
[0023] Where: H(P i ) represents information entropy;
[0024] S24: Obtain sample feature data x i With x j The joint probability q in the low-dimensional space defined ij , and the joint probability q i j is the probability similarity between each feature node, and its expression is:
[0025]
[0026] Where: y i Represents sample feature data x i Mapping point in low-dimensional space; y j Represents sample feature data x j Mapping point in low-dimensional space; y k ,y l Indicates that the sample feature data x i The mapping points of sample feature data other than in low-dimensional space;
[0027] S25: Construct the conditional probability p ij With the joint probability q ij The KL divergence function of is expressed as
[0028]
[0029] Where: Q represents the probability similarity matrix; C represents the KL divergence function;
[0030] The KL divergence is minimized by the gradient descent method to obtain the position update formula of each low-dimensional sample feature data, and the expression of the position update formula is:
[0031]
[0032] Where: η represents the learning rate of the gradient descent method;
[0033] The learning rate gradient is repeatedly calculated by the gradient descent method and the position of the low-dimensional sample feature data is updated to pass through the corresponding mapping point y in the low-dimensional space i With the mapping point y j To represent the high-dimensional space sample feature data x i With sample feature data x j The distribution of
[0034] S26: Obtain a low-dimensional feature sample set Y (y1, y2, ..., y k ), and based on the joint probability q ij, obtaining the probability similarity of the sample feature data in the optimized data set according to the low-dimensional feature sample set Y(y1, y2, ..., yk);
[0035] The probability similarity matrix Q is obtained according to the probability similarity of the sample feature data, and its expression is:
[0036]
[0037] Furthermore, the cosine similarity algorithm is used in S2 to obtain the cosine similarity adjacency matrix between the feature nodes, which specifically includes the following steps:
[0038] S200: Taking the sample feature data in the optimized data set as feature nodes, obtaining the expression of the cosine similarity between the feature nodes
[0039]
[0040] Where: C ij Represents sample feature data x i With sample feature data x j The cosine similarity between .
[0041] S201: Obtain the cosine similarity matrix C according to the cosine similarity between each feature node, and its expression is:
[0042]
[0043] Furthermore, the S3 specifically includes the following steps:
[0044] S31: normalizing the probability similarity matrix Q and the cosine similarity matrix C, and fusing the normalized probability similarity matrix Q and the cosine similarity matrix C to obtain a fused similarity matrix F containing different similarities;
[0045] And the formula for obtaining the fusion similarity matrix F is:
[0046] f ij =WNol(q ij )+(1-W)Nol(c ij )
[0047] Where: f ij represents the element in the i-th row and j-th column of the fusion similarity matrix F; W represents the fusion weight and W∈(0,1); Nol(·) represents normalization processing;
[0048] S32: merge f in the similarity matrix F ijThe values are arranged in descending order to obtain a fusion similarity sequence table, and an adjacency matrix discriminant formula is constructed based on the quartile method to obtain a fusion similarity adjacency matrix according to the fusion similarity sequence table, and the adjacency matrix discriminant formula is
[0049]
[0050] Where: Represents the adjacency matrix A f The element in row i and column j in , it means that feature node i and feature node j are neighbor nodes; otherwise When , it means that feature node i and feature node j are not neighbor nodes; T f represents the threshold determined according to the quartile method;
[0051] The fusion similarity adjacency matrix A f The expression is
[0052]
[0053] S34: Based on the fusion similarity matrix F and the fusion similarity adjacency matrix A f Get the feature node relationship graph.
[0054] Furthermore, the ship engine fault diagnosis model constructed as described in S4 includes an input layer, a graph attention aggregation layer, and a classification layer;
[0055] The input layer is used to input the feature node relationship graph and the feature nodes into the graph attention aggregation layer;
[0056] The graph attention aggregation layer is used to calculate and obtain the attention coefficients of each feature node and all neighbor nodes according to the received feature node relationship graph and feature nodes;
[0057] And obtaining an update formula of the feature node according to the attention coefficient to obtain an aggregation node for strengthening the corresponding relationship between the data label and the feature node;
[0058] The classification layer is used to perform fault classification prediction according to the aggregation node.
[0059] Furthermore, the method for obtaining the aggregation node specifically includes the following steps:
[0060] S41: Define the input of the graph attention aggregation layer as Represents feature node x i The feature vector corresponding to the lth layer; and H (0) =X, X represents the original node feature vector;
[0061] The input of the graph attention aggregation layer is H (l+1) , represents the node feature vector after the aggregation operation of the attention mechanism, that is,
[0062] S42: Define feature node x i The center node is the central node, and the attention coefficient e of the central node and the neighboring nodes is calculated and obtained according to the feature node relationship diagram ij , whose expression is
[0063]
[0064] Where: Represents the trainable weight parameters of node feature transformation, that is, a shared linear transformation parameterized by a weight matrix is applied to each feature node; d (l) Indicates the length of the feature vector of the input node; d (l+1) The length of the feature vector of the node representing the output; Represents the weight vector associated with the attention mechanism The transpose of ; LeakyReLU(·) represents the operation processed by the activation function LeakyReLU;
[0065] S43: According to the attention coefficient e ij Get the aggregation weight coefficient α ij , whose expression is
[0066]
[0067] Where: N i Represents the feature node x i The set of connected neighbor nodes; Represents the feature node x after weight feature conversion i With feature node x j The splicing of features; Represents the feature node x after weight feature conversion i With feature node x k The splicing of features;
[0068] S44: According to the attention coefficient α ij The update formula for obtaining the characteristic node is:
[0069]
[0070] The multi-head attention mechanism is used to improve the update formula of the feature node to improve the expression ability of the graph attention aggregation layer. The update formula of the improved feature node is:
[0071]
[0072] Where: K represents the number of attention mechanisms; represents the weight coefficient calculated by the k-th group of attention mechanism; W (k) Represents the learning parameters corresponding to the k-th group of attention mechanisms;
[0073] S45: Acquisition of aggregated nodes is achieved according to the improved updating formula of the characteristic nodes.
[0074] Furthermore, model training is performed on the ship engine fault diagnosis model, comprising the following steps:
[0075] S400: Obtaining a training set and a test set according to the feature nodes and the corresponding feature node relationship graph;
[0076] S401: taking the characteristic nodes in the training set and the corresponding characteristic node relationship graph as input data, inputting them into the ship engine fault diagnosis model for training, and obtaining a trained fault diagnosis model;
[0077] S402: performing a model test on the ship engine fault diagnosis model trained in S401 through the characteristic nodes in the test set and the corresponding characteristic node relationship diagram;
[0078] If the output of the trained ship engine fault diagnosis model converges, then the trained fault diagnosis model at this time is the optimal ship engine fault diagnosis model;
[0079] Wherein, the loss function for judging whether the output of the trained ship engine fault diagnosis model converges includes any one of a mean square error function, a cross entropy loss function or an average error function;
[0080] Otherwise, the parameter weights of the trained ship engine fault diagnosis model are adaptively adjusted using the gradient descent method, and step S401 is repeated.
[0081] Beneficial effect: The present invention provides a method for constructing a graph attention ship engine fault diagnosis model based on feature fusion, which regards each sample feature data as a feature node, constructs a probability similarity matrix and a cosine similarity matrix, and fuses the probability similarity matrix and the cosine similarity matrix as the input of the constructed ship engine fault diagnosis model, so that the model can learn multi-scale sample features, and optimizes the classification accuracy of the extracted feature values and data category labels by aggregating the features of neighbor nodes in the ship engine fault diagnosis model and continuously iterating the calculation, thereby realizing the construction of a ship engine fault diagnosis model based on graph attention of feature fusion, which greatly improves the ability to recognize the complexity of many thermal parameters of ship engines and improves the accuracy of ship engine fault diagnosis results. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0083] Figure 1 It is a flow chart of a method for constructing a graph attention ship engine fault diagnosis model based on feature fusion of the present invention;
[0084] Figure 2 In this embodiment Schematic diagram of the simulation model of a type of marine engine;
[0085] Figure 3 is the probability similarity graph in this embodiment;
[0086] Figure 4 is the cosine similarity graph in this embodiment;
[0087] Figure 5 is the fusion similarity graph in this embodiment
[0088] Figure 6 is a comparison diagram of the diagnosis results of each similarity graph in this embodiment;
[0089] Figure 7 is a schematic diagram of the MFGAT fault diagnosis model in this embodiment;
[0090] Figure 8 Schematic diagram of the test set classification results in this embodiment;
[0091] Fig. 9 4 is a graph showing the comparison results of various algorithms in this embodiment. DETAILED DESCRIPTION
[0092] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0093] This embodiment provides a method for constructing a ship engine fault diagnosis model based on feature fusion graph attention. Figure 1 As shown, the specific steps include:
[0094] S1: Obtain sample feature data of the ship engine in normal and faulty states, and set data category labels for the sample feature data to construct an initial data set;
[0095] The sample characteristic data at least includes temperature, pressure and rotation speed;
[0096] and performing normalization processing on the sample feature data in the initial data set to obtain an optimized data set;
[0097] Specifically, during the actual voyage of the ship, by collecting the thermal parameters of the ship's main engine in real time and inputting the collected data into the diagnostic network, it is possible to determine whether the system has a fault. The first step is to collect the data set, but since it is difficult to obtain the actual ship fault data, the actual ship engine in operation is in a fault state for a long time, which will cause danger to the safety of the ship. Therefore, in the specific implementation, the present invention is based on The model of marine diesel engine is used as a verification example. AVL-Boost software is used to model and simulate the diesel engine. The modeling and simulation diagram is shown in the figure below. Figure 2 As shown;
[0098] Four common faults, including increased valve clearance, delayed injection timing, dirty and blocked air cooler pipes, and worn turbocharger impeller, were selected for research. The fault analysis and simulation of the marine diesel engine model are carried out. Table 1 shows the main performance parameters of the engine.
[0099] Table 1. Main performance parameters of diesel engine
[0100]
[0101] In order to improve the comprehensiveness of various types of faults in the ship engine fault sample set, these four types of faults were simulated to different degrees for verification of the present invention, where the collected data set includes five operating states: increased valve clearance, delayed injection timing, dirty air cooler pipeline, wear of turbocharger impeller and normal operation. The data set selected 23-dimensional detection index parameters and a total of 400 groups of samples, including 80 groups of samples for each state; the constructed data set X = {x1, x2, x3…x n} n The dimension is 1×23, representing the nth sample. Subsequently, the data set X is used to verify the fault diagnosis invention. The data set is shown in Table 2, and the collected detection indicators are shown in Table 3.
[0102] Table 2. Engine failure dataset
[0103]
[0104] Table 3. Detection indicators
[0105]
[0106]
[0107] Then, the main work of this embodiment is to construct a graph attention fault diagnosis method based on feature fusion, convert the data set X into a graph structure composed of nodes and edges, and use the adjacency matrix and node feature information contained in the graph structure as the input of the graph attention neural network to complete the fault diagnosis of the ship engine, including the following three parts:
[0108] (1) Take sample x in dataset X n As the nth node, the probability similarity and cosine similarity between nodes are calculated using the t_SNE algorithm and cosine similarity respectively.
[0109] (2) The probability similarity and cosine similarity are fused to obtain a fused similarity containing different similarities. Based on this fused similarity, the edges between nodes are constructed through the four-part method to obtain the graph structure of the dataset X that fuses different similarities.
[0110] (3) Taking the similarity fusion graph structure of the dataset as input, the graph attention neural network improved by multi-head attention is used for final fault diagnosis;
[0111] The specific contents of these three parts are as follows:
[0112] S2: taking the sample feature data in the optimized data set as feature nodes, and using the t_SNE algorithm to obtain the probability similarity between the feature nodes to construct a probability similarity matrix;
[0113] The method for constructing a probability similarity matrix specifically comprises the following steps:
[0114] S21: Define the optimized data set as X = {x1, x2, x3 ... x n}, where x n Represents the nth sample feature data;
[0115] Specifically, in this embodiment, the data set X = {x1, x2, x3...x n The distance between samples is converted into the calculated joint probability to represent the similarity between data samples. The probability similarity is used as the data sample x i With x j The greater the correlation between them, the greater the probability similarity, j Become x i The higher the probability of having neighbors;
[0116] S22: Obtain any two sample feature data x according to the optimized data set i With x j The conditional probability p ij , and the conditional probability p ij The expression is
[0117]
[0118] Where: x k Indicates the optimization of the data set except for the sample feature data x i Sample characteristic data other than ii =0;σ i Represents sample feature data x i The Gaussian variance centered on σ is , and since the data density may change, there is no optimal σ in a data set in areas where the data is sparse. i value;
[0119] S23: Based on the binary search method, and through the definition of perplexity Per(P i ) to obtain σ i The value of this conditional probability p ij The entropy of the distribution increases with σ i increases with the increase of i The value of is binary searched, and the perplexity Per(P i ) is used to calculate σ i , and the perplexity range is [5,50], then the perplexity Per(P i ) is expressed as
[0120]
[0121] Where: H(P i ) represents information entropy, which expresses the degree of confusion. The actual meaning here is the number of neighboring points of xi. In the original data set, the density of data sample points is high in some places and low in some places, so in order to achieve the same confusion. For points in places with high density, σ i The specific calculation can be determined by binary search, because σ i It is positively correlated with the degree of sleepiness. Through binary search, satisfactory accuracy can be quickly iterated. In this way, the model can be used with different σ i The problem of uneven distribution of data sets in the original high-latitude space was considered;
[0122] S24: Select high-dimensional sample feature data x i With x j The corresponding point y in the preset low-dimensional space i and j, and similarly calculate the joint probability q in the low-dimensional space ij , the low-dimensional mapping point y is described by the following formula i and j The similarity between them, and the joint probability q ij That is, the probability similarity between each feature node, and its expression is
[0123]
[0124] Where: y i Represents sample feature data x i Mapping point in low-dimensional space; y j Represents sample feature data x j Mapping point in low-dimensional space; y k ,y l Indicates that the sample feature data x i The mapping points of sample feature data other than in low-dimensional space;
[0125] S25: Construct the conditional probability p ij With the joint probability q ij The KL divergence function of is expressed as
[0126]
[0127] Where: Q represents the probability similarity matrix; C represents the KL divergence function;
[0128] In this embodiment, KL divergence is used to represent the conditional probability p ij With the joint probability q ij When the KL divergence is 0, q ij =p ij , which means that y in the low-dimensional space i and j Can fully and correctly represent the sample feature data x in high-dimensional space i With x j The degree of correlation between
[0129] The KL divergence is minimized by the gradient descent method to obtain the position update formula of each low-dimensional sample feature data, and the expression of the position update formula is:
[0130]
[0131] Where: η represents the learning rate of the gradient descent method. By repeatedly calculating the gradient and updating the position of the low-dimensional sample point, the corresponding point y in the low-dimensional space is i and j Can represent high-dimensional space sample feature data x i With xj The distribution of , and after iterative optimization, a set of low-dimensional feature sample sets Y (y1, y2, ..., y k );
[0132] S26: Obtain a low-dimensional feature sample set Y (y1, y2, ..., y k ), and based on the joint probability q ij , according to the low-dimensional feature sample set Y(y1,y2,…,yk), obtain the probability similarity of the sample feature data in the optimized data set;
[0133] The probability similarity matrix Q is obtained according to the probability similarity of the sample feature data, and its expression is:
[0134]
[0135] S27: The probability similarity matrix Q in q ij The values are arranged in descending order to obtain a probability similarity sequence table, and a first adjacency matrix discriminant formula is constructed based on the quartile method to obtain a probability similarity adjacency matrix according to the probability similarity sequence table, and the first adjacency matrix discriminant formula is
[0136]
[0137] Where: Represents the adjacency matrix A q The element in row i and column j in T q represents the threshold determined according to the quartile method;
[0138] Specifically, according to the probability similarity sequence table, the quartile method is used to determine Q1 (first quartile), Q2 (second quartile) and Q3 (third quartile), and Q3 is selected as the threshold T q ; By comparing the q between nodes ij Value and T q The size of the adjacency matrix is constructed: if q ij >T q , then feature node i and feature node j are neighbor nodes; otherwise, they are not neighbor nodes. The diesel engine data set is calculated through the above steps to obtain Q3=4.60e -4 , this value is set as the threshold T q ; For each data point in the probability similarity matrix Q and T q Compare them to evaluate their relationship and construct the adjacency matrix A accordingly q ;
[0139] The expression of the probability similarity adjacency matrix is:
[0140]
[0141] In the adjacency matrix A q middle, , it means that node i and node j are neighbor nodes; otherwise In order to more intuitively understand the relationship between the similarity graphs, the graph topology constructed by the probability similarity is visualized as follows: Figure 3 As shown;
[0142] The cosine similarity algorithm is used to obtain the cosine similarity matrix between each feature node, which specifically includes the following steps:
[0143] S200: The cosine value between the angle between two vectors in a vector space is used as a measure of the difference between two individuals. The cosine value is close to 1 and the angle is close to 0, indicating that the two vectors are more similar; the cosine value is close to 0 and the angle is close to 90 degrees, indicating that the two vectors are less similar; the sample feature data in the optimized data set is used as the feature node, and the expression of the cosine similarity between each feature node is obtained
[0144]
[0145] Where: C ij Represents sample feature data x i With sample feature data x j The cosine similarity between .
[0146] S201: Obtain the cosine similarity matrix C according to the cosine similarity between each feature node, and its expression is:
[0147]
[0148] S202: C of the cosine similarity matrix C ij The values are arranged in descending order to obtain a cosine similarity sequence table, and a second adjacency matrix discriminant formula is constructed based on the quartile method to obtain a cosine similarity adjacency matrix according to the cosine similarity sequence table, and the second adjacency matrix discriminant formula is
[0149]
[0150] Where: Represents the adjacency matrix A c The element in row i and column j in T c represents the threshold determined according to the quartile method;
[0151] Specifically, the elements in the cosine similarity matrix are then thresholded. First, ij The values are sorted from large to small, and then the quartile method is used to determine C1 (first quartile), C2 (second quartile) and C3 (third quartile); C3 is selected as the threshold T cBy comparing the C ij Value and T c The size of the adjacency matrix is constructed: If C ij >T c , then feature node i and feature node j are neighbor nodes; otherwise, they are not neighbor nodes. The diesel engine data set is calculated through the above steps to obtain C3 = 9.88e -1 , this value is set as the threshold T c , for each data point in the cosine similarity matrix C and T c Compare them to evaluate their relationship and construct the adjacency matrix A accordingly c To build a graph topology for visualization;
[0152] The expression of the cosine similarity adjacency matrix is:
[0153]
[0154] Similarly, the graph topology constructed by the cosine similarity adjacency matrix is visualized as follows Figure 4 As shown;
[0155] S3: selecting an early fusion method as a similarity graph fusion method, fusing the probability similarity matrix and the cosine similarity matrix to obtain a fused similarity matrix containing different similarities;
[0156] In this embodiment, multi-scale feature fusion is mainly used to fuse the probability similarity and cosine similarity calculated previously to fully explore the intrinsic feature connections between the similarity graphs. The most widely used feature fusion methods are early fusion and late fusion. Late fusion can well capture the temporal correlation and interaction effects between data sources, and has a good performance in time series tasks. However, when the number of samples is small, the above two methods have the disadvantages of complex model structure, large computing resource requirements, and high training time cost. Therefore, the present invention selects early fusion as the similarity graph fusion method.
[0157] Based on the quartile method, a fused similarity adjacency matrix of different similarities is obtained according to the fused similarity matrix to obtain a feature node relationship graph;
[0158] The specific steps include:
[0159] S31: In order to ensure that the similarity matrix can be effectively fused, the two matrices are normalized so that all elements are at the same order of magnitude, that is, the probability similarity matrix Q and the cosine similarity matrix C are normalized. The normalization formula is:
[0160]
[0161] After normalization, all elements are rescaled to the same order of magnitude, which ensures that the two similarity matrices can be effectively fused. The normalized probability similarity matrix Q is fused with the cosine similarity matrix C to obtain a fused similarity matrix F containing different similarities.
[0162] And the formula for obtaining the fusion similarity matrix F is:
[0163] f ij =WNol(q ij )+(1-W)Nol(c ij )
[0164] Where: f ij represents the element in the i-th row and j-th column of the fusion similarity matrix F; W represents the fusion weight and W∈(0,1); Nol(·) represents normalization processing;
[0165] S32: merge f in the similarity matrix F ij The values are arranged in descending order to obtain a fusion similarity sequence table, and an adjacency matrix discriminant formula is constructed based on the quartile method to obtain a fusion similarity adjacency matrix according to the fusion similarity sequence table, and the adjacency matrix discriminant formula is
[0166]
[0167] Where: Represents the adjacency matrix A f The element in row i and column j in , it means that feature node i and feature node j are neighbor nodes; otherwise When , it means that feature node i and feature node j are not neighbor nodes; T f represents the threshold determined according to the quartile method;
[0168] Specifically, the fused similarity adjacency matrix is divided into four parts to determine F1 (first quartile), F2 (second quartile) and F3 (third quartile), where F3 is used as the threshold T f ; By comparing the f between nodes ij Value and T f The size of f is used to construct the adjacency matrix: ij >T f , then node i and node j are neighbor nodes; otherwise, they are not neighbor nodes. After arranging the elements in F from large to small, the value of F3 is calculated using the quartering method to be 1.97e -1 , then T f =F3=1.97e -1 , construct the adjacency matrix A of the fusion graph structure f ;
[0169] The fusion similarity adjacency matrix A f The expression is
[0170]
[0171] S34: Based on the fusion similarity matrix F and the fusion similarity adjacency matrix A f Get the feature node relationship graph. Similarly, visualize the fusion similarity graph topology as follows Figure 5 As shown in the figure, we can intuitively see that the neighbor relationship between most nodes has been clearly described. And compared with the two similarity graph topological structures before fusion, there is a significant improvement;
[0172] S4: constructing a ship engine fault diagnosis model, wherein the constructed ship engine fault diagnosis model includes an input layer, a graph attention aggregation layer, and a classification layer;
[0173] The input layer is used to input the feature node relationship graph and the feature nodes into the graph attention aggregation layer;
[0174] The graph attention aggregation layer is used to calculate and obtain the attention coefficients of each feature node and all neighbor nodes according to the received feature node relationship graph and feature nodes, and obtain the update formula of the feature node according to the attention coefficient to obtain the aggregation node for strengthening the corresponding relationship between the data label and the feature node;
[0175] The classification layer is used to perform fault classification prediction according to the aggregation node.
[0176] In this embodiment, the characteristic nodes and the characteristic node relationship diagram are used as input data, and the data category labels are used as output data to perform model training on the ship engine fault diagnosis model;
[0177] And the ship engine fault diagnosis prediction is realized through the ship engine fault diagnosis model after model training.
[0178] In a specific embodiment, the method for obtaining the aggregation node includes the following steps:
[0179] S41: Define the input of the graph attention aggregation layer as Represents feature node x i The feature vector corresponding to the lth layer; and H (0) =X, X represents the original node feature vector;
[0180] The input of the graph attention aggregation layer is H (l+1) , represents the node feature vector after the aggregation operation of the attention mechanism, that is,
[0181] S42: Define feature node x i The center node is the central node, and the attention coefficient e of the central node and the neighboring nodes is calculated and obtained according to the feature node relationship diagram ij , whose expression is
[0182]
[0183] Where: Represents the trainable weight parameters of node feature transformation, that is, a shared linear transformation parameterized by a weight matrix is applied to each feature node; d (l) Indicates the length of the feature vector of the input node; d (l+1) The length of the feature vector of the node representing the output; Represents the weight vector associated with the attention mechanism is the transpose of , and the weight vector LeakyReLU(·) indicates the operation is processed by the activation function LeakyReLU, and the activation function LeakyReLU used has a negative slope α=0.2, where || indicates the concatenation operation of the vector;
[0184] S43: According to the attention coefficient e ij Get the aggregation weight coefficient α ij , whose expression is
[0185]
[0186] Where: N i Represents the feature node x i The set of connected neighbor nodes; Represents the feature node x after weight feature conversion i With feature node x j The splicing of features; Represents the feature node x after weight feature conversion i With feature node x k The splicing of features;
[0187] S44: According to the attention coefficient α ij The update formula for obtaining the characteristic node is:
[0188]
[0189] The multi-head attention mechanism is used to improve the update formula of the feature node to improve the expression ability of the graph attention aggregation layer. The update formula of the improved feature node is:
[0190]
[0191] Where: K represents the number of attention mechanisms; represents the weight coefficient calculated by the k-th group of attention mechanism; W (k) Represents the learning parameters corresponding to the k-th group of attention mechanisms;
[0192] S45: Acquisition of aggregated nodes is achieved according to the improved updating formula of the characteristic nodes.
[0193] In a specific embodiment, model training is performed on the ship engine fault diagnosis model, comprising the following steps:
[0194] S400: Obtaining a training set and a test set according to the feature nodes and the corresponding feature node relationship graph;
[0195] S401: taking the characteristic nodes in the training set and the corresponding characteristic node relationship graph as input data, inputting them into the ship engine fault diagnosis model for training, and obtaining a trained fault diagnosis model;
[0196] S402: performing a model test on the ship engine fault diagnosis model trained in S401 through the characteristic nodes in the test set and the corresponding characteristic node relationship diagram;
[0197] If the output of the trained ship engine fault diagnosis model converges, then the trained fault diagnosis model at this time is the optimal ship engine fault diagnosis model;
[0198] Wherein, the loss function for judging whether the output of the trained ship engine fault diagnosis model converges includes any one of a mean square error function, a cross entropy loss function or an average error function;
[0199] Otherwise, the parameter weights of the trained ship engine fault diagnosis model are adaptively adjusted using the gradient descent method, and step S401 is repeated.
[0200] In order to verify the data mining performance of the fusion graph topology proposed in this invention, an experimental comparison was conducted. The selected similarity calculation methods include t_SNE algorithm, cosine similarity, Pearson correlation coefficient and Kendall correlation coefficient. The specific experimental steps are as follows:
[0201] Step 1: Use various correlation calculation methods to obtain the adjacency matrix of the graph topology for the data in the preset sample set, and use it and the sample features as the input of GAT;
[0202] Step 2: Divide each sample set into training set, validation set and test set in a ratio of 7:1:2, and the division method is random division;
[0203] Step 3: The activation function selected by the model is ReLU, the learning rate is 0.01, and the number of iterations is 1000. Each graph topology is independently repeated 20 times, and the average accuracy of the 20 experiments is used as the basis for judgment and the classification results are displayed.
[0204] like Figure 6 As shown, it can be clearly seen that the combined diagnosis result of the t_SNE algorithm and cosine similarity is the best and the running time is relatively short. Therefore, it is concluded that the feature mining effect of the joint mining of the t_SNE algorithm and cosine similarity is the best.
[0205] like Figure 7 This is a schematic diagram of a ship engine fault diagnosis model based on MFGAT (graph attention based on feature fusion). First, the detection index values of the ballast water system in different states are collected by sensors, and the data are normalized. Then, each sample is regarded as a node, and a probability similarity graph and a cosine similarity graph are constructed. The two similarity graphs are fused as the input of the GAT model, so that the model can learn multi-scale sample features, aggregate the features of neighbor nodes in the model, and continuously iterate the calculation to obtain the highest classification accuracy between the extracted feature values and the label values.
[0206] This embodiment introduces graph learning theory to explore the relationship between geometric structures of data, and proposes a graph fusion attention neural network (MFGAT) ship engine fault diagnosis model. Based on the ship engine fault data set, the model uses T_SNE and cosine similarity to calculate the similarity between data, then selects appropriate weights to perform early fusion of the two similarity graphs, and finally uses GAT to transfer and extract the combined features. The core is that the model can mine the similarity between data from two scales, and can more comprehensively use similarity graphs to describe the relationship between data, providing more useful information for the model. The main contributions of the present invention can be summarized as follows:
[0207] (1) The ship engine dataset is converted from different scales into two similarity graphs. By extracting the neighbor relationship between samples, the two similarity graphs contain similarity relationships from multiple angles. The fusion weight is introduced, and the two similarity graphs are structurally fused according to the appropriate weight to obtain a fused similarity graph containing deeper information. This complements and expands the model input information.
[0208] (2) The obtained fused similarity graph is input into GAT, the feature information of neighbor nodes is aggregated through the self-attention mechanism, and finally connected to the Softmax layer to realize fault diagnosis.
[0209] In addition, in order to verify the effectiveness of the model proposed in the embodiment, convolutional neural network (CNN), support vector machine (SVM) and back propagation neural network (BPNN) were selected as comparison algorithms. In the comparison experiment, Tanh was selected as the activation function, the learning rate was set to 0.01, and the number of iterations was set to 1000. In order to ensure the accuracy and repeatability of the experimental results, the training set, validation set and test set were divided into 7:1:2 ratios, and 20 independent repeated experiments were performed. The average accuracy of the 20 experiments was used to evaluate the model performance. The experimental results are as follows: Figures 8 to 9 As shown, it can be seen that in the diesel engine fault diagnosis task, the accuracy, precision, recall rate and F1 value of the MFGAT model proposed in the present invention are all optimal.
[0210] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing a ship engine fault diagnosis model based on feature fusion and graph attention. It is characterized in that The specific steps include: S1: Obtain sample feature data of the ship engine in normal and faulty states, and set data category labels for the sample feature data to construct an initial data set; The sample characteristic data at least includes temperature, pressure and rotation speed; and performing normalization processing on the sample feature data in the initial data set to obtain an optimized data set; S2: taking the sample feature data in the optimized data set as feature nodes, and using the t SNE algorithm to obtain the probability similarity between the feature nodes to construct a probability similarity matrix; The cosine similarity algorithm is used to obtain the cosine similarity matrix between each feature node; S3: selecting an early fusion method as a similarity graph fusion method, fusing the probability similarity matrix and the cosine similarity matrix to obtain a fused similarity matrix containing different similarities; Based on the quartile method, a fused similarity adjacency matrix of different similarities is obtained according to the fused similarity matrix to obtain a feature node relationship graph; S4: constructing a ship engine fault diagnosis model, taking the feature node and the feature node relationship graph as input data, taking the data category label as output data, and performing model training on the ship engine fault diagnosis model; And the ship engine fault diagnosis prediction is realized through the ship engine fault diagnosis model after model training.
2. According to claim 1, a method for constructing a graph attention ship engine fault diagnosis model based on feature fusion, It is characterized in that The method for constructing a probability similarity adjacency matrix described in S2 specifically comprises the following steps: S21: The optimized data set is defined as X={x 1 , x 2 , x 3 …x n }, where x n Represents the nth sample feature data; S22: Obtain any two sample feature data x according to the optimized data set i With x j The conditional probability p ij , and the conditional probability p ij The expression is Where: x k Indicates the optimization of the data set except for the sample feature data x i Sample characteristic data other than σ i Represents sample feature data x i The Gaussian variance centered at S23: Based on the binary search method, and through the definition of perplexity Per(P i ) to obtain σ i The value of the perplexity Per(P i ) is expressed as Where: H(P i ) represents information entropy; S24: Obtain sample feature data x i With x j The joint probability q in the low-dimensional space defined ij , and the joint probability q ij That is, the probability similarity between each feature node, and its expression is Where: y i Represents sample feature data x i Mapping point in low-dimensional space; y j Represents sample feature data x j Mapping point in low-dimensional space; y k ,y l Indicates that the sample feature data x i The mapping points of sample feature data other than in low-dimensional space; S25: Construct the conditional probability p ij With the joint probability q ij The KL divergence function of is expressed as Where: Q represents the probability similarity matrix; C represents the KL divergence function; The KL divergence is minimized by the gradient descent method to obtain the position update formula of each low-dimensional sample feature data, and the expression of the position update formula is: Where: η represents the learning rate of the gradient descent method; The learning rate gradient is repeatedly calculated by the gradient descent method and the position of the low-dimensional sample feature data is updated to pass through the corresponding mapping point y in the low-dimensional space i With the mapping point y j To represent the high-dimensional space sample feature data x i With sample feature data x j The distribution of S26: Obtain a low-dimensional feature sample set Y(y) according to the position update formula 1 ,y 2 ,…,y k ), and based on the joint probability q ij , according to the low-dimensional feature sample set Y(y 1 ,y 2 ,…,y k ) obtain the probability similarity of sample feature data in the optimization data set; The probability similarity matrix Q is obtained according to the probability similarity of the sample feature data, and its expression is:
3. According to claim 1, a method for constructing a graph attention ship engine fault diagnosis model based on feature fusion, It is characterized in that The cosine similarity algorithm is used in S2 to obtain the cosine similarity matrix between each feature node, which specifically includes the following steps: S200: Taking the sample feature data in the optimized data set as feature nodes, obtaining the expression of the cosine similarity between the feature nodes Where: C ij Represents sample feature data x i With sample feature data x j The cosine similarity between ; S201: Obtain the cosine similarity matrix C according to the cosine similarity between each feature node, and its expression is:
4. According to claim 1, a method for constructing a graph attention ship engine fault diagnosis model based on feature fusion, It is characterized in that The S3 specifically includes the following steps: S31: normalizing the probability similarity matrix Q and the cosine similarity matrix C, and fusing the normalized probability similarity matrix Q and the cosine similarity matrix C to obtain a fused similarity matrix F containing different similarities; And the formula for obtaining the fusion similarity matrix F is: f ij =WNol(q ij )+(1-W)Nol(c ij ) Where: f ij represents the element in the i-th row and j-th column of the fusion similarity matrix F; W represents the fusion weight and W∈(0,1); Nol(·) represents normalization processing; S32: merge f in the similarity matrix F ij The values are arranged in descending order to obtain a fusion similarity sequence table, and an adjacency matrix discriminant formula is constructed based on the quartile method to obtain a fusion similarity adjacency matrix according to the fusion similarity sequence table, and the adjacency matrix discriminant formula is Where: Represents the adjacency matrix A f The element in row i and column j in , it means that feature node i and feature node j are neighbor nodes; otherwise When , it means that feature node i and feature node j are not neighbor nodes; T f represents the threshold determined according to the quartile method; The fusion similarity adjacency matrix A f The expression is S34: Based on the fusion similarity matrix F and the fusion similarity adjacency matrix A f Get the feature node relationship graph.
5. According to claim 4, a method for constructing a graph attention ship engine fault diagnosis model based on feature fusion, It is characterized in that The ship engine fault diagnosis model constructed as described in S4 includes an input layer, a graph attention aggregation layer, and a classification layer; The input layer is used to input the feature node relationship graph and the feature nodes into the graph attention aggregation layer; The graph attention aggregation layer is used to calculate and obtain the attention coefficients of each feature node and all neighbor nodes according to the received feature node relationship graph and feature nodes; And obtaining an update formula of the feature node according to the attention coefficient to obtain an aggregation node for strengthening the corresponding relationship between the data label and the feature node; The classification layer is used to perform fault classification prediction according to the aggregation node.
6. According to claim 5, a method for constructing a graph attention ship engine fault diagnosis model based on feature fusion, It is characterized in that The method for obtaining the aggregation node specifically includes the following steps: S41: Define the input of the graph attention aggregation layer as Represents feature node x i The feature vector corresponding to the lth layer; and H (0) =X, X represents the original node feature vector; The input of the graph attention aggregation layer is H (l+1) , represents the node feature vector after the aggregation operation of the attention mechanism, that is, S42: Define feature node x i The center node is the central node, and the attention coefficient e of the central node and the neighboring nodes is calculated and obtained according to the feature node relationship diagram ij , whose expression is Where: Represents the trainable weight parameters of node feature transformation, that is, a shared linear transformation parameterized by a weight matrix is applied to each feature node; d (l) Indicates the length of the feature vector of the input node; d (l+1) The length of the feature vector of the node representing the output; Represents the weight vector associated with the attention mechanism The transpose of ; LeakyReLU(·) represents the operation processed by the activation function LeakyReLU; S43: According to the attention coefficient e ij Get the aggregation weight coefficient α ij , whose expression is Where: N i Represents the feature node x i The set of connected neighbor nodes; Represents the feature node x after weight feature conversion i With feature node x j The splicing of features; Represents the feature node x after weight feature conversion i With feature node x k The splicing of features; S44: According to the attention coefficient α ij The update formula for obtaining the characteristic node is: The multi-head attention mechanism is used to improve the update formula of the feature node to improve the expression ability of the graph attention aggregation layer. The update formula of the improved feature node is: Where: K represents the number of attention mechanisms; represents the weight coefficient calculated by the k-th group of attention mechanism; W (k) Represents the learning parameters corresponding to the k-th group of attention mechanisms; S45: Acquisition of aggregated nodes is achieved according to the improved updating formula of the characteristic nodes.
7. According to claim 5, a method for constructing a graph attention ship engine fault diagnosis model based on feature fusion, It is characterized in that Model training is performed on the ship engine fault diagnosis model, comprising the following steps: S400: Obtaining a training set and a test set according to the feature nodes and the corresponding feature node relationship graph; S401: taking the characteristic nodes in the training set and the corresponding characteristic node relationship graph as input data, inputting them into the ship engine fault diagnosis model for training, and obtaining a trained fault diagnosis model; S402: performing a model test on the ship engine fault diagnosis model trained in S401 through the characteristic nodes in the test set and the corresponding characteristic node relationship diagram; If the output of the trained ship engine fault diagnosis model converges, then the trained fault diagnosis model at this time is the optimal ship engine fault diagnosis model; Wherein, the loss function for judging whether the output of the trained ship engine fault diagnosis model converges includes any one of a mean square error function, a cross entropy loss function or an average error function; Otherwise, the parameter weights of the trained ship engine fault diagnosis model are adaptively adjusted using the gradient descent method, and step S401 is repeated.
Citation Information
Cited By
Mechanical equipment fault diagnosis method and device constructed based on feature map, equipment and medium
CN120372458A
Multi-ship meeting similar scene identification method based on topological graph sequence
CN121482425A
