A gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer
Through the Vision Transformer-based fault diagnosis method for gear acoustic and vibrating signal fusion, the position encoding weight is dynamically adjusted and combined with Mahalanobis distance, the problem of difficult gear failures being difficult to diagnose under speed fluctuations is solved, and high-accuracy cross-domain fault diagnosis is achieved.
Patent Information
- Application Number
- CN202510506363.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-04-22
AI Technical Summary
The prior art is difficult to effectively diagnose gear failures under speed fluctuations. Vision Transformer fails to fully utilize position information and multi-dimensional features in image processing tasks, resulting in diagnostic accuracy and inefficiency.
The gear acoustic and vibration signal fusion fault diagnosis method is adopted based on Vision Transformer. By dividing the acoustic and vibration signals into multiple vector blocks, dynamic allocation can learn position encoding and adjust weights with position perception scaling factors. The independent ViT module is used for feature extraction and fusion, and cross-domain fault diagnosis is performed with Mahalanobis distance.
It improves the diagnostic accuracy and robustness of the model under speed fluctuation, realizes accurate cross-domain diagnosis of gear failures, and significantly improves the diagnostic accuracy.
Smart Images

Figure CN120012033B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault diagnosis of rotating machinery vibration signals and acoustic signals, and in particular to a gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer. Background Art
[0002] The health of gears directly impacts the stability and reliability of equipment operation. Fault diagnosis methods that use signal processing techniques to extract fault characteristics have been widely used in this field. Many researchers have used the Transformer framework for fault research. The Transformer has demonstrated strong long-sequence processing capabilities and parallel computing advantages in natural language processing. The Vision Transformer (ViT) aims to introduce these architectural advantages of the Transformer to computer vision, breaking the long-standing dominance of CNNs in visual tasks and exploring a new approach to processing visual data such as images.
[0003] In ViT, each image block undergoes operations such as embedding before being input into the model. By default, all image blocks are treated equally, without dynamically adjusting their contribution to subsequent calculations based on their position within the overall image or the importance of the features they contain. This can result in some image block features that are critical to tasks like classification and detection not being highlighted, while some relatively unimportant or noisy image block features are equally included in the calculation, interfering with the model's extraction and utilization of effective features and reducing the model's overall accuracy and operational efficiency. Secondly, the Transformer's multi-head attention mechanism focuses on capturing feature interactions and relationships in the sequence dimension, but does not fully utilize the multi-dimensional features of the data. Summary of the Invention
[0004] In order to solve the technical problem in the prior art that it is difficult to effectively diagnose gear faults under speed fluctuations, the present invention discloses a gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer, comprising the following steps: S1, dividing the acoustic signal and the vibration signal into multiple vector blocks and embedding them based on linear mapping to generate an acoustic signal input sequence and a vibration signal input sequence respectively; the formula is: Where x pis a block in the segmented block sequence, and Z0 is the patch embedding; S2, dynamically assigns a learnable position code to each position of the acoustic signal input sequence and the vibration signal input sequence, and adjusts the weight of the position code in combination with the position-aware scaling factor; S3, extracts and fuses the acoustic signal and vibration signal after weight adjustment in independent ViT modules; S4, fuses the acoustic signal features and vibration signal features obtained in step S3 to obtain the spliced features; S5, uses the Mahalanobis distance to measure the difference in feature distribution between domains, and combines the fault classifier and domain classifier for cross-domain fault diagnosis.
[0006] Optionally, in step S2, the generated position index is introduced into the sequence, and the corresponding learnable position encoding vector is obtained by searching the position encoding matrix. During the forward propagation process, the learnable position encoding of the current sequence is first calculated, then added to the input sequence, and finally the adjusted position encoding is multiplied by the position-aware scaling factor to adjust the intensity of its influence on the input, that is, the weight, to form a new representation. This multiplication operation enables the model to flexibly enhance or weaken the influence of the position encoding on the final output during training, thereby improving the model's adaptability to position information in sequence data. Specifically including: S21, generating learnable position encoding, introducing the generated position index into the input sequence, and obtaining the corresponding learnable position encoding vector by searching the position encoding matrix; the formula is: PE(i)=Embedding(i); Where, The encoder input sequence, R is a set of real numbers, L is the sequence length, D is the embedding dimension, is the classification head vector, is the linear mapping matrix, P and Represent the number of segments and the feature dimension of each segment, respectively. is a segmented block sequence, represents the pth block in the segmented block sequence, PE(i) is a learnable embedding function used to generate the embedding vector of position i, The position encoding matrix is generated by PE(i). Embedding represents an embedding operation or an embedding matrix, which is used to convert discrete index values into continuous vector representations. S22 adds the learnable position encoding to the input sequence and multiplies it by the position-aware scaling factor. The formula is: Where, is the input sequence tensor, where B is the batch size and L is the sequence length. is the number of channels, α is the position-aware scaling factor, is the position-aware scaling factor Gradient loss function, b is the index variable of batch size, D is the embedding dimension, d is the index variable of embedding dimension, c is the index variable of number of channels, Represents the output value of the b-th batch, c-th channel, and l-th position.
[0007] Optionally, in step S3, the weighted acoustic signal and vibration signal are first transmitted to the ViT module, i.e., two independent feature extraction channels, each of which extracts the feature representation of that dimension. In this process, each feature extraction channel includes a Z-Pool layer, a convolution layer, a batch normalization layer, and an activation function. Among them, the Z-Pool layer is used to reduce the feature dimension while retaining important information; the convolution layer effectively captures the spatial features in the acoustic vibration signal through local connections and weight sharing; the batch normalization layer helps to accelerate training and improve the stability of the model; and the activation function introduces nonlinearity. The dimension reduction process of the Z-Pool layer is as follows: ; ; ; Where i, j, k are the coordinates of the output features, m, n are the relative coordinates within the pooling window, M and N are the height and width of the pooling window, is the maximum pooling operation, is an average pooling operation, Z-Pool(h) is a feature dimensionality reduction operation, Z represents the operation of concatenating the results of maximum pooling and average pooling, and Pool(h) is a pooling operation on the input sequence vector h. Fusion in this step refers to the feature fusion after maximum pooling and average pooling of acoustic signals and acoustic signals, and vibration signals and vibration signals, respectively. After feature extraction in the convolutional layer, weighting is performed, and the weighted features are combined and fused using element-by-element multiplication. This fusion method can not only effectively integrate information of different dimensions, but also enhance the feature expression ability of the model. The element-by-element multiplication operation can be regarded as a gating mechanism. By controlling the mutual influence of different features, the model can adaptively focus on more important features, thereby improving overall performance. This design can improve the performance of the model in complex tasks, making it more robust and adaptable.
[0008] Optionally, in step S4, the acoustic signal and vibration signal processed by the convolutional layer in step S3 are respectively encoded using an M-layer Vision Transformer encoder. Each layer of the encoder includes a feedforward network and a multi-head attention mechanism. The feedforward network consists of two fully connected layers, which is used to enable the model to perform nonlinear transformation independently at each position; the multi-head attention is used to enable the model to pay attention to different positions in the sequence, and to capture contextual features and relationships by calculating the similarity between the elements in the input sequence. In the output process of the encoder, the output of the multi-head attention is combined with the output of the feedforward network through a residual connection. This residual connection not only helps to alleviate the gradient vanishing problem in the deep network, but also improves the efficiency of information flow; after layer-by-layer processing by the encoder, the network extracts specific feature identifiers and performs layer normalization on these features to improve the convergence speed and stability of the model; finally, the extracted and normalized acoustic signal and vibration signal are horizontally spliced to complete feature fusion; the operating formula of the multi-head attention mechanism and the residual connection is: ; The operation formula of the feedforward network and residual connection is: ; The operational formula for layer normalization is: Where, is the corresponding sequence, is the internal output sequence of the M-layer encoder, MSA is multi-head attention, MLP is the feedforward network, MN is the layer normalization function, and y is the final output sequence after processing by the layer normalization function MN. is the initial input sequence of the M-th layer encoder, It is The internal output sequence of the layer encoder is In this step, fusion refers to the fusion of features of the acoustic signal and vibration signal through the multi-head attention mechanism and feedforward network after the fusion is completed in the ViT module.
[0009] Step S4 also includes dividing each vector of the concatenated features by the Euclidean norm (L2 norm) to make the vector length 1, which is used to eliminate the scale differences between different features and improve the stability and accuracy of the model; the formula is: ; Where U represents a vector and u represents the component of the vector.
[0010] Optionally, in step S5, the Mahalanobis distance is used to quantify the fusion features of the acoustic vibration signal, thereby improving the robustness of the domain-invariant features. The calculation formula of the Mahalanobis distance is: Where, is the mean vector, is the covariance matrix, e is the eigenvector of the input, is the difference vector between the vector e and the mean vector μ, is the Mahalanobis distance. The fused extracted features are passed to the domain classifier and the fault classifier. The fault classifier is built by a fully connected layer to establish a mapping relationship between collaborative features and fault categories. Based on the optimization method of Mahalanobis distance, the loss function is defined as: Where, is category y i The covariance matrix of is a hyperparameter, is the regularization term.
[0011] The beneficial effects of the present invention are as follows: the method of the present invention first divides the acoustic signal and vibration signal input vectors into fixed-size, non-overlapping segments or patches, each of which is flattened into a vector to form the input sequence of the model; before the feature fusion stage, a position-aware scaling factor is assigned to each position in the input sequence, enabling the model to dynamically adjust the feature weight according to the importance of the position, improving the model's ability to capture multi-dimensional features and adaptively assigning weights to different elements in the channel and sequence; then, the obtained data is directed to the dual feature extraction channels of the ViT module, each of which independently processes the input sequence to extract feature representations of the dimension; in the feature fusion stage, the features of the fused acoustic and vibration signals are horizontally spliced; to address the scale differences between the feature vectors, each element of the spliced feature is divided by its Euclidean norm (L2 norm) to make the vector length 1, eliminating the scale differences between different features and improving the stability and accuracy of the model; to measure the differences between different data distributions, the Mahalanobis distance of the fused features is calculated; in the final output stage of the model, the fused features are further processed by the domain classifier and the fault classifier to perform accurate classification tasks.
[0012] This invention fully leverages the complementary properties of acoustic and vibroacoustic signals, demonstrating excellent domain alignment capabilities. The model utilizes a Vision Transformer fusion network to simultaneously extract and fuse acoustic and vibroacoustic signal features. Furthermore, by innovatively combining learnable position scaling with dual feature extraction channel adaptation, it effectively eliminates the interference of speed fluctuations on feature extraction, thereby enabling accurate and intelligent collaborative cross-domain fault diagnosis of gears under speed fluctuation conditions in rotating machinery. Experimental results in the field of gear fault diagnosis demonstrate that compared to existing technologies, this invention achieves significantly improved diagnostic accuracy and performs better in domain-invariant feature extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a flow chart of a gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer of the present invention. DETAILED DESCRIPTION
[0014] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions 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 making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention for which protection is sought, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0015] A gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer uses the following components: a learnable position encoding module that dynamically optimizes position encoding according to the intrinsic characteristics of the data to improve feature expression; a position-aware scaling module that emphasizes key features and suppresses secondary information; a feature extraction module that extracts features of acoustic and vibration signals through dual feature extraction channels to ensure the comprehensiveness and accuracy of feature extraction; a Mahalanobis distance measurement module that considers the covariance structure between features to more accurately measure the differences between features; a fault classifier that accurately identifies and classifies various fault types; and a domain classifier that accurately distinguishes whether the data originates from the source domain or the target domain. The fault diagnosis method process is as follows: Figure 1 As shown in FIG, the method includes the following steps: S1, setting different gear health states, manually adjusting the frequency converter to control the motor speed to fluctuate randomly within a certain range, thereby obtaining a speed fluctuation working condition, and collecting vibration signals and acoustic signals of different faulty gears under the speed fluctuation working condition; dividing the acoustic vibration signal into multiple small fixed-size, non-overlapping fragments or patches, each of which is flattened into a vector and embedded based on linear mapping to generate an input sequence; the formula is: Where x p is a block in the segmented block sequence, and Z0 is the patch embedding.
[0016] S2. Dynamically assign a learnable position code to each position of the input sequence, and adjust the influence of the position code on the input sequence in combination with the position-aware scaling factor; introduce the generated position index into the sequence, and obtain the corresponding learnable position code vector by searching the position code matrix. During the forward propagation process, the learnable position code of the current sequence is first calculated, then added to the input sequence, and finally the adjusted position code is multiplied by the position-aware scaling factor to adjust the intensity of its influence on the input, thereby forming a new representation. This multiplication operation enables the model to flexibly enhance or weaken the influence of the position code on the final output during training, and improves the model's adaptability to position information in sequence data. Specifically including: S21. Generate a learnable position code, introduce the generated position index into the input sequence, and obtain the corresponding learnable position code vector by searching the position code matrix; the formula is: PE(i)=Embedding(i); Where, The encoder input sequence, R is a set of real numbers, L is the sequence length, D is the embedding dimension, is the classification head vector, is the linear mapping matrix, P and Represent the number of segments and the feature dimension of each segment, respectively. is a segmented block sequence, represents the pth block in the segmented block sequence, PE(i) is a learnable embedding function used to generate the embedding vector of position i, The position encoding matrix is generated by PE(i). Embedding represents an embedding operation or an embedding matrix, which is used to convert discrete index values into continuous vector representations. S22 adds the learnable position encoding to the input sequence and multiplies it by the position-aware scaling factor. The formula is: Where, is the input sequence tensor, where B is the batch size and L is the sequence length. is the number of channels, α is the position-aware scaling factor, is the loss function for the gradient of the position-aware scaling factor α, b is the index variable for the batch size, d is the index variable for the embedding dimension, D is the embedding dimension, and c is the index variable for the number of channels. Represents the output value of the b-th batch, c-th channel, and l-th position.
[0017] S3: The weighted acoustic and vibration signals are extracted and fused separately in independent ViT modules. Each ViT module sequentially performs Z-Pool layer dimensionality reduction, convolutional layer feature extraction, batch normalization, and nonlinear activation operations, and then fuses them using element-by-element multiplication. The formula is: ; ; ; Where i, j, k are the coordinates of the output features, m, n are the relative coordinates within the pooling window, M and N are the height and width of the pooling window, is the maximum pooling operation, is an average pooling operation, Z-Pool(h) is a feature dimensionality reduction operation, Z represents the operation of concatenating the results of maximum pooling and average pooling, and Pool(h) is a pooling operation on the input sequence vector h.
[0018] Specifically, the acoustic and vibration signals obtained in step S2 are first transmitted to the ViT module, which consists of two independent feature extraction channels, each of which extracts feature representations for that dimension. During this process, each feature extraction channel comprises a Z-Pool layer, a convolutional layer, a batch normalization layer, and an activation function. The Z-Pool layer is used to reduce feature dimensionality while retaining important information; the convolutional layer effectively captures spatial features in the acoustic and vibration signals through local connections and weight sharing; the batch normalization layer helps accelerate training and improve model stability; and the activation function introduces nonlinearity. After feature extraction in the convolutional layer, the weighted features are combined and fused using element-wise multiplication. This fusion method not only effectively integrates information from different dimensions but also enhances the model's feature representation capabilities. The element-wise multiplication operation can be viewed as a gating mechanism. By controlling the mutual influence of different features, the model can adaptively focus on more important features, thereby improving overall performance. This design can enhance the model's performance in complex tasks, making it more robust and adaptable.
[0019] S4. The acoustic signal and vibration signal processed by the convolutional layer in step S3 are respectively encoded using M layers of Vision Transformer. Each layer of the encoder contains a feedforward network and a multi-head attention mechanism. The feedforward network consists of two fully connected layers, which is used to enable the model to perform nonlinear transformation independently at each position to enhance the expressive ability of the features. The multi-head attention is used to enable the model to pay attention to different positions in the sequence. By calculating the similarity between the elements in the input sequence, it is used to capture contextual features and mutual relationships. In the output process of the encoder, the output of the multi-head attention is combined with the output of the feedforward network through a residual connection. This residual connection not only helps to alleviate the gradient vanishing problem in the deep network, but also improves the efficiency of information flow. After layer-by-layer processing by the encoder, the network extracts specific feature identifiers and performs layer normalization on these features to improve the convergence speed and stability of the model. Finally, the extracted and normalized acoustic signal and vibration signal are horizontally spliced to complete feature fusion. The operating formula of the multi-head attention mechanism and residual connection is: ; The operation formula of the feedforward network and residual connection is: ; The operational formula for layer normalization is: Where, is the corresponding sequence, is the internal output sequence of the M-layer encoder, MSA is multi-head attention, MLP is the feedforward network, MN is the layer normalization function, and y is the final output sequence after processing by the layer normalization function MN. is the initial input sequence of the M-th layer encoder, It is The internal output sequence of the layer encoder is In this step, fusion refers to the fusion of features of the acoustic signal and vibration signal through the multi-head attention mechanism and feedforward network after the fusion is completed in the ViT module.
[0020] After fusion, each vector of the concatenated features is divided by the Euclidean norm (L2 norm) to make the vector length 1. This is used to eliminate the scale differences between different features and improve the stability and accuracy of the model. The formula is: ; Where U represents a vector and u represents the component of the vector.
[0021] S5. Use the Mahalanobis distance to measure the difference in feature distribution between domains, and combine the fault classifier and domain classifier to perform cross-domain fault diagnosis. The Mahalanobis distance is used to measure the fusion features of the acoustic vibration signal, which improves the robustness of the domain-invariant features. The calculation formula of the Mahalanobis distance is: ; Where μ is the mean vector, S is the covariance matrix, is the difference vector between the vector e and the mean vector μ, is the Mahalanobis distance.
[0022] The fused extracted features are passed to the domain classifier and the fault classifier. The fault classifier is built by a fully connected layer to establish a mapping relationship between collaborative features and fault categories. Based on the optimization method of Mahalanobis distance, the loss function is defined as: Where, is category y i The covariance matrix of is a hyperparameter, is the regularization term.
[0023] The present invention is further described by collecting acoustic and vibration signals and conducting intelligent diagnosis under speed fluctuations on a specially designed gear fault test bench.
[0024] Seven gear health conditions were considered: normal gear, sun gear pitting, sun gear fracture, sun gear wear, planet gear pitting, planet gear fracture, and planet gear wear. The sampling frequency was set to 12.8 kHz, and gear acceleration signals were collected under four stable operating conditions (1000 rpm, 1500 rpm, 1800 rpm, 2000 rpm, 1000-1500 rpm, 1500-1800 rpm, and 1800-2000 rpm) and three fluctuating operating conditions. Each health condition consisted of 100 acoustic samples and 100 vibration signal samples, each containing 2048 points. Fifty percent of the dataset was used as the training set, and the remainder was used as the test set.
[0025] To evaluate the effectiveness of our method, we compared three state-of-the-art cross-domain fault diagnosis methods: a distance-based deep transfer learning network (WD-DTL), a feature-based transfer neural network (FTNN), and a dual-channel parallel adversarial network (DPAN). The diagnostic accuracy of these four methods was compared across six transfer tasks: 1000 rpm → 1000 rpm to 1500 rpm (Task 1), 1500 rpm → 1000 rpm to 1500 rpm (Task 2), 1500 rpm → 1500 rpm to 1800 rpm (Task 3), 1800 rpm → 1800 rpm to 2000 rpm (Task 4), 1800 rpm → 1800 rpm to 2000 rpm (Task 5), and 2000 rpm → 1800 rpm to 2000 rpm (Task 6). The left side of the arrow indicates the source domain, and the right side indicates the target domain. The diagnostic accuracy comparison results for these four methods are shown in Table 1.
[0026] Table 1 Comparison of diagnostic accuracy of four methods
[0027]
[0028] The experimental results clearly show that FTNN's diagnostic accuracy is significantly lower than that of the other comparison methods. In most diagnostic tasks, its accuracy is below 94%. In stark contrast, DPAN achieves diagnostic accuracy exceeding 93% across all tasks. This is due to its time-frequency domain signal fusion technology, which more precisely identifies fault features and thus improves diagnostic accuracy. The WD-DTL method is particularly noteworthy, demonstrating excellent performance in this comparison, achieving a peak accuracy of 94.3%. This outstanding performance may be attributed to its use of the Mahalanobis distance metric, which more efficiently learns the distribution differences between the source and target domains. When processing data from diverse operating conditions, WD-DTL is able to better adapt to the target domain's feature distribution, thereby improving diagnostic accuracy. However, WD-DTL may incur higher computational costs when processing complex data. Specifically, DPAN performs exceptionally well across tasks, achieving diagnostic accuracy exceeding 95% in Tasks 1, 2, and 5. However, our proposed method outperforms the other three comparison methods across all tasks, achieving an average diagnostic accuracy exceeding 99%. The method of the present invention fully combines the advantages of multi-channel feature fusion, which not only effectively improves the accuracy of the ViT model, but also pays more attention to the robustness of the model. In addition, the multi-channel feature fusion mechanism has unique advantages. It can better process and utilize information from different signal sources, and at the same time provides an intuitive way to understand how the model interacts with features of different dimensions, thereby improving the interpretability of the model. In addition, the present invention also utilizes a position-aware scaling module to enrich the feature representation by assigning a learnable position code to each position, so that the model can capture more subtle feature differences. In summary, the method of the present invention has significant and effective performance in dealing with migration fault diagnosis problems under gear speed fluctuation conditions.
[0029] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the scope of protection of the present invention.
Claims
1. A gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer, characterized in that: The steps include: S1. Divide the acoustic signal and vibration signal into multiple vector blocks and embed them based on linear mapping to generate acoustic signal input sequence and vibration signal input sequence respectively; the formula is: Where x p is a block in the segmented block sequence, Z0 is the patch embedding; S2, dynamically assigning a learnable position code to each position of the acoustic signal input sequence and the vibration signal input sequence, and adjusting the weight of the position code in combination with the position-aware scaling factor; S3, extracting and fusing the features of the weighted acoustic and vibration signals in independent ViT modules respectively; S4, fusing the acoustic signal features and the vibration signal features obtained in step S3 to obtain a splicing feature; S5. Use Mahalanobis distance to measure the difference in feature distribution between domains, and combine fault classifier and domain classifier to perform cross-domain fault diagnosis; Step S2 includes: S21. Generate a learnable position code, introduce the generated position index into the input sequence, and obtain the corresponding learnable position code vector by searching the position code matrix; the formula is: PE(i)=Embedding(i); Where f0∈R (L+1)×D The encoder input sequence, R is a set of real numbers, L is the sequence length, D is the embedding dimension, x class ∈R D is the classification head vector, E∈R (P×Q)×D is a linear mapping matrix, P and Q represent the number of segments and the feature dimension of each segment respectively, x p ∈R P×C is a segmented block sequence, represents the pth block in the segmented block sequence, PE(i) is a learnable embedding function used to generate the embedding vector of position i, E pos ∈R (L+1)×D The position encoding matrix is generated by PE(i), and Embedding represents the embedding operation or embedding matrix, which is used to convert discrete index values into continuous vector representations; S22. Add the learnable positional encoding to the input sequence and multiply it by the position-aware scaling factor. The formula is: Where X∈R B×L×C is the input sequence tensor, where B is the batch size, L is the sequence length, C is the number of channels, α is the position-aware scaling factor, ψ is the loss function with respect to the gradient of the position-aware scaling factor α, b is the index variable of the batch size, D is the embedding dimension, d is the index variable of the embedding dimension, c is the index variable of the number of channels, and Y b,c,l Represents the output value of the bth batch, cth channel, and lth position; In step S3, the weighted acoustic signal and vibration signal are subjected to Z-Pool layer dimensionality reduction, convolution layer feature extraction, batch normalization, and nonlinear activation operations in sequence. After convolution layer feature extraction, weighting is performed, and the weighted features are combined and fused using element-by-element multiplication. The Z-Pool layer dimensionality reduction process is as follows: MaxPool(h) i,j,k =max m,n h i+m,j+n,k ; Z-Pool(h)=Concat(MaxPool(h),AvgPool(h)); Where i, j, k are the coordinates of the output features, m, n are the relative coordinates within the pooling window, M and N are the height and width of the pooling window, and MaxPool(h) i,j,k is the maximum pooling operation, AvgPool(h) i,j,k is an average pooling operation, Z-Pool(h) is a feature dimensionality reduction operation, Z represents the operation of concatenating the results of maximum pooling and average pooling, and Pool(h) is a pooling operation on the input sequence vector h; In step S5, the calculation formula of Mahalanobis distance is: Where μ is the mean vector, S is the covariance matrix, (e-μ) is the difference vector between vector e and mean vector μ, and D M (e,μ) is the Mahalanobis distance.
2. The gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer according to claim 1 is characterized in that: In step S4, the acoustic signal and vibration signal processed by the convolutional layer in step S3 are respectively encoded using M layers of Vision Transformer. Each layer of the encoder contains a feedforward network and a multi-head attention mechanism. During the output of the encoder, the output of the multi-head attention is combined with the output of the feedforward network through a residual connection. After layer-by-layer processing by the encoder, the network extracts specific feature identifiers and performs layer-by-layer normalization on these features. Finally, the extracted and normalized acoustic and vibration signals are horizontally spliced to complete feature fusion. process for: z′ γ =MSA(MN(z γ-1 ))+z γ-1 ; With' γ =MLP(MN(z γ-1 ))+z γ-1 ; Where γ is the corresponding sequence, z′ γ is the internal output sequence of the M-layer encoder, MSA is multi-head attention, MLP is the feedforward network, MN is the layer normalization function, and y is the final output sequence after processing by the layer normalization function MN. is the initial input sequence of the M-th layer encoder, z γ-1 It is the internal output sequence of the γ-1 layer encoder and serves as the input of the γ layer encoder.
3. The gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer according to claim 1 is characterized in that: Step S4 includes dividing each vector of the concatenated features by the Euclidean norm to make the vector length become 1, which is used to eliminate the scale difference between different features. The formula is: Where U represents a vector and u represents the component of the vector.
4. The gear acoustic and vibration signal fusion fault diagnosis method based on Vision Transformer according to claim 1 is characterized in that: The Mahalanobis distance loss function is: Where, is category y i The covariance matrix of , λ is a hyperparameter, and R(θ) is a regularization term.
Citation Information
Patent Citations
Multi-sensor fusion gear fault diagnosis method
CN118133150A
Multi-class welding spot defect classification method, system and equipment based on Transform and channel interaction and medium
CN119851043A