{"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/towards-predicting-temporal-changes-in-a","title":"Towards Predicting Temporal Changes in a Patient's Chest X-ray Images based on Electronic Health Records","arxiv_id":"2409.07012","date":"2024-09-11","proceeding":null,"authors":["Daeun Kyung","Junu Kim","Tackeun Kim","Edward Choi"],"abstract":"Chest X-ray (CXR) is an important diagnostic tool widely used in hospitals to assess patient conditions and monitor changes over time. Recently, generative models, specifically diffusion-based models, have shown promise in generating realistic synthetic CXRs. However, these models mainly focus on conditional generation using single-time-point data, i.e., generating CXRs conditioned on their corresponding reports from a specific time. This limits their clinical utility, particularly for capturing temporal changes. To address this limitation, we propose a novel framework, EHRXDiff, which predicts future CXR images by integrating previous CXRs with subsequent medical events, e.g., prescriptions, lab measures, etc. Our framework dynamically tracks and predicts disease progression based on a latent diffusion model, conditioned on the previous CXR image and a history of medical events. We comprehensively evaluate the performance of our framework across three key aspects, including clinical consistency, demographic consistency, and visual realism. Results show that our framework generates high-quality, realistic future images that effectively capture potential temporal changes. This suggests that our framework could be further developed to support clinical decision-making and provide valuable insights for patient monitoring and treatment planning in the medical field. The code is available at https://github.com/dek924/EHRXDiff.","url_abs":"https://arxiv.org/abs/2409.07012v2","url_pdf":"https://arxiv.org/pdf/2409.07012v2.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":"towards-predicting-temporal-changes-in-a","repo_url":"https://github.com/dek924/ehrxdiff","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"diagnostic","task_name":"Diagnostic"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2409.07012","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.07012"}},"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/dek924/ehrxdiff","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":2,"ran":4,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":8,"ran":7,"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":"424012cb37b31172","entry":"default","repo":"dek924/ehrxdiff","repo_kind":"official","path":"EHRXDiff/cheff/ldm/modules/attention.py","file_url":"https://github.com/dek924/ehrxdiff/blob/HEAD/EHRXDiff/cheff/ldm/modules/attention.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"424012cb37b31172"}},{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"dek924/ehrxdiff","repo_kind":"official","path":"EHRXDiff/cheff/ldm/modules/attention.py","file_url":"https://github.com/dek924/ehrxdiff/blob/HEAD/EHRXDiff/cheff/ldm/modules/attention.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"bd88bace5dbeca1d","entry":"get_downsample_conv","repo":"dek924/ehrxdiff","repo_kind":"official","path":"EHRXDiff/cheff/sr/model.py","file_url":"https://github.com/dek924/ehrxdiff/blob/HEAD/EHRXDiff/cheff/sr/model.py","link_basis":"first_harvest_node","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":"bd88bace5dbeca1d"}},{"code_sha256_prefix":"cd6ac0205784d50d","entry":"get_upsample_conv","repo":"dek924/ehrxdiff","repo_kind":"official","path":"EHRXDiff/cheff/sr/model.py","file_url":"https://github.com/dek924/ehrxdiff/blob/HEAD/EHRXDiff/cheff/sr/model.py","link_basis":"first_harvest_node","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":"cd6ac0205784d50d"}},{"code_sha256_prefix":"95fd5b7646d1c068","entry":"load_mimic_cxr_meta","repo":"dek924/ehrxdiff","repo_kind":"official","path":"EHRXDiff/cheff/utils.py","file_url":"https://github.com/dek924/ehrxdiff/blob/HEAD/EHRXDiff/cheff/utils.py","link_basis":"first_harvest_node","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":"95fd5b7646d1c068"}},{"code_sha256_prefix":"05b65cc1f759ab80","entry":"load_tab_h5py_file","repo":"dek924/ehrxdiff","repo_kind":"official","path":"EHRXDiff/cheff/utils.py","file_url":"https://github.com/dek924/ehrxdiff/blob/HEAD/EHRXDiff/cheff/utils.py","link_basis":"first_harvest_node","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":"05b65cc1f759ab80"}},{"code_sha256_prefix":"9a299fe5ae09e407","entry":"uniq","repo":"dek924/ehrxdiff","repo_kind":"official","path":"EHRXDiff/cheff/ldm/modules/attention.py","file_url":"https://github.com/dek924/ehrxdiff/blob/HEAD/EHRXDiff/cheff/ldm/modules/attention.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9a299fe5ae09e407"}},{"code_sha256_prefix":"f63c4618d337ae21","entry":"build_model","repo":"dek924/ehrxdiff","repo_kind":"official","path":"EHRXDiff/cheff/ldm/modules/clip.py","file_url":"https://github.com/dek924/ehrxdiff/blob/HEAD/EHRXDiff/cheff/ldm/modules/clip.py","link_basis":"first_harvest_node","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":"f63c4618d337ae21"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}