## 3 Materials and Methods
### Proposed Method
#### 3.3.2 Sliding-Window Attention Mechanism  
The sliding-window attention mechanism was first introduced in Longformer [39] and has since been integrated into multiple Transformer variants to enhance computational efficiency. For example, Swin Transformer [40] employs a hierarchical window attention mechanism, enabling efficient feature modeling while reducing computational costs. BigBird [41] further combines sliding-window attention with global sparse attention and random attention, maintaining global information retention while significantly reducing computational overhead. Building on these advancements, the proposed method introduces an adaptive sliding-window attention mechanism to better accommodate the complex feature distributions of multimodal data, achieving significant performance improvements in temporal and spatial data fusion tasks. The sliding-window attention mechanism is a critical component of the proposed model, as shown in Figure 2.  
Compared to traditional global self-attention mechanisms, it reduces computational complexity by incorporating localized window designs while retaining essential local and global information. Traditional self-attention computes pairwise attention weights across all elements of a sequence or feature map, resulting in a computational complexity of \(O(n^{2})\), where \(n\) represents the length of the input sequence or feature map. This approach becomes computationally prohibitive for long sequences or high-resolution feature maps. In contrast, the sliding-window attention mechanism divides input features into fixed-size local windows and computes attention weights only within each window, reducing complexity to \(O(n\cdot w)\), where \(w\) is the window size. This localized attention preserves local feature correlations while capturing global context through the sliding operation. For a feature map with dimensions \(H\times W\times C\), where \(H\) and \(W\) denote the height and width and \(C\) is the number of channels, the sliding-window size is defined as \(w\times w\), with a stride of \(s\). The input feature map \(\mathbf{F}\in\mathbb{R}^{H\times W\times C}\) is partitioned into multiple local windows. Each window's query (Q), key (K), and value (V) vectors have dimensions \(\mathbf{Q},\mathbf{K},\mathbf{V}\in\mathbb{R}^{w\times w\times C}\). The attention weights \(\mathbf{A}\) for each window are computed as  
\[\mathbf{A}=\text{softmax}\left(\frac{\mathbf{Q}\mathbf{K}^{\top}}{\sqrt{d_{k }}}\right), \tag{27}\]  
Figure 1: Illustration of the sliding-window computation network (SWCN) architecture. The network follows an encoder-decoder structure designed for efficient multimodal spatial and temporal data processing. The encoder extracts multi-scale features \((F_{1},F_{2},F_{3},F_{4})\) through sliding-window attention layers, where queries and key–value pairs are denoted as \((X_{i,d})\) and \((X_{i,kv})\). The decoder progressively upsamples hierarchical features \((D_{1},D_{2},D_{3},D_{4})\) and concatenates them before passing through a multi-layer perceptron (MLP) to generate the final mask output. The notation \(\text{Cat}[p_{1}(F_{1}),p_{2}(F_{2}),p_{3}(F_{3}),p_{4}(F_{4})]\) represents feature concatenation. where \(d_{k}\) is the dimensionality of the key vectors. The output features \(\mathbf{Y}\) for each window are obtained via a weighted sum:  
\[\mathbf{Y}=\mathbf{AV}. \tag{28}\]  
The outputs of all windows are concatenated based on their original positions to reconstruct the final sliding-window attention output \(\mathbf{F}_{\text{output}}\in\mathbb{R}^{H\times W\times\text{C}}\). The sliding-window attention mechanism is embedded into multiple layers of the model to handle features at varying resolutions. For high-resolution feature maps (e.g., \(H/4\times W/4\times C_{1}\)), a window size of \(w=7\) and stride \(s=4\) are used to balance local feature extraction and computational cost.