{"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/mscpt-few-shot-whole-slide-image","title":"MSCPT: Few-shot Whole Slide Image Classification with Multi-scale and Context-focused Prompt Tuning","arxiv_id":"2408.11505","date":"2024-08-21","proceeding":null,"authors":["Minghao Han","Linhao Qu","Dingkang Yang","Xukun Zhang","Xiaoying Wang","Lihua Zhang"],"abstract":"Multiple instance learning (MIL) has become a standard paradigm for weakly supervised classification of whole slide images (WSI). However, this paradigm relies on the use of a large number of labelled WSIs for training. The lack of training data and the presence of rare diseases present significant challenges for these methods. Prompt tuning combined with the pre-trained Vision-Language models (VLMs) is an effective solution to the Few-shot Weakly Supervised WSI classification (FSWC) tasks. Nevertheless, applying prompt tuning methods designed for natural images to WSIs presents three significant challenges: 1) These methods fail to fully leverage the prior knowledge from the VLM's text modality; 2) They overlook the essential multi-scale and contextual information in WSIs, leading to suboptimal results; and 3) They lack exploration of instance aggregation methods. To address these problems, we propose a Multi-Scale and Context-focused Prompt Tuning (MSCPT) method for FSWC tasks. Specifically, MSCPT employs the frozen large language model to generate pathological visual language prior knowledge at multi-scale, guiding hierarchical prompt tuning. Additionally, we design a graph prompt tuning module to learn essential contextual information within WSI, and finally, a non-parametric cross-guided instance aggregation module has been introduced to get the WSI-level features. Based on two VLMs, extensive experiments and visualizations on three datasets demonstrated the powerful performance of our MSCPT.","url_abs":"https://arxiv.org/abs/2408.11505v1","url_pdf":"https://arxiv.org/pdf/2408.11505v1.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":"mscpt-few-shot-whole-slide-image","repo_url":"https://github.com/hanminghao/mscpt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"multiple-instance-learning","task_name":"Multiple Instance Learning"},{"task_slug":"weakly-supervised-classification","task_name":"Weakly Supervised Classification"},{"task_slug":"image-classification","task_name":"image-classification"},{"task_slug":"whole-slide-images","task_name":"whole slide images"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2408.11505","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.11505"}},"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/hanminghao/mscpt","reach":{"status":"ok"}}],"summary":{"ran":2,"unverified":6},"by_repo_kind":{"official":{"samples":8,"ran":2,"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":8,"samples":[{"code_sha256_prefix":"c8ea5e13d55dab48","entry":"get_transforms_ctranspath","repo":"hanminghao/mscpt","repo_kind":"official","path":"plot_heatmap.py","file_url":"https://github.com/hanminghao/mscpt/blob/HEAD/plot_heatmap.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c8ea5e13d55dab48"}},{"code_sha256_prefix":"046182617bffcc33","entry":"tokenize","repo":"hanminghao/mscpt","repo_kind":"official","path":"plot_heatmap.py","file_url":"https://github.com/hanminghao/mscpt/blob/HEAD/plot_heatmap.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"046182617bffcc33"}},{"code_sha256_prefix":"b000f5642bcb508b","entry":"create_model","repo":"hanminghao/mscpt","repo_kind":"official","path":"model/mscpt.py","file_url":"https://github.com/hanminghao/mscpt/blob/HEAD/model/mscpt.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":"b000f5642bcb508b"}},{"code_sha256_prefix":"c9da2b5ee1ea9a52","entry":"load_ctranspath_clip","repo":"hanminghao/mscpt","repo_kind":"official","path":"select_5X_pic.py","file_url":"https://github.com/hanminghao/mscpt/blob/HEAD/select_5X_pic.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":"c9da2b5ee1ea9a52"}},{"code_sha256_prefix":"38d0516eda8ab2da","entry":"load_pretrained_tokenizer","repo":"hanminghao/mscpt","repo_kind":"official","path":"model/mscpt.py","file_url":"https://github.com/hanminghao/mscpt/blob/HEAD/model/mscpt.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":"38d0516eda8ab2da"}},{"code_sha256_prefix":"181d436278a87802","entry":"load_pretrained_tokenizer","repo":"hanminghao/mscpt","repo_kind":"official","path":"plot_heatmap.py","file_url":"https://github.com/hanminghao/mscpt/blob/HEAD/plot_heatmap.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":"181d436278a87802"}},{"code_sha256_prefix":"eb89822d372a593b","entry":"load_pretrained_tokenizer","repo":"hanminghao/mscpt","repo_kind":"official","path":"select_5X_pic.py","file_url":"https://github.com/hanminghao/mscpt/blob/HEAD/select_5X_pic.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":"eb89822d372a593b"}},{"code_sha256_prefix":"7b8b35ae6c093998","entry":"load_pretrained_tokenizer","repo":"hanminghao/mscpt","repo_kind":"official","path":".history/plot_heatmap_20250507134241.py","file_url":"https://github.com/hanminghao/mscpt/blob/HEAD/.history/plot_heatmap_20250507134241.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":"7b8b35ae6c093998"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}