## 3 Methods
### Self-Guided Pseudo-Label Generation  
As a general segmentation foundation model, SAM faces challenges when employed in medical image segmentation, particularly in colonoscopy polyp segmentation. The inherent similarity between polyps and surrounding skin tissues, coupled with their indistinct boundaries, exacerbates the complexity of the segmentation task. Consequently, when weak annotation \(Y_{i}\) guides pretrained SAM in generating segmentation masks as pseudo-labels for the next precise segmentation, the resulting segmentation mask lacks precision due to these complexities. Employing imprecise segmentation masks as pseudo-labels not only fails to provide additional information but also may mislead the model and therefore could impede SAM's fine-tuning. To address this challenge, we designed three techniques, i.e., multi-augmentation fusion, pixel-level weighting, and mask post-processing, to enhance the accuracy of 'pseudo-labels', especially in complex scenarios. For a detailed overview of the model architecture, refer to Figure 2.  
**Multi-enhancement fusion (MEF). ** The information content of a single segmentation mask is often insufficient and inaccurate. To boost the information capacity and accuracy of the segmentation mask, we adopt multiple enhancement fusion techniques. For each image in the training set \((X_{i},Y_{i})\in\mathcal{S}\), random augmentation is applied, including color jittering, Gaussian blurring, vertical flipping, and horizontal flipping. Prompt information also changes accordingly after flipping operations, resulting in the generation of \(K\) augmented images and corresponding prompts \(\{X_{i}^{k},Y_{i}^{k}\}_{k=1}^{K}\). Specifically, color jittering follows the method proposed in [43], where the brightness factor is uniformly sampled from the range \([0.6,1.6]\), contrast is set to 0.2, the saturation factor to 0.1, and the hue factor to 0.01. Subsequently, we feed \(\{X_{i}^{k},Y_{i}^{k}\}_{k=1}^{K}\) into SAM to generate the corresponding segmentation masks \(\{\mathcal{M}_{i}^{k}\}_{k=1}^{K}\), where  
\[\mathcal{M}_{i}^{k}=SAM(X_{i}^{k},Y_{i}^{k}). \tag{1}\]  
Note that \(\mathcal{M}_{i}^{k}\) and \(X_{i}^{k}\) have the same shape but differ from the shape of \(X_{i}\). To ensure consistency between the mask and the original image, \(\mathcal{M}_{i}^{k}\) obtained after flipping will be flipped back. Due to using different augmented images for segmentation, the generated masks \(\mathcal{M}_{i}^{k}\) may exhibit some shape differences, but they often overlap in certain regions. SAM reliably predicts these overlapping regions, remains unaffected by image transformations, and usually corresponds to the correct foreground areas. Considering this complementarity, we propose a method to fuse the segmentation masks of different augmented images. The fusion process is described as follows:  
\[\tilde{\mathcal{M}}_{i}=\max_{k}\mathcal{M}_{i}^{k}, \tag{2}\]  
Figure 2: WSPolyp-SAM polyp framework under bounding box guidance. Note that the masks corresponding to flipping augmentation should be flipped back before engaging in the fusion process. where \(\tilde{\mathcal{M}}_{i}\) denotes the fused mask. We expected the fused mask \(\tilde{\mathcal{M}}_{i}\) to be more dependable than individual masks due to its ability to comprehensively reflect the features of the colonoscopy image. **Pixel-level weighting (PLW). ** The confidence of predictions may fluctuate across pixels. To accentuate the most reliable predictions, we suggest employing entropy for weighting. We compute the entropy of each pixel to generate an entropy map:  
\[\hat{E}_{i}=-\tilde{\mathcal{M}}_{i}\log\tilde{\mathcal{M}}_{i}-(1-\tilde{ \mathcal{M}}_{i})\log{(1-\tilde{\mathcal{M}}_{i})}. \tag{3}\]  
The entropy map \(\hat{E}_{i}\) is computed from the fused mask \(\tilde{\mathcal{M}}_{i}\) and quantifies the prediction uncertainty for each pixel across all augmented images. Pixels with high confidence and consistent predictions across all augmented images exhibit low entropy.