# EGSDK-Net: Edge-Guided Stepwise Dual Kernel Update Network for Panoptic Segmentation
## 3 Method
### Overall Structure  
The overall structure of EGSDK-Net is shown in Figure 2. First, we utilize the backbone composed of convolutional layers and RTFormer blocks proposed in RTFormer [27] to obtain the basic feature maps. Since RTFormer [27] employs a dual-branch module starting from stage three, the top layer of the backbone outputs low-resolution and high-resolution feature maps, denoted as \(R_{5}^{low}\) and \(R_{5}^{high}\), respectively. We denote the output of the second stage as \(R_{2}\). Since \(R_{2}\) has a high resolution and is rich in detailed information, we use it as the input for the real-time edge guidance module (RTEGM). The edge feature map extracted and supervised by the RTEGM subsequently affects \(R_{5}^{low}\) through weighted application. The reason for choosing \(R_{5}^{low}\) instead of \(R_{5}^{high}\) is that \(R_{5}^{low}\) retains a significant amount of semantic information but loses many detailed cues. Enhancing its discrimination of target areas using the edge feature map will be more effective. The edge-guided \(R_{5}^{low}\) is then enhanced through DAPPM [28] to improve its ability to perceive multi-scale objects. After upsampling, the output of this process is combined with \(R_{5}^{high}\) and processed through an additional convolutional module to mitigate aliasing effects, yielding the feature map \(F\). The stage that follows the application of the edge feature map represents the neck of the entire model. The output \(F\) from the neck is then fed into the head, which consists of the stepwise dual kernel update module (SDKUM), to obtain the model's mask predictions and class probability predictions. Considering that the kernel convolves the features to create mask predictions, additional supervision for the feature map \(F\) is required to ensure accurate mask predictions. Following [5], we use the auxiliary loss function as follows:  
\[L^{aux}=\omega_{rank}L^{rank}+\omega_{seg}L^{seg}+\omega_{disc}L^{disc}, \tag{1}\]  
where \(\omega_{rank}=0.1\), \(\omega_{seg}=1.0\), and \(\omega_{disc}=1.0\) are the balancing factors used in the auxiliary loss function to balance \(L^{rank}\), \(L^{seg}\), \(L^{disc}\), which is consistent with the design in RT-K-Net. \(L^{rank}\) represents the mask-ID cross-entropy loss, \(L^{seg}\) denotes the cross-entropy loss, and \(L^{disc}\) is the contrastive loss function introduced by RT-K-Net [5]. The overall loss function of EGSDK-Net can be formulated as follows:  
Figure 2: The overall structure of EGSDK-Net. Our main contributions are focused on RTEGM and SDKUM.  
\[L_{total}=\omega_{mask}L^{mask}+\omega_{dice}L^{dice}+\omega_{cls}L^{cls}+\omega_{ edge}L^{edge}+L^{aux}, \tag{2}\]  
where \(\omega_{mask}=1.0\), \(\omega_{dice}=4.0\), \(\omega_{cls}=2.0\), and \(\omega_{edge}=1.0\) are also the balancing factors for the overall loss function. \(\omega_{mask}\), \(\omega_{dice}\), \(\omega_{cls}\) are consistent with the design in RT-K-Net, while \(\omega_{edge}\) is set by us. \(L^{mask}\) refers to the binary cross-entropy loss, \(L^{dice}\) represents the dice loss, \(L^{cls}\) denotes the focal loss, and \(L^{edge}\) utilizes the balanced cross-entropy loss function. The applications of \(L^{mask}\), \(L^{dice}\), and \(L^{cls}\) are consistent with those in K-Net [2] and RT-K-Net [5], to improve the guidance of stuff masks and thing masks during training. Moreover, we adopt the same training and inference optimizations, post-processing methods, and instance-based cropping augmentation as RT-K-Net [5]. Please refer to [5] for more information on these steps.