# Query-Based Cascade Instance Segmentation Network for Remote Sensing Image Processing
## 2 Methods
### EFE Module  
Most people are accustomed to using CNN-based methods for feature extraction, such as the visual geometry group (VGG) [40] network, which stacks multiple layers of convolutional networks to produce feature images. The residual network (ResNet) [6] introduces residual connections while deepening the network to obtain features with different layers. In view of the small proportion and scattered distribution of off-shore ships in SAR images and of aircraft and storage tanks in optical images, traditional methods may fail to capture global information, connect well with context, and accurately locate objects, leading to large deviations in predicted results. Therefore, this paper introduces the efficient feature extraction (EFE) module. The key part of our EFE module is the Swin (Shift window) Transformer feature extractor, which has demonstrated excellent  
Figure 1: From left to right, the schematic shows the ground-truth, QCIS-Net, and Mask-RCNN results for optical and SAR images, where the images have cluttered backgrounds or complex instance shapes. We use green boxes to represent missed detections. The colors of all instances in the figure are randomly generated to distinguish each instance. Figure 2: The network architecture of QCIS-Net. performance in many papers. First, compared with the calculation redundancy of large parameters in the Transformer, by replacing multihead self-attention (MSA) [30] with windows multihead self-attention (W-MSA) and shifted windows multihead self-attention (SW-MSA), the experimental calculation cost is greatly reduced [41]. Equations (1) and (2) show the computational complexity of the three types of attention, respectively. Next, the nonoverlapping self-attentive mechanism in the Swin Transformer (ST) can quickly capture long-term dependencies between objects and focus on both local features and global information. In the end, the hierarchical construction of the ST endows it with outstanding feature-representation capabilities at different scales, thereby significantly enhancing the model's performance in IS tasks and demonstrating excellent segmentation results. \[O(MSA)=4 hwc^{2}+2(hw)^{2}C \tag{1}\]  
\[O(W-MSA,SW-MSA)=4 hwc^{2}+2K^{2}hwcC \tag{2}\]  
where \(h\) represents the height of the feature map, \(w\) represents the width of the feature map, \(C\) represents the number of channels, \(K\) represents the size of each window, and \(O\) represents the computational complexity. As shown in Figure 3, in order to facilitate the understanding of the transformation process, we use A, B, and C to denote the positional relationships of different patches in the transformation step. Correspondingly, the positional relationships of other patches can also be easily found. Intuitively, SW-MSA will slide all windows as a whole to the right and down by \(m(=h/4=w/4)\) pixels along the horizontal and vertical axes, forming new window combinations. The new windows generated use a cross-window connection strategy to compute their self-attention weights, so that the feature units can interact with each other in different windows, allowing the network to capture more contextual information. As shown in Figure 4, the Swin Transformer has four stages, and the outputs of stages 1 to 4 are \(H/4\)\(\times\)\(H/4\)\(\times\)\(C\), \(H/8\)\(\times\)\(W/8\)\(\times\)\(2C\), \(H/16\)\(\times\)\(W/16\)\(\times\)\(4C\), and \(H/32\)\(\times\)\(W/32\)\(\times\)\(8C\), respectively, where \(H\) and \(W\) are the height and width of the input image. Some connected Swin Transformer blocks are used in each stage to establish feature correlation. Firstly, the optical or SAR images are fed into the network, partitioned into nonoverlapping patches, and then mapped into a \(C\)-dimensional vector using embedding. Then, after two consecutive Swin blocks are used to establish feature correlation, the output dimension is \(H/4\)\(\times\)\(W/4\)\(\times\)\(C\). Next, three consecutive identical stages consisting of patch merging and some consecutive Swin blocks are passed.