Fault diagnosis method based on lightweight Vision Transformer module

Through the lightweight Vision Transformer module and multi-head attention mechanism, it solves the limitations of mechanical equipment fault diagnosis methods in the existing technology when the number of parameters is high and the data set is small, achieving stronger feature extraction and higher diagnosis. Accuracy.

CN114818826BActive Publication Date: 2024-08-23ANHUI DETONG ZHILIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210546115.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2024-08-23
Estimated Expiration
2042-05-19

AI Technical Summary

Technical Problem

Existing fault diagnosis methods based on convolutional neural networks and recurrent neural networks have limitations in capturing mechanical equipment fault information. Especially when the number of parameters is high and the data set is small, it is difficult to obtain high-accuracy fault diagnosis.

Method used

The lightweight Vision Transformer module is used to encode the one-dimensional vibration signal of the mechanical equipment through two-dimensional images, and combined with the multi-head attention mechanism and grouped convolution layer, a network model is constructed to extract the features of the bearing data set for fault diagnosis.

Benefits of technology

It achieves stronger feature extraction capabilities and higher diagnostic accuracy on small data sets, reduces the amount of model parameters, reduces equipment memory requirements, and can better learn the timing and global characteristics of mechanical equipment faults.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818826B
    Figure CN114818826B
Patent Text Reader

Abstract

The present invention discloses a fault diagnosis method based on a lightweight Vision Transformer module, comprising the following steps: obtaining vibration signals of mechanical equipment of various fault types as data sets and dividing them into training sets and test sets; using a two-dimensional image encoding method to encode the one-dimensional vibration signal of the mechanical equipment into a two-dimensional image; using a lightweight Vision Transformer module to build a network model and extracting the bearing data set features through the built network model; using the converted bearing training data set to train the fault diagnosis model; inputting the test data set into the trained fault diagnosis model to obtain a predicted classification result, and judging the fault condition of the mechanical equipment to be tested according to the classification result. The method has the advantages of strong feature extraction capability and high diagnostic accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fault diagnosis, and in particular to a fault diagnosis method based on a lightweight Vision Transformer module. Background Art

[0002] With the continuous development of modern industry, science and technology, and economy, industry has become an important criterion for measuring a country's comprehensive strength. In modern industrial society, mechanical equipment is an indispensable and commonly used component, and plays a vital role in industrial production. A large number of mechanical equipment have good stability in the initial operation, but the complex working environment and irregular operation process affect the safety of industrial equipment, causing abnormalities in mechanical equipment, and their performance will decrease or even fail over time. Effective maintenance of mechanical equipment is a basic requirement for maintaining normal operation. Preventing equipment failure can reduce property losses and avoid serious accidents. Therefore, in the production process, the demand for reliability, safety, and reducing manufacturing costs has greatly promoted the development of mechanical equipment fault diagnosis technology.

[0003] With the development of deep learning, fault diagnosis methods based on convolutional neural networks and recurrent neural networks have been widely used and have achieved good fault diagnosis results. However, these two types of neural networks also have their own defects. Recurrent neural networks and their variants still cannot completely avoid the long-term dependency problem. The local receptive field of the convolutional neural network convolution kernel requires a large number of convolutional layers to be superimposed in order to obtain global information. It has the disadvantages of lack of capturing the relationship between targets, equal treatment of all pixels, and lack of targeting. The emergence of the Transformer model makes up for the shortcomings of convolutional neural networks, but the original Transformer is suitable for natural language processing. In recent years, Vision Transformer in the field of computer vision has received widespread attention, but in classification tasks, it can only obtain good feature extraction capabilities when the data set is particularly large, and the model has a high number of parameters, which places too high requirements on the equipment. Summary of the invention

[0004] The technical problem to be solved by the present invention is how to provide a fault diagnosis method based on a lightweight Vision Transformer module with strong feature extraction capability and high diagnostic accuracy.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a fault diagnosis method based on a lightweight VisionTransformer module, characterized in that it includes the following steps:

[0006] Obtain vibration signals of mechanical equipment with different fault types as data sets and divide them into training sets and test sets;

[0007] The one-dimensional vibration signal of the mechanical equipment is encoded into a two-dimensional image using a two-dimensional image encoding method;

[0008] Use the lightweight Vision Transformer module to build a network model and extract the bearing dataset features through the built network model;

[0009] The fault diagnosis model is trained using the converted bearing training data set;

[0010] The test data set is input into the trained fault diagnosis model to obtain the predicted classification results, and the fault condition of the mechanical equipment to be tested is judged according to the classification results.

[0011] The beneficial effects of adopting the above technical scheme are: the method described in the present invention adopts the designed lightweight Vision Transformer module as the feature extraction part of the model, and the module can better learn the temporal characteristics and global characteristics of mechanical equipment fault information over a long period of time, and obtain more accurate fault relationships; the model parameter amount of the module constructed by the present invention is smaller, and better feature extraction effect can be obtained on a small data set. Compared with ordinary convolutional neural networks, the method described in the present invention has stronger feature extraction ability and higher diagnostic accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0013] Figure 1 is a flow chart of the method described in an embodiment of the present invention;

[0014] Figure 2 Schematic diagram of the structure of the multi-head attention mechanism in the method described in the embodiment of the present invention;

[0015] Figure 3 is a schematic diagram of the structure of a lightweight Vision Transformer module in the method described in an embodiment of the present invention;

[0016] Figure 4 It is a schematic diagram of the diagnostic model structure built according to the original Vision Transformer model structure in the method described in an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0018] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0019] like Figure 1 As shown, the embodiment of the present invention discloses a fault diagnosis method based on a lightweight Vision Transformer module, comprising the following steps:

[0020] Obtain vibration signals of mechanical equipment with different fault types as data sets and divide them into training sets and test sets;

[0021] The one-dimensional vibration signal of the mechanical equipment is encoded into a two-dimensional image using a two-dimensional image encoding method;

[0022] Use the lightweight Vision Transformer module to build a network model and extract the bearing dataset features through the built network model;

[0023] The fault diagnosis model is trained using the converted bearing training data set;

[0024] The test data set is input into the trained fault diagnosis model to obtain the predicted classification results, and the fault condition of the mechanical equipment to be tested is judged according to the classification results.

[0025] In this embodiment, there are multiple methods for encoding the one-dimensional vibration signal of mechanical equipment into a two-dimensional image using image coding technology, including: grayscale image, time-frequency image, Markov transition field, Gram angle field, and recursive image.

[0026] Furthermore, the lightweight Vision Transformer module is mainly used to extract features between and within images in the dataset. The module structure includes: a convolution layer, a multi-head attention mechanism layer, a group convolution layer, and 3 batch normalization layers (BN). The convolution layer and group convolution are used to extract feature information within the image, and the multi-head attention mechanism layer is used to extract feature information between different images.

[0027] The lightweight Vision Transformer module structure consists of two parts: channel contraction and channel expansion. Placing the multi-head attention mechanism after the convolutional layer that compresses the number of channels not only retains the performance of the original Transformer, but also reduces the number of model parameters and the model's requirements for device memory, achieving a lightweight effect. Figure 2 This is the multi-head attention mechanism structure in this embodiment.

[0028] In this embodiment, the multi-head attention mechanism in the lightweight Vision Transformer module is composed of multiple self-attention mechanisms:

[0029] Specifically, the self-attention mechanism formula is as follows:

[0030]

[0031] Where Q is the Query vector, K is the Key vector, and V is the Value vector; K T is the transpose of the K vector, is the scaling factor;

[0032] The multi-head attention mechanism composed of multiple self-attention mechanisms is calculated using the following formula:

[0033] MultiHedds(Q,K,V)=Concat(head1,...,head n )W o

[0034] in,

[0035]

[0036] In the formula, Q is the Query vector, K is the Key vector, V is the Value vector, and head i is the result of the i-th self-attention mechanism, W o is the weight matrix, is the Query weight matrix, is the Key weight matrix, is the Value weight matrix, and Concat is the feature concatenation function.

[0037] The lightweight Vision Transformer module shrinks channels through convolutional layers and expands channels through grouped convolutions. The shrinkage ratio is set to N, that is, the number of channels obtained after the input channel number C_in passes through the convolutional layer is C_out / N. Then, grouped convolutions are used to obtain the expanded channel number C_out (1-1 / N), and finally the two parts of features are concatenated to obtain the output feature map C_out. Convolutional layers and grouped convolutional layers are used to control the number of channels. Here, grouped convolutions expand the number of channels by performing multiple feature extraction operations on the same feature map. Compared with the two fully connected layers of the original Transformer, the number of model parameters is greatly reduced.

[0038] In this embodiment, the calculation method of the mentioned fully connected layer and grouped convolution parameters is:

[0039] The parameter calculation formula of the fully connected layer is:

[0040] H*W*C_in*C_out

[0041] The parameter calculation formula of the proposed group convolution is:

[0042] K*K*C_out

[0043] Among them, H is the height of the feature map, W is the width of the feature map, C_in is the number of input channels of the feature map, C_out is the number of output channels of the feature map, and K is the size of the convolution kernel.

[0044] The lightweight Vision Transformer module adds a BN layer after the convolutional layer, the multi-head attention mechanism layer, and the deep convolutional layer.

[0045] In this embodiment, the calculation process of the BN layer is expressed as:

[0046]

[0047]

[0048]

[0049] y i =γz i +β

[0050] Among them, x i and i Respectively represent the input and output features of the i-th observation in the batch; N batch is the number of samples in each batch in the classification task; γ and β are two trainable parameters that can adaptively learn a more appropriate feature distribution; ε is a constant close to zero.

[0051] like Figure 3 As shown in the figure, the processing steps of the lightweight Vision Transformer module include: the input feature map first passes through the channel contraction part, where the channel contraction is performed by convolution operation, and the number of channels becomes 1 / N of the number of output channels; the multi-head attention mechanism operation is performed on the feature map obtained after contraction, and the number of heads is set (the number of heads ≥ 2) to obtain feature maps with different attention weights; in the channel expansion part, the obtained feature maps with different weights are channel expanded by grouped convolution operation; the feature map obtained by the contraction part is spliced ​​with the feature map of the expansion part to restore the original number of feature map channels.

[0052] There are three methods for building a network model using the lightweight Vision Transformer module, including: building a network model according to the channel increment mode, building a network model according to the original Vision Transformer model structure, and replacing any convolutional layer in different models to obtain a network model with a lightweight Vision Transformer module.

[0053] like Figure 4 As shown, in this embodiment, in the lightweight Vision Transformer module model design method: the channel increment mode is to use a lightweight Vision Transformer module to build the model. As the number of layers increases, the number of channels of the module also increases; according to the Vision Transformer model structure design: the first layer of the model is a convolutional layer, and the subsequent m layers are lightweight Vision Transformer modules with the same number of channels, where m≥1.

[0054] Furthermore, in the lightweight Vision Transformer module model design method, feature extraction is performed through a convolutional layer or a lightweight Vision Transformer module and then enters a classifier for feature classification. The classifier is composed of a fully connected layer, and the number of neurons in the fully connected layer is the number of mechanical equipment diagnosis categories.

[0055] The method described in the present invention adopts the designed lightweight Vision Transformer module as the feature extraction part of the model. The module can better learn the temporal characteristics and global characteristics of mechanical equipment fault information over a long period of time, and obtain more accurate fault relationships; the model parameter amount of the module constructed in the present invention is smaller, and better feature extraction effect can be obtained on a small data set. Compared with ordinary convolutional neural networks, the method described in the present invention has stronger feature extraction capability and higher diagnostic accuracy.

Claims

1. A fault diagnosis method based on a lightweight Vision Transformer module, characterized in that The steps include: Obtain vibration signals of mechanical equipment with different fault types as data sets and divide them into training sets and test sets; The one-dimensional vibration signal of the mechanical equipment is encoded into a two-dimensional image using a two-dimensional image encoding method; Use the lightweight Vision Transformer module to build a network model and extract the bearing dataset features through the built network model; The fault diagnosis model is trained using the converted bearing training data set; Input the test data set into the trained fault diagnosis model to obtain the predicted classification results, and judge the fault condition of the mechanical equipment to be tested according to the classification results; The lightweight Vision Transformer module is used to extract features between and within images in the dataset. The module structure includes: a convolution layer, a multi-head attention mechanism layer, a group convolution layer, and three batch normalization layers. The convolution layer and the group convolution layer are used to extract feature information within the image, and the multi-head attention mechanism layer is used to extract feature information between different images. The multi-head attention mechanism layer in the lightweight Vision Transformer module is composed of multiple self-attention mechanisms. The self-attention mechanism formula is as follows: Where Q is the Query vector, K is the Key vector, and V is the Value vector; K T is the transpose of the K vector, is the scaling factor; The multi-head attention mechanism composed of multiple self-attention mechanisms is calculated using the following formula: MultiHeads(Q,K,V)=Concat(head1,...,head n )W o in, In the formula, Q is the Query vector, K is the Key vector, V is the Value vector, and head i is the result of the i-th self-attention mechanism, W o is the weight matrix, is the Query weight matrix, is the Key weight matrix, is the Value weight matrix, Concat is the feature concatenation function; The lightweight Vision Transformer module adds a BN layer after the convolution layer, the multi-head attention mechanism layer, and the deep convolution layer. The calculation process of the BN layer is expressed as: y i =γz i +b Among them, x i and i Respectively represent the input and output features of the i-th observation in the batch; N batch is the number of samples in each batch in the classification task; γ and β are two trainable parameters that can adaptively learn a more appropriate feature distribution; ε is a constant close to zero.

2. The fault diagnosis method based on the lightweight Vision Transformer module according to claim 1, characterized in that: The image coding method includes a grayscale image, a time-frequency image, a Markov transition field, a Gram angle field and a recurrence image.

3. The fault diagnosis method based on the lightweight Vision Transformer module according to claim 1 is characterized in that: The lightweight Vision Transformer module performs channel contraction through a convolutional layer and channel expansion through grouped convolution; the contraction ratio is set to N, that is, the number of channels obtained after the input channel number C_in passes through the convolutional layer is C_out / N; then grouped convolution is used to obtain the expanded channel number C_out (1-1 / N), and finally the two parts of the features are spliced ​​to obtain the output feature map C_out.

4. The fault diagnosis method based on the lightweight Vision Transformer module according to claim 1 is characterized in that: The lightweight Vision Transformer module uses convolutional layers and grouped convolutional layers to control the number of channels. The grouped convolution expands the number of channels by performing multiple feature extraction operations on the same feature map. The parameter calculation formula of the fully connected layer is: H*W*C_in*C_out The parameter calculation formula of the proposed group convolution is: K*K*C_out Among them, H is the height of the feature map, W is the width of the feature map, C_in is the number of input channels of the feature map, C_out is the number of output channels of the feature map, and K is the size of the convolution kernel.

5. The fault diagnosis method based on the lightweight Vision Transformer module according to claim 1 is characterized in that: The processing method of the lightweight Vision Transformer module is as follows: The input feature map first passes through the channel contraction part, where the channel contraction is performed through the convolution operation, and the number of channels becomes 1 / N of the number of output channels; Perform a multi-head attention mechanism operation on the feature map obtained after shrinkage, set the number of multi-heads, the number of multi-heads ≥ 2, and obtain feature maps with different attention weights; In the channel expansion part, the obtained feature maps with different weights are expanded through grouped convolution operations; The feature map obtained from the contraction part is concatenated with the feature map from the expansion part to restore the original number of feature map channels.

6. The fault diagnosis method based on the lightweight Vision Transformer module according to claim 1 is characterized in that: In the lightweight Vision Transformer module model design method: The channel increment mode uses lightweight Vision Transformer modules to build the model. As the number of layers increases, the number of channels in the module also increases. According to the Vision Transformer model structure design: the first layer of the model is a convolutional layer, and the subsequent m layers are lightweight Vision Transformer modules with the same number of channels; Here m≥1.

7. The fault diagnosis method based on the lightweight Vision Transformer module according to claim 1 is characterized in that: In the lightweight Vision Transformer module model design method, features are extracted through convolutional layers or lightweight Vision Transformer modules and then enter the classifier for feature classification. The classifier is composed of a fully connected layer, and the number of neurons in the fully connected layer is the number of mechanical equipment diagnosis categories.