## 4 Results and Discussion
### Ablation Study on Different Attention Mechanisms  
The ablation study on different attention mechanisms aimed to evaluate the contribution of the proposed sliding-window attention mechanism in time-series and spatial data tasks. Comparisons were made with the standard self-attention mechanism and the convolutional block attention module (CBAM) to validate the performance superiority of the proposed approach. The evaluation was conducted using four metrics: precision, recall, accuracy, and F1-score, across both time-series and spatial data tasks. The results demonstrated that the proposed method outperformed the other attention mechanisms in all the metrics for both tasks. Specifically, in the time-series task, the proposed method achieved precision, recall, accuracy, and F1-score values of 0.95, 0.91, 0.93, and 0.93, respectively. Similarly, in the spatial data task, the corresponding metrics were 0.93, 0.90, \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Model** & **Precision** & **Recall** & **Accuracy** & **F1-Score** & **FPS** \\ \hline Federated Learning & 0.84 & 0.79 & 0.81 & 0.81 & 26 \\ MPC & 0.87 & 0.83 & 0.85 & 0.85 & 32 \\ Homomorphic Encryption & 0.88 & 0.84 & 0.86 & 0.85 & 38 \\ TEE-Based & 0.91 & 0.87 & 0.89 & 0.89 & 42 \\ Proposed Method & 0.93 & 0.90 & 0.92 & 0.91 & 49 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Experimental results of spatial data testing. Figure 5: The figure presents the violin plot of accuracy distribution for different baseline models and the proposed method in the spatial data testing results experiment. 0.92, and 0.91. While CBAM demonstrated improvements in local feature modeling over the standard self-attention mechanism, its overall performance remained inferior to the proposed method, particularly in recall and F1-score. In contrast, the standard self-attention mechanism exhibited the lowest performance in both tasks, highlighting its limitations in multimodal feature modeling. As shown in Table 5, from a theoretical perspective, the observed performance differences can be attributed to the mathematical properties and structural designs of the attention mechanisms. The standard self-attention mechanism has a computational complexity of \(O(n^{2})\), where \(n\) represents the input sequence length or the number of pixels in the feature map. This quadratic complexity renders the mechanism inefficient for large-scale time-series data or high-resolution spatial data. Although the global nature of self-attention is advantageous for capturing long-range dependencies, it exhibits insufficient sensitivity to local features, resulting in lower precision and recall. CBAM addresses this limitation by introducing channel and spatial attention, enhancing local feature modeling while reducing computational complexity. However, its static feature extraction strategy is less adaptable to dynamic data distributions, leading to suboptimal performance in recall and F1-score. In contrast, the proposed sliding-window attention mechanism effectively combines localized attention with dynamic window adjustments, reducing computational complexity to \(O(n\cdot w)\), where \(w\) represents the window size. This approach significantly enhances computational efficiency while capturing the local information within each sliding window. Additionally, global feature integration is achieved through window sliding, demonstrating superior generalization and robustness in both time-series and spatial data tasks. The mathematical advantage of the proposed method lies in its alignment with task-specific requirements. By constraining the attention calculation range, irrelevant features are excluded, enhancing the purity of feature representations. This design improves sensitivity to dynamic patterns in time-series data and ensures precise capture of local details in spatial data.