## 3 Methodology
### Feature Space Construction  
The above superpixel results for the SAR image are mapped to each 3D feature. So, the adaptive 3D feature blocks, where \(S_{i}^{flag}(i=1,\cdots,num_{block},\ num_{block}\) denotes the number of blocks, and \(flag\) is a member of \(\{G,A,W\}\)), are generated on each 3D feature tensor. Moreover, each pixel of each 3D feature tensor is clustered according to the superpixel label at the corresponding position. The 3D feature blocks can preserve the structure of the object comprehensively due to it being multi-layer, adhering to edges, and of unfixed size. Hence, they can explore the contextual and spatial information more accurately. The generalized neighborhood of each block \(S_{i}^{flag}\) includes the neighborhood blocks \(S_{i,j}^{flag}(j=1,\cdots,num_{nei},\ num_{nei}\) is the number of block \(S_{i}^{flag}\) neighborhood) in the current layer and other layers, as shown in Figure 3b. Figure 3: (**a**) Adaptive feature blocks and (**b**) generalized neighborhood of an adaptive block \(S_{i}\). Figure 2: Comparison of superpixel results: (**a**) the improved algorithm, (**b**) the previous algorithm, (**c**) the zoom part of (**a**), and (**d**) the zoom part of (**b**). The internal context information and generalized spatial information need to be extracted from each shape adaptive feature block and neighborhood. Because each shape-adaptive 3D feature block \(S_{i}^{flag}\) includes a group of neighbor \(F_{ij}^{flag}\) vectors, \(F_{ij}^{flag}\) is the expression of feature information which is GLCM, AP, and WL extracted above, and the number of neighbor vectors is denoted as \(num_{pix}\), so the internal context information of each 3D feature block \(S_{i}^{flag}\) is expressed as the average of each feature \(F_{ij}^{flag}\) values in \(S_{i}^{flag}\), which is defined as  
\[S_{i}^{mean,flag}=(\sum_{k=1}^{num_{pix}}F_{ij}^{flag})/num_{pix}. \tag{11}\]  
The average value vector \(S_{i}^{mean,flag}\) is assigned to each pixel in the shape-adaptive block \(S_{i}^{flag}\) to replace the original feature \(F_{ij}^{flag}\). Then, the internal context information feature \(F_{mean}^{flag}\) can be constructed by performing the same filtering operation on all shape-adaptive blocks, which is  
\[F_{mean}^{flag}=\left\{S_{1}^{mean,flag},S_{2}^{mean,flag},\ldots,S_{i}^{ mean,flag},\ldots,S_{num_{block}}^{mean,flag},\ldots,S_{1}^{mean,flag},S_{2}^{ mean,flag},\ldots,S_{i}^{mean,flag},\ldots,S_{num_{block}}^{mean,flag} \right\}_{I_{1}\times I_{2}}, \tag{12}\]  
where \(num_{block}\) is the number of all \(S_{i}^{flag}\) shape-adaptive blocks on one layer, and the number of \(S_{i}^{mean,flag}\) elements in the feature set \(F_{mean}^{flag}\) is \(I_{1}\times I_{2}\). Then, 3D internal context information feature space \(F_{mean}^{flag}\) is constructed by \(S_{i}^{mean,flag}\) vectors. Considering that the neighboring shape-adaptive blocks have similar spatial information on different layers in 3D space, the generalized spatial information is represented by spatial distance metric similarity, which is expressed as  
\[S_{i}^{spa,flag}=\sum_{j=1}^{num_{pix}}w_{i,j}\times S_{i,j}^{mean,flag}, \tag{13}\]  
\[w_{i,j}=\left\|S_{i,j}^{mean,flag}-S_{i}^{mean,flag}\right\|_{2}^{-1}/(\sum_ {j=1}^{num_{pix}}\left\|S_{i,j}^{mean,flag}-S_{i}^{mean,flag}\right\|_{2}^{- 1}), \tag{14}\]  
where \(S_{i}^{spa,flag}\) is the generalized spatial information value of the shape-adaptive block \(S_{i}^{flag}\), \(S_{i,j}^{mean,flag}\) is the mean of the \(j\)th neighborhood of block \(S_{i}^{flag}\), and \(num_{nei}\) is the number of neighboring \(S_{i}^{flag}\) shape-adaptive blocks. \(\left\|S_{i,j}^{mean,flag}-S_{i}^{mean,flag}\right\|_{2}\) is the Euclidean distance that measures the dissimilarity between neighboring block and center block [30; 31]. \(w_{i,j}\) is the weight, which is inversely proportional to the Euclidean distance. The larger the Euclidean distance and the smaller the weight, then the less impact the neighborhood value has on the new generalized spatial information value.