{"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/adr-attention-diversification-regularization","title":"AEM: Attention Entropy Maximization for Multiple Instance Learning based Whole Slide Image Classification","arxiv_id":"2406.15303","date":"2024-06-18","proceeding":null,"authors":["Yunlong Zhang","Zhongyi Shui","Yunxuan Sun","Honglin Li","Jingxiong Li","Chenglu Zhu","Lin Yang"],"abstract":"Multiple Instance Learning (MIL) has demonstrated effectiveness in analyzing whole slide images (WSIs), yet it often encounters overfitting challenges in real-world applications, particularly in the form of attention over-concentration. While existing methods to alleviate this issue introduce complex modules or processing steps, such as multiple-stage training and teacher-student distillation, this paper proposes a simple yet effective regularization: Attention Entropy Maximization (AEM). Motivated by our investigation revealing a positive correlation between attention entropy and model performance, AEM incorporates a negative entropy loss for attention values into the standard MIL framework, penalizing overly concentrated attention and encouraging the model to consider a broader range of informative regions in WSIs, potentially improving its generalization capabilities. Compared to existing overfitting mitigation methods, our AEM approach offers advantages of simplicity, efficiency, and versatility. It requires no additional modules or processing steps, involves only one hyperparameter, and demonstrates compatibility with MIL frameworks and techniques. These advantages make AEM particularly attractive for practical applications. We evaluate AEM on three benchmark datasets, demonstrating consistent performance improvements over existing methods. Furthermore, AEM shows high versatility, integrating effectively with four feature extractors, two advanced MIL frameworks, three attention mechanisms, and Subsampling augmentation technique. The source code is available at \\url{https://github.com/dazhangyu123/AEM}.","url_abs":"https://arxiv.org/abs/2406.15303v2","url_pdf":"https://arxiv.org/pdf/2406.15303v2.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":"adr-attention-diversification-regularization","repo_url":"https://github.com/dazhangyu123/adr","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"adr-attention-diversification-regularization","repo_url":"https://github.com/dazhangyu123/aem","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"adr-attention-diversification-regularization","repo_url":"https://github.com/dazhangyu123/acmil","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"multiple-instance-learning","task_name":"Multiple Instance Learning"},{"task_slug":"image-classification","task_name":"image-classification"},{"task_slug":"whole-slide-images","task_name":"whole slide images"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.15303","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.15303"}},"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/dazhangyu123/acmil","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dazhangyu123/adr","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dazhangyu123/aem","reach":{"status":"ok"}}],"summary":{"ran":6,"ran_draft_wrong":2,"unverified":4},"by_repo_kind":{"official":{"samples":12,"ran":8,"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":12,"samples":[{"code_sha256_prefix":"2342504240643c41","entry":"getBorder","repo":"dazhangyu123/adr","repo_kind":"official","path":"wsi_core/AlgorithmUtils.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/wsi_core/AlgorithmUtils.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":"2342504240643c41"}},{"code_sha256_prefix":"101174eba8b3ee1d","entry":"getMask","repo":"dazhangyu123/adr","repo_kind":"official","path":"wsi_core/AlgorithmUtils.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/wsi_core/AlgorithmUtils.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":"101174eba8b3ee1d"}},{"code_sha256_prefix":"3666b7bb4f9ffa54","entry":"get_pretrained_url","repo":"dazhangyu123/adr","repo_kind":"official","path":"models.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3666b7bb4f9ffa54"}},{"code_sha256_prefix":"68bba5a544faaf0c","entry":"pad_img","repo":"dazhangyu123/adr","repo_kind":"official","path":"wsi_core/SlideBase.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/wsi_core/SlideBase.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":"68bba5a544faaf0c"}},{"code_sha256_prefix":"6ca1f4cd53ffd7e6","entry":"patching","repo":"dazhangyu123/adr","repo_kind":"official","path":"Step1_create_patches_fp.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/Step1_create_patches_fp.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"none","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6ca1f4cd53ffd7e6"}},{"code_sha256_prefix":"d631c6718b6f954c","entry":"resnet18","repo":"dazhangyu123/adr","repo_kind":"official","path":"models.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/models.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":"d631c6718b6f954c"}},{"code_sha256_prefix":"f267d2dc21e502aa","entry":"resnet50","repo":"dazhangyu123/adr","repo_kind":"official","path":"models.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/models.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":"f267d2dc21e502aa"}},{"code_sha256_prefix":"a63b7288bd08c89e","entry":"segment","repo":"dazhangyu123/adr","repo_kind":"official","path":"Step1_create_patches_fp.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/Step1_create_patches_fp.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a63b7288bd08c89e"}},{"code_sha256_prefix":"2294c69b1f977ee2","entry":"initialize_df","repo":"dazhangyu123/adr","repo_kind":"official","path":"wsi_core/batch_process_utils.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/wsi_core/batch_process_utils.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":"2294c69b1f977ee2"}},{"code_sha256_prefix":"da36c66c0dc9829f","entry":"isBlackPatch","repo":"dazhangyu123/adr","repo_kind":"official","path":"wsi_core/wsi_utils.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/wsi_core/wsi_utils.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":"da36c66c0dc9829f"}},{"code_sha256_prefix":"9aaa29e4bf4b5c1f","entry":"isBlackPatch_S","repo":"dazhangyu123/adr","repo_kind":"official","path":"wsi_core/wsi_utils.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/wsi_core/wsi_utils.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":"9aaa29e4bf4b5c1f"}},{"code_sha256_prefix":"f8ae8348aecd8800","entry":"isWhitePatch","repo":"dazhangyu123/adr","repo_kind":"official","path":"wsi_core/wsi_utils.py","file_url":"https://github.com/dazhangyu123/adr/blob/HEAD/wsi_core/wsi_utils.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":"f8ae8348aecd8800"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}