A ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism
By introducing a multi-attention mechanism for channel parallel fusion in ball screw fault diagnosis, combined with Gram angle field preprocessing and image blocking technology, the problem of insufficient classification recognition and local feature extraction capabilities in ball screw fault diagnosis is solved, and the problem of insufficient classification recognition and local feature extraction capabilities is achieved. Higher fault identification accuracy and calculation efficiency.
Patent Information
- Application Number
- CN202311080811.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2043-08-25
AI Technical Summary
The prior art has poor classification and identification capabilities and insufficient local feature extraction capabilities in ball screw fault diagnosis, resulting in threats to the processing quality and safety of mechanical equipment.
A ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism was designed. By performing Gram angle field preprocessing on the ball screw acceleration data, combining image chunking and feature extraction modules, the channel parallel fusion multi-attention is used. The force mechanism module strengthens the model's local perception and global information integration capabilities and improves classification accuracy.
The classification accuracy and prediction stability of ball screw fault diagnosis are improved, the calculation amount is saved, and the problem of insufficient local feature extraction capabilities of traditional models is overcome.
Smart Images

Figure CN117218508B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mechanical equipment fault diagnosis, and in particular to a ball screw fault diagnosis method based on a channel parallel fusion multi-attention mechanism. Background Art
[0002] The ball screw pair is a driving mechanism that converts rotational motion into linear motion. It has the advantages of high efficiency, high precision, and long life. It is widely used in CNC machine tools, servo transmission, precision instruments and other fields. At present, the transmission device in CNC machine tools is still mainly ball screw pairs, which occupy an important position in the field of servo transmission. However, after working under harsh working conditions such as high speed, heavy load and cyclic start and stop for a long time, the contact interface of the ball screw pair raceway will inevitably suffer from wear and pitting, which will seriously threaten the processing quality and work safety of mechanical equipment. Once a failure occurs, it will cause serious equipment and even personal safety accidents, and will cause huge economic losses. Therefore, the reliability and safety of the ball screw pair must be taken seriously, and research on the fault diagnosis technology of the ball screw pair should be carried out to reduce major accidents of mechanical equipment caused by ball screw pair failures.
[0003] There are more and more studies based on Transformer models, which have achieved good results in the fields of computer vision and target detection, but there are relatively few applications in the field of mechanical fault diagnosis, and there are still defects such as poor classification and recognition capabilities and insufficient local feature extraction capabilities. The introduction of Swin Transformer solves these problems and has achieved good results in classification, detection, and segmentation tasks. In order to achieve a higher fault recognition rate, deep neural network models are developing towards a larger and larger receptive field, but sometimes the importance of local information is ignored. Therefore, the combination of classic and efficient convolutional neural network models and computer vision models has a very high research value. The commonly used channel shuffle operation is used to fuse the multi-attention mechanism, and local information extraction is added while paying attention to the global information of the model.
[0004] In order to solve these problems, the present invention integrates the advantages of channel parallelism and multi-attention mechanism to optimize the commonly used SwinTransformer module, and designs a module based on channel parallel fusion multi-attention mechanism to enhance the model's local perception and ability to integrate global information, thereby improving the classification accuracy. Summary of the invention
[0005] In response to the defects or improvement needs of the above-mentioned prior art, the present invention provides a ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism, which solves the problems of poor model classification and recognition ability and insufficient local feature extraction ability.
[0006] In order to achieve the above object, the present invention provides the following technical solution, comprising the following steps:
[0007] Step S1, pre-processing the ball screw acceleration data using the Gram angle field to convert it into two-dimensional data, thereby establishing a ball screw data set;
[0008] Step S2, inputting the preprocessed ball screw data set into an image segmentation module, and segmenting the input image into small sub-images of the same size;
[0009] Step S3, constructing a ball screw feature extraction module based on channel parallel fusion multi-attention mechanism, which is divided into four stages to obtain feature maps;
[0010] Step S4, after four stages of calculation, use the global average pooling layer on the output features, and finally use the SoftMax classifier to classify the ball screw fault. According to the classification loss function, the gradient is back-propagated to update the parameters of the ball screw fault diagnosis model again. After the training test is completed, the optimized diagnosis model is saved.
[0011] In step S1, the acceleration data of the ball screw is obtained by performing dynamic simulation on the ball screw using dynamic simulation software.
[0012] When the ball screw data set is preprocessed in step S1, the ball screw acceleration data is first transformed into a Gram angle field to obtain two-dimensional image data.
[0013] Furthermore, the Gram angle field converts the one-dimensional time series in the Cartesian coordinate system into a polar coordinate system representation, and then uses trigonometric functions to generate a Gram matrix. First, numerical scaling is performed to scale the time series in the Cartesian coordinate system to the interval [0,1] or [-1,1]; then polar coordinate conversion is performed, using the coordinate transformation formula to convert the Cartesian coordinate system sequence into a polar coordinate system time series; after the trigonometric function transformation of the angle sum / difference, if the cosine function of the sum of two angles is used, the Gram angle sum matrix is obtained, and if the cosine function of the difference of two angles is used, the Gram angle difference matrix is obtained.
[0014] In step S2, the image segmentation module segments the input image into non-overlapping small-sized sub-images in a size of 4×4.
[0015] In step S3, the ball screw feature extraction module includes four stages. The first stage consists of a linear embedding module and a channel parallel fusion multi-attention mechanism module. The following three stages are composed of an image merging module and a channel parallel fusion multi-attention mechanism module. In the channel parallel fusion multi-attention mechanism module, the data is first input into two branches after channel separation. The left branch performs a shallow convolution operation to efficiently extract local information, and the right branch can focus on global information and cross-window information transmission through the Swin Transformer module, wherein:
[0016] Linear embedding: Project the above original features to any dimension to obtain the feature vector corresponding to each subgraph;
[0017] Channel parallel fusion multi-attention mechanism module: First, divide the input feature map into two branches with 1 / 2 channels each. One branch performs shallow convolution operation, using the same number of input channels and output channels, and undergoes three convolutions with a step size of 1, of which two 1×1 convolutions are ordinary convolutions and 3×3 convolutions are deep convolutions in depth-separable convolutions. The other branch can better extract global information through the Swin Transformer module. When feature extraction is completed, the two branches will perform cascade operations, add the number of channels, fuse features, and finally use channel shuffling to exchange information between different groups, so that the channels are fully integrated and the local features are efficiently and accurately integrated with the global features.
[0018] Swin Transformer module: First, the normalization layer is used to stabilize the model training, and residual connections are added. Then, the feature map is input into the window multi-head self-attention module. The window multi-head self-attention module first divides the feature map into image blocks according to the size of 4×4, and then calculates the self-attention for each image block. The obtained self-attention result is first input into the layer normalization module, and then the normalized result is input into the multi-layer perceptron module to perform a nonlinear transformation on the input normalized result. The obtained feature is input into the multi-head self-attention module of the moving window and then moved. Then, the self-attention in the moved window is calculated to obtain the self-attention in the moved window. The self-attention result in the moved window is input into the layer normalization module for normalization, and then the normalized result is input into the multi-layer perceptron module to perform a nonlinear transformation on the input normalized result and output a new feature.
[0019] Multilayer perceptron module: The multilayer perceptron includes an input layer, a hidden layer, and an output layer. The different layers of the multilayer perceptron neural network are fully connected. The input layer receives input data, the hidden layer represents features through learning, and the output layer generates the final prediction result. Each neuron in the hidden layer and the output layer has an activation function to introduce nonlinear mapping.
[0020] Image merging: used for downsampling to obtain multi-scale feature information, reduce resolution, and adjust the number of channels.
[0021] In step S4, after the four stages of calculation, the global average pooling layer is used on the output features and then the SoftMax classifier is used to implement ball screw fault classification.
[0022] According to the classification loss function, the gradient backpropagation is used to update the parameters of the ball screw fault diagnosis model again to obtain the optimized ball screw fault diagnosis model. The ball screw image to be diagnosed is input into the optimized and trained ball screw image classification model to output the fault diagnosis result of the ball screw.
[0023] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0024] The present invention provides a ball screw pair fault diagnosis method, which uses dynamic simulation of the acceleration signal on the ball screw pair vibration sensor to extract important features, maps the extracted features into fault categories through an algorithm, and uses the loss function to back-propagate the gradient optimization model to improve the stability and accuracy of the prediction.
[0025] The present invention adds channel parallelism to each detection layer of the model, strengthens the local perception ability of the network, helps to extract local features and integrate global information, and improves the limitation of the traditional Swin transformer module that is not good at extracting local features. When the amount of calculation and the amount of parameters are less than dozens of times of the traditional classification model, the final classification accuracy is still much higher than that of the traditional classification model, and when the accuracy is almost the same, it saves several times the amount of calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 The overall flow chart of the ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism
[0027] Figure 2 Module architecture diagram for channel parallel fusion of multiple attention mechanisms DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0029] like Figure 1 As shown, a ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism includes the following steps:
[0030] Step S1, preprocessing the ball screw acceleration data using the Gram angle field to convert the one-dimensional time series into a two-dimensional image, thereby establishing a ball screw data set.
[0031] The present invention uses the acceleration data of the ball screw as input, and the acceleration data of the ball screw is obtained by performing dynamic simulation on the ball screw through dynamic simulation software. Since the original signal is a time domain signal, it is necessary to convert the Gram angle field thereof into a two-dimensional image.
[0032] Furthermore, the image obtained by the Gram angular field expresses the time series from the upper left corner to the lower right corner. It first obtains the radius and angle by performing polar coordinate transformation on the step size and amplitude in the time series, and then calculates the trigonometric function value of each point and its correlation, and uses trigonometric function transformation to form a Gram matrix.
[0033] Step S2, input the preprocessed ball screw data set into the image segmentation module, and divide the input image into small-sized sub-images of the same size.
[0034] The input image w (width) × h (height) × 3 is segmented into non-overlapping small-sized sub-images through the image segmentation module, whose features are set to the original image pixel values. In Swin Transformer, we use a sub-image size of 4 × 4, and the feature dimension of each sub-image is 4 × 4 × 3 = 48. The number of original image segmentations is (w / 4) × (h / 4).
[0035] Step S3, then establish a ball screw feature extraction module based on channel parallel fusion multi-attention mechanism, which is divided into four stages to obtain feature maps.
[0036] In step S3.1, linear embedding is applied to the original features to project them to any dimension, and then the above sub-graphs are input into the channel-parallel fusion multi-attention mechanism module for feature extraction. In order to generate multi-scale feature representations, as the network goes deeper, we reduce the total number of sub-graphs by merging images.
[0037] In step S3.2, each group of 2×2 adjacent sub-image features is first fused, and image merging is applied on the fused feature dimension. The total number of sub-images is reduced by 4 times. Then, the channel parallel fusion multi-attention mechanism module is input for feature extraction with a resolution of (w / 8)×(h / 8).
[0038] In the channel parallel fusion multi-attention mechanism, the data is first input into two branches after channel separation. The left branch performs shallow convolution operations to efficiently extract local information, and the right branch can focus on global information and cross-window information transmission through the Swin Transformer module, where:
[0039] Linear embedding: Project the above original features to any dimension to obtain the feature vector corresponding to each subgraph.
[0040] Channel parallel fusion multi-attention mechanism module: First, divide the input feature map into two branches with 1 / 2 channels each. One branch performs shallow convolution operation, using the same number of input channels and output channels, and undergoes three convolutions with a step size of 1, of which two 1×1 convolutions are ordinary convolutions and 3×3 convolutions are deep convolutions in deep separable convolutions. The other branch can better extract global information through the Swin Transformer module. When feature extraction is completed, the two branches will perform cascade operations, add the number of channels, fuse features, and finally use channel shuffling to exchange information between different groups, so that the channels are fully integrated and local features are efficiently and accurately integrated with global features.
[0041] Swin Transformer: First, the normalization layer is used to stabilize the model training, and residual connections are added. Then, the feature map is input into the window multi-head self-attention module. The window multi-head self-attention module first divides the feature map into image blocks according to the size of 4×4, and then calculates the self-attention for each image block. The obtained self-attention result is first input into the layer normalization module for normalization operation, and then the normalized result is input into the multi-layer perceptron module to perform nonlinear transformation on the input normalized result. The obtained feature is input into the shifted window multi-head self-attention module and then moved. Then, the self-attention in the moved window is calculated to obtain the self-attention in the moved window. The self-attention result in the moved window is input into the layer normalization module for normalization, and then the normalized result is input into the multi-layer perceptron module to perform nonlinear transformation on the input normalized result and output new features.
[0042] In step S3.3, the window multi-head self-attention module and the shifted window multi-head self-attention module are alternately used in two consecutive Swin Transformer modules.
[0043] The 8x8 feature map of the previous Swin Transformer module is divided into 2x2 sub-maps, each with a size of 4x4. Then the window position of the next Swin Transformer module is moved to obtain 3x3 non-overlapping sub-maps. The moving window division method introduces connections between adjacent non-overlapping windows in the previous layer, greatly increasing the receptive field.
[0044] Among them, the window multi-head self-attention module introduces a window, which can reduce the amount of calculation to linear growth. The multi-head self-attention module divides the input image into non-overlapping windows, and then performs self-attention calculations in different windows. An image has a sub-image of w (width) × h (height), then:
[0045] The computational complexity of the multi-head self-attention module is: Ω(MSA)=4hwC2+2(hw)2C;
[0046] The computational complexity of the window-based multi-head self-attention module is: Ω(W-MSA)=4hwC2+2M2hwC.
[0047] Here h and w represent the height and width of the original image respectively, C represents the number of channels, and M represents the size of each image block. The h and w of the corresponding image block are both M.
[0048] In addition, the shifted window multi-head self-attention module introduces cross-window connections while maintaining efficient computation of non-overlapping windows.
[0049] Image merging: used for downsampling to obtain multi-scale feature information, reduce resolution, and adjust the number of channels.
[0050] In step S4, after four stages of calculation, a global average pooling layer is used on the output features, and finally a SoftMax classifier is used to classify the ball screw fault.
[0051] According to the classification loss function, the gradient is back-propagated to update the parameters of the ball screw fault diagnosis model again, and the optimized diagnosis model is saved after the training test is completed.
[0052] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism, characterized in that: The following steps are involved: step S1, pre-processing the ball screw acceleration data using the Gram angle field to convert it into two-dimensional data, and establishing a ball screw data set; Step S2, inputting the preprocessed ball screw data set into the image segmentation module, and segmenting the input image into small-sized sub-images of the same size; Step S3, constructing a ball screw feature extraction module based on channel parallel fusion multi-attention mechanism, which is divided into four stages to obtain feature maps; Step S4, after four stages of calculation, a global average pooling layer is used on the output features, and finally a SoftMax classifier is used to classify the ball screw fault. The gradient is back-propagated according to the classification loss function to update the parameters of the ball screw fault diagnosis model again. After the training test is completed, the optimized diagnosis model is saved; In step S3, the ball screw feature extraction module includes four stages. The first stage consists of a linear embedding module and a channel parallel fusion multi-attention mechanism module. The following three stages are composed of an image merging module and a channel parallel fusion multi-attention mechanism module. In the channel parallel fusion multi-attention mechanism module, the data is first input into two branches after channel separation. The left branch performs a shallow convolution operation to efficiently extract local information, and the right branch can focus on global information and cross-window information transmission through the SwinTransformer module, wherein: Linear embedding: Project the original features to any dimension to obtain the feature vector corresponding to each subgraph; Channel parallel fusion multi-attention mechanism module: The input feature channel is divided into two branches, one of which performs shallow convolution operation and passes through three convolutions with a step size of 1, of which two 1×1 convolutions are ordinary convolutions and 3×3 convolutions are deep convolutions in depth-separable convolutions. The other branch passes through the Swin Transformer module to better extract global information. After the feature extraction is completed, the two branches will perform cascade operations, add the number of channels, fuse features, and finally use channel shuffling to exchange information between different groups, so that the channels are fully integrated and the local features are efficiently and accurately integrated with the global features. Swin Transformer: First, the normalization layer is used to stabilize the model training, and residual connections are added. Then, the feature map is input into the window multi-head self-attention module. The window multi-head self-attention module first divides the feature map into image blocks according to the size of 4×4, and then calculates the self-attention for each image block. The obtained self-attention result is first input into the layer normalization module, and then the normalized result is input into the multi-layer perceptron module to perform a nonlinear transformation on the input normalized result. The obtained feature is input into the shifted window multi-head self-attention module and then moved. Then, the self-attention in the moved window is calculated to obtain the self-attention in the moved window. The self-attention result in the moved window is input into the layer normalization module, and then the normalized result is input into the multi-layer perceptron module to perform a nonlinear transformation on the input normalized result and output a new feature. Image merging: used for downsampling to obtain multi-scale feature information.
2. The ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism according to claim 1 is characterized in that: In the step S1, the ball screw acceleration data is obtained by performing a dynamic simulation on the ball screw.
3. The ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism according to claim 1 is characterized in that: In the step S1, when preprocessing the ball screw data set, the ball screw acceleration data is first transformed into two-dimensional image data by Gram angle field transformation.
4. The ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism according to claim 1 is characterized in that: In the step S2, the image segmentation module segments the input image into non-overlapping small-sized sub-images in a size of 4×4.
5. The ball screw fault diagnosis method based on channel parallel fusion multi-attention mechanism according to claim 1 is characterized in that: In the step S4, after the four stages of calculation, the global average pooling layer is used on the output features and then the SoftMax classifier is used to realize the ball screw fault classification. The gradient is back-propagated according to the classification loss function to update the parameters of the ball screw fault diagnosis model again to obtain the optimized ball screw fault diagnosis model. The ball screw image to be diagnosed is input into the optimized and trained ball screw image classification model, and the fault diagnosis result of the ball screw is output.
Citation Information
Patent Citations
Fault diagnosis method based on lightweight Vision Transform module
CN114818826A
Medical image segmentation model construction method based on multi-attention fusion
CN116309648A
Fault diagnosis method and system for electromechanical equipment
CN116340750A
Deep learning fault diagnosis method integrating prior knowledge
WO2022188425A1
Self-attention-based method for detecting defective area of color-textured fabric
WO2023070911A1
