## 3 Methods
### Spatial Probability Distribution Encoder  
The purpose of the spatial distribution encoder is to extract meaningful geometric relationships from the input data, which is essential for capturing spatial correlations between matches as in Figure 7. And the detail is shown in Figure 8. The input data, represented as \(\mathbf{X}_{s}=\{\mathbf{x}_{i}^{s}\}_{i=1}^{N}\in\mathbb{R}^{N\times 4}\), contain geometric information for image matching. To effectively capture this information, ResNet blocks are applied to project \(\mathbf{x}_{i}^{s}\) into a higher-dimensional feature space, generating the feature map \(F_{s}=\{f_{s}^{s}\}_{i=1}^{N}\). This transformation  
Figure 5: The architecture of SA-Net. The proposed model consists of the confidence distribution encoder and spatial distribution encoder. The confidence distribution encoder reduces outlier impact by refining confidence scores through group layers and graph neural networks. In the spatial distribution encoder, the Cluster-based Graph Mapping block (CGM) connects clusters, while the sparse graph aggregates spatial information from neighboring areas. Additionally, the FPS Aggregate Dispatch Block (FAD) selects anchor points, allowing global spatial data to influence the local context. The Multi-Perspective Block integrates confidence probabilities and spatial distribution probabilities to derive the final sampling distribution. Figure 6: The architecture of the confidence distribution encoder.The confidence distribution encoder takes the spatial positions of matches and additional information as input. The Res-block maps low-dimensional information to higher dimensions, while the Group Layer aggregates features to explore the consistency among high-dimensional features. The GCN establishes connections between features, effectively eliminating incorrect matches. Finally, the MLP layer reduces the feature dimensions into confidence probability information. enhances the model's ability to learn spatial relationships, providing a richer feature representation for subsequent encoding processes. **Cluster-based Graph Mapping Block. ** The Cluster-based Graph Mapping block is proposed to group similar features into clusters and propagate information within clusters. This helps model the spatial relationships more effectively by aggregating information across nodes. To achieve this, we treat each feature \(f_{s}^{i}\) as a node and divide the nodes into \(k_{c}\) clusters. A sparse graph network is then constructed to facilitate communication between nodes within clusters. The clustering matrix \(M=\{m_{ij}\}_{i,j=1}^{N}\) is used to mapping intra-cluster relationships, where \(m_{ij}=1\) if nodes \(i\) and \(j\) belong to the same cluster:  
\[m_{ij}=\left\{ \begin{array}{ll}1,&\quad c_{i}=c_{j}\\ 0,&\quad\text{otherwise}\end{array} \right. \tag{1}\]  
Then, to obtain the cluster feature \(F_{clu}\), the process of interaction can be expressed as  
\[ \begin{split}&(Q_{s},K_{s},V_{s})=Linear_{(Q,K,V)}(F_{s})\\ & F_{clu}=Att_{clu}(F_{s})=M\cdot softMax(\frac{Q_{s}K_{s}^{T}}{\sqrt{dim}})V_ {s},\end{split}  \tag{2}\]  
where \(Q\), \(K\), and \(V\) represent the query, key, and value vectors corresponding to the respective features. **FPS Aggregation Dispatch Block**. This block selects representative points (anchors) from geometric data to effectively propagate global spatial information to the local context. The process starts with the random selection of an initial data match from \(X_{s}\), forming the starting point for the anchor set \(X_{fps}\). We then compute the distance between each remaining point and the current anchor set, iteratively adding the farthest point until \(X_{fps}\) contains \(k_{s}\) points. After obtaining the anchor set, FPS Attention extracts the corresponding features from the feature map, and these anchor features are aggregated using a self-attention mechanism, which captures key global spatial relationships. To disseminate this global information into the local context, KNN Attention is applied.