SemFlow: Binding Semantic Segmentation and Image Synthesis via Rectified Flow

Authors: chaoyang  wang
xiangtai  li
lu  qi
henghui  ding
yunhai  tong
ming-hsuan  yang
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-14 09:52:27

Abstract: Semantic segmentation and semantic image synthesis are two representative tasks in visual perception and generation. While existing methods consider them as two distinct tasks, we propose a unified framework (SemFlow) and model them as a pair of reverse problems. Specifically, motivated by rectified flow theory, we train an ordinary differential equation (ODE) model to transport between the distributions of real images and semantic masks. As the training object is symmetric, samples belonging to the two distributions, images and semantic masks, can be effortlessly transferred reversibly. For semantic segmentation, our approach solves the contradiction between the randomness of diffusion outputs and the uniqueness of segmentation results. For image synthesis, we propose a finite perturbation approach to enhance the diversity of generated results without changing the semantic categories. Experiments show that our SemFlow achieves competitive results on semantic segmentation and semantic image synthesis tasks. We hope this simple framework will motivate people to rethink the unification of low-level and high-level vision.

Main paper: 
 introduction: 
 Understanding semantic content and creating images from semantic conditions are fundamental research topics in computer vision. Semantic segmentation [45; 7; 59; 85; 11; 10] and image synthesis [8; 32; 28; 72; 90] are two representative dense prediction tasks and inspires various downstream applications, including autonomous driving [5] and medical image analysis [89] . The former aims to assign a category label to each pixel in the image, while the latter aims to generate realistic images given semantic layouts.Although semantic segmentation and image synthesis constitute a pair of reverse problems, existing works typically solve them using two distinct methodologies. On the one hand, segmentation models mostly follow the spirit of discriminative models. Specifically, a pre-trained backbone is employed to extract multi-scale features, and then task-specific decoders are used for dense prediction. On the other hand, semantic image synthesis frameworks are mainly built upon generative adversarial networks (GAN) [19; 52; 57; 62] or diffusion models (DM) [63; 64; 25] . GAN-based methods [90; 72; 28] typically take semantic layouts as inputs and adopt a discriminator for adversarial training. Meanwhile, DM-based methods [36] generate from noise with semantic layouts functioning as control signals.An intuitive solution is to represent the segmentation mask as a colormap and model it as a conditional image generation task [56] . However, there are several implementation challenges. Overall, most of SS and SIS are modeled as a pair of transportation problems between the distributions of images and masks. They share the same ODE and only differ in the direction of the velocity field. We propose a finite perturbation operation on the mask to enable multi-modal generation without changing the semantic labels. Grey dots represent data samples. Colored dots represent semantic centroids, also known as anchors in Eq. 7. Colored bubbles represent the scale of perturbation.the discriminative segmentation models do not apply to this problem due to their irreversibility. For generative adversarial networks, their generators are typically unidirectional. Jointly training multiple unidirectional models to achieve bidirectional generation [90] is not the concern of this paper. Latent diffusion models (LDMs) have recently demonstrated great potential in generative tasks. Beyond generative tasks, several works [56; 69] attempt to apply diffusion models for segmentation, with images functioning as conditions, but their applicable tasks are limited to be class-agnostic. There are three main problems for existing LDM-based segmentation frameworks: 1) The contradiction between the randomness of generation outputs and the certainty of segmentation labels.2) The huge cost brought by multiple inference steps.3) The irreversibility between semantic masks and images.In this paper, we use rectified flow [40; 42; 17] to enable LDM as a unified framework for semantic segmentation and semantic image synthesis. Our key idea is summarized in Fig. 1 . Starting from an LDM [58] framework, we solve the above problems with three methodologies. First, we redefine the mapping function to address the randomness. Previous works [56] aim to learn the mapping from the joint distribution of Gaussian noise and images to the segmentation masks. We argue that Gaussian noise in this mapping function is redundant and negatively affects the determinism of semantic segmentation results. Instead, our model directly learns the mapping from images to masks. Secondly, we make the mapping reversible via rectified flow. Rectified flow is an ordinary differential equation (ODE) framework with a time-symmetric training object. This feature allows the model to be trained once to obtain bi-directional transmission capabilities and can be solved numerically using simple ODE solvers such as Euler. Finally, we propose a finite perturbation method to enable multi-modal image synthesis, as the mapping is one-to-one in semantic segmentation but one-to-many in semantic synthesis. We add amplitude-limited noise, enabling masks to be sampled from a collection of semantic-invariant distributions rather than a fixed value, and further improving the quality of synthesized results. Moreover, our model needs fewer inference steps than traditional diffusion models because the transport trajectory is straight, significantly reducing the gap between LDM and traditional discriminative models in segmentation.The main contributions are as follows: 1) We introduce SemFlow, a new unified framework that binds semantic segmentation and image synthesis with rectified flow, effectively leveraging the length of the generative models. 2) We propose specialized designs of SemFlow, including pseudo mask modeling, bi-directional training of segmentation and generation, and a finite perturbation strategy. 3) We validate SemFlow on several popular benchmarks. For semantic segmentation, SemFlow dramatically narrows the gap between diffusion models and discriminative models in terms of accuracy and inference speed with a more elegant framework. Meanwhile, SemFlow also performs decently in semantic image synthesis tasks. [78] and bounding box [36] . Despite these methods achieves good synthetic results, their architecture is usually asymmetric, and the generator is usually unidirectional. This hinders the exploration of the unification of semantic segmentation and image synthesis. 
limitations: 
 Question: Does the paper discuss the limitations of the work performed by the authors?Answer: [Yes] Justification: We discuss the limitations in Appendix C.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. 
method: 
 In this section, we first review diffusion models and the differential equations of diffusion-based segmentation models (DSMs) and then analyze the disadvantages of existing approaches. Afterward, we propose our SemFlow, which is inspired by rectified flow theory. It solves the randomness problem in the existing DSM and unifies semantic segmentation and image synthesis with one model. We will elaborate on each phase of our method.Diffusion models are a class of likelihood-based models that define a Markov chain of forward and backward processes. In the forward process, the noise is gradually added to the real data x 0 to form the noisy dataEQUATIONwhere α t is functions of t. During training, the model ϵ θ learns to estimate the noise by minimizing the objective with L2 loss:EQUATIONIn the backward process, the model starts from Gaussian noise and gradually denoises to generate realistic data [63] via,EQUATIONLuckily, Eq. 3 provides a unified solution for DDPM and DDIM, where the former belongs to an SDE modeling and the latter is an ODE modeling. We parameterized it asEQUATIONwhere σ controls the way of modeling:EQUATIONIn the image generation task, x 0 represents the real images, and x T represents the Gaussian noise. We extend the boundaries of Eq. 4 and apply it to semantic segmentation problems. An intuitive way is to encode the segmentation mask into colormaps and model segmentation as a conditional image generation task. Given image I, we rewrite the projection f into a formulation of conditional generation,EQUATIONEq. 6 formulates the existing diffusion-based segmentation models with generative modeling. However, this modeling approach suffers from the following problems: 1) The randomness of initial noise and the determinism of the segmentation mask are contradictory. 2) From a transmission point of view, the transfer from noise to the segmentation mask does not conform to the paradigm of semantic segmentation task, where noise is redundant.3) The images in this approach only serve as the condition, which is non-causal in reverse transfer. Thus, the reversed transfer is a separate problem.Task-agnostic Framework. We employ the standard Stable Diffusion [58] (SD) framework for our task without any task-specific decoder head or well-designed text prompts. To this end, we design the network architecture using the following three steps. First, we convert the semantic segmentation masks to 3-channel pseudo mask M = (m 0 , m 1 , m 2 ) to align with the images I. Assume that the valid region [0, 255] (for real images) is divided into k parts with a spacing of s, the pseudo mask corresponding to category index c is formulated as:EQUATIONwhere s * (k -1) < 255 and ⌊•⌋ means the floor operator. The (m i 0 , m i 1 , m i 2 ) are called anchors. After the transformation, we adopt a VAE encoder E to compress the images and pseudo masks into the latent space. The corresponding VAE decoder D restores the latent variables to the pixel space.EQUATIONwhere z means the output of the UNet.Discussion. Although previous works [69] argue that segmentation masks are lower in entropy and specifically re-train a lighter network, we still adopt the off-the-shelf VAE from SD. The reasons are as follows: 1) The number of parameters in VAE is negligible compared to the UNet (84M vs. 860M).2) The VAE specifically trained for segmentation masks can not be applied to images, thus destroying the bi-directional transportation. 3) Specific training creates spatial priors, such as clustering, which hinders our exploration of LDM's segmentation capability itself.Note that we do not use image captions or image features as prompts. As our model unifies semantic segmentation and image synthesis with one model, the usage of captions contradicts the definition of semantic segmentation task while the features are non-causal for image synthesis. Thus, in this work, we set the prompt as empty.Bi-directional Training and Inference. Contrary to the conventional approach, we propose modeling the segmentation task with rectified flow. It is an ODE framework that aims to learn the mapping between two distributions through straight trajectories.Denote π 0 and π 1 represent the distribution of the latent variables of images and masks, respectively. Denote z 0 ∼ π 0 and z 1 ∼ π 1 , the trajectory from z 0 to z 1 can be formulated as z t = φ t (z 0 , z 1 ):EQUATION)When φ is the trajectory of rectified flow [40] , z t can be reformulated as the linear interpolation process between z 0 and z 1 as z t = (1 -t)z 0 + tz 1 . We aim to learn the velocity field using neural networks v θ (z t , t) and solve it with optimization methods,EQUATION= 1 0 E (z0,z1)∼γ ||v θ (z t , t) -(z 1 -z 0 )|| 2 dt,where γ indicates the coupling of images and their corresponding pseudo masks.Eq. 10 is our training loss. Upon training completed, the transfer from z 0 to z 1 can be described via an ODE:EQUATIONSo far, we have constructed a mapping from the distribution of images to that of masks. Compared with DSMs in Eq. 6, our approach avoids the interference of randomness, enabling the application of diffusion models to semantic segmentation tasks.Moreover, Eq. 10 has a time-symmetric form, which results in an equivalent problem by exchanging z 0 and z 1 and flipping the sign of v θ . Interestingly, the transportation problem from π 1 to π 0 indicates the semantic image synthesis task. This means that semantic segmentation and semantic image synthesis essentially become a pair of mutually reverse problems that share the same ODE (Eq. 11) and have solutions with opposite signs.In the inference stage, we can obtain the approximate results by numerical solvers like the forward Euler method, which can be formulated as follows, Semantic segmentation is regarded as the transportation from z 0 to z 1 , which we call forward flow.The ODE is Eq. 11 and the numerical solution is,EQUATION)After M is restored with Eq. 8, we calculate the L2 distance between M and anchors and obtain the segmentation mask.Correspondingly, the semantic image synthesis task is considered to transfer in a reverse direction, which we call the reverse flow. Specifically, this transfer can be described as dzt dt = -v θ (z t , t), and the solution is,EQUATION)In Eq. 10, the model is configured to learn the one-to-one mapping between images and masks. However, assigning a fixed mask to each image brings about several problems. First, we find that constant z 1 in Eq. 13 hinders the multi-modal generation for the image synthesis task. Moreover, the pseudo masks are low in entropy. We hypothesize that the low-entropy distribution of masks hinders the training process and may finally spoil the quality of synthesis results.To this end, we propose to add finite perturbation on the pseudo masks. Specifically, given pseudo masks M which has a spacing of s, we add a noise with a limited amplitude on M ,EQUATION)where U is a uniform distribution. We set 0 < β < s/2 to ensure that the semantic label of each pixel does not change. Therefore, we propose to replace z 1 with z ′ 1 = E(M ′ ) in Eq. 10 and Eq. 13. We show the effectiveness of this design in Sec. 4.3.Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?Answer: [Yes]• It should be clear whether the error bar is the standard deviation or the standard error of the mean. • It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified. • For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates). • If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text. 
experimental settings: 
 Dataset and Metrics. We study SemFlow using three popular datasets: COCO-Stuff [37] , CelebAMask-HQ [30] , and Cityscapes [12] . They contain 171, 19, and 19 categories, respectively. For semantic segmentation, we evaluate with mean intersection over union (mIoU). For We use the off-the-shelf VAE of the corresponding Stable Diffusion model. The spacing s is set as 50, and the division coefficient k is 6. The amplitude of perturbation is 6. Note that there is no need to train two models for segmentation and synthesis separately since the optimization target in Eq. 10 is time-symmetric.Baselines. We seek to unify semantic segmentation (SS) and semantic image synthesis (SIS) into a pair of reverse problems and train one model for a solution. As few previous works achieve this goal, we thus take different baselines for SS and SIS, respectively. For SS, we design two baseline models, DSMs [58] , which follow the principle of diffusion-based conditional generation modeling in Sec. 3.1. The network structure and hyperparameters of DSM follow SemFlow, except that the inputs of UNet are eight channels. Specifically, the noise and images are concatenated in the channel dimension. DSM-DDIM and DSM-DDPM differ in differential equation modeling (ODE vs. SDE).For SIS, we take pix2pixHD [72] , SPADE [53] , SC-GAN [74] , BBDM [31] and CycleGAN [90] as the baselines.Semantic Segmentation. Fig. 2 shows the qualitative comparison between SemFlow and DSMs. Our SemFlow demonstrates satisfactory performance in a range of scenarios and exhibits high accuracy in classifying the semantic labels of targets. Semantic Image Synthesis. We compare our approach with other specialist models on semantic image synthesis tasks in Tab. 1. On CelebAMask-HQ, SemFlow achieves a performance of 32.6 FID and 0.393 LPIPS.Beyond specialist models, we also qualitatively compare our approach with CycleGAN [90] in Fig. 3 to demonstrate the overall performance on SS and SIS tasks. All results of SemFlow are generated with one model. In other words, the ODE modeling of SS and SIS share the same velocity Discussion. Although the performance gap exists compared with specialist models, our approach solves the two major issues of diffusion-based segmentation approaches: 1) Randomness of outputs and 2) Large inference steps. We believe it significantly reduces the gap between discriminative models and diffusion models.Perturbation. Fig. 4 shows the synthesized results of SemFlow on the CelebAMask-HQ dataset and demonstrates the importance of perturbation operation. First, perturbation enables our approach to generate multi-modal results from one semantic layout using different noises. The synthesized results show diverse appearances, such as skin, hair color, and the background, and exhibit good consistency with the masks. Moreover, we also show the synthesis results of the model without perturbation in Fig. 4 . It is witnessed that the model without perturbation is only able to generate uni-modal results, and the synthesized images exhibit a loss of detail and suffer from severe over-smoothing problems.Straight Trajectory. Our SemFlow aims to establish linear trajectories between the distribution of images and the masks, which enables it to sample with fewer steps.Tab. 2 compares the performance of DSM and SemFlow on segmentation tasks under different inference steps, where DSM sampled with DDPM and DDIM represent SDE and ODE modeling, respectively. Overall, SemFlow outperforms DSM by a remarkable margin regardless of the inference steps. Specifically, the DSMs' performance declines markedly as the number of steps decreases. With 5 steps, the DSM-DDPM achieves a mIoU of 12.3, while the DSM-DDIM achieves 9.5 mIoU. On the contrary, our SemFlow achieves 28.3 even with one step.Fig. 5 provides semantic image synthesis results with different inference steps. Although fewer steps will result in some loss of detail and make the images appear smoother, the results of one-step synthesis are still competitive. This indicates that the trajectory between the two distributions is straightened. Fig. 6 and Fig. 7 visualizes the latent variable sampled from the trajectory. The transition between z 0 and z 1 is smooth. 
conclusion: 
 In this work, we present SemFlow, a framework that employs a diffusion model to integrate semantic segmentation and semantic image synthesis as a pair of reverse problems. To overcome the con- tradiction between the randomness of diffusion models and the certainty of semantic segmentation results, we propose to model semantic segmentation as a transport problem between image and mask distributions. We then employ rectified flow to learn the transfer function, which brings the benefits of reversible transportation. We propose a finite perturbation method to enable multi-modal generation, which also greatly improves the quality of synthesized results. With straight trajectory modeling, our model can sample with much fewer steps. Experimental results show that even with a weak sampler, our model still achieves comparable or even better results than specialist models. We hope our research can inspire the findings on unified generative model design for the community.Overview. In this supplementary, we present more results and details:• A. More details on our method.• B. More empirical studies and visual results.• C. Discussion of the limitations, broader impacts and safeguards.A More Details on Method Amplitude of Perturbation. In the main paper, the perturbation follows the uniform distribution ϵ ∼ U(-β, β). We set 0 < β < s/2 to prevent the semantic labels from changing. Here is the proof.Let M = (m 0 , m 1 , m 2 ) be the anchor for category c 1 , M ′ = M + ϵ be the anchor with perturbation, and P = (p 0 , p 1 , p 2 ) be another anchor for category c 2 , c 1 ̸ = c 2 . First, it is obvious that E(M ′ ) = E(M ) = M , which means that adding perturbation will not change the estimation of original anchors. Then we only need to prove 2 , and can be further written as 0 < i∈ [3] (m i -p i )(m i -p i + 2ϵ i ). Since -s < 2ϵ i < s and m i -p i can only take the values of {..., -2s, -s, 0, s, 2s, ...}, the two terms must have the same sign or one of them equals 0. The proof is completed.||M ′ -M || 2 < ||M ′ -P || 2 , which is equivalent to i∈[3] ϵ 2 i < i∈[3] (ϵ i + m i -p i )Implementation Details. We train CelebAMask-HQ and Cityscapes with a batch size of 256 with AdamW optimizer for 80K and 8K steps, respectively. The initial learning rate is set as 2 × 10 -5 and 5 × 10 -5 . Linear learning rate scheduler is adopted. For COCO-Stuff dataset, we use a constant learning rate of 1 × 10 -5 with a batch size of 128 for 320K steps. The COCO-Stuff indicates the version of COCO-Stuff-164k. 
experiments compute resources: 
 Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?Answer: [Yes]Justification: We provide the implementation details in Section 4.Guidelines:• The answer NA means that the paper does not include experiments.• The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage. • The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute. • The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper). 
code of ethics: 
 Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines? 
broader impacts: 
 Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?Answer: [Yes] Justification: We discuss broader impacts in Appendix C.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: [Yes]Justification: We describe the safeguards in Appendix C.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: We use existing assets with 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. 
 
 Appendix: Sampling from Other Distributions. Fig. 8 shows the synthesized images which are sampled with different perturbations ϵ ∼ U(-β ′ , β ′ ). It can be observed that the model can obtain high-quality synthetic results only when the perturbations in the inference stage and the training stage follow the same distribution. Specifically, the synthesized images are dim when β ′ < β, and overexposed when β ′ > β. More Visual Results on Cityscapes. Fig. 11 shows the results of multi-modal image synthesis. The appearance of the synthesized scene varies according to different random seeds. Moreover, our model can learn the laws of shadows and light angles (the third column), demonstrating its great potential. Fig. 12 shows visual results of semantic segmentation. Our model accurately segments the objects and assigns the correct semantic labels.Limitations. Some previous work, such as Stable Diffusion, SDXL show that scaling up the training data is essential to exploit the potential of diffusion models fully. Due to the limited computational resources and the number of image-mask pairs in the existing dataset, we leave it to future work. In addition, although this paper does not focus on the network structure and the design of ODE solvers, we believe there is room for exploration to further improve performance.Broader Impacts. Our SemFlow extends the diffusion model from the generative domain to the segmentation task and narrows the gap with traditional discriminative models. It also functions as a unified framework to bind semantic segmentation and image synthesis. We hope this will motivate people to explore the unification of low-level and high-level vision. In terms of social impact, it will encourage artistic content creation, but at the same time may face the problem of fake content.Safeguards. The content produced by a generative model is highly correlated with its training data. Ensuring fair and clean training data can effectively prevent models from generating harmful content. Justification: We include the main claims in the abstract and 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.Justification: We conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics .Guidelines:• The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.• If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics. • The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction). 


Decision: This paper proposes a new unified framework that binds semantic segmentation and image synthesis with rectified flow as a pair of reverse problems, trained with an ordinary differential equation (ODE) model to transport between the distributions of real images and semantic masks, using techniques including pseudo mask modeling, bi-directional training of segmentation and generation, and a finite perturbation strategy.

It has received 1x borderline reject and 2x borderline accepts.  Authors have provided an extensive rebuttal which has partially addressed most concerns.  Reviewers generally like the motivation to unify two different tasks in a reversible process,  with "uni-directional training, bi-directional inferencing".  Reviewers questions the extent of technical novelty and performance gaps, esp. on segmentation (10% worse than Mask2Former).  While authors explains the cause of this gap by pointing out that their model cannot leverage the transport capability of Stable Diffusion between noises and images for the transport between images and masks,  this inability does cast doubts on the flexibility and practicality of this framework. 

Nevertheless, the AC recommends acceptance based on the consensus of an interesting novel approach to unify low-level and high-level vision tasks, with non-trivial technical solutions.  Please take all the comments and additional clarification/results in the rebuttal into account and improve the quality in the final version.

Reviews: review: paper_summary: paper_summary: This paper proposed a unified diffusion-based framework for semantic segmentation and semantic image synthesis. The proposed SemFlow applied the existing ordinary differential equation (ODE) model and modified the transport problem setting. Additionally, it incorporates techniques such as perturbation and straight trajectory to enhance model performance. The proposed method was compared with a simple diffusion-based conditional generation modeling and a transformer-based method (Mask2Former) for semantic segmentation, as well as several GAN-based and diffusion-based methods for semantic image synthesis. However, the results did not surpass existing methods, and performance in the semantic segmentation task was even 10% lower in mIoU compared to basic segmentation methods.
strength_weakness: strength_weakness: 1. The literature review is insufficient and lacks citations of relevant works such as FreeMask, NeurIPS, 2023. 
2. Although the motivation is thoughtful, the theoretical and practical value of the proposed method is limited. The application results are not promising, as the semantic segmentation performance is over 10% lower than Mask2Former. The method does not demonstrate advantages over existing training data synthesis methods. 
3. The key components of the proposed method are commonly used in generative fields and therefore lack novelty. 
4. The experiments are insufficient. It is recommended that the authors include FreeMask and other relevant methods for comparison in the semantic segmentation task, as well as ControlNet or Freestyle generation methods for semantic image synthesis. Additionally, the authors should provide complete quantitative results on all three datasets for both semantic image synthesis and semantic segmentation tasks. 
5. The authors claim limited computational resources as a reason to leave training data synthesis methods for future work, yet the experiments were conducted on 8 NVIDIA A100 GPUs, which is more than the resources used in most training data synthesis studies. Also, the computational cost advantages are unclear due to the absence of computation time data.
questions: questions: Although I appreciate the motivation and exploration in this paper, the results do not convince me that the proposed method is promising and practical for image synthetic and semantic segmentation tasks.
limitations: limitations: Yes
paper_summary: paper_summary: The paper presents SemFlow, an approach that binds semantic segmentation and semantic image synthesis using an ordinary differential equation (ODE) model. The motivation is to use rectified flow to enable LDM as a unified framework for both tasks. The key contributions include a unified framework that jointly optimizes both tasks, the specialized designs of the frameworks, including pseudo mask modelling, bi-directional training of segmentation and generation, and a finite perturbation strategy. This approach bridges the gap between semantic segmentation and semantic image synthesis, showing good visualization results.
strength_weakness: strength_weakness: 1. Lines 133-140: Why is there a necessity to transform the semantic segmentation masks into 3-channel pseudo-masks utilizing Eq. 7? Could you provide insights on how the formulations for m1 and m2 were derived?

2. Figure 4: During the model inference process (semantic image synthesis task), will noise be added to the mask? 

3. Lines 147-155: SemFlow cannot use captions to guide image synthesis, and the authors claim the usage of captions is non-casual for semantic image synthesis, however, there is still some work on it [1,2].

4. There is still a gap in quantitative results compared to the popular model within each task.

[1] Xue, Han, et al. "Freestyle layout-to-image synthesis." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2023.

[2] Lv, Zhengyao, et al. "Place: Adaptive layout-semantic fusion for semantic image synthesis." *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition*. 2024.
questions: questions: See Weaknesses
limitations: limitations: Yes
paper_summary: paper_summary: This paper presents a work for solving semantic image segmentation and image synthesis simultaneously. This work proposed to use rectified flow and adopt a VAE encoder to compress the images and pseudo masks into the latent space. By comparing the proposed method with previous semantic segmentation models and image synthesis SOTAs, the effectiveness of this method is demonstrated. The proposed method handles the randomness issue for semantic segmentation. Finally, ablation study has been provided.
strength_weakness: strength_weakness: - What is the motivation to use Euler sampler. More discussion between Euler and DDIM/DDPM will be more helpful to understand the technical details for most readers.

- For image synthesis task, the proposed method had a clear gap compared with other diffusion models.
questions: questions: See above.
limitations: limitations: No.

Comments: title: Maintain my rating - Borderline accept
Please let us know whether we address all the issues
Please let us know whether we address all the issues
Please let us know whether we address all the issues
comment: Thanks for your comments. 

Issue 1: This framework seems unpractical and lacks potential.

A1: First, our method builds a deterministic transport from images to masks, which solves the stochasticity problem in existing diffusion-based segmentation models (Fig.2, Sec.3.1). Second, our method significantly reduces the sampling steps of diffusion-based segmentation methods through straight trajectory modeling (Tab.3). Third, our framework models image segmentation and generation as a pair of reversible problems. We believe it is helpful for the community and has the potential to achieve better performance when scaled up, as discussed in future works. As for research potential discussion, recently, lots of works use generative model for segmentation. We acknowledge that existing diffusion pipeline for segmentation cannot compete with traditional segmentation models. However, it is also one of solution towards an unified model and should be encouraged considering the diversity of research.


Issue 2: The details of experiments on Freestyle and ControlNet.

A2: For Freestyle, we use the official layout-to-image synthesis script for ADE task. This official script formulates the text prompts as "[class 1] [class 2] ..." where "class n" is the name of the specified category. The checkpoint we use is from the Freestyle official repository. 
For ControlNet, we adopt the official checkpoint named "Controlnet - v1.1 - seg Version", which is designed for ADE dataset. We use the provided scripts in README and only replace the text prompts from a complete sentence with a string of category names, which is **in the same way as Freestyle**. We observed that the synthesized results of ControlNet and Freestyle are significantly different in domains, including style, texture, material, etc. This difference is also observed in Freestyle's visualization. The samples of Freestyle are much closer to those of the realistic ADE dataset.
Thank the authors for their response. I have carefully read the responses and the comments from other reviewers. I think my original concerns have been partially addressed. Although the motivation is good, I remain unconvinced that the new framework is more practical or has greater potential in contributing to both image synthesis and semantic segmentation tasks compared to other approaches. The exclusion of text prompts and the inability to leverage existing foundation models reduce the flexibility and practicality of this framework. Additionally, it is unclear how the authors conducted the experiments on Freestyle and ControlNet. It seems that the results for ControlNet are not optimal. Generally, it is not supposed to perform such worse than Freestyle. For these reasons, I am inclined to increase my original score to borderline reject, which is the highest score I can give.
We sincerely appreciate the reviewer's comments and positive feedback. We'll carefully consider your review and make any necessary revisions to improve the quality of our manuscript. Thank you.
Hi

After reading all the reviews and authors' feedback, I prefer to maintain my initial rating - borderline accept.

From my perspective, this work presents a novel model for jointly modelling image generation and synthesis, which are two reverse tasks. It is clearly different to previous work UniGS and FreeMask, as mentioned by R1.

The authors also provide more explanation on the Euler sampler. I think authors need to refine this part much better in the next version, no matter for an accepted paper or a resubmission. Therefore, I insist on my initial rating, even though the performance still needs to improve to compete with other methods.

Best
R3
Dear reviewer,

Thank you for the comments on our paper. 

We have submitted the response to your comments. Please let us know if you have additional questions so that we can address them during the discussion period. We hope that you can consider raising the score after we address all the issues. 

Thank you
Dear reviewer,

Thank you for the comments on our paper. 

We have submitted the response to your comments. Please let us know if you have additional questions so that we can address them during the discussion period. We hope that you can consider raising the score after we address all the issues. 

Thank you
Dear reviewer,

Thank you for the comments on our paper. 

We have submitted the response to your comments. Please let us know if you have additional questions so that we can address them during the discussion period. We hope that you can consider raising the score after we address all the issues. 

Thank you