# GCN-Former: A Method for Action Recognition Using Graph Convolutional Networks and Transformer
## 2 Methods
### GCN-Former Block Architecture  
Each GCN-Former Block consists of three core components: the GCN module, the Contextual Temporal Attention (CTA) mechanism, and the Transformer Block. Specifically, the GCN module aggregates information from neighboring nodes via graph convolution operations on the input data, generating new feature representations for each node. In action recognition, this process helps capture local spatial dependencies and dynamic patterns, such as the relative motion relationships between human joints. Additionally, GCNs preserve graph structure information, crucial for understanding key components of the action. Nevertheless, standard GCNs have limitations in capturing complex long-range dependencies between nodes. To address these limitations, we designed the CTA module to follow the GCN, enabling further exploration of contextual information within local neighborhoods, particularly when the nodes in the graph possess rich spatial or geometric structures. The CTA module enhances visual representation capability by utilizing contextual information between input keys to guide the learning of the self-attention matrix. It combines static context encoding with dynamic self-attention learning, effectively capturing dependencies between different positions and improving the global understanding of the entire graph. Additionally, the CTA module introduces a context-aware mechanism that  
Figure 1: Overall architecture of GCN-Former.  
enhances feature expressiveness without significantly increasing computational cost. This is particularly crucial for handling complex tasks, such as image recognition and object detection. The Transformer Block in this study excels at handling sequential data and modeling long-range dependencies through the multi-head self-attention mechanism.  
However, transitioning directly from GCN to Transformer may result in the loss of important local details. To address this, we use the CTA as an intermediate layer to preserve local details. This ensures that the details are passed on in a form better suited for the Transformer, achieving more efficient feature transformation and smoother data flow. Meanwhile, the dynamic context representation in the CTA module is built based on the interaction between queries and context keys, making it an ideal choice for linking the two different architectural components. This facilitates information exchange and promotes collaboration between them. Finally, the features enhanced by the CTA module are fed into the Transformer Block, which models relationships between nodes over a broader range using the multi-head self-attention mechanism, including long-range dependencies.  
Specifically, the Transformer Block is well suited for handling long-duration action sequences, as it can analyze the development trends and rhythmic changes in the action from a global perspective. This is crucial for accurately classifying different types of actions. These three modules employ residual connections, meaning that the output of each layer not only includes the new information generated by the current layer but also retains a certain proportion of the original input. This design helps alleviate the vanishing gradient problem that may arise during the training of deep networks and makes the model easier to optimize. Residual connections ensure the continuity and stability of information flow throughout the architecture, facilitating the effective transmission and fusion of information. This enhances the overall robustness and generalization capability of the system.