# A New Partitioned Spatial-Temporal Graph Attention Convolution Network for Human Motion Recognition
## 3 ST-GCN
### Constructing Spatial-Temporal Graph Convolution Kernels  
The human skeleton sequence is connected by video frames, and each frame is a 2D image containing the skeleton graph of the human body [36]. The skeleton edges \(E_{S}(\tau)=\left\{v_{ti}v_{tj},(i,j)\in H\right\}\) are composed of a single frame \(\tau\) and \(V_{t}\) with \(N\) joint nodes. After the image in the convolutional neural network is convolved, its output is still a 2D grid. The output value for a single channel at the spatial location x can be written as Equation (1).  
\[f_{out}(x)=\sum_{h=1}^{K}\sum_{\omega=1}^{K}f_{in}(p(\mathrm{x},h,\omega))\cdot \omega(h,\omega) \tag{1}\]  
where \(f_{in}\) is an input feature map with the number of channels \(c\), the sampling function \(p(h,\omega)\) is the surrounding adjacent pixels centered on the x pixel and the size of the sampling region is the same as the filter size; \(\omega\) is the weight function matrix.  
\(f_{out}(x)\) provides a weight vector in the c-dimensional space, which is used to calculate the inner product with the input characteristic matrix. The graph convolution formula can be constructed by redefining the sampling function \(p\) and the weighting function \(\omega\). The set of pixels in the adjacent region is represented by \(B(v_{ti})=\left\{v_{tj}|d\big{(}v_{ti},v_{ti}\big{)}\leq D\right\}\), where \(d\big{(}v_{tj},v_{ti}\big{)}\) denotes the shortest distance from \(v_{tj}\) to \(v_{ti}\). The sampling function (D = 2) can be expressed by Equation (2). In 2D convolution, the adjacent-region pixels are regularly arranged around the central pixel, so they can be convolved with a regular convolution kernel based on spatial order. The adjacent-region pixels obtained by the sampling function are divided into different subsets, each of which corresponds to a numerical label. Thus, \(l_{ti}:B(v_{ti})\rightarrow\left\{0,\ldots,K-1\right\}\) maps the nodes in the adjacent set to the corresponding subset labels. So, the new weight function is represented by Equation (3). The Equation (4) is the convolution formula of the spatial graph.  
\[p\big{(}v_{ti},v_{tj}\big{)}=v_{tj} \tag{2}\]  
\[w\big{(}v_{ti},v_{tj}\big{)}=w^{\prime}\big{(}l_{ti}(v_{tj})\big{)} \tag{3}\]  
\[f_{out}(v_{ti})=\sum_{v_{tj\in B(v_{ti})}}\frac{1}{Z_{ti}\big{(}v_{tj}\big{)}} f_{in}\big{(}v_{tj}\big{)}\cdot w^{\prime}\big{(}l_{ti}\big{(}v_{tj}\big{)} \big{)} \tag{4}\]  
where \(Z_{ti}\big{(}v_{tj}\big{)}=\left|\left\{v_{tj}\right.\big{|}l_{ti}(v_{tk})=l_{ ti}(v_{tj})\right\}\right|\) is a normalization term.  
The temporal dimension is described by connecting two identical skeletal points in two adjacent frames when constructing the skeleton spatial-temporal graph. After selecting a skeleton frame sequence with a time range of \(\Gamma\), spatial graph convolution is applied within this range. The spatial graph convolution formula of Equation (4) can be extended to the time dimension, so that the spatial-temporal graph convolution formula is Equation (5). In the temporal dimension, the functions of the sampling and weight are used to define the mapping result \(l_{ST}\) of bone nodes in adjacent regions. The mapping result is Equation (6). This can realize convenient spatial-temporal graph convolution operations on a skeleton spatial-temporal graph.  
\[B(v_{ti})=\left\{v_{qj}|d\big{(}v_{tj},v_{ti}\big{)}\leq K,|q-t|\leq\Gamma/2\right\} \tag{5}\]  
\[l_{ST}\big{(}v_{qj}\big{)}=l_{ti}\big{(}v_{tj}\big{)}+(q-t+\Gamma/2)\times K \tag{6}\]  
where \(\Gamma\) controls the convolution kernel in the temporal domain, and \(l_{ti}\big{(}v_{tj}\big{)}\) is the label map at \(v_{tj}\).