Papers › Leveraging Cross-Modal Neighbor Representation for Improved CLIP Classification

Leveraging Cross-Modal Neighbor Representation for Improved CLIP Classification

27 Apr 2024CVPR 2024 1arXiv:2404.17753archive 2025-07-28

Chao Yi, Lu Ren, De-Chuan Zhan, Han-Jia Ye

CLIP showcases exceptional cross-modal matching capabilities due to its training on image-text contrastive learning tasks. However, without specific optimization for unimodal scenarios, its performance in single-modality feature extraction might be suboptimal. Despite this, some studies have directly used CLIP's image encoder for tasks like few-shot classification, introducing a misalignment between its pre-training objectives and feature extraction methods. This inconsistency can diminish the quality of the image's feature representation, adversely affecting CLIP's effectiveness in target tasks. In this paper, we view text features as precise neighbors of image features in CLIP's space and present a novel CrOss-moDal nEighbor Representation(CODER) based on the distance structure between images and their neighbor texts. This feature extraction method aligns better with CLIP's pre-training objectives, thereby fully leveraging CLIP's robust cross-modal capabilities. The key to construct a high-quality CODER lies in how to create a vast amount of high-quality and diverse texts to match with images. We introduce the Auto Text Generator(ATG) to automatically generate the required texts in a data-free and training-free manner. We apply CODER to CLIP's zero-shot and few-shot image classification tasks. Experiment results across various datasets and models confirm CODER's effectiveness. Code is available at:https://github.com/YCaigogogo/CVPR24-CODER.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2404.17753")

Code

Syntology Ran 11 of 20 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · our draft was wrong; 9 ran with no contract checked.

By repository: official repository: 20 samples from 1 repository, 11 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ycaigogogo/cvpr24-coder officialmentioned in paperpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

20 samples harvested; 11 ran; 1 honoured the contract we drafted; 9 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · our draft was wrong
9ran
9unverified

Licence: 20 of the 20 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from ycaigogogo/cvpr24-coder. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_abs_path ycaigogogo/cvpr24-coder/datasets/dataset_config.py official repository ran fingerprinted no licence file found · pointer only · cd842675cb581de9 · report
get_ana_templates YCaigogogo/CVPR24-CODER/CODER/CODER.py official repository ran fingerprinted no licence file found · pointer only · a64d39d1a99f8f42 · report
get_att_templates YCaigogogo/CVPR24-CODER/CODER/CODER.py official repository ran fingerprinted no licence file found · pointer only · 979ae65cc828c9e4 · report
get_class_names ycaigogogo/cvpr24-coder/classify_zero_shot.py official repository ran no licence file found · pointer only · 644c2a9c22e5f2f2 · report
get_name_templates YCaigogogo/CVPR24-CODER/CODER/CODER.py official repository ran · our draft was wrong no licence file found · pointer only · 86c82affa2d154f9 · report
get_ovo_templates YCaigogogo/CVPR24-CODER/CODER/CODER.py official repository ran fingerprinted no licence file found · pointer only · 51bee0de7e56c2ea · report
heuristic_classifier ycaigogogo/cvpr24-coder/classify_zero_shot.py official repository ran no licence file found · pointer only · 1d5e24ac93408ca4 · report
load_pickle ycaigogogo/cvpr24-coder/datasets/dataset_class.py official repository ran no licence file found · pointer only · d9847cc2f8495b76 · report
minmax_normalization ycaigogogo/cvpr24-coder/utils.py official repository ran fingerprinted no licence file found · pointer only · d94bc26deebfbac5 · report
pil_loader ycaigogogo/cvpr24-coder/datasets/dataset_class.py official repository ran · honoured contract no licence file found · pointer only · f321f54723433661 · report
update_cfg ycaigogogo/cvpr24-coder/utils.py official repository ran no licence file found · pointer only · 9b9ce4000929d33f · report
CODER YCaigogogo/CVPR24-CODER/CODER/CODER.py official repository unverified no licence file found · pointer only · cdb65597626e1418 · report
build_model ycaigogogo/cvpr24-coder/CLIP/clip/model.py official repository unverified no licence file found · pointer only · 39e6b23b55f376ea · report
cls_acc ycaigogogo/cvpr24-coder/utils.py official repository unverified no licence file found · pointer only · f2a0a5061e7c204e · report
get_cache ycaigogogo/cvpr24-coder/classify_few_shot.py official repository unverified no licence file found · pointer only · 6ee57d74d436ecab · report
get_templates YCaigogogo/CVPR24-CODER/CODER/CODER.py official repository unverified no licence file found · pointer only · 5e8258eccc2a7bfa · report
get_templates ycaigogogo/cvpr24-coder/CODER/template.py official repository unverified no licence file found · pointer only · 669c0f6e8ba13fa3 · report
get_test_feature ycaigogogo/cvpr24-coder/classify_few_shot.py official repository unverified no licence file found · pointer only · 216a738551d825eb · report
get_val_feature ycaigogogo/cvpr24-coder/classify_few_shot.py official repository unverified no licence file found · pointer only · 558e0e421031aff9 · report
modify_top_gap ycaigogogo/cvpr24-coder/classify_zero_shot.py official repository unverified no licence file found · pointer only · 5e6389c00af848a2 · report

Tasks

Contrastive LearningFew-Shot Image ClassificationImage Classificationimage-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Contrastive Learning

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections