Medical data processing method and system based on patient adaptive residual map and two-hop structure enhancement
Patent Information
- Application Number
- CN202611363844.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-10-09
AI Technical Summary
[0005]本发明要解决的技术问题在于,提供一种基于患者自适应残差图与二跳结构增强的医疗数据处理方法及系统,以缓解现有图序列医疗数据处理模型过度依赖全局共享图、难以根据当前就诊上下文调节图传播权重以及对间接结构关联利用不足的问题
[0007]与现有技术相比,本发明至少具有以下有益效果:第一,四向传播门控使代码级图传播能够根据当前就诊上下文进行重标定,从而提高不同患者、不同就诊阶段下诊断代码关系建模的灵活性;第二,残差融合保留全局图传播信息,降低仅依赖自适应传播可能引入的不稳定性;第三,二跳结构增强边不引入额外可训练权重,能够以较低开销补充直接共现图中未显式表示的间接拓扑关系;第四,该方法与就诊级时序建模模块解耦,便于嵌入现有医疗数据处理系统;第五,本发明在不显著增加模型参数量的前提下实现代码级图传播的个体化调整,例如在一种实验实现中参数量增幅小于5%,便于在计算资源受限的医疗信息系统中部署。
Smart Images

Figure CN122889400A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medical artificial intelligence and electronic health record data processing technology, and in particular to electronic health record risk prediction technology based on graph neural networks and patient adaptive mechanisms. Specifically, it relates to a medical data processing method, system, electronic device, and computer-readable storage medium based on patient adaptive residual graphs and two-hop structure enhancement. Background Technology
[0002] Electronic health record data typically includes diagnostic codes, visit times, and disease evolution information from multiple patient visits. Extracting stable disease risk-related characteristics from longitudinal visit sequences is a significant technical challenge in medical data processing and clinical decision support systems.
[0003] Existing graph sequence models can combine the co-occurrence relationships between diagnostic codes with the patient's medical visit sequence. For example, graph sequence models represented by TCEM rely primarily on global co-occurrence relationships for diagnostic code graph propagation. The same diagnostic edge has the same propagation weight in different patients and different medical visits, failing to reflect individual differences in disease relationships. Furthermore, the original co-occurrence graph mainly describes direct co-occurrence relationships, underutilizing indirect topological associations formed through intermediate diagnostic codes.
[0004] Simply adding complex time modeling modules or large-scale graph neural network structures can easily lead to increased model size and computational overhead, making deployment in medical information systems difficult. Therefore, a medical data processing method is needed that can adjust the diagnostic code graph propagation process based on the current medical context with relatively low additional model overhead. Summary of the Invention
[0005] The technical problem to be solved by this invention is to provide a medical data processing method and system based on patient adaptive residual graph and two-hop structure enhancement, so as to alleviate the problems of existing graph sequence medical data processing models that rely too much on the global shared graph, have difficulty adjusting the graph propagation weight according to the current medical context, and do not make sufficient use of indirect structural associations.
[0006] To address the aforementioned technical problems, this invention employs the following technical solution: acquiring desensitized electronic health record data, constructing a patient visit sequence and a global diagnostic code graph; adding low-weight structural enhancement edges based on the two-hop paths in the global diagnostic code graph; generating a current visit context representation based on the current visit diagnostic code, and generating a four-way propagation gating and a residual fusion gating from this context representation; the four-way propagation gating is used to adjust the information contribution of each direction in the patient adaptive graph propagation, and the residual fusion gating is used to control the fusion ratio between the subsequent static graph propagation results and the patient adaptive graph propagation results; performing static graph propagation to obtain static graph propagation results; performing patient adaptive graph propagation regulated by the four-way propagation gating to obtain patient adaptive graph propagation results; using the residual fusion gating to perform weighted fusion of the two types of propagation results, outputting an enhanced diagnostic code representation; inputting the enhanced diagnostic code representation into a visit-level temporal modeling module, which classifies diseases based on the occurrence status of diagnostic codes in adjacent visits, and extracts temporal features using recurrent neural networks and / or attention mechanisms, outputting predicted values related to the risk of the target disease.
[0007] Compared with existing technologies, the present invention has at least the following beneficial effects: First, the four-way propagation gating enables code-level graph propagation to be recalibrated according to the current medical context, thereby improving the flexibility of diagnostic code relationship modeling for different patients and different stages of medical treatment; Second, residual fusion preserves global graph propagation information and reduces the instability that may be introduced by relying solely on adaptive propagation; Third, the two-hop structure enhancement edge does not introduce additional trainable weights and can supplement indirect topological relationships not explicitly represented in the direct co-occurrence graph with low overhead; Fourth, the method is decoupled from the medical treatment-level temporal modeling module, making it easy to embed into existing medical data processing systems; Fifth, the present invention achieves individualized adjustment of code-level graph propagation without significantly increasing the number of model parameters, for example, in one experimental implementation the parameter increase is less than 5%, which is convenient for deployment in medical information systems with limited computing resources. Attached Figure Description
[0008] Figure 1 This is a schematic diagram of the overall process of the medical data processing method in this embodiment of the invention, showing the steps of acquiring electronic health record data, constructing patient visit sequence, constructing global diagnostic code graph, adding two-hop structure enhancement edges, generating current visit context representation, generating four-way propagation gating and residual fusion gating, static graph propagation, patient adaptive graph propagation, residual fusion, and outputting risk-related prediction values.
[0009] Figure 2This is a schematic diagram of the patient adaptive residual graph propagation module in an embodiment of the present invention, showing the data flow relationship between the current diagnosis code set, the current diagnosis context representation, the enhanced global diagnosis code graph, the four-way propagation gating, the static graph propagation path, the patient adaptive graph propagation path, the residual fusion gating, and the enhanced diagnosis code representation.
[0010] Figure 3 This is a schematic diagram of the module structure of the medical data processing system in an embodiment of the present invention. Detailed Implementation
[0011] The present invention will be further described below with reference to embodiments. It should be understood that the embodiments are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention.
[0012] In one embodiment, the electronic device acquires anonymized electronic health record data and constructs a patient-by-patient visit sequence based on hospitalization time. Each visit is represented by a set of diagnostic codes, which are mapped to multi-hot vectors or embedding vectors. The electronic device constructs a global diagnostic code graph using only the co-occurrence relationships of diagnostic codes from historical training data to avoid information leakage caused by the participation of validation or test data in graph construction.
[0013] In this article, a neighbor node refers to a diagnostic code node in the global diagnostic code graph that is directly connected to a diagnostic node appearing in the current consultation but does not appear in the current consultation.
[0014] In the two-hop structure enhancement stage, let A be the adjacency matrix of the global diagnostic code graph. The electronic device retrieves two-hop paths based on the second-order topological relationship of A. If there is no direct edge between two diagnostic codes and they can be connected through an intermediate diagnostic code, a low-weight two-hop structure enhancement edge is added between the two diagnostic codes. The two-hop structure enhancement edge is calculated based solely on the co-occurrence relationship of diagnostic codes in historical training data, without introducing external knowledge or test data information. In an optional implementation, the weight of the two-hop structure enhancement edge can be configured to be lower than the average weight of the original direct edges to reflect that indirect associations are weaker than direct co-occurrence associations; in specific experiments or deployment scenarios, the appropriate value can be selected based on the risk ranking effect on the validation data or the system stability requirements. This two-hop structure enhancement edge originates from the statistical topological relationship in the training data, does not represent medical causal relationships, and does not replace external medical ontology or hierarchical knowledge.
[0015] During the patient adaptive graph propagation phase, the electronic device performs mean pooling on the embedded representation of the diagnostic code in the current consultation, and then obtains the current consultation context representation through linear projection and nonlinear activation. Subsequently, a four-way propagation gating is generated based on the current consultation context representation. The four-way propagation gating includes gating weights corresponding to four propagation directions: diagnostic node to diagnostic node, neighbor node to diagnostic node, neighbor node to neighbor node, and diagnostic node to neighbor node, used to adjust the information contribution of different propagation directions. In an optional implementation, the nonlinear activation function can be a hyperbolic tangent function, a sigmoid function, or other activation functions that can introduce nonlinear transformations.
[0016] During the residual fusion phase, the electronic device performs static graph propagation based on the enhanced global diagnostic code graph and patient adaptive graph propagation regulated by a four-way propagation gate in parallel. The residual fusion gate is generated based on the current visit context representation and is used to control the fusion ratio between the static graph propagation result and the patient adaptive graph propagation result. In an optional implementation, the residual fusion gate can be generated using a sigmoid function or other nonlinear activation functions that can constrain the output within a preset range. The enhanced diagnostic code representation obtained through residual fusion simultaneously retains both global graph propagation information and adaptive propagation information regulated by the current visit context.
[0017] During the time-series modeling stage at the patient visit level, the electronic device inputs an enhanced diagnostic code representation into the time-series modeling module. This module classifies diseases based on the occurrence of diagnostic codes in adjacent visits and extracts temporal features using recurrent neural networks and / or attention mechanisms, ultimately outputting a predicted value related to the risk of the target disease. In one optional implementation, the time-series modeling module can classify diseases into chronic diseases, newly diagnosed diseases, and irrelevant diseases; it uses gated recurrent units for time-series modeling of chronic diseases and attention mechanisms for feature aggregation of newly diagnosed and irrelevant diseases. This predicted value is used for data layering, data classification, or risk alerts in the medical information system and does not directly constitute a disease diagnosis conclusion.
[0018] Application Mode Selection Implementation Examples In one optional embodiment, the method can select different processing modes according to the application objectives of the medical information system. In the initial screening mode, both the static graph propagation results and the patient adaptive graph propagation results are retained, and an enhanced diagnostic code representation is generated through residual fusion gating to obtain a more stable overall risk ranking. In the high-risk early warning mode, the output of the residual fusion gating can be set to 1, so that the enhanced diagnostic code representation is entirely determined by the patient adaptive graph propagation results, equivalent to skipping the fusion of the static graph propagation results; alternatively, the static graph propagation step can be directly omitted, and only the patient adaptive graph propagation is performed. Both of these implementations are optional deployments of the present invention. The above mode selection is an optional application method during system deployment and does not change the basic flow of the aforementioned medical data processing method.
[0019] In one system embodiment, the medical data processing system may include a data preprocessing module, a graph structure enhancement module, a static graph propagation module, a patient adaptive residual graph module, and a data prediction module. The data preprocessing module acquires anonymized electronic health record data, constructs patient visit sequences, and generates a global diagnostic code graph based on historical training data. The graph structure enhancement module retrieves two-hop path relationships in the global diagnostic code graph and generates enhanced two-hop structure edges to obtain an enhanced global diagnostic code graph. The static graph propagation module performs static graph propagation on the enhanced global diagnostic code graph to obtain the static graph propagation result. The patient adaptive residual graph module generates a current visit context representation based on the current visit diagnostic code, further generating a four-way propagation gating and a residual fusion gating; this module also performs patient adaptive graph propagation based on the four-way propagation gating to obtain the patient adaptive graph propagation result, and uses the residual fusion gating to perform a weighted fusion of the static graph propagation result and the patient adaptive graph propagation result to output an enhanced diagnostic code representation. The data prediction module receives the enhanced diagnostic code representation, performs visit-level temporal modeling, and outputs predicted values related to the risk of the target disease.
[0020] In one device embodiment, the method can be executed by an electronic device including a processor and a memory. The memory stores a computer program, and when the processor runs the computer program, it can implement the steps in the above-described medical data processing method, such as data acquisition, graph structure enhancement, current medical context generation, four-way propagation gating, residual fusion, medical visit-level time-series modeling, and risk-related prediction numerical output. In one storage medium embodiment, a computer-readable storage medium stores a computer program, which, when executed by a processor, can also implement the above-described method flow.
[0021] To verify the feasibility of this invention, experiments were conducted on a publicly available electronic health record dataset. In the risk prediction task on this dataset, the accuracy of risk ranking was significantly improved using the method of this invention; for example, in a certain exemplary task, the accuracy improved from approximately 0.85 to approximately 0.87, with the number of model parameters increasing by less than 5%. In-frame ablation experiments showed that the patient adaptive graph propagation module is the main source of performance improvement, and the two-hop structure enhancement edges provide a lightweight supplement without introducing additional trainable weights. The above experimental results are intended to illustrate that the technical solution of this invention can produce positive data processing effects and do not imply that the method directly provides a clinical diagnostic conclusion.
Claims
1. A medical data processing method based on patient adaptive residual graph and two-hop structure enhancement, characterized in that, The method is executed by an electronic device and includes the following steps: S1, acquiring desensitized electronic health record data, constructing a patient visit sequence according to the patient's hospitalization time, extracting diagnostic codes from the visit sequence, and constructing a global diagnostic code graph based solely on the co-occurrence relationship of diagnostic codes in historical training data; S2, retrieving two-hop path relationships in the global diagnostic code graph. If there is no direct edge between two diagnostic codes and they can be connected through an intermediate diagnostic code, then adding a two-hop structure enhancement edge with a preset low weight between the two diagnostic codes to obtain an enhanced global diagnostic code graph; the two-hop structure enhancement edge calculates the two-hop path solely based on the co-occurrence relationship of diagnostic codes in historical training data, without introducing external knowledge or test data information; S3, for the set of diagnostic codes in the patient's current visit, acquiring the diagnostic code embedding representation, generating a current visit context representation based on the diagnostic code embedding representation, and generating a four-way propagation gating and a residual fusion gating based on the current visit context representation; the four-way propagation gating is used to adjust the patient's adaptive graph propagation... Information contributions from each direction; the residual fusion gating is used to control the fusion ratio of subsequent static graph propagation results and patient adaptive graph propagation results; the four-way propagation gating includes gating weights corresponding to four propagation directions: diagnostic node to diagnostic node, neighbor node to diagnostic node, neighbor node to neighbor node, and diagnostic node to neighbor node; S4, static graph propagation is performed on the enhanced global diagnostic code graph to obtain the static graph propagation result; patient adaptive graph propagation is performed based on the four-way propagation gating to obtain the patient adaptive graph propagation result; the residual fusion gating is used to perform weighted fusion of the static graph propagation result and the patient adaptive graph propagation result to obtain the enhanced diagnostic code representation; S5, the enhanced diagnostic code representation is input into the visit-level temporal modeling module, which classifies diseases according to the occurrence status of diagnostic codes in adjacent visits, and uses recurrent neural networks and / or attention mechanisms to extract temporal features, outputting predicted values related to the risk of the target disease, which are used for data layering, data classification, or risk warning in the medical information system.
2. The method according to claim 1, characterized in that, The weights of the two-hop structure-enhanced edges are configured to be lower than the average weights of the original direct edges to reflect the weak priors of indirect associations.
3. The method according to claim 1, characterized in that, The current medical context representation is obtained by performing mean pooling, linear projection, and nonlinear activation on the embedded representation of the diagnostic code in the current medical visit.
4. The method according to claim 1, characterized in that, The four-way propagation gating is represented based on the current medical context and generated using a non-linear activation function. The four-way propagation gating includes gating weights corresponding to four propagation directions: diagnostic node to diagnostic node, neighbor node to diagnostic node, neighbor node to neighbor node, and diagnostic node to neighbor node.
5. The method according to claim 1, characterized in that, The residual fusion gating is generated based on the current medical context and using a nonlinear activation function. The output of the residual fusion gating is used to control the fusion ratio between the patient adaptive graph propagation result and the static graph propagation result.
6. The method according to claim 1, characterized in that, In step S5, the visit-level temporal modeling module classifies diseases into chronic diseases, newly developed diseases, and irrelevant diseases based on the occurrence status of diagnostic codes in adjacent visits. For chronic diseases, a gated recurrent unit is used for temporal modeling, and for newly developed diseases and irrelevant diseases, an attention mechanism is used for feature aggregation.
7. The method according to claim 1, characterized in that, The global diagnostic code graph is constructed based solely on historical training data; validation and test data are not included in its construction.
8. A medical data processing system based on patient adaptive residual graph and two-hop structure enhancement, characterized in that, include: The data preprocessing module is used to acquire electronic health record data, construct patient visit sequences, and build a global diagnostic code graph. The graph structure enhancement module is used to generate two-hop structure enhancement edges based on two-hop path relationships and obtain the enhanced global diagnostic code graph. The static graph propagation module is used to perform static graph propagation on the enhanced global diagnostic code graph to obtain the static graph propagation result; the patient adaptive residual graph module is used to generate the current medical context representation, the four-way propagation gating and the residual fusion gating, and to perform patient adaptive graph propagation based on the four-way propagation gating to obtain the patient adaptive graph propagation result. The residual fusion gating is then used to perform weighted fusion of the static graph propagation result and the patient adaptive graph propagation result to output the enhanced diagnostic code representation. The data prediction module is used to perform time-series modeling at the visit level based on the enhanced diagnostic code representation and output predicted values related to the risk of the target disease.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 7.
10. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.