## 6 Hybrid 3D Convolutional-Transformer Model
### Global Feature Extraction Using Swin_3D_b Model  
The **Swin3D Transform** section is responsible for further processing the features extracted by the 3D-ResNet backbone. This section includes the following components:  
* **Feature Patching:** This stage includes breaking down the 3D features retrieved from the 3D-ResNet backbone into smaller patches. Each patch is handled as a separate token for the transformer. This approach improves the efficiency with which the spatial and temporal elements of the incoming video are handled. * **Linear Embedding:** The patches are passed through a linear embedding layer. This layer converts the patches into dimensions that the transformer can handle. It simply translates the raw patches into a higher-dimensional space, allowing the transformer to better grasp the data. * **Swin3D_b Transformer Layers:** These are the core layers of the Swin3D transformer. The Swin3D transformer employs a hierarchical structure with shifting windows to collect both local and global characteristics in the video. It consists of numerous layers of self-attention and feed-forward networks, which enable the model to learn complicated connections between video frames. Figure 3 shows the typical architecture of a Swin-3D-based Transformer block. The Swin Transformer design, including the 3D edition, is composed of alternating layers of window-based multi-head self-attention (W-MSA) and shifting window multi-head self-attention (SW-MSA), as well as feed-forward networks (MLP layers) and normalization layers (LayerNorm). The provided diagram is consistent with these ideas. The following is a breakdown \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Description** \\ \hline Input Channels & 3 (RGB channels) \\ \hline Output Channels & 128 \\ \hline Kernel Size & (3, 7, 7), indicating the convolution kernel spans 3 frames in time and 7 \(\times\) 7 pixels in space. \\ \hline \multirow{2}{*}{Stride} & (1, 2, 2), meaning the kernel moves 1 frame at a time in the temporal dimension and 2 pixels in spatial dimensions. \\ \hline \multicolumn{1}{c}{Padding} & (1, 3, 3), adding padding to maintain the spatial dimensions of the output. \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Implementation details of the Con3D layer. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Description** \\ \hline Kernel Size & (1, 3, 3), indicating pooling over 1 frame in time and 3x3 pixels in space. \\ \hline \multicolumn{1}{c}{Stride} & (1, 2, 2), meaning the kernel moves 1 frame at a time in the temporal dimension and 2 pixels in spatial dimensions. \\ \hline \multicolumn{1}{c}{Padding} & (0, 1, 1), maintaining the spatial dimensions of the output. \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Implementation details of the MaxPooling 3D layer. of the components depicted in Figure 3 and how they fit into the Swin Transformer model [28]:  
* **MLP (Multi-Layer Perceptron):*
* The MLP is a feed-forward network made up of two completely linked layers and a GELU activation function in the middle. This component appears in both the standard transformer block and the Swin Transformer block. * **LayerNorm (layer normalization):*
* Layer normalization is used before the MLP and self-attention layers to help stabilize and expedite training. It assures that the inputs to these layers have zero mean and unit variance, which is useful for training deep neural networks. * **SW-MSA (Shifted Window Multi-Head Self-Attention):*
* Swin Transformer computes self-attention inside local windows, which are then moved across layers to allow for cross-window connections. This shifted window method captures both local and global dependencies efficiently. * **W-MSA (window-based multi-head self-attention):*
* This is the standard window-based self-attention method, which calculates attention within fixed-size windows. It focuses on capturing local dependencies between non-overlapping planes.