{"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/self-calibrated-tuning-of-vision-language","title":"Self-Calibrated Tuning of Vision-Language Models for Out-of-Distribution Detection","arxiv_id":"2411.03359","date":"2024-11-05","proceeding":null,"authors":["Geng Yu","Jianing Zhu","Jiangchao Yao","Bo Han"],"abstract":"Out-of-distribution (OOD) detection is crucial for deploying reliable machine learning models in open-world applications. Recent advances in CLIP-based OOD detection have shown promising results via regularizing prompt tuning with OOD features extracted from ID data. However, the irrelevant context mined from ID data can be spurious due to the inaccurate foreground-background decomposition, thus limiting the OOD detection performance. In this work, we propose a novel framework, namely, Self-Calibrated Tuning (SCT), to mitigate this problem for effective OOD detection with only the given few-shot ID data. Specifically, SCT introduces modulating factors respectively on the two components of the original learning objective. It adaptively directs the optimization process between the two tasks during training on data with different prediction uncertainty to calibrate the influence of OOD regularization, which is compatible with many prompt tuning based OOD detection methods. Extensive experiments and analyses have been conducted to characterize and demonstrate the effectiveness of the proposed SCT. The code is publicly available.","url_abs":"https://arxiv.org/abs/2411.03359v1","url_pdf":"https://arxiv.org/pdf/2411.03359v1.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":"self-calibrated-tuning-of-vision-language","repo_url":"https://github.com/tmlr-group/sct","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2411.03359","atlas_url":"https://app.syntology.ai/?focus=2411.03359","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.03359"}},"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":"deterministic:regex_extraction","url":"https://github.com/tmlr-group/SCT","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tmlr-group/sct","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":3,"ran_fixture":1,"ran_honours":1,"unverified":8},"by_repo_kind":{"official":{"samples":13,"ran":5,"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":13,"samples":[{"code_sha256_prefix":"98f385d847636a3e","entry":"basic_clean","repo":"tmlr-group/SCT","repo_kind":"official","path":"clip_w_local/simple_tokenizer.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/clip_w_local/simple_tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"98f385d847636a3e"}},{"code_sha256_prefix":"3853ecdb6fc74451","entry":"fpr_and_fdr_at_recall","repo":"tmlr-group/SCT","repo_kind":"official","path":"utils/detection_util.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/utils/detection_util.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3853ecdb6fc74451"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"tmlr-group/SCT","repo_kind":"official","path":"clip_w_local/simple_tokenizer.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/clip_w_local/simple_tokenizer.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":"d919ae32e5e4e616"}},{"code_sha256_prefix":"d4acb3120a027622","entry":"stable_cumsum","repo":"tmlr-group/SCT","repo_kind":"official","path":"utils/detection_util.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/utils/detection_util.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d4acb3120a027622"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"tmlr-group/SCT","repo_kind":"official","path":"clip_w_local/simple_tokenizer.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/clip_w_local/simple_tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9542161e9640b858"}},{"code_sha256_prefix":"dbbf313e1d3a69ba","entry":"build_model","repo":"tmlr-group/SCT","repo_kind":"official","path":"clip_w_local/model.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/clip_w_local/model.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":"dbbf313e1d3a69ba"}},{"code_sha256_prefix":"efa941da0bce2a64","entry":"class_prior","repo":"tmlr-group/SCT","repo_kind":"official","path":"utils/loss_util.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/utils/loss_util.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":"efa941da0bce2a64"}},{"code_sha256_prefix":"80167249a79bbdee","entry":"entropy_select_topk","repo":"tmlr-group/SCT","repo_kind":"official","path":"trainers/sct.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/trainers/sct.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":"80167249a79bbdee"}},{"code_sha256_prefix":"65319c2dbd4ac5e8","entry":"entropy_select_topk","repo":"tmlr-group/SCT","repo_kind":"official","path":"trainers/locoop.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/trainers/locoop.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":"65319c2dbd4ac5e8"}},{"code_sha256_prefix":"ae9af00449c026cb","entry":"generate_compl_labels","repo":"tmlr-group/SCT","repo_kind":"official","path":"utils/loss_util.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/utils/loss_util.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":"ae9af00449c026cb"}},{"code_sha256_prefix":"24570af601666d85","entry":"get_measures","repo":"tmlr-group/SCT","repo_kind":"official","path":"utils/detection_util.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/utils/detection_util.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":"24570af601666d85"}},{"code_sha256_prefix":"fbf8c0143d9c48e3","entry":"load","repo":"tmlr-group/SCT","repo_kind":"official","path":"clip_w_local/clip.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/clip_w_local/clip.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":"fbf8c0143d9c48e3"}},{"code_sha256_prefix":"022975ea1eca0e30","entry":"prepare_train_loaders","repo":"tmlr-group/SCT","repo_kind":"official","path":"utils/loss_util.py","file_url":"https://github.com/tmlr-group/SCT/blob/HEAD/utils/loss_util.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":"022975ea1eca0e30"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}