DiffCut: Catalyzing Zero-Shot Semantic Segmentation with Diffusion Features and Recursive Normalized Cut

Authors: paul  couairon
mustafa  shukor
jean-emmanuel  haugeard
matthieu  cord
nicolas  thome
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-10 14:47:37

Abstract: Foundation models have emerged as powerful tools across various domains including language, vision, and multimodal tasks. While prior works have addressed unsupervised semantic segmentation, they significantly lag behind supervised models. In this paper, we use a diffusion UNet encoder as a foundation vision encoder and introduce DiffCut, an unsupervised zero-shot segmentation method that solely harnesses the output features from the final self-attention block. Through extensive experimentation, we demonstrate that using these diffusion features in a graph based segmentation algorithm, significantly outperforms previous state-of-the-art methods on zero-shot segmentation. Specifically, we leverage a recursive Normalized Cut algorithm that regulates the granularity of detected objects and produces well-defined segmentation maps that precisely capture intricate image details. Our work highlights the remarkably accurate semantic knowledge embedded within diffusion UNet encoders that could then serve as foundation vision encoders for downstream tasks.

Main paper: 
 introduction: 
 Foundation models have emerged as powerful tools across various domains, including language [2, 3, 4] , vision [5, 6, 7] , and multimodal tasks [8, 9, 10, 11, 12, 13] . Pretrained on extensive datasets, these models exhibit unparalleled generalization capabilities, marking a significant departure from training models from scratch to efficiently adapting pretrained foundation models [14, 15, 16, 17] . Utilizing pretrained models is particularly vital for dense visual tasks, alleviating the need for large annotated datasets specific to each domain. While prior works [18, 19, 20, 21, 22] have addressed unsupervised image segmentation, they significantly lag behind supervised models [23, 24, 25, 26] . Recently, SAM [27] , proposed a model that can produce fine-grained class-agnostic masks which achieves outstanding zero-shot transfer to any images. Still, it requires a huge annotated segmentation dataset as well as significant training resources. Therefore, in this work, we investigate an alternative direction: unsupervised and zero-shot segmentation under the most constraining conditions, where no segmentation annotations or prior knowledge on the target dataset are available.Recently, several methods have emerged to address unsupervised object detection by framing it as a graph partitioning problem, utilizing self-supervised ViT features [28, 5] . LOST [29] proposes to localize a unique object in a image by exploiting the inverse degree information to find a seed patch. TokenCut [30] splits the graph in two subsets given a bipartition. FOUND [31] and MaskCut [32] extend these approaches by addressing the single object discovery limitation. While being able to localize multiple objects, the latter methods remain constrained to identify a pre-determined number of objects, making them ill-suited for a task of unsupervised image segmentation which inherently requires to adapt the number of segment to uncover to the visual content.Conversely, text-to-image diffusion models [33, 34, 35] can produce high-quality visual content from textual descriptions [36, 37, 38] , indicating implicit learning of a wide range of visual concepts. Recent works have tried to leverage diverse internal representations of such models for localization or segmentation tasks. Several methods [39, 40, 41, 42, 43] opt to exploit image-text interactions within cross-attention modules but are ultimately constrained by the need for meticulous input prompt design. Concurrently, [44] identifies semantic correspondences between image pixels and spatial locations of low-dimensional feature maps by modulating cross-attention modules. This method proves to be computationally intensive as it requires numerous forward inferences. On the other hand, DiffSeg [1] segment images by iteratively merging self-attention maps which only depict local correlation between patches.In this work, we introduce DiffCut, a new method for zero-shot image segmentation which solely harnesses the encoder features of a pre-trained diffusion model in a recursive graph partitioning algorithm to produce fine-grained segmentation maps. Importantly, our method does not require any label from downstream segmentation datasets and its backbone has not been pre-trained on dense pixel annotations such as SAM [27] . We observe in Fig. 1 that DiffCut produces sharp segments that nicely outline object boundaries. In comparison with the recent state-of-the-art unsupervised zero-shot segmentation method DiffSeg [1] , the segments yielded by DiffCut, are better aligned with the semantic visual concepts, e.g. DiffCut is able to uncover the urban area as well as the boats in the middle row image. Our main contributions are as follows:• We leverage the features from the final self-attention block of a diffusion UNet encoder, for the task of unsupervised image segmentation. In this context, we demonstrate that exploiting the inner patch-level alignment yields superior performance compared to merging self-attention maps as done in DiffSeg [1] .• Compared to existing graph based object localization methods e.g. TokenCut or MaskCut [30, 32] , we push further and take advantage of a recursive Normalized Cut algorithm to generate dense segmentation maps. Via a partitioning threshold, the method is able to regulate the granularity of detected objects and consequently adapt the number of segments to the visual content.• We perform extensive experiments to validate the effectiveness of DiffCut and show that it significantly outperforms state-of-the-art methods for unsupervised segmentation on standard benchmarks, reducing the gap with fully supervised models.In addition, we exhibit the remarkable semantic coherence emerging in our chosen diffusion features by measuring their patch-level alignment, which surpasses other backbones such as CLIP [8] or DINOv2 [5] . Our ablation studies further reveal the relevance of these diffusion features as well as the recursive partitioning approach which proves to provide robust segmentation performance. Finally, we show that DiffCut can be extended to an open-vocabulary setting with a straightforward process leveraging a convolutional CLIP, which even tops most dedicated methods on this task. 
related work: 
 Semantic segmentation. Semantic segmentation consists in partitioning an image into a set of segments, each corresponding to a specific semantic concept. While supervised semantic segmentation has been widely explored [45, 46, 47, 27] , unsupervised and zero-shot transfer segmentation for any images with previously unseen categories remains significantly more challenging and much less investigated. For example, most works in unsupervised segmentation require access to the target data for unsupervised adaption [21, 20, 19, 18] . Therefore, these methods cannot segment images that are not seen during the adaptation. Recently, DiffSeg [1] moved a step forward by proposing an unsupervised and zero-shot approach that can produce quality segmentation maps without any prior knowledge on the underlying visual content.Segmentation with Text Supervision. Recent works have shown that learning accurate segmentation maps is possible with text supervision, overcoming the cost of dense annotations. These works are mostly based on image-text contrastive learning [48, 49, 50, 51] , and usually exploit the features of CLIP [52, 53, 54] . MaskCLIP [52] leverages CLIP to get pseudo labels used to train a typical image segmentation model. ReCO [53] uses CLIP for dataset curation and get a reference image embedding for each class that is used to obtain the final segmentation. CLIPpy [48] proposes minimal modifications to CLIP to get dense labels. SegCLIP [54] continues to train CLIP with additional reconstruction and superpixel-based KL loss to enhance localization. TCL [50] learns a region-text alignment to get precise segmentation masks. GroupViT [49] also learns masks from text supervision and is based on a hierarchical grouping mechanism. Similarly, ViewCo [51] proposes a contrastive learning between multiple views/crops of the image and the text.Graph-based Object Detection. Built on top of self-supervised ViT features, various methods frame the problem of object detection as a graph partitioning problem. LOST [29] aims at detecting salient object in an image using the degree of the nodes in the graph and a seed expansion mechanism.Based on Normalized Cut (NCut) [55] , FOUND [31] proposes to identify all background patches, hence discovering all object patches as a by-product with no need for a prior knowledge of the number of objects or their relative size with respect to the background. TokenCut [30] detects one single salient object in each image with a unique NCut bipartition. In an attempt to adapt TokenCut to multi-objects localization, MaskCut [32] first localizes an object and disconnects its corresponding patches to the rest of the graph before repeating the process a pre-determined number of times. As these graph partitioning methods are only able to uncover a fixed number of segments, they are inadequate for a task of image segmentation.Segmentation with Diffusion Models. Diffusion models can produce high-quality visual content given a text prompt, indicating implicit learning of a wide range of visual concepts and the ability of grounding these concepts in images. Therefore their internal representations appear as good candidates for visual localization tasks [56, 57, 58] . ODISE [59] is one of the first training-based approaches to build a fully supervised panoptic image segmentor on top of diffusion features. Several other methods [40, 41, 42] leverage attention modules for localization or segmentation tasks. DiffuMask [42] uses the cross-modal grounding between a text input and an image in cross-attention modules to segment the referred object in a synthetic image. However, DiffuMask can only be applied to a generated image. In a zero-shot setting, [41] harnesses the image-text interaction via cross-attention score maps to complete self-attention maps and segment grounded objects. EmerDiff [44] opts not to exploit image-text interactions in cross-attention modules. Instead, it identifies semantic correspondences between image pixels and spatial locations by modulating the values of a sub-region of feature maps in low-resolution cross-attention layers. These cross-attention based methods eventually prove to be highly computationally intensive as multiple forward inferences are often required. On the other hand, DiffSeg [1] proposes an iterative merging process based on measuring KL divergence among self-attention maps to merge them into valid segmentation masks. However, it appears that self-attention score maps only depict very local correlation between patches.Question: Does the paper discuss the limitations of the work performed by the authors?Answer: [Yes] Justification: Conclusion includes some limitations of this work and potential future development.Guidelines:• The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper. • The authors are encouraged to create a separate "Limitations" section in their paper.• The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be. • The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated. • The authors should reflect on the factors that influence the performance of the approach.For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon. • The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size. • If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness. • While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations. 
diffcut: 
 Diffusion Models. Diffusion models [60, 61, 62] are generative models that aim to approximate a data distribution q by mapping an input noise x T ∼ N (0, I) to a clean sample x 0 ∼ q through an iterative denoising process. In latent text-to-image (T2I) diffusion models, e.g. Stable Diffusion [33] , the diffusion process is performed in the latent space of a Variational AutoEncoder [63] for computational efficiency, and encode the textual inputs as feature vectors from pretrained language models. Starting from a noised latent vector z t at the timestep t, a denoising autoencoder ϵ θ is trained to predict the noise ϵ that is added to the latent z, conditioned on the text prompt c. The training objective writes:EQUATION)where t is uniformly sampled from the set of timesteps {1, . . . , T }. 2) These features are used to construct an affinity matrix that serves in a recursive normalized cut algorithm, which outputs a segmentation map at the latent spatial resolution. 3) A high-resolution segmentation map is produced via a concept assignment mechanism on the features upsampled at the original image size.An input image is encoded into a latent via the VQ-encoder of the latent diffusion model and a small amount of gaussian noise is added to it (not shown in Fig. 2 ). The obtained latent is passed to the diffusion UNet encoder, from which we only extract the output features, denoted ẑ, from its last self-attention block. This choice design has several motivations:Attention Limitations. In contrast to several methods that harness cross-attention modules for localization or segmentation tasks [39, 40, 41, 42] , we deliberately choose not to depend on this mechanism. The accuracy of segmentation maps generated via attention modules heavily relies on the quality of the textual input which often requires an automatic captioning model combined with a meticulous prompt design to reach competitive performance. Besides being constrained by the maximum number of input tokens, such approach is proved to be inaccurate in the presence of cohyponyms [64] and is prone to neglect subject tokens as the number of objects to detect becomes large [65] . The localization and segmentation capacity with a single forward inference is then constrained by the performance of the captioning model and the attention modules themselves. Exploiting only the intermediate diffusion features alleviate the computational cost of an additional captioning model and do not necessitate multiple forward inferences.UNet Encoder Effectiveness. Previous works [66, 67, 37] have shown that diffusion features provide precise semantic information shared across objects from different domains. Building on this observation, we hypothesize that the pyramidal architecture of the UNet encoder capture semantically rich image representations that are well-suited for zero-shot vision tasks. To validate this assumption, we exhibit the semantic coherence emerging in the UNet encoder, evidenced by a remarkable patch level alignment in the output features of the final self-attention block. We in fact demonstrate that these features are sufficient to reach state-of-the-art zero-shot segmentation performance.Computational Efficiency. By solely exploiting the diffusion UNet encoder, our method offers a substantial computational gain, reducing the model size by 70% (400M vs 1.3B parameters). In contrast, DiffSeg extracts every self-attention maps of the UNet which requires a full model inference.Normalized Cut treats image segmentation as a graph partitioning problem [55] . Given a graph G = (V, E) where V and E are respectively a set of nodes and edges, we construct an affinity matrix W such that W ij is the edge between node v i and v j , and a diagonal degree matrix D, with d(i) = j W ij . NCut minimizes the cost of partitioning the graph into two sub-graphs by solving:EQUATIONto find the eigenvector x corresponding to the second smallest eigenvalue. In the ideal case, the clustering solution only takes two discrete values. Since the solution of Eq. ( 2) is a continuous relaxation of the initial problem, x contains continuous values and a splitting point has to be determined to partition it. To find the optimal partition, we examine l evenly spaced points in x and select the one resulting in the minimum NCut value.Graph Affinity. Based on our observations of the patch-level alignment of diffusion features illustrated in Fig. 4 , we assume that the normalized cut algorithm will produce sharp segments, each corresponding to a precise semantic concept as distinct objects would manifest as weakly connected components in a patch similarity matrix. Following this intuition, we construct an affinity matrix W , by computing the cosine similarity, normalized between 0 and 1, between each pair of patches.As the NCut criterion evaluates both the dissimilarity between different segments and the similarity within each segment, we opt to emphasize inter-segments dissimilarity by raising each element to a positive integer power α:W ij = ẑi ẑj ∥ẑ i ∥ 2 ∥ẑ j ∥ 2 α (3)Essentially, this process maintains a relatively high affinity for highly similar patches, while squashing the weights between dissimilar patches towards zero. This mechanism plays the role of a soft thresholding, offering a more gradual adjustment compared to setting a threshold to explicitly binarize the affinity matrix as done in [30] and [32] .Recursive Partitioning. Classical spectral clustering [68] requires setting a pre-defined number of clusters to partition the graph, which is a significant constraint in the context of zero-shot image segmentation where no prior knowledge on the visual content is available. We therefore adopt a recursive graph partitioning [55] , which adapts the number of uncovered segments to the visual content via a threshold, denoted τ , on the maximum partitioning cost. This hyperparameter stops the recursive partitioning of a segment when its NCut value exceeds it and thereby regulates the granularity of detected objects. We demonstrate that our soft thresholding process detailed above enhances the robustness of the method which delivers competitive performance across a wide range of τ values. This recursive clustering process is summarized in Supplementary A.Thus far, we have constructed segmentation maps (e.g. 32×32) which are 32 times lower in resolution than the original image (e.g. 1024 × 1024). The number of segments found in each image depends on the image and the value of the hyperparameter τ . Our next goal is to upscale these low-resolution maps to build accurate pixel-level segmentation maps. We propose a high-resolution segmentation process that can be decomposed into the following steps:1. Masked Spatial Marginal Mean. First, our objective is to extract a set of representations that embeds the semantics of each segment. As shown in [37] , reducing the spatial dimension of diffusion features with a Spatial Marginal Mean (SMM) effectively retains semantic information and provides accurate image descriptor. In light of this, we naturally propose to collapse the spatial dimension of each segment with a Masked SMM. This process yields a collection of semantically rich concept-embeddings, denoted C. 2. Concept Assignment. A naive approach to obtain segmentation maps at the original image resolution consists in performing a nearest-neighbor upsampling. Despite its straightforwardness, this approach results in a blocky output structure as all pixels within the same feature patch are assigned to the same concept. Alternatively, we opt to first bilinearly upsample our low-resolution feature map ẑ to match the original image spatial size and then proceed with the pixel/concept assignment. Specifically, for each concept c i ∈ C, we compute its cosine similarity with the upsampled features ẑup . This yields a similarity matrix of size (H × W × K) where K = |C|.Then, the assignment process simply consists in taking the argmax across the K channels. The obtained segmentation map S is eventually refined with a pixel-adaptive refinement module [69] .Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?Answer: [Yes] Justification: The datasets used in the experiments are publicly available. Code will be released.Guidelines:• The answer NA means that paper does not include experiments requiring code. • Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted. 
experiments: 
 Datasets. Following existing works in image segmentation [21, 53, 52, 18] , we use the following datasets for evaluation: a) Pascal VOC [70] We ignore their training sets and directly evaluate our method on the original validation sets, at the exception of COCO for which we evaluate on the validation split curated by prior works [21, 19] .Metrics. For all datasets, we report the mean intersection over union (mIoU), the most popular evaluation metric for semantic segmentation. Because our method does not provide a semantic label, we use the Hungarian matching algorithm [75] to assign predicted masks to a ground truth mask. For datasets including a background class, we perform a many-to-one matching to the background label (Supplementary H). As in [1] , we emphasize unsupervised adaptation (UA), language dependency (LD), and auxiliary image (AX). UA means that the specific method requires unsupervised training on the target dataset. Methods without the UA requirement are considered zero-shot. LD means that the method requires text input, such as a descriptive sentence for the image, to facilitate segmentation. AX means that the method requires an additional pool of reference images or synthetic images.Implementation details. DiffCut builds on SSD-1B [35] , a distilled version of Stable Diffusion XL [34] . The model takes an empty string as input and we set the timestep for denoising to t = 50.To ensure a fair comparison when evaluating our method against baselines, we set a unique value for τ and α across all datasets, equal to 0.5 and 10 respectively. Following previous works, we make use of PAMR [69] to refine our segmentation masks. Our method runs on a single NVIDIA TITAN RTX (24GB) with input images of size 1024 × 1024 and can segment an image in one second.Tab. 1 reports the mIoU score for each baseline across the 6 benchmarks. Note that the numbers shown for COCO-Stuff and Cityscapes are taken from [1] . We complete ReCo [53] and MaskCLIP [52] scores with the results obtained in [50] . Other numbers are taken from [18] . We also note that DiffSeg tunes the sensible merging hyperparameter on a subset of images from the training set from the respective datasets. For a fair comparison, we evaluate the method fixing it to 1, as recommended in the original paper, and refine the obtained masks with PAMR. This baseline is denoted DiffSeg † . With our set of default hyperparameters, DiffCut significantly outperforms all other baselines despite not relying on language dependency, auxiliary images or unsupervised adaptation. On average, our method achieves a gain of +7.3 mIoU over the second best baseline. Notably, DiffCut exceeds MaskCut with an average improvement of +9.4 mIoU. Additionally, it outperforms the previous state-of-the-art method in unsupervised segmentation, DiffSeg, by +5.5 mIoU on COCO-Stuff and +9.4 mIoU on Cityscapes. The superiority of DiffCut over these two methods demonstrates our two key contributions: the high quality of our visual features for semantic segmentation and the flexibility of the recursive NCut algorithm in adjusting the number of segments according to the visual content of each image. The effectiveness of our method is further corroborated by our qualitative results shown in Fig. 1 . In comparison to DiffSeg, DiffCut provides finely detailed segmentation maps that more closely align with semantic concepts. Additional examples can be found in Supplementary N.We note here that, as the granularity of annotations varies across target datasets, our fixed set of hyperparameters can not be in the optimal regime on each of them. Therefore, relaxing the condition on prior knowledge about the target dataset, we report in Supplementary G results of DiffCut where τ is loosely tuned using a small subset of annotated images from the target training split.As good candidates for a task of unsupervised segmentation are expected to be semantically coherent, we conduct a comparison between different families of foundation models on their internal alignment at the patch-level. Selected models include text-to-image DMs (SSD-1B [35] ), text-aligned contrastive models (CLIP [79] , SigLIP [80] ) and self-supervised models (DINO [28] , DINOv2 [5] ). At the exception of DINO-ViT-B/16, evaluated models are of roughly similar size, approximately 300M parameters for DINOv2, CLIP-ViT-L/14 and SigLIP-ViT-L/16 and 400M for SSD-1B UNet encoder. As in [81] , we collect patch representations from various vision encoders and store their corresponding target classes using the segmentation labels. Given ẑi = E(x 1 ) i ∈ R Dv and ẑj = E(x 2 ) j ∈ R Dv , the patch representations of images x 1 and x 2 at respectively index i and j, we compute their cosine similarity and use this score as a binary classifier to predict if the two patches belong to the same class. Given l(x 1 ) i and l(x 2 ) j , the labels associated to the patches, if l(x 1 ) i,j = l(x 2 ) p,q , the target value for binary classification is 1, else 0. We present in Fig. 3 the ROC curve and AUC score for our candidate models. We observe that SSD-1B UNet encoder [35] demonstrates a greater patch-level alignment than any other candidate model with an AUC score of 0.83, even surpassing DINOv2 [5] . We further exhibit the outstanding alignment between patch representations associated to semantically similar concepts with qualitative results in Fig. 4 . We provide additional qualitative examples patch-level alignment in Supplementary M. A potential rationale for this observation lies in the superior semantic information retention of a diffusion model compared to alternative backbones, attributed to its inherent capacity to set a structural image layout, internally acquired during the training phase. These results provides insight into the strong clustering results presented in previous section, as improved semantic coherence suggests that patches belonging to the same object are more effectively clustered.In this section, we perform ablation studies to validate the individual choices in the design of DiffCut.DiffCut vs DiffSeg. DiffSeg proposes their own clustering algorithm based on a self-attention map merging process. As the original implementation uses a different diffusion backbone as ours, we validate the benefit of our method by swapping the original SDv1.4 with our stronger SSD-1B. For a fair comparison between methods, we use the default set of hyperparameters recommended in [1] and set the default merging threshold of DiffSeg to 0.5 for all datasets. Tab. 2 clearly validates the superiority of using rich semantic features in a recursive graph partitioning algorithm over the self-attention merging mechanism of DiffSeg. Qualitative results shown in Fig. 1 further display the edge of DiffCut in uncovering semantic clusters. Shown results do not make use of the mask refinement module, explaining the gap with Tab. 1. Recursive Normalized Cut vs Automated Spectral Clustering. In DiffCut, the hyperparameter τ corresponds to the maximum graph partitioning cost allowed. In contrast, classical spectral clustering requires to explicitly set the number of segments to be found in the graph. To validate the benefit of the recursive approach over spectral clustering, we introduce a simple yet effective baseline dubbed AutoSC. [82] proposes a heuristic that estimates the number of connected components in a graph with the largest relative-eigen-gap between its Laplacian eigen-values. The larger the gap, the more confident the heuristic. In our context, the index of the eigen-value that maximizes this quantity can be interpreted as the number of clusters in an image. Thus, we define a set of exponents {1, 5, 10, 15} and determine the value α in this set such that its element-wise exponentiation of matrix A yields the largest Laplacian relative-eigen-gap. Then, we use the index of the eigen-value maximizing the gap as the number of clusters in a k-way spectral clustering performed with the algorithm proposed in [83] . As shown in Tab. 2, DiffCut consistently outperforms AutoSC on all datasets, with a gain up to +3.5 on ADE20K, at the exception of COCO-Stuff where the latter yields slightly better results. Noting that AutoSC is already a state-of-the-art baseline on most benchmarks, this experiment confirms the relevance of the recursive Normalized Cut to uncover arbitrary numbers of segments. Hyperparameters Impact. In this section, we assess the impact of hyperparameters τ and α over the segmentation performance. We report in Fig. 5 the mIoU for various α values, with respect to partitioning threshold values τ ranging from 0.3 to 0.97 on Cityscapes validation set. As α increases, we observe a dual effect. First, since a greater α value shrinks the affinity matrix components towards 0, the partitioning cost corresponding to the NCut value decreases, explaining the shift of the optimal threshold between the different curves. Second, as α increases, the range of τ values for which the method yields competitive performance widens, contributing to the overall robustness of the method. For example, DiffCut outperforms our own competitive baseline AutoSC for any τ between 0.35 and 0.67 when α = 10, whereas it only surpasses it between 0.92 and 0.96 when α = 1. Qualitatively, we observe in Fig. 6 that as τ increases, the method uncovers finer segments in images. Considering the final self-attention modules at resolution 64 × 64 and 32 × 32 in the encoder and decoder, we demonstrate in Tab. 3, that the encoder's features extracted at the lowest spatial resolution retain the most semantic information and are sufficient to reach optimal performance. In addition, combining different hierarchical features does not lead to any improvements and adds to the computational burden.  
discussion: 
 In this work, we tackle the challenging task of unsupervised zero-shot semantic segmentation by introducing DiffCut, a method that significantly narrows the performance gap with fully supervised models. DiffCut leverages the diffusion features of a UNet encoder within a recursive graph partitioning algorithm to generate sharp segmentation maps, achieving state-of-the-art results on popular benchmarks. By reusing pre-trained models in a zero-shot manner, our approach can not only reduce computational resources, energy consumption, and human labor but also align with sustainable AI practices. However, because the diffusion backbone is not specifically trained for specialized domains, such as biomedical imaging, the method may struggle with out-of-distribution images. Fine-tuning the diffusion model on domain-specific data could mitigate this challenge. While fully supervised, end-to-end segmentation methods currently offer better efficiency and accuracy, further advancements could close this gap, positioning diffusion-based UNet encoders as foundation models for future vision tasks.a fixed number of segments, making it less suitable for image segmentation. This limitation arises from the use of an iterative graph partitioning approach, where graph nodes associated with detected objects are masked. Each segment is treated as a single object and cannot be refined after detection, which severely restricts its ability to identify a large number of objects. To highlight the superiority of our recursive partitioning over MaskCut's iterative process, we present below a comparison between the two methods with k the number of objects to be detected varying in {3, 5, 20}. DiffCut significantly outperforms MaskCut, regardless of the chosen value of k. DiffCut's improvement shows our two key contributions: the effectiveness of our visual features for semantic segmentation and the ability of the recursive NCut algorithm to dynamically adjust the number of segments based on the visual content of each image.To further display the relevance of diffusion features, we show that DiffCut achieves competitive performance even when using smaller diffusion backbones than SSD-1B. Specifically, we test two alternative models: SD1.4 and SSD-Vega [35] (another distilled version of SDXL). The UNet encoder in SD1.4 has 260M parameters, comprising approximately 30% of the overall UNet, while the UNet encoder in SSD-vega has 240M parameters, making up around 32% of the UNet. The results obtained using SD1.4 and SSD-Vega are consistent with those achieved with SSD-1B. While the SD1.4 UNet encoder shows a slight performance drop compared to SSD-1B, DiffCut still significantly outperforms DiffSeg. Notably, with the SSD-Vega UNet encoder, DiffCut delivers performance comparable to SSD-1B, despite having only half the number of parameters. Normalized Cut algorithm does not scale well with the graph size due to the generalized eigenvalue problem to solve, which hinder its use on the native image resolution (e.g., 1024×1024). Thus, the clustering is applied in the latent space and yields segmentation maps at the latent resolution. To obtain pixellevel segmentation at the original image resolution, we need to upscale the low-resolution maps. In Tab. 8, we compare the nearest-neighbor upsampling approach versus our concept assignment upsampling and show that our proposed method obtain better results than the naive upsampling of the segmentation masks.To evaluate the potential of vision encoders for zero-shot segmentation, we compare their clustering performance with a simple KMeans algorithm. For selected vision encoders, features are extracted from the last layer. The hyperparameter K is either determined by the ground-truth (K * ) for each image, or fixed across the dataset. We compute the mIoU with respect to the ground truth masks using the Hungarian matching algorithm [75] . Tab. 9 shows that the diffusion UNet encoder (SSD-1B) significantly outperforms other vision encoders on Pascal VOC (20 classes and no background), COCO-Stuff-27 and Cityscapes. This confirms that diffusion features are well-suited for localizing and segmenting objects. Interestingly, unsupervised models such as DINOv2 are better than CLIP models, suggesting that text-aligned features does not contain accurate localization features. EQUATIONWe show in Sec. 4.3 that the performance of the method is highly robust with respect to the value of the threshold τ . However, as the granularity of annotations varies across target datasets, the value of this threshold, fixed in our experiments, can not be in the optimal regime on each benchmark. Therefore, we relax the condition on the absence of prior knowledge about the target dataset and report in Tab. 10 results of DiffCut where τ is loosely tuned using a small subset of annotated images (200) from the target training split. Specifically, we estimate an adequate value for τ with a grid-search in the set {0.35, 0.55, 0.75} for COCO-Object, COCO-Stuff and Cityscapes. As COCO-Object and COCO-Stuff-27 offer different level of object granularity despite corresponding to the same images, a fixed value for τ can not perform optimally on both benchmarks. Tuning the value of this threshold allows to infer the granularity of objects expected to be uncovered in images. For example, the estimated τ * value for COCO-Stuff-27 is 0.35 whereas it is 0.75 on COCO-Object whose annotations requires to detect much finer objects. For Cityscapes the initial fixed τ value was in the good range to yield optimal performance.Given a set of predicted masks, our goal is to find the best matching ground-truth labels. For each predicted mask, we compute the Intersection over Union (IoU) with every ground-truth mask and select the one with the highest IoU as its optimal ground-truth match. This results in a pairing where each predicted mask is associated with at most one ground truth mask. In datasets that include a background class, this label implicitly encompasses a variety of concepts related to "things" or "stuff," which vary depending on the dataset. Since our method generates a segment for every detected object in an image, a one-to-one matching between a single predicted cluster and the entire background does not accurately represent the model's true categorization capabilities. Therefore, in such cases, we use a many-to-one matching approach by associating the clusters that primarily overlap with the background to its ID.Before passing the image to the diffusion UNet, a predefined amount of gaussian noise, controlled by a parameter called the timestep, is added to it. At timestep t = 0 the input image corresponds to the original image without added noise while t = 1000 corresponds to an image transformed into pure gaussian noise. In Fig. 7 , we show the segmentation performance on the validation split of Pascal VOC for timesteps values ranging from 0 to 500. We can observe that a small amount of noise, around 50, gives the best mIoU score, indicating that the best semantic features are obtained with a slightly noisy input image. We note that despite a significant drop in the mIoU score for t = 500, DiffCut still reaches state-of-the-art segmentation performance on Pascal VOC benchmark, demonstrating a high robustness of the method with respect to the noising ratio. Justification: Our experiments reflect the scope of the paper and the claims made in the abstract and in the introduction.Guidelines:• The answer NA means that the abstract and introduction do not include the claims made in the paper. • The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers. • The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings. • It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper. 
experimental setting/details: 
 Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?Answer: [Yes] Justification: We detail in section Sec. 4 the datasets splits used to evaluate the method as well as the value of default hyper-parameters.Guidelines:• The answer NA means that the paper does not include experiments.• The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them. • The full details can be provided either with the code, in appendix, or as supplemental material. 
experiment statistical significance: 
 Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?Answer: [NA] Justification: No error bars are reported as standard validation sets are used to evaluate the method.Guidelines:• The answer NA means that the paper does not include experiments.• The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.• The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions). • The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.) • The assumptions made should be given (e.g., Normally distributed errors). • It should be clear whether the error bar is the standard deviation or the standard error of the mean. Justification: Our method which reuses pre-trained models in a zero-shot fashion can save computational ressources as well as reduce energy consumption and human labor, contributing to more sustainable AI practices. Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact. • Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations. • The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster. • The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology. • If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML). 
safeguards: 
 Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?Answer: [NA] Justification: We do not deem that this paper poses such risk.Guidelines:• The answer NA means that the paper poses no such risks.• Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters. • Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images. • We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.12. Licenses for existing assets Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?Answer: [Yes] Justification: Authors of used assets (data) in particular, are credited in the paper. Code will be released and original owners of assets will be properly credited.Guidelines:• The answer NA means that the paper does not use existing assets.• The authors should cite the original paper that produced the code package or dataset.• The authors should state which version of the asset is used and, if possible, include a URL. • The name of the license (e.g., CC-BY 4.0) should be included for each asset.• For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.• If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset. • For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided. • If this information is not available online, the authors are encouraged to reach out to the asset's creators. 
new assets: 
 Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?Answer: [Yes]Justification: Code will be released and documented.Guidelines:• The answer NA means that the paper does not release new assets.• Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc. • The paper should discuss whether and how consent was obtained from people whose asset is used. • At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file. 
crowdsourcing and research with human subjects: 
 Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?Answer: [NA] Justification: This paper does not involve crowdsourcing nor research with human subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects. • Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper. • According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector. 
institutional review board (irb) approvals or equivalent for research with human subjects: 
 Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?Answer: [NA] Justification: This paper does not involve crowdsourcing nor research with human subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects. • Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.• We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution. • For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review. 
 
 Appendix:  


Decision: The paper is reviewed by 4 reviewers. All reviewers recommend acceptance. The authors should add to the additional comparisons, clarifications and discussions about limitations to the final copy or supplementary materials.

Reviews: review: paper_summary: paper_summary: This paper introduces an innovative unsupervised, zero-shot image segmentation method called DiffCut. This method leverages the encoder features of a pre-trained diffusion model within a recursive graph partitioning algorithm to create finely detailed segmentation maps without requiring labels from downstream segmentation datasets. DiffCut exploits features from the last self-attention block of a diffusion UNet encoder to perform image segmentation. This approach does not rely on paired image and text data, making it suitable for unsupervised and zero-shot learning tasks. The core algorithmic innovation in DiffCut is the use of a recursive Normalized Cut (NCut) that allows the model to regulate the granularity of detected objects and consequently adapt the number of segments to the visual content of each image. Compared to existing methods like DiffSeg and other graph-based object localization techniques, DiffCut significantly outperforms in terms of the quality of segmentation maps and alignment with semantic visual concepts. The effectiveness of DiffCut was validated across multiple standard benchmarks with a focus on mIoU scores, where it consistently outperformed the state-of-the-art unsupervised semantic segmentation methods.
strength_weakness: strength_weakness: 1. **[Unsupervised Instance or Panoptic Segmentation Performance]** While the paper positions itself as effective in segmenting more objects within an image, it primarily focuses on semantic segmentation, potentially overlooking the model's capability for instance discrimination. I am interested in how the model performs in unsupervised instance or panoptic segmentation tasks, as these require differentiating individual objects or integrating both semantic and instance segmentation.

2. **[Technical Contribution and Comparison with MaskCut]** MaskCut is actually capable of segmenting multiple objects per image, with the ability to set a large number of masks per image. This raises questions about the novelty and technical contributions of this paper, particularly in the absence of quantitative comparisons with established methods like TokenCut [30] or MaskCut [32].

3. **[Lack of Comparisons with Previous Works]** The paper does not compare its results with some previous state-of-the-art works in unsupervised panoptic and semantic segmentation, such as U2Seg [N1] and EAGLE [N2]. Notably, [N2] also explores the use of prototypes derived from eigenvectors of feature maps. 

4. **[Adequacy of Low-Resolution Features]** The use of low-resolution feature maps to produce concept-embeddings may result in missing small-scale objects in the images, which could lead to the exclusion of these small objects during the "High-Resolution Concept Assignment" phase. This could limit the model’s effectiveness in capturing medium or small-sized objects, which are crucial for detailed image segmentation. 

5. **[Recursive Normalized Cuts or Multi-class Spectral Clustering]** I am curious if the authors have explored to use spectral clustering for multi-entity/object segmentation. The granularity of the segmentation masks can be controlled by using a different cluster numbers. 


[N1] Niu, Dantong, Xudong Wang, Xinyang Han, Long Lian, Roei Herzig, and Trevor Darrell. "Unsupervised universal image segmentation." In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 22744-22754. 2024.

[N2] Kim, Chanyoung, Woojung Han, Dayun Ju, and Seong Jae Hwang. "EAGLE: Eigen Aggregation Learning for Object-Centric Unsupervised Semantic Segmentation." In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3523-3533. 2024.
questions: questions: Please check the weakness section.
limitations: limitations: The authors adequately addressed the limitations.
paper_summary: paper_summary: This paper addresses harnessing semantic localization information in pretrained diffusion UNet models. With the proposed recursive normalized cut on the final self-attention features of the diffusion UNet encoder, this paper achieves better performance on unsupervised zero-shot segmentation comparing to previous methods utilizing other fundation vision encoders, with regulation to the granularity of details. Experiments on several benchmarks and ablation studies show the efficacy of the proposed method.
strength_weakness: strength_weakness: My main concerns consists of several aspects:
1. The writing seems a bit too vague, maybe with more visual illustraition of the observations? For example, can you demonstrate the "patch-level alignment" with visual examples? It's hard to imagine when reading this in Line 168.
2. Are there any visual verification and description for what kind of concepts you get in Section 3.3?
3. The experiments with the proposed DiffCut seems to mainly excute with SSD-1B. What about using other SD models? Regarding computation cost and performance benefit.
questions: questions: 1. In Line 223, what do you mean by "perform a many-to-one matching"?
2. Are the hyperparameters the same for DiffCut on different datasets? Since you seem to use the same hyperparameters for DiffSeg?
limitations: limitations: This author did not discuss the limitations in the paper, which potentially could include:
1. How is the computation efficiency of the proposed method comparing to other methods? Considering the recursive partitioning and concept assigning process.
2. The semantic clustering knowledge in pretrained diffusion models might not be able to transfer to data domains like biomedical images.
3. If LD, AX, or UA is given, would the proposed method still outperform the corresponding SOTAs? Or can it further improve its performance?
paper_summary: paper_summary: This work proposes a new strategy for the task of unsupervised zero-shot segmentation using diffusion model features. The semantic maps are extracted from the U-net features of a diffusion model by applying a recursive algorithm that allows various levels of granularities of the segmentation maps. The proposed method beats competing methods on unsupervised and open-vocabular semantic segmentation on six datasets.
strength_weakness: strength_weakness: My main concern is that the experimental comparison seems rather unfair. While the proposed method uses powerful distilled SD-XL model the baselines only use SD1.4, which might explain most of the performance improvements. In my opinion, the ablation with respect to SD1.4 is not comprehensive enough: 1) The proposed method is not applied with SD1.4, which I think would be mandatory. 2) The DiffSeg results in Tab. 2 seem to be worse than in Tab. 1. I would appreciate a clarification of the effect of using SD-XL features. The proposed method should also be evaluated using the less powerful SD1.4 features to allow a direct comparison with the original DiffSeg method. Otherwise, the comparisons cannot be really fair, in my opinion.

Tab. 4: I assume, DiffSeg would again underperform DiffCut. However, having DiffSeg in this table would be a more complete comparison, not only relaying on the Hungarian algorithm-based evaluation strategy in Tab. 1.

When considering Fig. 9, the masks do get more fine-granular for higher tau. However, the masks do not always align with the object boundaries (e.g. the surfer, the roofs, or the sign). I am wondering whether this is because of using the low-dimensional resolution and only bi-linearly upsampling?

While the previous method DiffSeg also pursued this strategy, I am unsure if the application of the Hungarian matching algorithm to assign predicted masks to a ground truth mask is fair when comparing with methods that do not apply this strategy for the evaluation. It appears not directly comparable. I would appreciate a discussion of this fact and an argumentation why the presented evaluation strategy is reasonable and comparable to the other methods (that do not apply the Hungarian algorithm).

I like the additional baseline AutoSC, which is also seems to be very effective. While the recursive and adaptive formulation of the baseline seem so to be reasonable, the gap to DiffCut is, however, not very clear. The results are almost the same. I would appreciate a more complete ablation of this. The set of chosen exponents seems to be arbitrary (l.302). Did you study whether AutoSC outperforms DiffCut if more possible alpha values were chosen? I would appreciate such an analysis and discussion of it in the rebuttal. Also, I am wondering – which model is faster, AutoSC or DiffCut?
questions: questions: ReCO is first listed training-free, in the open-vocabulary setting with extra-training, but this is not explained in the text?

Regarding terminology: The section 4.4) model analysis is nicely to read. I would maybe consider replacing the term robustness with hyperparameter sensitivity (also in G). But I have no strong opinion on this.

Tab. 3: Did you also study the results if only 64x64 resolution were used?

l.339: Could you please discuss this strategy more comprehensively in the final manuscript (or refer to a related work if existing)? It is not very clear.
limitations: limitations: The method seems to be profound. However, some important evaluations are missing, as explained above.
paper_summary: paper_summary: This paper proposes a model for zero-shot semantic image segmentation based on clustering
feeatures from an off-the-shelf text-to-image diffusion model. Features are extracted
from the U-Net used in the diffusion model. The features are then clustered using
a recursive normalized cut algorithm. The clustering is scaled up to the original
image resolution by semantic guidance from the extracted features. The proposed model
consistently outperforms previous methods on standard benchmarks for image segmentation.
strength_weakness: strength_weakness: - The main contribution explitly states the improvements over the TokenCut and MaskCut
  models, but does not compare to these models in the experiments.
- In my view, the comparison of the respective strengths and weaknesses of different
  base models is not detailed enough. The experiment on semantic coherence targets this
  direction. However, beyond this analysis it would have been interesting to directly
  compare the segmentation results after clustering that are obtained from the different
  base models, both in terms of quantiative metrics and example cases and further
  analyses that show the differences.
questions: questions: - The paper should state more clearly that it target *semantic segmention* to avoid
  confusion with other types of image segmentation. In my view this would have a
  major impact on the clarity of the paper.
- How large is the computational improvement over previous methods? The differences are
  mentioned in terms of parameter count, but a comparison in terms of runtime would be
  interesting as well.
- In comparison to standard semantic segmentation, the method proposed here predicts
  unlabelled classes. Are the features consistent enough to allow for an easy (e.g.
  linear) mapping to the labelled classes across images?
limitations: limitations: I don't fully agree with the statement that the method does not have potential societal
impacts. For example, as briefly mentioned by the authors elsewhere, resusing pre-trained
models in a zero-shot fashion can save computational and labeling resources. In terms
of energy consumption and human labour, this line of works might have a societal impact.

One limitation in my view stems from the fact that the diffusion model used as a basis
probably does not work well on all types of images. While unsupervised, the approach
followed in the paper is dependent on the capabilities of the foundation model. This is
not mentioned in the paper.

Comments: comment: I thank the author for the detailed response. After reading the reviews and the rebuttal, I agree this is a good work and would like to increase my rating.
Thank you for the detailed response and additional experiments and clarifications. Considering the other reviews and the rebuttal of the authors, I am happy to increase my score 5->6. This paper presents solid work with a fair contribution that should be presented to the community.
I appreciate the authors for addressing most of my concerns in the rebuttal. I will keep my rating as borderline accept. I encourage the authors to include the additional comparisons, especially the comparisons with MaskCut in the main paper, which can help other researchers to better understand the key distinctions and benefits of the proposed method.
I thank the authors for their detailed response. The additional comparisons reported
here and in the responses to the other reviewers as well as the clarifications are very
helpful in my view. I agree with with reviewer jdn9 that providing steps towards
instance or panoptic segmentation would have increased the impact of the paper.
Nevertheless, I think the authors demonstrated the potential of diffusion model features
in this setting and overall addressed my concerns, so I am happy to increase my score.