A medical electronic medical record missing value collaborative imputation method based on a knowledge graph

By constructing a clinical knowledge graph based on a knowledge graph method and combining it with a multi-task optimization module, the problem of imputation results deviating from the physiological range in the missing value imputation algorithm of medical electronic medical records is solved. This achieves the accuracy and reliability of the imputation results, outputs a complete dataset with confidence intervals, and improves the reliability of medical diagnosis.

CN122177335APending Publication Date: 2026-06-09CHENGDU KNOWLEDGE VISION SCI & TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU KNOWLEDGE VISION SCI & TECH CO LTD
Filing Date
2026-05-09
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing electronic medical record missing value imputation algorithms cannot effectively constrain the imputation results to within normal threshold ranges and physiological correlations, causing the imputation values ​​to deviate from human physiological logic and affecting the accuracy and reliability of medical diagnosis.

Method used

A knowledge graph-based approach was used to construct a clinical knowledge graph. The approach combined R-GCN knowledge encoding, temporal preprocessing and fusion, bidirectional Transformer encoding and multi-task joint optimization modules to generate imputation results through physiological boundaries and covariate constraints. The MC-Dropout module was used to quantify uncertainty and output a complete dataset with confidence intervals.

Benefits of technology

Effectively constraining the interpolation results within the physiological range reduces noise propagation, improves the accuracy and reliability of the interpolation results, provides datasets with confidence intervals for downstream medical decision-making models, and reduces the risk of misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122177335A_ABST
    Figure CN122177335A_ABST
Patent Text Reader

Abstract

This invention relates to the field of medical electronic medical record data processing technology, and discloses a collaborative imputation method for missing values ​​in medical electronic medical records based on knowledge graphs. The method includes: a knowledge graph construction module extracting a lower bound constant and an upper bound constant of the physiological boundary, and a covariate proportion constant; an R-GCN knowledge encoding module generating a knowledge embedding vector; a temporal preprocessing and fusion module generating a knowledge-enhanced input sequence; a bidirectional Transformer encoding module generating an imputation result matrix; a multi-task joint optimization module updating the model parameter matrix; and an MC-Dropout uncertainty quantification module generating a complete dataset with confidence intervals. This invention utilizes the lower bound constant of the physiological boundary, the upper bound constant of the physiological boundary, and the covariate proportion constant in the multi-task joint optimization module to constrain the imputation result matrix and generate a knowledge consistency penalty loss, thus avoiding deviations of the imputation result matrix from the normal range threshold constraint relationship and physiological correlation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical electronic medical record data processing technology, specifically to a collaborative imputation method for missing values ​​in medical electronic medical records based on knowledge graphs. Background Technology

[0002] Healthcare institutions accumulate massive amounts of electronic medical record data during the diagnosis and treatment process. Downstream medical decision-making models need to read complete clinical feature time series when conducting disease early warning and patient status assessment. In actual intensive care or ward observation scenarios, due to factors such as sensor detachment, patient transfer and examination, and differences in the frequency of medical order sampling, the collected multivariate physiological data suffers from data recording gaps. To ensure the data continuity of downstream analysis algorithms, it is necessary to perform imputation operations on the missing data.

[0003] Existing missing value imputation algorithms rely on data-driven approaches and loss fitting mechanisms for numerical prediction. Medical physiological data contains inherent baseline rules and physiological limits. Existing data imputation models, lacking constraints from clinical knowledge rules, unilaterally pursue minimizing reconstruction errors, leading to imputed values ​​deviating from normal threshold constraints and producing calculation results that disregard objective physiological logic. Furthermore, medical laboratory indicators exhibit covariate correlations. Existing numerical prediction models fail to perceive the proportional rules between different feature dimensions, resulting in data logic conflicts in the imputed multidimensional co-variable indicators.

[0004] Clinical feature time series data within electronic medical records are characterized by irregular sampling intervals, and the time interval differences caused by missing data lead to timestamp misalignment. Existing attention models perform indiscriminate computation on missing and valid time steps when aggregating contextual information. The computational noise caused by missing nodes propagates outward, disrupting the feature representation of surrounding valid time step data points. The hidden states extracted by the model contain computational errors, reducing the accuracy of the interpolation matrix output by subsequent fully connected mapping operations.

[0005] Current deep learning imputation models output a single point estimate. Downstream medical decision-making systems, when reading these imputation results, cannot grasp the level of uncertainty behind the imputed value. Without a reference boundary for risk confidence intervals, downstream systems rely solely on a single, definitive imputation value for disease warning analysis, increasing the risk of misjudgment in the medical diagnosis process and affecting the reliability of the final clinical diagnosis.

[0006] Therefore, this invention proposes a collaborative imputation method for missing values ​​in medical electronic medical records based on knowledge graphs to address the shortcomings of existing technologies. Summary of the Invention

[0007] To address the shortcomings of existing technologies, this invention provides a knowledge graph-based collaborative imputation method for missing values ​​in medical electronic medical records, which solves the problems of the imputation result matrix deviating from the normal range threshold constraint relationship and physiological correlation relationship during the collaborative imputation operation of missing values ​​in medical electronic medical records.

[0008] To achieve the above objectives, the present invention provides the following technical solution: This invention provides a collaborative imputation method for missing values ​​in electronic medical records based on knowledge graphs, comprising the following steps: The knowledge graph construction module connects to a relational database to read clinical medical guideline texts, pharmacopoeia texts, medical order data, and physiology textbook texts. It then executes a named entity recognition algorithm to extract medical entities, categorized as disease nodes, symptom nodes, sign nodes, laboratory test indicator nodes, drug nodes, and surgical procedure nodes. Finally, the module extracts the relationships between these medical entities, classifying them as complication relationships, treatment relationships, physiologically related relationships, antagonistic relationships, and normal range threshold constraints. The knowledge graph module aggregates these medical entities into sets of medical entity nodes and assigns the relationships... The system is aggregated into a set of relation edges and a set of relation types. The knowledge graph construction module uses the set of medical entity nodes, the set of relation edges, and the set of relation types to generate a clinical knowledge graph. The knowledge graph construction module parses the normal range threshold constraint relationship and extracts the lower and upper bound constants of the physiological boundary from the text. The knowledge graph construction module parses the physiological related relationships and extracts the covariate proportion constant from the text. The knowledge graph construction module writes the lower and upper bound constants of the physiological boundary into the attribute fields of the laboratory test indicator nodes. The knowledge graph construction module writes the covariate proportion constant into the attribute fields of the relation edge set. The R-GCN knowledge encoding module connects to the in-memory database to read the clinical knowledge graph. It extracts the text names and attribute fields of medical entities within the medical entity node set. The module then calls a pre-trained medical text language model to map the text names and attribute fields into initial dense feature vectors, using these vectors as the target node's hidden state vectors. The module performs message passing and graph convolution aggregation operations along the relation edge set to generate the target node's output hidden state vector. It processes the target node's output hidden state vector to construct a knowledge embedding vector. Finally, the module establishes a key-value pair mapping between the knowledge embedding vector and laboratory test indicator nodes and stores it in the in-memory database for offline caching. The temporal preprocessing and fusion module reads patient clinical feature data within a closed-loop time window to generate a clinical feature time series. It then processes the clinical feature time series to generate a missing data indicator matrix. If observation data records exist in the clinical feature time series, the module assigns a value of 1 to the corresponding element in the missing data indicator matrix; if observation data records are missing, the module assigns a value of 0 to the corresponding element. The module extracts timestamps from adjacent observation points in the clinical feature time series and performs subtraction to calculate the time interval. It converts the time interval into an irregular temporal position code. The module reads the temporal feature vector corresponding to the clinical feature time series. It connects to an in-memory database to retrieve the knowledge embedding vector. Finally, it extracts the temporal feature vector, the irregular temporal position code, and the knowledge embedding vector, performs tensor broadcast copying along the time step dimension, and performs multimodal feature fusion operations along the feature dimension to generate a knowledge-enhanced input sequence. The bidirectional Transformer encoding module receives a knowledge-enhanced input sequence. It performs a linear projection transformation on the sequence to generate a query matrix, a key matrix, and a value matrix. Based on the missing information matrix, it dynamically constructs a mask-aware attention bias matrix. When an element in the missing information matrix is ​​0, it assigns the corresponding position in the mask-aware attention bias matrix as the attention score for the queried key, setting it to a preset negative extreme value. The module extracts the query matrix, key matrix, value matrix, and mask-aware attention bias matrix, performs a multi-head self-attention operation, aggregates the forward and backward contexts within the closed-loop time window, and generates a multi-head self-attention output matrix. It processes the output matrix, performs a feedforward neural network operation, and generates a hidden state sequence. Finally, it inputs the hidden state sequence into a linear regression head and performs a fully connected mapping operation to generate an interpolation result matrix. The multi-task joint optimization module receives the imputation result matrix, reads the clinical feature time series and combines it with the missing mechanism perception strategy to generate a pseudo-missing indicator matrix for numerical occlusion, compares the imputation result matrix with the real clinical feature time series before occlusion to perform error calculation and generate reconstruction loss, reads the lower and upper bounds of the physiological boundary constants and the covariate proportion constant, uses the lower and upper bounds of the physiological boundary constants to constrain the imputation result matrix and calculates the boundary penalty value, uses the covariate proportion constant and the predicted value of the associated feature to establish a numerical multiplication relationship and calculates the absolute value of the residual between the predicted value of the target feature and the multiplication result, and then calculates the two-sided covariate penalty value, aggregates the boundary penalty value and the covariate penalty value to generate the knowledge consistency penalty loss, receives the reconstruction loss and the knowledge consistency penalty loss and performs a weighted summation operation to generate the total loss of the multi-task joint objective function, processes the total loss of the multi-task joint objective function, performs backpropagation operation and updates the model parameter matrix; The MC-Dropout uncertainty quantization module keeps the network deactivation mechanism enabled during the system inference phase. It extracts the feature tensors output by the bidirectional Transformer encoding module, performs random forward sampling operations to generate a set of independently sampled interpolation result matrices, extracts the numerical elements in the interpolation result matrix set, calculates the expected value to generate the prediction mean matrix, statistically calculates the prediction standard deviation along the sampling dimension, and merges the prediction mean matrix and the prediction standard deviation to generate a complete dataset with confidence intervals.

[0009] This invention utilizes an R-GCN knowledge encoding module to process clinical knowledge graphs and generate knowledge embedding vectors. An in-memory database caches these vectors. A temporal preprocessing and fusion module reads the patient's clinical feature time series and generates a missing information matrix and irregular temporal position encodings. Simultaneously, it performs multimodal feature fusion operations to generate a knowledge-enhanced input sequence. This module queries the in-memory database to retrieve the knowledge embedding vectors, avoiding graph node computation and reducing inference latency. A bidirectional Transformer encoding module dynamically constructs a mask-aware attention bias matrix based on the missing information matrix to block the propagation of missing noise. A multi-task joint optimization module calculates the reconstruction loss and knowledge consistency penalty loss, aggregating them to generate the total loss of the multi-task joint objective function. This module calculates the knowledge consistency penalty loss based on multiplication logic to avoid the risk of division-by-zero anomalies at the lower levels and maintain training state balance. It also executes a dynamic weight adjustment strategy to extract the loss exponential change rate and automatically balance the learning rates of each task. An MC-Dropout uncertainty quantification module performs random forward sampling and calculates the predicted mean matrix and predicted standard deviation, ultimately outputting a complete dataset with confidence intervals.

[0010] This invention provides a collaborative imputation method for missing values ​​in electronic medical records based on knowledge graphs. It has the following beneficial effects: 1. This invention uses a multi-task joint optimization module to calculate boundary penalty values ​​by constraining the interpolation result matrix with the lower and upper bound constants of the physiological boundary, and to calculate covariate penalty values ​​by constraining the interpolation result matrix with the covariate proportional constant. The boundary penalty values ​​and covariate penalty values ​​are aggregated to generate knowledge consistency penalty loss. Combined with the reconstruction loss, backpropagation is performed to update the model parameter matrix, thus avoiding deviation of the interpolation result matrix from the normal range threshold constraint relationship and physiological correlation relationship.

[0011] 2. This invention uses a time-series preprocessing and fusion module to process clinical feature time series to generate a missing indicator matrix and an irregular time-series position code. The bidirectional Transformer encoding module dynamically constructs a mask-aware attention bias matrix based on the missing indicator matrix. When the value of an element is zero, the attention score of the corresponding position in the mask-aware attention bias matrix is ​​assigned a preset negative extreme value to block the propagation of missing noise to the outside information, while retaining the calculation path for aggregating context information of other effective time steps.

[0012] 3. This invention keeps the network deactivation mechanism in the active state through the MC-Dropout uncertainty quantization module, extracts feature tensors, performs random forward sampling operations to generate a set of independently sampled interpolation result matrices, counts the numerical elements in the set of interpolation result matrices along the sampling dimension and calculates the predicted standard deviation, calculates the mathematical expectation to generate the predicted mean matrix, and merges the predicted mean matrix and the predicted standard deviation to generate a complete dataset with confidence intervals for downstream medical decision-making models to read and call. Attached Figure Description

[0013] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a system block diagram of the present invention; Figure 3 This is a comparison chart of the loss convergence of the multi-task joint optimization module in a specific application embodiment of the present invention; Figure 4 This is a comparison chart of interpolation results with confidence intervals in a specific application embodiment of the present invention. Detailed Implementation

[0014] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0015] See attached document Figure 1 This invention provides a collaborative imputation method for missing values ​​in medical electronic medical records based on knowledge graphs. The method relies on a server and a graphics processor to run. The server connects to an in-memory database and a relational database. The relational database stores clinical feature time series and clinical knowledge graph data, while the in-memory database caches knowledge embedding vectors. The graphics processor performs relational graph convolutional network aggregation operations and bidirectional Transformer encoder multi-head self-attention operations. The architecture is positioned for offline retrospective analysis scenarios or batch processing scenarios with a set delayed observation window. The server extracts multivariate time series data within the closed-loop time window and performs batch collaborative imputation operations for missing values.

[0016] The collaborative imputation method for missing values ​​in medical electronic medical records is divided into four modules according to the logical processing flow: a knowledge graph construction module, an R-GCN knowledge encoding module, a temporal preprocessing and fusion module, a bidirectional Transformer encoding module, a multi-task joint optimization module, and an MC-Dropout uncertainty quantification module. The knowledge graph construction module extracts medical entities and relationships from the data source and constructs a clinical knowledge graph. The R-GCN knowledge encoding module processes the clinical knowledge graph and generates knowledge embedding vectors. The temporal preprocessing and fusion module reads the patient's clinical feature time series and generates a missing indicator matrix and irregular temporal position encoding, while performing multimodal feature concatenation to generate a knowledge-enhanced input sequence. The bidirectional Transformer encoding module receives the knowledge-enhanced input sequence and combines it with forward and backward contexts to output an imputation result matrix. The multi-task joint optimization module calculates the reconstruction loss and knowledge consistency penalty loss and updates the model weight matrix. The MC-Dropout uncertainty quantification module performs stochastic forward inference and calculates the mean and standard deviation, finally outputting a complete dataset with confidence intervals.

[0017] The server reads clinical feature time series data from a relational database, truncates them according to the closed-loop time window size to generate multidimensional data batches, and the time series preprocessing and fusion module simultaneously retrieves knowledge embedding vectors from the in-memory database to perform concatenation operations. The graphics processing unit (GPU) receives the concatenated data batches and allocates space in the GPU memory to perform tensor multiplication. The multi-task joint optimization module calculates the knowledge consistency loss within the GPU according to the multiplication operation logic to avoid the risk of division by zero at the underlying level and maintain the balance of the training state. After the operation is completed, the server receives the final output complete dataset with confidence intervals and stores it in persistent storage medium for downstream clinical early warning analysis to read and call.

[0018] In a specific embodiment, the knowledge graph construction module connects to a relational database to read clinical medical guideline texts, pharmacopoeia texts, medical order data, and physiology textbook texts. The knowledge graph construction module executes a named entity recognition algorithm to extract medical entities. Medical entities are divided into disease nodes, symptom nodes, sign nodes, laboratory test indicator nodes, drug nodes, and surgical operation nodes. The knowledge graph construction module extracts the relationships between medical entities. These relationships are divided into complication relationships, treatment relationships, physiologically related relationships, antagonistic relationships, and normal range threshold constraint relationships. The knowledge graph construction module aggregates medical entities into a set of medical entity nodes and aggregates relationships into a set of relationship edges and a set of relationship types.

[0019] The knowledge graph construction module generates a directed heterogeneous graph format clinical knowledge graph using a set of medical entity nodes, a set of relation edges, and a set of relation types. The clinical knowledge graph data structure is then converted into a topological graph set formula. ; In the above formula, Represents a clinical knowledge graph; Represents a set of medical entity nodes; Represents the set of relational edges; Represents a set of relation types.

[0020] The knowledge graph construction module parses the normal range threshold constraint relationships and extracts the lower and upper bound constants of physiological boundaries from the text using regular expression-based numerical extraction rules or dependency parsing algorithms. It also parses physiologically related relationships and extracts covariate proportion constants from the text using the aforementioned extraction rules or analysis algorithms. The knowledge graph construction module writes the lower and upper bound constants of physiological boundaries into the attribute fields of the laboratory test indicator nodes, and writes the covariate proportion constants into the attribute fields of the relation edge set. A relational database persistently stores the clinical knowledge graph in tables, while an in-memory database synchronizes the relational database table records to perform data structure caching operations for use by the R-GCN knowledge encoding module and the multi-task joint optimization module.

[0021] Furthermore, the R-GCN knowledge encoding module connects to the in-memory database to read the clinical knowledge graph. The R-GCN knowledge encoding module extracts the text name and attribute fields of medical entities within the medical entity node set. By calling the pre-trained medical text language model, the text name and attribute fields are mapped to an initial dense feature vector, and this dense feature vector is used as the hidden state vector of the target node. The R-GCN knowledge encoding module performs message passing and aggregation operations along the relation edge set.

[0022] ; In the formula, The target node outputs the hidden state vector. Represents a non-linear activation function; Represents a set of relation types; Represents the type of relationship; Represents adjacent nodes; Represents the set of adjacent nodes; Represents the structure normalization constant; Represents the relational weight matrix; Represents the hidden state vector of adjacent nodes; Represents the self-loop weight matrix; This represents the hidden state vector of the target node.

[0023] The R-GCN knowledge encoding module performs graph convolution aggregation operations to generate the target node's output latent state vector. The R-GCN knowledge encoding module processes the target node's output latent state vector to construct a knowledge embedding vector. The R-GCN knowledge encoding module establishes a key-value pair mapping relationship between the knowledge embedding vector and the laboratory test indicator nodes. The in-memory database receives the key-value pair mapping relationship and performs offline caching operations. When the time series preprocessing and fusion module receives the clinical feature time series, it queries the in-memory database to read the knowledge embedding vector, avoiding the graph node calculation process and reducing inference latency.

[0024] Next, the time series preprocessing and fusion module reads the patient's clinical feature data within the closed-loop time window to generate a clinical feature time series. The time series preprocessing and fusion module processes the clinical feature time series and initializes a missing indicator matrix that matches the dimension of the clinical feature time series. If the time series preprocessing and fusion module determines that there are observation data records in the clinical feature time series, it assigns the corresponding element in the missing indicator matrix a value of 1. If the time series preprocessing and fusion module determines that there are no observation data records in the clinical feature time series, it assigns the corresponding element in the missing indicator matrix a value of 0.

[0025] The time series preprocessing and fusion module extracts the timestamps of adjacent observation points in the clinical feature time series, performs subtraction operations to calculate the time interval, and converts the time interval into irregular time series position codes.

[0026] ; ; In the formula, Represents an even-dimensional vector encoding irregular temporal positions; Represents an odd-dimensional vector encoding irregular temporal positions; Represents a time interval; Represents the feature dimension index; This represents the constant of the total dimension of the hidden layer.

[0027] The temporal preprocessing and fusion module reads the temporal feature vectors corresponding to the clinical feature time series. It then connects to an in-memory database to retrieve knowledge embedding vectors. When a feature dimension in the clinical feature time series lacks a corresponding knowledge embedding vector in the in-memory database, the module triggers a degradation protection mechanism, filling the knowledge embedding vector for that dimension with a zero vector or the global average embedding vector for that entity type, ensuring the continuity of tensor dimension alignment and multimodal fusion operations. The module extracts the temporal feature vectors, irregular temporal position codes, and knowledge embedding vectors. Since the knowledge embedding vectors are static vectors without a time dimension, the module performs a tensor broadcast copy operation along the time step dimension to match the time dimension length with the clinical feature time series, generating a copied embedding vector. Subsequently, it performs multimodal feature fusion operations along the feature dimension on the temporal feature vectors, irregular temporal position codes, and copied embedding vectors to generate a knowledge-enhanced input sequence. The temporal preprocessing and fusion module then transmits the knowledge-enhanced input sequence to the bidirectional Transformer encoding module for context encoding operations.

[0028] Subsequently, the bidirectional Transformer encoding module receives the knowledge-enhanced input sequence output by the temporal preprocessing and fusion module. The module performs a linear projection transformation on the knowledge-enhanced input sequence to generate a query matrix, a key matrix, and a value matrix. Based on the current system operating state, the module dynamically constructs a mask-aware attention bias matrix: during model training, it reads the pseudo-missing indicator matrix generated by random occlusion from the multi-task joint optimization module; during system inference, it reads the true missing indicator matrix generated by the temporal preprocessing and fusion module. The bidirectional Transformer encoding module extracts the element values ​​from the corresponding indicator matrix. When an element value is 0, the corresponding position in the mask-aware attention bias matrix is ​​assigned a preset negative extreme value as the attention score corresponding to the queried key, thus blocking the outward propagation of missing noise. Simultaneously, this position is retained as a query path to aggregate context information from other valid time steps. When an element value is 1, the corresponding position in the mask-aware attention bias matrix is ​​assigned the normal attention weight calculation logic.

[0029] The bidirectional Transformer encoding module extracts the query matrix, key matrix, value matrix, and mask-aware attention bias matrix to perform multi-head self-attention operations. The bidirectional Transformer encoding module aggregates the forward and backward contexts within the closed-loop time window and generates the multi-head self-attention output matrix.

[0030] ; In the formula, Represents the multi-head self-attention output matrix; Represents the normalized exponential function; Represents the query matrix; Represents the transpose of the key matrix; Represents the constant dimension of the attention head feature; The square root of the constant representing the feature dimension of the attention head; This represents the mask-aware attention bias matrix; Representative value matrix.

[0031] The bidirectional Transformer encoding module processes the multi-head self-attention output matrix, performs feedforward neural network operations to generate a hidden state sequence, uses the hidden state sequence to generate a feature tensor, and inputs the feature tensor into the linear regression head. The linear regression head performs a fully connected mapping operation to generate an interpolation result matrix, and the bidirectional Transformer encoding module transmits the interpolation result matrix to the multi-task joint optimization module.

[0032] Building upon this, the multi-task joint optimization module receives the imputation result matrix output by the bidirectional Transformer encoding module. It then reads the clinical feature time series, extracts numerical elements from the time series, and combines this with a missing mechanism perception strategy to generate a pseudo-missing indicator matrix for numerical masking. For a completely random missing mechanism, a uniformly distributed random sampling is used to generate the masking mask. For a non-random missing mechanism, the module constructs a bias mask generator, extracting the critical value attributes of laboratory test indicators from the clinical knowledge graph. As the observed value approaches this critical value, the weight of the data point retained as a valid observation in the bias mask generator is amplified with non-linear probability, making the generated pseudo-missing indicator matrix mask distribution more concentrated within the normal value range. This simulates the non-random mechanism of doctors increasing sampling of critical indicators in real clinical scenarios. The multi-task joint optimization module uses the generated pseudo-missing indicator matrix to mask the input and compares the imputation result matrix with the real clinical feature time series before masking to perform error calculations and generate a reconstruction loss.

[0033] The multi-task joint optimization module reads the lower and upper bound constants of the physiological boundary and the covariate proportion constant from the clinical knowledge graph. It then uses these constants to constrain the interpolation result matrix and calculate the boundary penalty value. To avoid the division-by-zero anomaly (ZeroDivisionError) caused by zero feature predictions in graphics processor tensor operations, the module converts the covariate proportion relationship into a residual form. It establishes a numerical multiplication relationship between the covariate proportion constant and the associated feature prediction value, calculates the absolute value of the residual between the target feature prediction value and the multiplication result, and generates a corresponding loss penalty when this absolute value exceeds a preset tolerance limit constant. Finally, it calculates the bilateral covariate penalty value and aggregates the boundary penalty value with the covariate penalty value to generate a knowledge consistency penalty loss.

[0034] ; In the formula, This represents the penalty loss for knowledge consistency; The boundary penalty weight coefficient constant; Represents the time step index; Represents the feature dimension index; The time step in the interpolation result matrix And feature dimensions The corresponding value; Represents the upper bound constant of the physiological boundary; Represents the lower bound constant of the physiological boundary; The constant represents the penalty weight coefficient of the covariate; Represents the index of covariate feature dimensions; Represents the set of edges representing covariate relationships; Represents the proportion constant of covariates; The time step in the interpolation result matrix And feature dimensions The corresponding value; This represents the tolerance limit constant.

[0035] The multi-task joint optimization module receives the reconstruction loss and the knowledge consistency penalty loss and performs a weighted summation operation to generate the total loss of the multi-task joint objective function. The multi-task joint optimization module executes a dynamic weight adjustment strategy, extracts the current scalar value of the reconstruction loss and the current scalar value of the knowledge consistency penalty loss corresponding to the current iteration, and extracts the historical scalar values ​​of the reconstruction loss and the historical scalar values ​​of the knowledge consistency penalty loss corresponding to the previous iteration. It calculates the exponential rate of change of the above two losses between adjacent iterations. The multi-task joint optimization module uses the exponential rate of change of the loss to automatically balance the learning rate of each task and dynamically updates the reconstruction loss balance coefficient and the knowledge consistency penalty loss balance coefficient. The multi-task joint optimization module processes the total loss of the multi-task joint objective function, performs backpropagation operation, and updates the model parameter matrix.

[0036] Finally, the MC-Dropout uncertainty quantization module keeps the network deactivation mechanism enabled during the system inference phase, extracts the feature tensor output by the bidirectional Transformer encoding module, performs random forward sampling, and generates a set of independently sampled interpolation result matrices.

[0037] The MC-Dropout uncertainty quantization module extracts numerical elements from the interpolation result matrix set, and statistically calculates the predicted standard deviation along the sampling dimension.

[0038] ; In the above formula, Represents time step And feature dimensions The corresponding standard deviation of the forecast; Represents a constant number of random forward samples; Represents the sampling batch index; Representing the The time step in the interpolation result matrix output by the next sampling operation And feature dimensions The corresponding numerical value.

[0039] The MC-Dropout uncertainty quantification module calculates the expected value of the numerical elements in the imputation result matrix set to generate the predicted mean matrix. The MC-Dropout uncertainty quantification module uses the predicted mean matrix as the final missing value estimation result. The MC-Dropout uncertainty quantification module merges the predicted mean matrix and the predicted standard deviation to generate a complete dataset with confidence intervals. The complete dataset with confidence intervals is stored in persistent storage medium for downstream medical decision-making models to read and call.

[0040] See attached document Figure 2 This invention provides a knowledge graph-based collaborative imputation system for missing values ​​in medical electronic medical records. The collaborative imputation system for missing values ​​in medical electronic medical records is mapped to a computer program virtual device. The computer program virtual device integrates a knowledge graph construction module, an R-GCN knowledge encoding module, a temporal preprocessing and fusion module, a bidirectional Transformer encoding module, a multi-task joint optimization module, and an MC-Dropout uncertainty quantification module.

[0041] The knowledge graph construction module extracts the set of medical entity nodes and the set of relation edges to generate a clinical knowledge graph. The knowledge graph construction module extracts the lower bound constant of the physiological boundary, the upper bound constant of the physiological boundary, and the covariate ratio constant. The R-GCN knowledge encoding module reads the clinical knowledge graph and performs graph convolution aggregation operation to generate knowledge embedding vectors. The R-GCN knowledge encoding module stores the knowledge embedding vectors in the in-memory database to perform offline caching operations.

[0042] The temporal preprocessing and fusion module reads the clinical feature time series to generate a missing indicator matrix and irregular temporal position encoding. The temporal preprocessing and fusion module retrieves the knowledge embedding vector and performs multimodal feature fusion operation to generate a knowledge-enhanced input sequence. The bidirectional Transformer encoding module receives the knowledge-enhanced input sequence and generates a mask-aware attention bias matrix based on the missing indicator matrix. The bidirectional Transformer encoding module performs multi-head self-attention operation to aggregate forward and backward context to generate an interpolation result matrix.

[0043] The multi-task joint optimization module calculates the reconstruction loss and knowledge consistency penalty loss and aggregates them to generate the total loss of the multi-task joint objective function. The multi-task joint optimization module processes the total loss of the multi-task joint objective function and performs backpropagation to update the model parameter matrix. The MC-Dropout uncertainty quantization module performs random forward sampling to generate a set of interpolation result matrices. The MC-Dropout uncertainty quantization module calculates the predicted mean matrix and the predicted standard deviation and merges them to generate a complete dataset with confidence intervals.

[0044] Furthermore, this invention provides an electronic device that integrates a processor, a memory, a communication network interface, and an internal system bus. The processor, memory, and communication network interface establish a data transmission connection through the internal system bus. The memory stores computer program instruction code, and the processor retrieves the computer program instruction code from the memory and executes the underlying computational logic of a knowledge graph-based collaborative imputation method for missing values ​​in medical electronic medical records.

[0045] This invention provides a computer-readable storage medium that stores a computer program entity. A processor in an electronic device reads and runs the computer program entity recorded in the computer-readable storage medium to complete the data processing steps involved in the knowledge graph-based collaborative imputation method for missing values ​​in medical electronic medical records.

[0046] The processor uses a central processing unit, a graphics processing unit, a field-programmable gate array, or an application-specific integrated circuit computing unit. The computer-readable storage medium uses a read-only memory, a random access memory, a solid-state drive, a flash memory device, or a magnetic data medium. The communication network interface receives timing data requests sent by external devices and transmits the completed dataset with confidence intervals to the external downstream medical decision-making system terminal.

[0047] Specific application examples: To further aid in understanding the specific implementation logic and working principle of the present invention, the following provides a specific application example and experimental verification effect based on the continuous monitoring scenario of acute respiratory distress syndrome patients in the intensive care unit (ICU) of a hospital.

[0048] In this application scenario, ICU monitoring equipment continuously collects multidimensional physiological data from patients. However, due to patient transfers or sensor detachment, irregular data gaps often occur. To accurately reconstruct missing vital signs, the following explains the calculation process by substituting specific physiological parameters into the system's internal algorithm model.

[0049] When the server captures multidimensional physiological data within a closed-loop time window (set to a length of 24 hours), the time series preprocessing and fusion module reads patient data to generate a clinical feature time series. Assuming that in this series, the first... Time and the Data interruption occurred between moments. The module extracted the timestamps of adjacent observation points and performed a subtraction operation to calculate the time interval. Minutes. Set the total dimension of the hidden layer as a constant. For feature dimension indexing The module substitutes the time intervals into the formula to convert them into an even-dimensional vector of irregular temporal position encoding. : ; Subsequently, the temporal preprocessing and fusion module performs multimodal feature fusion operations on the temporal feature vector, the aforementioned irregular temporal position encoding, and the knowledge embedding vector retrieved from the memory database to generate a knowledge-enhanced input sequence.

[0050] After entering the bidirectional Transformer encoding module, for the first... In cases where records are always missing, the system dynamically constructs a mask-aware attention bias matrix based on the missing information matrix (where the element at that position is assigned a value of 0). The module assigns the attention score corresponding to the queried key at that position in the bias matrix. Constant. When extracting the query matrix. Key matrix and value matrix When performing multi-head self-attention calculations, according to the formula: ; Because it contains ,go through After the normalized exponential function is operated on, the corresponding weights collapse to 0, which effectively blocks the outward propagation of missing noise information and finally outputs a clean interpolation result matrix.

[0051] In the multi-task joint optimization module, the system extracts the feature dimension at this moment. The interpolation result of (arterial blood oxygen partial pressure) is shown in the interpolation result matrix as follows: mmHg. The system reads the clinical knowledge graph and extracts the lower bound constant of the physiological boundary for this indicator. and the upper bound constant of the physiological boundary Simultaneously obtain feature dimensions The predicted value of (blood oxygen saturation) at this time. The covariate proportionality constant that links the two and tolerance boundary constant .

[0052] The system substitutes the values ​​of boundary penalties and covariate penalties into the formula, and then generates the knowledge consistency penalty loss: ; Calculate the boundary penalty part: ; Calculate the absolute value residual: Since the absolute value 1 is less than the tolerance limit constant 2.0, the output of the covariate penalty part is 0.

[0053] Set boundary penalty weight coefficient constant Covariate penalty weight coefficient constant .

[0054] The knowledge consistency penalty loss in the current state This penalty will be combined with the reconstruction loss to generate the total loss of the multi-task joint objective function, which will then be used for backpropagation.

[0055] During the system inference phase, the MC-Dropout uncertainty quantization module performs random forward sampling operations, setting a constant number of random forward sampling times. The output values ​​at corresponding positions in the set of independently sampled interpolation result matrices are respectively... , , .

[0056] The module first calculates the expected value of these three independent samples, and generates the point estimate result corresponding to the predicted mean matrix as follows: .

[0057] Then, substitute the values ​​into the formula for calculating the predicted standard deviation: ; The process of calculating the standard deviation is as follows: ; Finally, the system merges the predicted mean matrix 55 with the predicted standard deviation value 1.63 to generate a complete dataset with confidence intervals including the fluctuation confidence boundary for clinical use.

[0058] The conclusions are as follows: Reference Appendix Figure 3 , Figure 3 The solid line represents the trajectory of the total loss of the multi-task joint objective function calculated by the method of this invention, while the dashed line represents the trajectory of the single reconstruction loss of the traditional knowledge-unconstrained method that relies solely on data fitting.

[0059] Depend on Figure 3 It is evident that traditional methods without knowledge constraints are prone to getting trapped in local optima, and the loss can no longer decrease after several iterations. The method of this invention introduces knowledge consistency penalty loss as a physiological rule constraint, which drives an automatic balancing mechanism of the loss exponential rate of change, resulting in faster convergence of the solid curve and a lower overall convergence error than traditional methods, thus ensuring efficient updating of the model parameter matrix.

[0060] Reference Appendix Figure 4 , Figure 4 The solid circles represent the actual observation points of the collected original clinical feature time series, the solid lines represent the lines connecting the predicted mean matrix inferred by the model of this invention, and the solid lines with triangular symbols and the dashed lines together constitute the confidence interval based on the predicted standard deviation value (that is, the solid lines with triangular symbols represent the upper bound of the confidence interval, and the dashed lines represent the lower bound of the confidence interval).

[0061] Depend on Figure 4As can be seen, near the time points with clinical records (e.g., 1-2 hours and 7-8 hours), the model exhibits high determinism, with the upper and lower bounds of the confidence interval curves shrinking to closely approximate the solid mean line. However, in the time blind areas where data is continuously missing (e.g., 3-6 hours), the system successfully detects the risk of data distribution deviation through the MC-Dropout mechanism, and the envelope range is reasonably widened. The final imputation result output by this invention not only smoothly bridges the missing values ​​on the mean curve but also outputs reliable risk interval boundaries, enhancing the safety guidance capability of the complete dataset with confidence intervals for real-world clinical early warning analysis systems.

Claims

1. A collaborative imputation method for missing values ​​in electronic medical records based on knowledge graphs, characterized in that, Includes the following steps: Extract the set of medical entity nodes and the set of relation edges to generate a clinical knowledge graph; The clinical knowledge graph is processed to generate knowledge embedding vectors; Read the patient's clinical feature data to generate a clinical feature time series, process the clinical feature time series to generate a missing indicator matrix, and fuse the knowledge embedding vector with the clinical feature time series to generate a knowledge-enhanced input sequence. The knowledge-enhanced input sequence is processed based on the missing indication matrix to generate a mask-aware attention bias matrix, and the feature tensor and interpolation result matrix are generated by operating on the mask-aware attention bias matrix. The model parameter matrix is ​​updated by comparing the imputation result matrix with the clinical feature time series to generate a reconstruction loss, combining the clinical knowledge graph to generate a knowledge consistency penalty loss, and aggregating the reconstruction loss and the knowledge consistency penalty loss. The feature tensor is processed to generate an interpolation result matrix set. The predicted mean matrix and predicted standard deviation of the interpolation result matrix set are calculated. The predicted mean matrix and predicted standard deviation are then merged to generate a complete dataset with confidence intervals.

2. The method for collaborative imputation of missing values ​​in electronic medical records based on knowledge graphs according to claim 1, characterized in that, The steps for extracting the set of medical entity nodes and the set of relation edges to generate a clinical knowledge graph specifically include: Read clinical medical guidelines, pharmacopoeia texts, medical orders, and physiology textbook texts; The named entity recognition algorithm is executed to extract medical entities from the clinical medical guide text, the pharmacopoeia text, the medical order data, and the physiology textbook text, and to extract the relationships between the medical entities; The medical entities are aggregated into a set of medical entity nodes, and the relationships are aggregated into a set of relationship edges and a set of relationship types; The clinical knowledge graph in a directed heterogeneous graph format is generated using the set of medical entity nodes, the set of relation edges, and the set of relation types.

3. The method for collaborative imputation of missing values ​​in medical electronic medical records based on knowledge graphs according to claim 2, characterized in that, Also includes: Extract normal range threshold constraint relationships and physiological correlation relationships from the aforementioned relationships, and extract laboratory test indicator nodes from the set of medical entity nodes; The normal range threshold constraint relationship is analyzed to generate a lower bound constant and an upper bound constant for the physiological boundary. The physiological correlations were analyzed to generate covariate proportional constants; Write the lower bound constant of the physiological boundary and the upper bound constant of the physiological boundary into the attribute field of the laboratory test index node, and write the covariate proportion constant into the attribute field of the relation edge set; The clinical knowledge graph is persistently stored in a data table created in a relational database.

4. The method for collaborative imputation of missing values ​​in electronic medical records based on knowledge graphs according to claim 2, characterized in that, The specific steps for processing the clinical knowledge graph to generate knowledge embedding vectors include: The system connects to an in-memory database to read the clinical knowledge graph and extracts text names and attribute fields from the medical entities contained in the medical entity node set. The medical text language model is invoked to map the text name and attribute fields to the hidden state vector of the target node; Message passing and graph convolution aggregation operations are performed along the set of relation edges to process the hidden state vector of the target node and generate the output hidden state vector of the target node. The target node's output hidden state vector is processed to construct the knowledge embedding vector; The laboratory testing indicator nodes included in the medical entity node set are identified, a key-value pair mapping relationship is established between the knowledge embedding vector and the laboratory testing indicator nodes, and an offline caching job is performed in the in-memory database.

5. The method for collaborative imputation of missing values ​​in medical electronic medical records based on knowledge graphs according to claim 1, characterized in that, The steps of fusing the knowledge embedding vector with the clinical feature time series to generate the knowledge-enhanced input sequence specifically include: The clinical characteristic time series is generated by reading the patient's clinical characteristic data within the closed-loop time window. Initialize a missing indicator matrix that matches the dimension of the clinical feature time series; when it is determined that there are no observation data records in the clinical feature time series, assign the corresponding element in the missing indicator matrix to 0, thereby obtaining the missing indicator matrix; Calculate the time interval between timestamps of adjacent observation points in the clinical feature time series, and convert the time interval into an irregular temporal position code; The knowledge embedding vector is copied by performing a tensor broadcasting operation along the time step dimension to generate a copied embedding vector. Temporal feature vectors are extracted from the clinical feature time series. The temporal feature vectors, the irregular temporal position encoding, and the copied embedding vector are fused to perform a multimodal feature fusion operation to generate the knowledge-enhanced input sequence.

6. The method for collaborative imputation of missing values ​​in medical electronic medical records based on knowledge graphs according to claim 1, characterized in that, The steps for generating the feature tensor and the interpolation result matrix using the mask-aware attention bias matrix specifically include: Perform a linear projection transformation operation on the knowledge-enhanced input sequence to generate a query matrix, a key matrix, and a value matrix; Extract the element values ​​in the missing indicator matrix. When the element value is 0, assign the corresponding position in the mask-aware attention bias matrix as the attention score corresponding to the key being queried and set it to a preset negative extreme value. Then output the mask-aware attention bias matrix. Extract the query matrix, the key matrix, the value matrix, and the mask-aware attention bias matrix, perform multi-head self-attention operation, aggregate the forward context and backward context, and generate a multi-head self-attention output matrix; The multi-head self-attention output matrix is ​​processed to perform a feedforward neural network operation to generate a hidden state sequence. The hidden state sequence is then used to generate the feature tensor, which is input into a linear regression head to perform a fully connected mapping operation to generate the interpolation result matrix.

7. The method for collaborative imputation of missing values ​​in medical electronic medical records based on knowledge graphs according to claim 1, characterized in that, The steps of comparing the imputation result matrix with the reconstruction loss generated from the clinical feature time series specifically include: Numerical elements within the time series of the clinical features are extracted, and a false missing indication matrix is ​​generated by performing numerical occlusion on the numerical elements in conjunction with a missing mechanism perception strategy. The input is masked using the pseudo-missing indicator matrix, and the imputation result matrix is ​​compared with the clinical feature time series before masking to perform error calculation and generate the reconstruction loss.

8. The method for collaborative imputation of missing values ​​in medical electronic medical records based on knowledge graphs according to claim 3, characterized in that, The steps for generating knowledge consistency penalty loss based on the aforementioned clinical knowledge graph specifically include: The lower bound constant of the physiological boundary, the upper bound constant of the physiological boundary, and the covariate proportion constant are read from the clinical knowledge graph. The boundary penalty value is calculated by constraining the interpolation result matrix using the lower bound constant of the physiological boundary and the upper bound constant of the physiological boundary. The covariate proportion constant is converted into residual form. The predicted values ​​of the associated features and the predicted values ​​of the target features are extracted from the interpolation result matrix. A numerical multiplication relationship is established between the covariate proportion constant and the predicted values ​​of the associated features to generate a multiplication result. The absolute value of the residual between the predicted value of the target features and the multiplication result is calculated. In response to the absolute value of the residual exceeding a preset tolerance limit constant, the penalty value of the two-sided covariates is calculated. The knowledge consistency penalty loss is generated by aggregating the boundary penalty value and the bilateral covariate penalty value.

9. The method for collaborative imputation of missing values ​​in medical electronic medical records based on knowledge graphs according to claim 1, characterized in that, The steps of aggregating the reconstruction loss and the knowledge consistency penalty loss to update the model parameter matrix specifically include: Receive the reconstruction loss and the knowledge consistency penalty loss, perform a weighted summation operation to generate the total loss of the multi-task joint objective function; During the iterative training process of updating the model parameter matrix, the current reconstruction loss scalar value and the current knowledge consistency penalty loss scalar value corresponding to the current iteration round are extracted, and the historical reconstruction loss scalar value and the historical knowledge consistency penalty loss scalar value corresponding to the previous iteration round are extracted. The exponential rate of change of the reconstruction loss and the knowledge consistency penalty loss between adjacent iteration rounds are calculated respectively. The reconstructed loss balance coefficient and the knowledge consistency penalty loss balance coefficient are dynamically updated using the exponential rate of change. The total loss of the multi-task joint objective function is processed by performing backpropagation and updating the model parameter matrix.

10. The method for collaborative imputation of missing values ​​in electronic medical records based on knowledge graphs according to claim 1, characterized in that, The steps of merging the predicted mean matrix and the predicted standard deviation to generate a complete dataset with confidence intervals specifically include: Configure a network deactivation mechanism and keep the network deactivation mechanism enabled. The feature tensor is extracted and random forward sampling is performed under the network deactivation mechanism to generate the set of interpolation result matrices with independent sampling; Extract the numerical elements in the interpolation result matrix set and statistically calculate the predicted standard deviation along the sampling dimension; The expected value of the numerical elements in the set of imputation result matrices is calculated to generate the prediction mean matrix, and the prediction mean matrix is ​​used as the final estimation result of missing value points. The predicted mean matrix and the predicted standard deviation are combined to generate the complete dataset with confidence intervals.

Citation Information

Patent Citations

  • Brain tumor survival prediction method and system based on multi-modal medical knowledge graph

    CN121565447A

  • Breast cancer recurrence risk prediction method and system based on multi-modal data missing interpolation and gene interpretability enhancement

    CN121617637A

  • Low-rank personalized blood pressure estimation method

    CN121667654A

  • Cooperative tumble detection method based on Bayesian cognitive routing and space-time rhythm prior

    CN121963300A