{"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/dynamic-graph-enhanced-contrastive-learning","title":"Dynamic Graph Enhanced Contrastive Learning for Chest X-ray Report Generation","arxiv_id":"2303.10323","date":"2023-03-18","proceeding":"CVPR 2023 1","authors":["Mingjie Li","Bingqian Lin","Zicong Chen","Haokun Lin","Xiaodan Liang","Xiaojun Chang"],"abstract":"Automatic radiology reporting has great clinical potential to relieve radiologists from heavy workloads and improve diagnosis interpretation. Recently, researchers have enhanced data-driven neural networks with medical knowledge graphs to eliminate the severe visual and textual bias in this task. The structures of such graphs are exploited by using the clinical dependencies formed by the disease topic tags via general knowledge and usually do not update during the training process. Consequently, the fixed graphs can not guarantee the most appropriate scope of knowledge and limit the effectiveness. To address the limitation, we propose a knowledge graph with Dynamic structure and nodes to facilitate medical report generation with Contrastive Learning, named DCL. In detail, the fundamental structure of our graph is pre-constructed from general knowledge. Then we explore specific knowledge extracted from the retrieved reports to add additional nodes or redefine their relations in a bottom-up manner. Each image feature is integrated with its very own updated graph before being fed into the decoder module for report generation. Finally, this paper introduces Image-Report Contrastive and Image-Report Matching losses to better represent visual features and textual information. Evaluated on IU-Xray and MIMIC-CXR datasets, our DCL outperforms previous state-of-the-art models on these two benchmarks.","url_abs":"https://arxiv.org/abs/2303.10323v1","url_pdf":"https://arxiv.org/pdf/2303.10323v1.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":"dynamic-graph-enhanced-contrastive-learning","repo_url":"https://github.com/mlii0117/dcl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"general-knowledge","task_name":"General Knowledge"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"medical-report-generation","task_name":"Medical Report Generation"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2303.10323","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.10323"}},"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/mlii0117/dcl","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":6,"ran_fixture":1,"ran":2,"unverified":2},"by_repo_kind":{"official":{"samples":11,"ran":9,"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":0,"samples":[{"code_sha256_prefix":"cf9ffa02a42184af","entry":"whitespace_tokenize","repo":"mlii0117/dcl","repo_kind":"official","path":"models/tokenization_bert.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/models/tokenization_bert.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cf9ffa02a42184af"}},{"code_sha256_prefix":"83045338e170467c","entry":"attention","repo":"mlii0117/dcl","repo_kind":"official","path":"models/tagencoder.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/models/tagencoder.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"83045338e170467c"}},{"code_sha256_prefix":"dabc5c8e7c1ae006","entry":"clones","repo":"mlii0117/dcl","repo_kind":"official","path":"models/tagencoder.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/models/tagencoder.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dabc5c8e7c1ae006"}},{"code_sha256_prefix":"aa81d03f07735ab8","entry":"compute_acc","repo":"mlii0117/dcl","repo_kind":"official","path":"utils.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aa81d03f07735ab8"}},{"code_sha256_prefix":"0bc1f8b3524f6b1b","entry":"compute_loss","repo":"mlii0117/dcl","repo_kind":"official","path":"generation_api/loss.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/generation_api/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0bc1f8b3524f6b1b"}},{"code_sha256_prefix":"ad12a494674d23fb","entry":"compute_n_params","repo":"mlii0117/dcl","repo_kind":"official","path":"utils.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/utils.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ad12a494674d23fb"}},{"code_sha256_prefix":"c6ec173f19f5c34d","entry":"interpolate_pos_embed","repo":"mlii0117/dcl","repo_kind":"official","path":"models/vit.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/models/vit.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c6ec173f19f5c34d"}},{"code_sha256_prefix":"e7fbc7a74a3457c7","entry":"load_vocab","repo":"mlii0117/dcl","repo_kind":"official","path":"models/tokenization_bert.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/models/tokenization_bert.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e7fbc7a74a3457c7"}},{"code_sha256_prefix":"0d760ca65749dc14","entry":"pre_caption","repo":"mlii0117/dcl","repo_kind":"official","path":"blip_original/utils.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/blip_original/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0d760ca65749dc14"}},{"code_sha256_prefix":"771da9d8d8724c6a","entry":"init_tokenizer","repo":"mlii0117/dcl","repo_kind":"official","path":"models/blip.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/models/blip.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"771da9d8d8724c6a"}},{"code_sha256_prefix":"ff8181a95a91647d","entry":"pre_question","repo":"mlii0117/dcl","repo_kind":"official","path":"blip_original/utils.py","file_url":"https://github.com/mlii0117/dcl/blob/HEAD/blip_original/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ff8181a95a91647d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}