{"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/slime-segment-like-me","title":"SLiMe: Segment Like Me","arxiv_id":"2309.03179","date":"2023-09-06","proceeding":null,"authors":["Aliasghar Khani","Saeid Asgari Taghanaki","Aditya Sanghi","Ali Mahdavi Amiri","Ghassan Hamarneh"],"abstract":"Significant strides have been made using large vision-language models, like Stable Diffusion (SD), for a variety of downstream tasks, including image editing, image correspondence, and 3D shape generation. Inspired by these advancements, we explore leveraging these extensive vision-language models for segmenting images at any desired granularity using as few as one annotated sample by proposing SLiMe. SLiMe frames this problem as an optimization task. Specifically, given a single training image and its segmentation mask, we first extract attention maps, including our novel \"weighted accumulated self-attention map\" from the SD prior. Then, using the extracted attention maps, the text embeddings of Stable Diffusion are optimized such that, each of them, learn about a single segmented region from the training image. These learned embeddings then highlight the segmented region in the attention maps, which in turn can then be used to derive the segmentation map. This enables SLiMe to segment any real-world image during inference with the granularity of the segmented region in the training image, using just one example. Moreover, leveraging additional training data when available, i.e. few-shot, improves the performance of SLiMe. We carried out a knowledge-rich set of experiments examining various design factors and showed that SLiMe outperforms other existing one-shot and few-shot segmentation methods.","url_abs":"https://arxiv.org/abs/2309.03179v4","url_pdf":"https://arxiv.org/pdf/2309.03179v4.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":"slime-segment-like-me","repo_url":"https://github.com/aliasgharkhani/slime","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"3d-shape-generation","task_name":"3D Shape Generation"},{"task_slug":"segmentation","task_name":"Segmentation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2309.03179","atlas_url":"https://app.syntology.ai/?focus=2309.03179","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.03179"}},"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/aliasgharkhani/slime","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":7},"by_repo_kind":{"official":{"samples":7,"ran":7,"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":"05522ac567ba2c48","entry":"add_base_args","repo":"aliasgharkhani/slime","repo_kind":"official","path":"src/arguments.py","file_url":"https://github.com/aliasgharkhani/slime/blob/HEAD/src/arguments.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"05522ac567ba2c48"}},{"code_sha256_prefix":"eb84022f842924c8","entry":"add_dataset_args","repo":"aliasgharkhani/slime","repo_kind":"official","path":"src/arguments.py","file_url":"https://github.com/aliasgharkhani/slime/blob/HEAD/src/arguments.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eb84022f842924c8"}},{"code_sha256_prefix":"21819a46cf461c78","entry":"add_train_args","repo":"aliasgharkhani/slime","repo_kind":"official","path":"src/arguments.py","file_url":"https://github.com/aliasgharkhani/slime/blob/HEAD/src/arguments.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"21819a46cf461c78"}},{"code_sha256_prefix":"1de29ccdb9393811","entry":"calculate_iou","repo":"aliasgharkhani/slime","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/aliasgharkhani/slime/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1de29ccdb9393811"}},{"code_sha256_prefix":"b15365d62ea00b2a","entry":"get_crops_coords","repo":"aliasgharkhani/slime","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/aliasgharkhani/slime/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b15365d62ea00b2a"}},{"code_sha256_prefix":"466ab3aa39de1a8c","entry":"get_random_crop_coordinates","repo":"aliasgharkhani/slime","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/aliasgharkhani/slime/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"466ab3aa39de1a8c"}},{"code_sha256_prefix":"0b2a3c6cb50d6a19","entry":"jax_memory_efficient_attention","repo":"aliasgharkhani/slime","repo_kind":"official","path":"diffusers/models/attention_flax.py","file_url":"https://github.com/aliasgharkhani/slime/blob/HEAD/diffusers/models/attention_flax.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0b2a3c6cb50d6a19"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}