## 2 Related Work
### Cross-Attention-Based Feature Fusion Module  
The cross-attention-based feature fusion module has been widely applied in tasks such as multimodal learning, image segmentation, and object detection [31]. Its core idea is to efficiently fuse features by establishing relationships between them, enhancing the expressive power of the features. Traditional methods like concatenation, weighted summation, or convolution operations struggle to capture complex feature relationships. In contrast with traditional attention mechanisms, the cross-attention mechanism builds an attention weight matrix between the Query (Q), Key (K), and Value (V) vectors, which are derived from different feature sources. This approach effectively models the dependencies and interactions between these diverse feature representations, enabling more sophisticated and context-aware feature fusion.  
For example, [PERSON] et al. proposed a new cross-attention module [32]. This module thoroughly captures the global context in images. It collects information from all pixelsalong the cross-path of each pixel. Through iterative operations, each pixel can capture the dependencies of the entire image. [PERSON] et al. introduced a dual-cross attention transformer feature fusion module [33]. This module improves object feature discernibility using a query-guided cross-attention mechanism. It captures complementary information across different modalities. Compared to traditional methods, this approach simulates global feature interactions, fixes image misalignment, and improves detection performance. [PERSON] et al. created a multi-scale feature fusion module using a cross-attention mechanism. The module calculates correlations between channels, adjusts channel weights dynamically, and aggregates features from different sources. This allows efficient interaction between two-branch features and improves performance in semantic segmentation tasks [34]. However, the cross-attention module mainly works for shallow feature fusion and struggles to capture cross-modal dependencies in deeper features. This limits the model's ability to express complex feature relationships. Additionally, [PERSON] et al. proposed a dual-cross attention feature fusion framework [35]. This framework captures complementary and differential features between modalities. It also facilitates global feature interaction. By adding a query-guided cross-attention mechanism, they improved the target feature discriminability. The framework combines differential information injection modules and alternating common information injection modules. This further improves feature fusion quality. The design improves model performance and reduces computational complexity while preserving detailed features.  
In conclusion, combining CNNs with transformers and using an advanced feature fusion mechanism like CaFF provides a robust and efficient solution for weld seam recognition, addressing key challenges in industrial applications. Our proposed cross-attention feature fusion module (CaFF) addresses these shortcomings by combining local detailed features and global semantic information. Unlike prior methods, our approach allows for effective interaction between both shallow and deep features, enhancing the overall model's ability to capture complex relationships across multiple scales and modalities. By employing a more comprehensive feature fusion strategy, our model overcomes the limitations of previous cross-attention modules, improving robustness and accuracy, especially in complex environments.