{"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/flair-vlm-with-fine-grained-language-informed","title":"FLAIR: VLM with Fine-grained Language-informed Image Representations","arxiv_id":"2412.03561","date":"2024-12-04","proceeding":"CVPR 2025 1","authors":["Rui Xiao","Sanghwan Kim","Mariana-Iuliana Georgescu","Zeynep Akata","Stephan Alaniz"],"abstract":"CLIP has shown impressive results in aligning images and texts at scale. However, its ability to capture detailed visual features remains limited because CLIP matches images and texts at a global level. To address this issue, we propose FLAIR, Fine-grained Language-informed Image Representations, an approach that utilizes long and detailed image descriptions to learn localized image embeddings. By sampling diverse sub-captions that describe fine-grained details about an image, we train our vision-language model to produce not only global embeddings but also text-specific image representations. Our model introduces text-conditioned attention pooling on top of local image tokens to produce fine-grained image representations that excel at retrieving detailed image content. We achieve state-of-the-art performance on both, existing multimodal retrieval benchmarks, as well as, our newly introduced fine-grained retrieval task which evaluates vision-language models' ability to retrieve partial image content. Furthermore, our experiments demonstrate the effectiveness of FLAIR trained on 30M image-text pairs in capturing fine-grained visual information, including zero-shot semantic segmentation, outperforming models trained on billions of pairs. Code is available at https://github.com/ExplainableML/flair .","url_abs":"https://arxiv.org/abs/2412.03561v1","url_pdf":"https://arxiv.org/pdf/2412.03561v1.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":"flair-vlm-with-fine-grained-language-informed","repo_url":"https://github.com/explainableml/flair","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"flair-vlm-with-fine-grained-language-informed","repo_url":"https://github.com/ExplainableML/cosmos","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"zero-shot-semantic-segmentation","task_name":"Zero-Shot Semantic Segmentation"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-pooling","method_name":"Attention Pooling"},{"method_slug":"clip","method_name":"CLIP"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2412.03561","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2412.03561"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/explainableml/flair","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ExplainableML/cosmos","reach":{"status":"ok"}}],"summary":{"ran_violates":1,"ran_draft_wrong":2,"unverified":17},"by_repo_kind":{"official":{"samples":19,"ran":3,"repositories":1},"listed":{"samples":1,"ran":0,"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":20,"samples":[{"code_sha256_prefix":"f19962ebb134b3d7","entry":"convert_to_custom_text_state_dict","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/model.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/model.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f19962ebb134b3d7"}},{"code_sha256_prefix":"dcd422d66b0581d8","entry":"get_cast_dtype","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/model.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/model.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dcd422d66b0581d8"}},{"code_sha256_prefix":"b476c8cfbf0f1f47","entry":"get_input_dtype","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/model.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/model.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b476c8cfbf0f1f47"}},{"code_sha256_prefix":"7c9f37f7273100f9","entry":"center_square_crop_box","repo":"explainableml/flair","repo_kind":"official","path":"src/visualization.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/visualization.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7c9f37f7273100f9"}},{"code_sha256_prefix":"7ce5eede4639706f","entry":"download_weights_from_hf","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/factory.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/factory.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7ce5eede4639706f"}},{"code_sha256_prefix":"7e7ffff6d9c929a3","entry":"draw_numbers","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/data.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7e7ffff6d9c929a3"}},{"code_sha256_prefix":"ddcbd45e940484ee","entry":"gather_features","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/loss.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ddcbd45e940484ee"}},{"code_sha256_prefix":"575ba28efe232215","entry":"get_default_params","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/params.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/params.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"575ba28efe232215"}},{"code_sha256_prefix":"5c7cf820e99443ff","entry":"get_model_config","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/factory.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/factory.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5c7cf820e99443ff"}},{"code_sha256_prefix":"33cecaac74cf6257","entry":"make_red_rgba_from_alpha","repo":"explainableml/flair","repo_kind":"official","path":"src/visualization.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/visualization.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"33cecaac74cf6257"}},{"code_sha256_prefix":"e332856e3c2fc814","entry":"neighbour_exchange","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/loss.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e332856e3c2fc814"}},{"code_sha256_prefix":"5b1fd364afcf3c05","entry":"neighbour_exchange_bidir","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/loss.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5b1fd364afcf3c05"}},{"code_sha256_prefix":"6932ab58022e237c","entry":"parse_args","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/params.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/params.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6932ab58022e237c"}},{"code_sha256_prefix":"25977d0641f6f647","entry":"process_tar","repo":"explainableml/flair","repo_kind":"official","path":"preprocess/presplit_captions.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/preprocess/presplit_captions.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"25977d0641f6f647"}},{"code_sha256_prefix":"dae4304ab834bc31","entry":"random_sample_from_list","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/data.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dae4304ab834bc31"}},{"code_sha256_prefix":"7e3625da2fe10689","entry":"split_caption","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/data.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7e3625da2fe10689"}},{"code_sha256_prefix":"23590b0021929371","entry":"split_caption","repo":"explainableml/flair","repo_kind":"official","path":"preprocess/presplit_captions.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/preprocess/presplit_captions.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"23590b0021929371"}},{"code_sha256_prefix":"61548bf76b531c76","entry":"text_global_pool","repo":"explainableml/flair","repo_kind":"official","path":"src/flair/transformer.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/flair/transformer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"61548bf76b531c76"}},{"code_sha256_prefix":"e22c0b4748cddefb","entry":"trigger_visualization_hook","repo":"ExplainableML/cosmos","repo_kind":"listed","path":"src/seg_eval.py","file_url":"https://github.com/ExplainableML/cosmos/blob/HEAD/src/seg_eval.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e22c0b4748cddefb"}},{"code_sha256_prefix":"5aa6110f46cd2158","entry":"upsample_heatmap_to_size","repo":"explainableml/flair","repo_kind":"official","path":"src/visualization.py","file_url":"https://github.com/explainableml/flair/blob/HEAD/src/visualization.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5aa6110f46cd2158"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}