{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/diffusion-models-for-implicit-image","title":"Diffusion Models for Implicit Image Segmentation Ensembles","arxiv_id":"2112.03145","date":"2021-12-06","proceeding":null,"authors":["Julia Wolleb","Robin Sandkühler","Florentin Bieder","Philippe Valmaggia","Philippe C. Cattin"],"abstract":"Diffusion models have shown impressive performance for generative modelling of images. In this paper, we present a novel semantic segmentation method based on diffusion models. By modifying the training and sampling scheme, we show that diffusion models can perform lesion segmentation of medical images. To generate an image specific segmentation, we train the model on the ground truth segmentation, and use the image as a prior during training and in every step during the sampling process. With the given stochastic sampling process, we can generate a distribution of segmentation masks. This property allows us to compute pixel-wise uncertainty maps of the segmentation, and allows an implicit ensemble of segmentations that increases the segmentation performance. We evaluate our method on the BRATS2020 dataset for brain tumor segmentation. Compared to state-of-the-art segmentation models, our approach yields good segmentation results and, additionally, detailed uncertainty maps.","url_abs":"https://arxiv.org/abs/2112.03145v2","url_pdf":"https://arxiv.org/pdf/2112.03145v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"diffusion-models-for-implicit-image","repo_url":"https://github.com/juliawolleb/diffusion-based-segmentation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"diffusion-models-for-implicit-image","repo_url":"https://github.com/aimansnigdha/ambiguous-medical-image-segmentation-using-diffusion-models","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"diffusion-models-for-implicit-image","repo_url":"https://github.com/marrlab/dispr","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"brain-tumor-segmentation","task_name":"Brain Tumor Segmentation"},{"task_slug":"image-segmentation","task_name":"Image Segmentation"},{"task_slug":"lesion-segmentation","task_name":"Lesion Segmentation"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"tumor-segmentation","task_name":"Tumor Segmentation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2112.03145","atlas_url":"https://app.syntology.ai/?focus=2112.03145","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2112.03145"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/juliawolleb/diffusion-based-segmentation","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/marrlab/dispr","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/aimansnigdha/ambiguous-medical-image-segmentation-using-diffusion-models","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":3,"ran_honours":4,"ran_fixture":2,"ran":4,"unverified":6},"by_repo_kind":{"official":{"samples":2,"ran":2,"repositories":1},"listed":{"samples":17,"ran":11,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"cfd76fd0d89574a4","entry":"approx_standard_normal_cdf","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/losses.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/losses.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cfd76fd0d89574a4"}},{"code_sha256_prefix":"6cdc8772f5db6f48","entry":"betas_for_alpha_bar","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/gaussian_diffusion.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/gaussian_diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6cdc8772f5db6f48"}},{"code_sha256_prefix":"42c9692e3f59033f","entry":"dice_score","repo":"juliawolleb/diffusion-based-segmentation","repo_kind":"official","path":"scripts/segmentation_sample.py","file_url":"https://github.com/juliawolleb/diffusion-based-segmentation/blob/HEAD/scripts/segmentation_sample.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"42c9692e3f59033f"}},{"code_sha256_prefix":"cd33283d615fb3d7","entry":"discretized_gaussian_log_likelihood","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/losses.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/losses.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cd33283d615fb3d7"}},{"code_sha256_prefix":"141937afc98f8d1e","entry":"get_named_beta_schedule","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/gaussian_diffusion.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/gaussian_diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"141937afc98f8d1e"}},{"code_sha256_prefix":"e41367ad14ff58fd","entry":"get_param_groups_and_shapes","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/fp16_util.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/fp16_util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e41367ad14ff58fd"}},{"code_sha256_prefix":"e20dd5102da3b050","entry":"make_master_params","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/fp16_util.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/fp16_util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e20dd5102da3b050"}},{"code_sha256_prefix":"bcd8b4acab199405","entry":"make_output_format","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/logger.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/logger.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bcd8b4acab199405"}},{"code_sha256_prefix":"cf2798b666b231ca","entry":"normal_kl","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/losses.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/losses.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cf2798b666b231ca"}},{"code_sha256_prefix":"9b6e4e070473e76f","entry":"space_timesteps","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/respace.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/respace.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9b6e4e070473e76f"}},{"code_sha256_prefix":"64fff1e30802b815","entry":"unflatten_master_params","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/fp16_util.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/fp16_util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"64fff1e30802b815"}},{"code_sha256_prefix":"004f59ffcd28edcc","entry":"visualize","repo":"juliawolleb/diffusion-based-segmentation","repo_kind":"official","path":"scripts/segmentation_sample.py","file_url":"https://github.com/juliawolleb/diffusion-based-segmentation/blob/HEAD/scripts/segmentation_sample.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"004f59ffcd28edcc"}},{"code_sha256_prefix":"129b804760b3115f","entry":"zero_module","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/nn.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/nn.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"129b804760b3115f"}},{"code_sha256_prefix":"ecd0fc28815b65ae","entry":"avg_pool_nd","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/nn.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/nn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ecd0fc28815b65ae"}},{"code_sha256_prefix":"fe4eb545bbb728e0","entry":"conv_nd","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/nn.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/nn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fe4eb545bbb728e0"}},{"code_sha256_prefix":"49a5e51a44d77a98","entry":"create_named_schedule_sampler","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/resample.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/resample.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"49a5e51a44d77a98"}},{"code_sha256_prefix":"e515a67f7f32e76d","entry":"mpi_weighted_mean","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/logger.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/logger.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e515a67f7f32e76d"}},{"code_sha256_prefix":"17e660f0e95b0309","entry":"profile","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/logger.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/logger.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"17e660f0e95b0309"}},{"code_sha256_prefix":"f7b9e18794a10023","entry":"standardize","repo":"marrlab/dispr","repo_kind":"listed","path":"guided_diffusion/gaussian_diffusion.py","file_url":"https://github.com/marrlab/dispr/blob/HEAD/guided_diffusion/gaussian_diffusion.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f7b9e18794a10023"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}