# Deep Clustering Efficient Learning Network for Motion Recognition Based on Self-Attention Mechanism
## 3 Method
### Self-Attention Mechanism Fusion Depth Clustering Learning Network Model
#### 3.2.2 Self-Attention Mechanism  
The self-attention mechanism has been widely used in image recognition and natural language processing, such as image classification, image detection, object detection, pedestrian recognition, etc. The self-attention mechanism simulates the key information features of things captured by the human brain when observing things, which is conducive to paying attention to the important information features of interested objects when the computer [36; 37; 38; 39] executes image scene tasks, and this feature information is crucial for subsequent work. The traditional depth learning convolution neural network cannot extract the feature information of a specific target according to the input image, and will ignore the impact of global features on group detection. The self-attention mechanism can act on the middle layer features of the image, enrich the semantic features to help the model extract the key features with identification contained in the image, and improve the performance of the features. In addition, the self-attention mechanism is good at extracting the internal correlation of features, which can enhance the performance of network local feature extraction and global context aggregation. Common attention mainly includes spatial attention and channel attention. Spatial attention aims at improving the feature expression of key areas, transforming the spatial information in the original image into another space and retaining the key information, generating a weight mask for each area and weighting the output. Channel attention can find the correlation of different channels to the feature map, automatically obtain the weight of each channel through the neural network, and enhance the features of important channels and weaken the features of non-important channels according to the dependence of each channel. In this paper, a self-attention mechanism is designed in LSTM, which can fuse multi-scale information. While enhancing the feature difference between the tampered area and the real area of the image, it can improve the detection performance of the tampered area of the network. The core idea of the self-attention mechanism is to highlight the part of the input data that is more relevant to the output task in the form of weight according to the probability distribution of the data and the relationship between variables. In terms of image semantic understanding, the attention weight is learned through the neural network and fused with the original feature map so as to strengthen important features and weaken irrelevant components, reduce dependence on external information, and make use of the inherent information in the features to interact with attention as much as possible. A feature map contains information, such as feature channels and positions. Some of the content in the map is of concern to us, while some of the content contributes little to the results of the detection task. Through learning, we can suppress insignificant features, enhance the expression ability of features in the network, and then improve the target detection effect. In this paper, the self-attention mechanism used is decomposed into two parallel one-dimensional feature codes, that is, two one-dimensional vectors are obtained by averaging pooling in the horizontal and vertical directions, and then \(1\times 1\) convolution is spliced in the spatial dimension to compress channels. Through Relu activation coding, the same number of channels as the input feature map is obtained. Normalized weighting is used to adjust the features and extract the output feature map. The self-attention mechanism adopts the multi-head attention mechanism. Its principle is to splice the calculation results of the multi-point product attention mechanism. The self-attention model can be seen as establishing the interaction between different forms of the input vector in a linear projection space. Multi-head attention is to establish different projection information in multiple different projection spaces.