# Human Action Representation Learning Using an Attention-Driven Residual 3 DCNN Network
## 3 Proposed DA-R3 DCNN Human Activity Recognition Framework
### Dual Channel-Spatial Attention Module  
Our proposed framework utilizes an attention-driven CNN architecture to selectively concentrate on the most significant regions within video frames. This method enables efficient and accurate localization of the salient regions while also enhancing the quality of the feature representation. The proposed attention mechanism is the modification of the convolutional block attention module (CBAM) [26]. To achieve this modification, the \(7\times 7\) convolution layer in CBAM is replaced with a 3D convolution layer having a kernel size of \(3\times 3\times 3\). Additionally, the spatial attention module is fused with the intermediate output of the channel attention module using an element-wise product operation. The resulting dual-attention block is visually represented in Figure 3. Our proposed approach employs a fusion of channel and spatial attentions to efficiently extract important features from video frames while minimizing the number of parameters required. This design not only improves the representation of features but also reduces overhead. To implement this approach, we incorporated a stacked dual-attention module after every two consecutive convolutional layers in our network. This construction strategy optimizes the extraction of salient features, resulting in a highly efficient and accurate model. The channel attention module in our proposed architecture calculates the weighted contribution of RGB channels by applying intermediate channel attention \(A_{C}\) to the output feature maps \(F_{M}\) from the previous convolutional layer. This process results in the channel attention \(Att_{C}\), which is used to enhance the overall feature representation. Once the channel attention module computes the channel attention feature maps \(Att_{C}\), they are then passed into the spatial attention module for further processing. The spatial attention module uses the channel attention maps to identify relevant object-specific regions within the video frames. To generate the refined feature maps \(F_{M^{\prime}}\), we fused the spatial attention feature maps \(Att_{S}\) with the input feature maps \(F_{M}\) using a residual skip connection by employing an element-wise addition operation. This approach significantly enhances the quality of the feature representation, enabling more precise localization of salient regions. Mathematically, channel attention, spatial attention, and refined attention feature maps can be expressed as follows:  
\[Att_{C}^{H\times W\times C}=\mathcal{A}_{C}(F_{M}^{H\times W\times C})\otimes F _{M}^{H\times W\times C}, \tag{2}\]  
\[Att_{S}^{H\times W\times C}=\mathcal{A}_{S}(Att_{C}^{H\times W\times C})\otimes Att _{C}^{H\times W\times C}, \tag{3}\]  
Figure 2: The visual overview of the utilized 3D residual convolutional block used in this study, with convoluted shortcut path.  
\[F_{M^{\prime}}^{H\times W\times C}=Att_{S}^{H\times W\times C}\oplus F_{M}^{H\times W \times C} \tag{4}\]  
In the above equations, \(H\), \(W\), and \(C\) represent the height, width, and the number of channels of the feature maps, respectively, and \(A_{C}\) and \(A_{S}\) represent the intermediate channel and spatial attentions. The refined feature maps, denoted as \(F_{M^{\prime}}\), are obtained by fusing the spatial attention feature maps \(A_{S}\) with the input feature maps \(F_{M}\). This process allowed us to enhance the representation of features and improve the quality of the final output.