# A New Partitioned Spatial-Temporal Graph Attention Convolution Network for Human Motion Recognition
## 4 Optimization of ST-GCN Neural Networks
### CA Attention Mechanism Module  
The remarkable advantage of attention mechanisms is that they pay attention to relevant information while ignoring irrelevant information, establishing direct dependency between input and output without the need for circulation. The degree of parallelism is enhanced, and the running speed is greatly improved. It overcomes some limitations of traditional neural networks, such as the performance degradation of the system with the increase in the input length, the low computational efficiency of the system due to the unreasonable input order, and the lack of feature extraction and enhancement of the system. However, attention mechanisms can well model serial data with variable length, further enhancing their ability to capture remote dependency information, reduce the depth of hierarchy, and effectively improve accuracy. At present, the most popular attention mechanism is the squeeze-and-excitation (SE) [37] attention mechanism. With the help of the global pooling layer, it calculates the channel information attention and realizes the gain function at a low cost. However, SE  
Figure 3: The way the sampling area is divided. (**a**) Unilabeling partitioning strategy. All nodes in the neighborhood have the same label (green); (**b**) distance partitioning strategy. These two subsets are the root node itself with a distance of 0 (green) and other adjacent points with a distance of 1 (blue). ; (**c**) spatial configuration partitioning. Center of gravity of the skeleton (black cross), centripetal node (blue), and centrifugal node (yellow). only considers the information between channels and ignores the importance of location information. Secondly, the convolutional block attention module (CBAM) [38] obtains location information by reducing the channel dimension of the input tensor and using convolution to calculate spatial attention. The CA attention mechanism incorporates location information into channel data. Because of these advantages, it helps to improve the positioning and recognition abilities of the model. Then, the CA attention mechanism is adaptable and lightweight, allowing it to be easily integrated into a mobile network (for example, MobileNetV2 [39], MobileNet [40], and EfficientNet [41]). It can enhance features by emphasizing information representation while avoiding a large amount of computation. The information is embedded in a global method. However, the global method is usually used for the global coding of channel coding spatial information, and it is difficult to save the location information. To address this problem, the global pooling is decomposed according to Equation (7) and transformed into a pair of one-dimensional feature encoding operations. Next, each channel is coded by the pooling kernels (\(H\), 1) or (1, \(W\)). Therefore, the output of the \(c\)-th channel with height \(h\) is represented as Equation (8) and the output of the \(c\)-th channel with width \(w\) is Equation (9). \[z_{c}=\frac{1}{H\times W}\sum_{i=1}^{H}\sum_{j=1}^{W}x_{c}(i,j) \tag{7}\]  
\[z_{c}^{h}(h)=\frac{1}{W}\sum_{0\leq i<W}x_{c}(h,j) \tag{8}\]  
\[z_{c}^{w}(w)=\frac{1}{H}\sum_{0\leq j<H}x_{c}(j,w) \tag{9}\]  
where \(z_{c}\) is the output associated with the \(c\)-th channel. The features of height and width are gathered, and a pair of feature maps with direction perception are obtained. Therefore, the attention mechanism can capture the channel space information in one direction and obtain the position information in the other direction. Using the 1 \(\times\) 1 convolutional transform function for \(F_{1}\), its transform is shown in Equation (10). Then, f is decomposed into two separate tensors: \(f^{h}\in R^{\frac{c}{\gamma}\times H}\) and \(f^{w}\in R^{\frac{c}{\gamma}\times w}\). The other 1 \(\times\) 1 convolutional transforms, \(F_{h}\) and \(F_{w}\), transform tensors with the same number of channels into the input. The attention is weighted as Equations (11) and (12), respectively.