SegRefiner: Towards Model-Agnostic Segmentation Refinement with Discrete Diffusion Process

In this paper, we explore a principal way to enhance the quality of object masks produced by different segmentation models. We propose a model-agnostic solution called SegRefiner, which offers a novel perspective on this problem by interpreting segmentation refinement as a data generation process. As a result, the refinement process can be smoothly implemented through a series of denoising diffusion steps. Specifically, SegRefiner takes coarse masks as inputs and refines them using a discrete diffusion process. By predicting the label and corresponding states-transition probabilities for each pixel, SegRefiner progressively refines the noisy masks in a conditional denoising manner. To assess the effectiveness of SegRefiner, we conduct comprehensive experiments on various segmentation tasks, including semantic segmentation, instance segmentation, and dichotomous image segmentation. The results demonstrate the superiority of our SegRefiner from multiple aspects. Firstly, it consistently improves both the segmentation metrics and boundary metrics across different types of coarse masks. Secondly, it outperforms previous model-agnostic refinement methods by a significant margin. Lastly, it exhibits a strong capability to capture extremely fine details when refining high-resolution images. The source code and trained models are available at https://github.com/MengyuWang826/SegRefiner.

Paper

References (61)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer Xhma6/10 · confidence 3/52023-07-04

Summary

This paper develops a method based discrete diffusion process to refine coarse segmentation masks with input images in the context of semantic image segmentation. In this work, the refinement problem has been formulated as an iterative data generation process. To work with binary masks, as adapted for most segmentation scenarios, the authors proposed discrete state translation with mathematical analysis. Experimental results seem solid about the superiority of the proposed methods against several parallel methods on three segmentation tasks.

Strengths

Originality: this paper is new for its adaptation of discrete prior to tackling binary segmentation masks. although the discrete diffusion model is not new, its application in segmentation can be an interesting attempt. In order to handle a smooth translation from a fine mask to a coarse one, the authors proposed a transition sample module in the forward process. This is different from adding traditional Gaussian noise as in continuous diffusion models. Quality: the quality of this paper is relatively good, through multiple reading passes. The paper is kind of self-contained, including strong motivation, mathematical analysis, and experimental results. Clarity: This paper is not easy to read for my first pass. After reading it several times, one can have a better understanding of certain concepts and illustrations Significance: I give high significance to this paper as it solves a common problem in a novel way as well as the obtained results seem to be greatly improved in a wide range of segmentation tasks and datasets.

Weaknesses

Personally, the biggest concern of this paper is the clarification. Basically, the authors devised a discrete process to bridge the fine mask with the coarse one, by using a transitioned mask. This mask is unidirectional, which means only the transition to the target happens. This forward process consists of a continuous Q_{t} and a discrete sampling based on probability defined on Q_{t}. These processes are not well illustrated and explained in the paper. In addition, the paper refers to source and target masks differently for forward and backward processes, which can confuse readers and a better nomination would be suggested. Although this paper presents extensive experimental results, it lacks a comparison of computational complexity and time and resources. Despite the fact that the authors had a small discussion on this aspect in the conclusion, it is much better to provide quantitative results either in the main paper or in the supplementary material.

Questions

- throughout the paper, the authors utilized examples with binary masks to illustrate the idea, including Fig. 2, Equ. 6-11, etc. Could the authors explain how exactly to apply this method to a multi-class segmentation problem? - Since the authors utilize Gumbel-softmax sampling in the forward, it might exhibit some kind of diversities for the transitioned masks in the intermediate steps (even the final output–coarse mask remains the same). However, for the backward process, if my understanding is not wrong, how can this algorithm ensure a certain degree of diversity as no stochastic operations are involved? - The forward process has ground truth for the source and target masks, while for the backward process, the paper applied simple thresholding. This can cause instability of convergence. Did the authors meet any optimization difficulties? - In the training strategy, why exactly two versions of SegRefiner were proposed?

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

The authors have adequately addressed the limitation of this paper while I am expecting more details, as stated in the previous comments.

Area Chair geEb2023-08-18

Please acknowledge reading the rebuttal

Dear reviewer, Please acknowledge reading the rebuttal. One can acknowledge reading the rebuttal by posting an official comment on the open review platform. Best, AC

Reviewer oFWK6/10 · confidence 4/52023-07-09

Summary

In this paper, the authors propose a model-agnostic solution called SegRefiner to enhance the quality of object masks generated by different segmentation models. The approach introduces a novel perspective on segmentation refinement, treating it as a data generation process. By leveraging a series of denoising diffusion steps, SegRefiner achieves effective mask refinement. Specifically, SegRefiner takes coarse masks as inputs and employs a discrete diffusion process to refine them. By predicting the label and states-transition probabilities for each pixel, the method progressively refines the noisy masks in a conditional denoising manner. To evaluate the performance of SegRefiner, extensive experiments are conducted on various segmentation tasks, including semantic segmentation, instance segmentation, and dichotomous image segmentation. The experimental results demonstrate the superiority of SegRefiner in multiple aspects. Firstly, it consistently improves both the segmentation metrics and boundary metrics for different types of coarse masks. Secondly, it outperforms previous model-agnostic refinement methods by a significant margin. Lastly, SegRefiner exhibits a strong capability to capture extremely fine details when refining high-resolution images.

Strengths

(1) This paper is the first one to introduce diffusion-based refinement for segmentation masks. (2) The proposed method, called SegRefiner, is model-agnostic, and thus applicable across different segmentation models and tasks. (3) The authors extensively analyze the performance of SegRefiner across various segmentation tasks, demonstrating that our SegRefiner not only outperforms all previous model agnostic refinement methods, but can also be effortlessly transferred to other segmentation tasks without any modification.

Weaknesses

(1) In the Objective Function of sec 4.1, how do you specify the value of alpha? Do you have any ablation studies on the alpha? (2) In Table 3, it seems that the improvement on Boundary AP is larger than Mask AP. Why is that? (3) In Table 4, it seems that the improvement on ISNet is smaller than the other datasets. Could you explain the reason? (4) Why do you only do the ablation studies on semantic segmentation task? Have you ever tried the ablation studies on instance segmentation and Dichotomous Image Segmentation? Have you ever tried ablation studies on the number of iterations and output size? For Table 5 (c), have you ever tried a larger input size, like 1024x1024?

Questions

I'm positive about this paper. I really like the idea to apply diffusion model to segmentation task. However, I have some concerns in the Weaknesses. I hope to see the response from the authors for those questions. Thank you.

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

The diffusion process leads to slowdown of the inference due to the multi-step iterative strategy.

Area Chair geEb2023-08-18

Please acknowledge reading the rebuttal

Dear reviewer oFWK, Please acknowledge reading the rebuttal. One can acknowledge reading the rebuttal by posting an official comment on the open review platform. Best, AC

Reviewer oFWK2023-08-21

Keep my rating

Thanks for the author's rebuttal. It has resolved all of my concerns and I don't have any other questions. I'll keep my rating for weak accept. Thank you.

Reviewer cXkh7/10 · confidence 4/52023-07-09

Summary

This manuscript presents a model-agnostic solution for segmentation refinement, which implements the refinement process of the coarse masks through a series of denoising diffusion steps. Comprehensive experiments on various segmentation tasks are conducted, including semantic segmentation, instance segmentation, and dichotomous image segmentation and the results demonstrate the superiority of the proposed method.

Strengths

- They obtain SOTA results on multiple tasks. - The idea sounds quite interesting. - This manuscript is well-formulated and -presented.

Weaknesses

The motivation behind lacks focus. The manuscript primarily discusses the problem of the existing methods of segmentation refinement in Introduction but fails to indicate the reason why denoising diffusion models are suitable and important for the task of segmentation refinement. What are the technical challenges in applying denoising diffusion models to segmentation refinement? To address these challenges, what innovations does this paper propose regarding the application of denoising diffusion models to segmentation refinement? How is the value of the state transition probability specifically calculated? There are several instances where the use of others' work, such as Gumbel-max sampling, has not been properly cited. For the DIS experiment, commonly used evaluation metrics for DIS are not employed. Some grammar and spelling errors.

Questions

See above comments.

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

As mentioned in the conclusion, the diffusion process seems to lead to a slowdown in inference due to the multi-step iterative strategy. As a post-processing step for segmentation tasks, this is indeed a major drawback. Did the authors conduct any experiments to examine the relationship between iteration step, accuracy, and speed?

Reviewer ygQQ8/10 · confidence 4/52023-07-11

Summary

This work proposes diffusion-based image segmentation refinement approach, SegRefiner, using a newly designed discrete diffusion process. SegRefiner performs model-agnostic segmentation refinement that takes in coarse output masks from any segmentation model as an input and refines them through a series of diffusion steps while estimating state-transition probabilities for each pixel. Comprehensive experiments across multiple segmentation tasks demonstrates that SegRefiner consistently improves segmentation metrics and outperforms state-of-the-art model-specific and model-agnostic refinement approaches.

Strengths

Originality This work has multiple novel contribution ranging from - being first to introduce diffusion-based image segmentation refinement approach, the use of discrete diffusion instead of Gaussian diffusion process of DDPM, being class-agnostic as well as ability to capture extremely fine-details when applied to high-resolution images. Quality The paper is well-written and mostly easy to follow. Authors have put their best effort to condense lot of details into conference paper length. As the use of discrete diffusion is new in practice, some of the details can be elaborated using examples in the supplementary for the ease audience. Significance The approach taken by SegRefiner is unique. For instance, mask and states prediction task is kept separate. Similarly, there is lot of subtle details required to run this successfully as listed under the training strategy, noise schedule and other settings. All these contribution can be quite useful to other researcher pursuing different applications using generative model.

Weaknesses

None that are significant. Have listed one under the limitation section.

Questions

1. How is the posteior in eq(9) derived ? Similarly how do one derive eq(11) ? And hence where is eq(9) used ? 2. Is the refinement of semantic and instance segmentation performed using zero-shot ? All I understand is LR- and HR-SegRefiner are trained using LVIS and composite dataset respectively.

Rating

8: Strong Accept: Technically strong paper, with novel ideas, excellent impact on at least one area, or high-to-excellent impact on multiple areas, with excellent evaluation, resources, and reproducibility, and no unaddressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

4 excellent

Presentation

3 good

Contribution

4 excellent

Limitations

Yes, authors have address one of the core limitation to using diffusion process. As far as my understanding, another limitation of such class-agnostic and model-agnostic approach is one should undertake each instance one at a time for refinement. This probably due to the fact there is no class information input to SegRefiner model.

Reviewer cPQx7/10 · confidence 3/52023-07-26

Summary

This paper proposes a novel method for improving the quality of object masks generated by different segmentation models. The method, called SegRefiner, is model-agnostic, meaning that it can be used with different segmentation models. SegRefiner works by interpreting segmentation refinement as a data generation process. This allows the work to implement the refinement process as a series of denoising diffusion steps. Specifically, SegRefiner takes coarse masks as input and refines them using a discrete diffusion process. For each pixel, it predicts the label and corresponding state-transition probabilities. This allows the model to progressively refine the noisy masks in a conditional denoising manner. The method is evaluated on a variety of segmentation tasks, and the results show that SegRefiner consistently outperforms previous methods. It improves both the segmentation metrics and boundary metrics across different types of coarse masks. SegRefiner also exhibits a strong capability to capture extremely fine details when refining high-resolution images.

Strengths

1. Overall, the paper is well written and clearly organized. 2. The method is intuitive and straightforward. The performance improvements are clear compared to the previous baselines. 3. The inference is efficient for diffusion as it only uses 6 timesteps.

Weaknesses

1. Not necessarily a weakness but the model does not clearly state how the coarse masks are generated for training until later sections. While the proposed method follows previous works on this part, it would still improve the clarity if this is discussed in earlier sections and in the overview figures. 2. The paper only shows one example of how each step of the diffusion process works during inference. The authors are recommended to include more examples with some highlighted boundary comparisons.

Questions

Please see the weakness section.

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

4 excellent

Presentation

3 good

Contribution

3 good

Limitations

The authors properly addressed the limitations in the paper.

Reviewer cXkh2023-08-10

Thank you for your impressive feedback. The majority of my concerns have been addressed. However, I still have a few remaining questions about motivation that I would like to discuss further. Regarding your response to Q1 (a): - What are the advantages and insights of using diffusion for segmentation, and further for high-accuracy segmentation? Regarding your response to Q1 (b): - Why is the addition of Gaussian noise to the diffusion process deemed unsuitable for binary segmentation tasks? - How does the proposed technique demonstrate generazability to both general segmentation tasks (such as instance/semantic segmentation) and high-accuracy segmentation tasks (like DIS)? What differentiates the usage of SegRefiner between these two task types? Does this imply that SegRefiner can be used for ultra-accuracy segmentation tasks, akin to alpha matting datasets? Furthermore, I would like to inquire whether the authors have uploaded the revised version of the paper (*.pdf) to the system.

Authorsrebuttal2023-08-10

Response to Reviewer cXkh

### **Q1. Advantages of using diffusion for segmentation** The advantages of diffusion model are mainly manifested in the following aspects: * Firstly, the diffusion model exhibits a strong perceptual capability for the texture and edge details of images. This conclusion has been demonstrated in numerous diffusion-based image generation works since diffusion models can generate samples with extremely realistic details. The reason for this might lie in the fact that, as a latent variable generative model, diffusion's latent variables are full-sized. Similar to the findings in StyleGAN \[A\], larger-sized latent variables tend to be more inclined towards controlling details and textures. This might explain the perceptual sensitivity of diffusion towards details. Thus, such a detail-sensitive model is particularly suitable for pixel-level segmentation task (especially for high-accuracy segmentation which emphasizes capturing very fine details). * Secondly, as mentioned in the previous response, addressing all errors in a single iteration can be exceptionally challenging. In contrast, the iterative strategy of diffusion model reduces the difficulty of segmentation refinement tasks by making the model focus on only some "most obvious errors" (subset of all errors) during each step/iteration. This iterative procedure gradually refines the segmentation mask, leading to improved accuracy. In image generation, this iterative strategy imparts the diffusion model with the ability to generate realistic images of challenging complex scenes. When applied to segmentation refinement task, it empowers our SegRefiner to handle more challenging examples and consistently rectify errors and produce precise predictions. \[A\] Karras, Tero, Samuli Laine, and Timo Aila. "A style-based generator architecture for generative adversarial networks." in CVPR 2019. ### **Q2. Why is the addition of Gaussian noise unsuitable** * Firstly, the reason for adding Gaussian noise in image generation fundamentally stems from the assumption that natural images, as target data, can be considered as high-dimensional Gaussian variables. Thus, the forward and backward processes are interpreted as noising and denoising and the core idea is to fit a Gaussian distribution. However, in this perspective, our target data is binary masks, which obviously do not conform to the Gaussian distribution. Therefore, we should not regard the process of obtaining segmentation masks as fitting a Gaussian variable. On the contrary, representing it with a discrete random states-transition process is very natural. * Secondly, as a segmentation refinement method, our core idea is to treat the coarse prediction as a noisy ground truth and recover the high-quality segmentation by eliminating this noise. Since the coarse segmentation result entails misclassifications during foreground/background prediction, it is more akin to discrete states transitions occurring in certain pixels of the ground truth, rather than a binary ground truth overlayed with a continuous Gaussian noise. ### **Q3. Generazability of SegRefiner** * The generazability largely comes from the model-agnostic and class-agnostic manners of SegRefiner. Its mechanism is first obtaining prompts from the coarse mask to determine the objects needed to be segmented and then providing accurate masks. Such a mechanism allows SegRefiner to have consistent objectives across different segmentation tasks, enhancing the generazability of SegRefiner. * The difference lies in the fact that for DIS, the dataset resolution is exceptionally high, while the model's output size is only $256 \times 256$. This resolution is inadequate for such high-resolution datasets and results in the loss of numerous fine details. Therefore, we employed a combination of both global and local refinements strategy (as elaborated in line 217 of the paper). However, for instance segmentation on the LVIS dataset with relatively smaller resolution, we only employed instance-level refinement without local refinement. * The alpha matting task requires predicting floating-point values for unknown region. Although our method is designed for binary masks using a discrete process, it can also handle image matting by converting the intermediate predicted fine mask into a floating-point format. However, since this approach would require the aforementioned modifications and training on matting datasets independently, resulting in substantial deviations from the overall framework of this work, we did not conduct the matting experiment within the scope of this work. ### **Q4. "whether the authors have uploaded the revised version of the paper (*.pdf) to the system."** According to the author responses policy of NeurIPS 2023, *"Authors may not submit revisions of their paper or supplemental material"*, we have not uploaded the revised vision. We will update the paper according to the reviewers' comments. Thank you very much for your valuable comments!

Reviewer cXkh2023-08-10

Thanks for your illustrations. It would be nice when you corporate these discussion into your paper or supplementary materials, just for better understanding for readers. After discussion, I am happy to change my rating to acceptance. Looking forward to the final publication. Best.

Authorsrebuttal2023-08-10

Thanks for the Response of Reviewer cXkh

Dear Reviewer cXkh, Thank you very much for your careful response and for increasing the rating to acceptance. We will add these discussions to the main paper or supplementary materials in the revision following your valuable suggestions. Best regards, Authors

Reviewer cPQx2023-08-18

Thanks for preparing the rebuttal! I don't have other concerns that need to be addressed.

Reviewer Xhma2023-08-21

Thank you for the answers

I thank the authors for their careful answers. I will increase my score to weakly accept.

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC