## 4 Results Analysis
### Ablation Experiment
#### 4.4.2 Shift Window  
The PRI-SWT model employs a different approach compared to the Vision Transformer (ViT) model, which calculates attention scores across patches spanning the entire image. Instead, PRI-SWT uses a shifted window technique, computing attention scores within each window, significantly reducing computational costs. This method enhances information exchange and improves the model's global perception. This section explores two key aspects: the effects of varying window shift values on classification performance and the impact of the window size itself. The effects of varying the window shift size on model performance are summarized in Table 4, with accuracy curves for three scenarios involving the linear projection fusion layer depicted in Figure 14.  
As shown in Table 4, \(w\) refers to the window size. It was found that reducing the window shift size led to significant improvements in classification performance. This enhancement was likely due to the model's ability to capture more localized information regarding CFRP defects, thereby aiding in the accurate identification of cracks, delamination, and impact damage. Figure 14 further supports this observation, showing that accuracy trends remained consistent across all cases. Smaller window shifts consistently yielded continued accuracy improvements throughout the training process, ultimately culminating in the optimal model configuration. In addition to the window shift size, the actual window size itself significantly influences the performance of the PRI-SWT model. Smaller windows enhance computational efficiency and improve the perception of local information, but they may limit the model's ability to capture global features. Therefore, it is essential to adjust window sizes carefully to optimize classification performance for different tasks. The results regarding varying window sizes are presented in Figure 15. PRI-SWT classification metrics are shown in Table 5. Notably, increasing the window size reduced the macro-P to 94% and lowered the Kappa coefficient by 1.8%. The model with a larger window size encountered difficulties in differentiating between crack and impact damage, likely because it struggled to focus on localized CFRP defect regions, allowing nondefective information to interfere with classification decisions. Nevertheless, larger windows did facilitate a smoother convergence process for accuracy. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Shifted Values** & **macro-P** & **macro-R** & **macro-F1** & **Kappa Coefficient** \\ \hline \multirow{4}{*}{\(\frac{\text{Figure 14: Model accuracy curves and confusion matrix obtained using different shifted values. (**a**) Confusion matrix; (**b**) accuracy curves. A smaller window size results in slightly higher final classification performance compared to the other cases. Figure 15: _Cont._  
Transitioning from the configuration of \([2,2,4,6]\) to \([2,4,4,6]\) resulted in notable improvements, with macro-P reaching 0.963, macro-R reaching 0.957, and macro-F1 reaching 0.960. This enhancement underscores the model's ability to extract intricate patterns and details from the data. However, further increasing the network depth to \([4,4,4,6]\) demonstrated diminishing returns as performance gains were negligible. This suggests that the model may have reached a performance plateau, indicating a limit to the benefits of adding additional layers. Furthermore, while deeper networks can initially improve accuracy, they also introduce a higher risk of overfitting. As depth increases, the model's propensity to memorize training data may hinder its ability to generalize effectively to unseen data. Additionally, the trade-off between computational efficiency and model depth becomes evident. Deeper architectures require more computational resources, leading to increased training and inference times. As a result, the marginal performance improvements gained from additional depth may not justify the added complexity and resource demands.