A method for constructing an interpretable disease risk prediction model and a disease risk prediction device
By decomposing electronic medical record data into diagnostic codes and medical examination data, and using deep learning and attention mechanisms to build an interpretable disease risk prediction model, the problems of single data input and lack of interpretability are solved, and a disease risk prediction model with high accuracy and interpretability is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV OF TECH
- Filing Date
- 2022-10-21
- Publication Date
- 2026-07-31
AI Technical Summary
Existing deep learning-based disease risk prediction models suffer from single data input and lack of interpretability, making it difficult to effectively utilize multiple types of electronic medical record data and provide credible predictive reasons.
By employing deep learning models and attention mechanisms, electronic medical record data is decomposed into diagnostic code data and medical examination data, which are then represented and learned separately. This process constructs learning sub-models for diagnostic code data and medical examination data, and the combined outputs are used for disease risk prediction and interpretation.
While ensuring prediction accuracy, the model's tolerance for missing data is improved, and the ability to interpret prediction results is enhanced, thereby increasing the model's interpretability.
Smart Images

Figure CN115579141B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of smart healthcare and machine learning technology, specifically relating to a method for constructing an interpretable disease risk prediction model and a disease risk prediction device. Background Technology
[0002] In recent years, electronic medical record (EMR) systems have been widely used to record patients' healthcare information. With the development of artificial intelligence (AI) technology, the accumulation of this EMR data (e.g., medical examination results, medical diagnostic codes) has driven the development of disease risk prediction methods. Disease risk prediction involves analyzing and mining big data from EMRs to build disease risk prediction models, enabling early prediction of potential disease risks and development trends. These methods can assist doctors in more accurately assessing patients' physical conditions, thereby selecting more effective treatment plans to prevent and control diseases.
[0003] Due to the high complexity and rich semantic content of electronic medical record (EMR) data, deep learning techniques with the ability to automatically learn features have achieved good performance in EMR-based disease risk prediction. However, existing deep learning-based disease risk prediction methods have the following limitations:
[0004] (1) Most existing methods use only a single type of electronic medical record data as model input. For example, they use only diagnostic code data, only medical examination data, or only medical text data as model input. This is because it is difficult to process different types of electronic medical record data in a single model. However, different types of electronic medical record data are complementary, and collaborative processing can effectively improve the predictive ability of the model.
[0005] (2) Deep learning models are black-box systems, lacking interpretability; they can only provide prediction results but not the reasons behind them. However, interpretability is crucial for disease risk prediction systems. For example, when a disease risk prediction system determines that a patient is at risk of developing a certain disease, doctors usually need to know exactly which risk factors or test data the model based its judgment on in order to provide a reliable diagnosis and treatment plan. If a model is difficult to interpret, then no matter how accurate its results are, it will be difficult to convince patients and doctors. Summary of the Invention
[0006] One of the objectives of this invention is to provide a method for constructing an interpretable disease risk prediction model. This method employs a deep learning model and an attention mechanism to ensure the accuracy of the model's predictions while gaining the ability to interpret the prediction results, thereby constructing an interpretable disease risk prediction model.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A method for constructing an explainable disease risk prediction model, the method comprising:
[0009] The user's electronic medical record data is decomposed into diagnostic code data and medical examination data, and the diagnostic code data and medical examination data are characterized and used as training samples.
[0010] The training samples are input into the interpretable disease risk prediction model to obtain the risk prediction results. The risk prediction results are compared with the actual results. The interpretable disease risk prediction model is optimized based on the comparison results to complete the construction of the interpretable disease risk prediction model.
[0011] The interpretable disease risk prediction model includes a diagnostic code data learning sub-model, a medical examination data learning sub-model, and a risk prediction and interpretation sub-model. The diagnostic code data learning sub-model learns diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting. The medical examination data learning sub-model learns medical examination data through feature extraction, self-attention mechanism, and feature attention weighting. The risk prediction and interpretation sub-model fuses the outputs of the diagnostic code data learning sub-model and the medical examination data learning sub-model to predict disease risk and obtain risk prediction results, and then interprets the risk prediction results.
[0012] Several alternative methods are provided below, but they are not intended as additional limitations on the overall solution above. They are merely further additions or optimizations. Provided there are no technical or logical contradictions, each alternative method can be combined individually with respect to the overall solution above, or multiple alternative methods can be combined with each other.
[0013] Preferably, the step of decomposing the user's electronic medical record data into diagnostic code data and medical examination data, and then characterizing the diagnostic code data and medical examination data as training samples, includes:
[0014] Take user p's electronic medical record data as a medical treatment sequence D = <V1,V2,…,V N >, where V k Let V represent the medical data of user p's kth medical visit, where 1 ≤ k ≤ N, and the medical data V k ={CD k ,TD k}, where CD k and TD k These are the diagnostic code data and medical examination data for user p's kth medical visit, respectively. in Let i be the diagnosis code for user p's k-th medical visit, 1≤i≤M, and let M be the medical examination data. in Let J be the value of the j-th type of medical examination during user p's k-th visit, where 1 ≤ j ≤ L;
[0015] Diagnostic code data representation: Taking the set containing all types of diagnostic codes as set C, then each diagnostic code... Represented as a |C|-dimensional one-hot vector, for CD k If the number of diagnostic codes contained is less than M, then pseudo-diagnostic codes are added to the end; if the number of diagnostic codes contained is more than M, then the redundant diagnostic codes at the end are deleted. All diagnostic code data of user p is represented as a tensor CT of size N×M×|C|.
[0016] Medical examination data representation: For TD k It is represented as an L-dimensional vector tv k TV k [j] represents the value of the j-th type of medical examination. If no j-th type of medical examination is performed, then tv k [j] = 0, and all medical examination data of user p are represented as a matrix TT of size N×L.
[0017] Preferably, the diagnostic code data learning sub-model learns the diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting, including:
[0018] Diagnostic code embedding: Input is tensor CT, including CD1, CD2, ..., CD N It employs feature embedding technology based on multilayer perceptrons to analyze each diagnostic code. Will Transform a |C|-dimensional, sparse one-hot vector into a d-dimensional, dense embedding vector. but It can be represented as an M×d-dimensional embedding matrix
[0019] Diagnostic code attention weighting: First, for each CD k Calculate each diagnostic code Attention weights Then, based on attention weights CD k The CD is obtained by averaging the attention-weighted embedding vectors corresponding to all diagnostic codes. k The representation vector g k ;
[0020] Recurrent network: This refers to the diagnostic code data CD1, CD2, ..., CD... NThe corresponding representation vectors g1, g2, ..., g N Inputting these vectors sequentially into an LSTM network yields N hidden vectors h1, h2, ..., h... N ;
[0021] Diagnostic code data attention weighting: First, calculate the CD for each diagnostic code data. k Attention weight β k Then, based on the attention weight β k The latent vectors corresponding to all diagnostic code data are averaged by attention weighting to obtain the representation vector x of user p.
[0022] Preferably, the medical examination data learning sub-model learns from the medical examination data through feature extraction, self-attention mechanism, and feature attention weighting, including:
[0023] Feature extraction: The input is a matrix TT, which is first decomposed into L N-dimensional vectors fv. j fv j [k] represents the value of the j-th type of medical examination in the k-th visit. Then, the characteristics of each type of medical examination are calculated, i.e., for each fv j Calculate five features for all values: mean, variance, latest value, maximum value, and minimum value. Normalize all features to form a 5-dimensional feature vector, denoted as f. j Then, by performing feature extraction on the entire TT, L feature vectors f1, f2, ..., f3 are obtained. L ;
[0024] Self-attention mechanism: First, calculate each pair of feature vectors f j and f q Self-attention weight δ jq Then, based on the self-attention weight δ jq Calculate the augmented semantic vector u for each feature vector j ;
[0025] Feature attention weighting: First, calculate the enhanced semantic vector u for each feature vector. j Attention weight σ j Then, based on the attention weight σ j The enhanced semantic vectors of all feature vectors are averaged by attention weighting to obtain the representation vector y of user p.
[0026] Preferably, the risk prediction and interpretation sub-model integrates the outputs of the diagnostic code data learning sub-model and the medical examination data learning sub-model to predict disease risk, and then interprets the risk prediction results, including:
[0027] Risk prediction: Take the representation vector x of user p output by the diagnostic code data learning sub-model and the representation vector y of user p output by the medical examination data learning sub-model, concatenate the representation vector x and y of user p to obtain the representation vector z, and then use a Sigmoid layer as a classifier on the representation vector z to output the risk prediction result, which is either risky or no risk.
[0028] Prediction Interpretation: If the risk prediction result is risky, then calculate the i-th diagnosis code for user p's k-th medical visit. weight And calculate the weight w of the j-th type of medical examination for user p. j The system outputs the diagnostic codes and medical examination results with the highest weights as an interpretation of the risk prediction results.
[0029] The method for constructing an interpretable disease risk prediction model provided by this invention has the following advantages compared with the prior art: (1) It adopts a deep learning model and attention mechanism to obtain the ability to interpret the prediction results while ensuring the accuracy of the model prediction. (2) It performs parallel learning on diagnostic code data and medical examination data to improve the model's tolerance to missing data. (3) It performs hierarchical learning on diagnostic code data and feature learning on medical examination data to improve the model's understanding of data and its ability to interpret results.
[0030] The second objective of this invention is to provide a disease risk prediction device that improves the accuracy and interpretability of disease risk prediction.
[0031] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0032] A disease risk prediction device includes: a data modeling module and an interpretable disease risk prediction module. The interpretable disease risk prediction module further includes a diagnostic code data learning submodule, a medical examination data learning submodule, and a risk prediction and interpretation submodule, wherein:
[0033] The data modeling module is used to decompose the user's electronic medical record data into diagnostic code data and medical examination data, and to characterize the diagnostic code data and medical examination data.
[0034] The diagnostic code data learning submodule is used to learn diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting.
[0035] The medical examination data learning submodule is used to learn medical examination data through feature extraction, self-attention mechanism and feature attention weighting.
[0036] The risk prediction and interpretation submodule is used to integrate the outputs of the diagnostic code data learning submodule and the medical examination data learning submodule to predict disease risk, obtain risk prediction results, and interpret the risk prediction results.
[0037] Preferably, the data modeling module decomposes the user's electronic medical record data into diagnostic code data and medical examination data, and represents the diagnostic code data and medical examination data by performing the following operations:
[0038] Take user p's electronic medical record data as a medical treatment sequence D = <V1,V2,…,V N >, where V k Let V represent the medical data of user p's kth medical visit, where 1 ≤ k ≤ N, and the medical data V k ={CD k ,TD k}, where CD k and TD k These are the diagnostic code data and medical examination data for user p's kth medical visit, respectively. in Let i be the diagnosis code for user p's k-th medical visit, 1≤i≤M, and let M be the medical examination data. in Let J be the value of the j-th type of medical examination during user p's k-th visit, where 1 ≤ j ≤ L;
[0039] Diagnostic code data representation: Taking the set containing all types of diagnostic codes as set C, then each diagnostic code... Represented as a |C|-dimensional one-hot vector, for CD k If the number of diagnostic codes contained is less than M, then pseudo-diagnostic codes are added to the end; if the number of diagnostic codes contained is more than M, then the redundant diagnostic codes at the end are deleted. All diagnostic code data of user p is represented as a tensor CT of size N×M×|C|.
[0040] Medical examination data representation: For TD k It is represented as an L-dimensional vector tv k TV k [j] represents the value of the j-th type of medical examination. If no j-th type of medical examination is performed, then tv k [j] = 0, and all medical examination data of user p are represented as a matrix TT of size N×L.
[0041] Preferably, the diagnostic code data learning submodule learns the diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting, performing the following operations:
[0042] Diagnostic code embedding: Input is tensor CT, including CD1, CD2, ..., CD N It employs feature embedding technology based on multilayer perceptrons to analyze each diagnostic code. Will Transform a |C|-dimensional, sparse one-hot vector into a d-dimensional, dense embedding vector. but It can be represented as an M×d-dimensional embedding matrix
[0043] Diagnostic code attention weighting: First, for each CD k Calculate each diagnostic code Attention weights Then, based on attention weights CD k The CD is obtained by averaging the attention-weighted embedding vectors corresponding to all diagnostic codes. k The representation vector g k ;
[0044] Recurrent network: This refers to the diagnostic code data CD1, CD2, ..., CD... N The corresponding representation vectors g1, g2, ..., g N Inputting these vectors sequentially into an LSTM network yields N hidden vectors h1, h2, ..., h... N ;
[0045] Diagnostic code data attention weighting: First, calculate the CD for each diagnostic code data. k Attention weight β k Then, based on the attention weight β k The latent vectors corresponding to all diagnostic code data are averaged by attention weighting to obtain the representation vector x of user p.
[0046] Preferably, the medical examination data learning submodule learns the medical examination data through feature extraction, self-attention mechanism, and feature attention weighting, and performs the following operations:
[0047] Feature extraction: The input is a matrix TT, which is first decomposed into L N-dimensional vectors fv. j fv j [k] represents the value of the j-th type of medical examination in the k-th visit. Then, the characteristics of each type of medical examination are calculated, i.e., for each fv j Calculate five features for all values: mean, variance, latest value, maximum value, and minimum value. Normalize all features to form a 5-dimensional feature vector, denoted as f. jThen, by performing feature extraction on the entire TT, L feature vectors f1, f2, ..., f3 are obtained. L ;
[0048] Self-attention mechanism: First, calculate each pair of feature vectors f j and f q Self-attention weight δ jq Then, based on the self-attention weight δ jq Calculate the augmented semantic vector u for each feature vector j ;
[0049] Feature attention weighting: First, calculate the enhanced semantic vector u for each feature vector. j Attention weight σ j Then, based on the attention weight σ j The enhanced semantic vectors of all feature vectors are averaged by attention weighting to obtain the representation vector y of user p.
[0050] Preferably, the risk prediction and interpretation submodule integrates the outputs of the diagnostic code data learning submodule and the medical examination data learning submodule to predict disease risk, obtains risk prediction results, and interprets the risk prediction results by performing the following operations:
[0051] Risk prediction: Take the representation vector x of user p output by the diagnostic code data learning sub-model and the representation vector y of user p output by the medical examination data learning sub-model, concatenate the representation vector x and y of user p to obtain the representation vector z, and then use a Sigmoid layer as a classifier on the representation vector z to output the risk prediction result, which is either risky or no risk.
[0052] Prediction Interpretation: If the risk prediction result is risky, then calculate the i-th diagnosis code for user p's k-th medical visit. weight And calculate the weight w of the j-th type of medical examination for user p. j The system outputs the diagnostic codes and medical examination results with the highest weights as an interpretation of the risk prediction results.
[0053] The disease risk prediction device provided by this invention has the following advantages compared with the prior art: (1) It adopts a deep learning model and attention mechanism to ensure the accuracy of model prediction while obtaining the ability to interpret the prediction results. (2) It performs parallel learning on diagnostic code data and medical examination data to improve the model's tolerance to missing data. (3) It performs hierarchical learning on diagnostic code data and feature learning on medical examination data to improve the model's understanding of data and its ability to interpret results. Attached Figure Description
[0054] Figure 1 This is a flowchart of the method for constructing an interpretable disease risk prediction model according to the present invention;
[0055] Figure 2 This is a schematic diagram of the user electronic medical record data structure of the present invention;
[0056] Figure 3 This is a flowchart illustrating the specific learning process of the diagnostic code data learning sub-model of the present invention.
[0057] Figure 4 This is a flowchart illustrating the specific learning process of the medical examination data learning sub-model of the present invention.
[0058] Figure 5 This is a schematic diagram of the disease risk prediction device of the present invention. Detailed Implementation
[0059] The technical solutions of 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.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to limit the invention.
[0061] To overcome the shortcomings of existing technologies in disease risk prediction, this embodiment provides an interpretable disease risk prediction model construction method. This method is simple and effective, and the constructed model has high predictive power and interpretability, making it suitable for teaching exercises, etc. Figure 1 As shown, the method for constructing an interpretable disease risk prediction model includes the following steps:
[0062] Step 1: Decompose the user's electronic medical record data into diagnostic code data and medical examination data, and use the diagnostic code data and medical examination data as training samples after characterization.
[0063] In this embodiment, when constructing an interpretable disease risk prediction model, diagnostic code data and medical examination data are learned in parallel to improve the model's tolerance to missing data. For example... Figure 2 As shown, the training samples are obtained in this embodiment as follows:
[0064] Step 1.1: Extract user p's electronic medical record data as a medical treatment sequence D = <V1,V2,…,V N>, where V k Let V represent the medical data of user p's kth medical visit, where 1 ≤ k ≤ N, and the medical data V k ={CD k ,TD k}, where CD k and TD k These are the diagnostic code data and medical examination data for user p's kth medical visit, respectively. in Let i be the diagnosis code for user p's k-th medical visit, 1≤i≤M, and let M be the medical examination data. in Let j be the value of the j-th type of medical examination during user p's k-th visit, where 1 ≤ j ≤ L. Diagnostic code. For discrete data (e.g., ICD-9 encoded), medical examinations For continuous data (e.g., blood pressure indicators).
[0065] Step 1.2, Diagnostic Code Data Representation: Take the set containing all types of diagnostic codes as set C, then each diagnostic code... Represented as a |C|-dimensional one-hot vector, for CD k If the number of diagnostic codes contained is less than M, then pseudo-diagnostic codes (represented as a |C|-dimensional vector of all zeros) are added to the end; if the number of diagnostic codes contained is more than M, then the redundant diagnostic codes at the end are deleted. All diagnostic code data of user p are represented as a tensor CT of size N×M×|C|.
[0066] Step 1.3, Medical Examination Data Representation: For TD k It is represented as an L-dimensional vector tv k TV k [j] represents the value of the j-th type of medical examination during the k-th medical visit. If no j-th type of medical examination was performed, then tv k [j] = 0, and all medical examination data of user p are represented as a matrix TT of size N×L.
[0067] Step 2: Input the training samples into the interpretable disease risk prediction model to obtain the risk prediction results. Compare the risk prediction results with the actual results, optimize the interpretable disease risk prediction model based on the comparison results, and complete the construction of the interpretable disease risk prediction model.
[0068] It should be noted that the conventional methods used in deep neural network training when optimizing the interpretable disease risk prediction model based on the comparison results in this embodiment, such as using regularization to improve the model's generalization ability or using gradient optimization methods, are not limited in this embodiment.
[0069] In order to construct a model with high prediction accuracy and interpretability, this embodiment provides an interpretable disease risk prediction model including a diagnostic code data learning sub-model, a medical examination data learning sub-model, and a risk prediction and interpretation sub-model.
[0070] (1) Diagnostic code data learning sub-model: Diagnostic code data is learned through diagnostic code embedding, diagnostic code attention weighting, recurrent network and diagnostic code data attention weighting.
[0071] like Figure 3 As shown, the specific learning process of the diagnostic code data learning sub-model is as follows:
[0072] (1-1) Diagnostic code embedding: The input is tensor CT, including CD1, CD2, ..., CD N It employs feature embedding technology based on multilayer perceptrons to analyze each diagnostic code. Will Transform a |C|-dimensional, sparse one-hot vector into a d-dimensional, dense embedding vector. but It can be represented as an M×d-dimensional embedding matrix
[0073] (1-2) Diagnostic code attention weighting: First, for each CD k Each diagnostic code is calculated according to formula (1). Attention weights Then, based on formula (2) according to attention weights CD k The CD is obtained by averaging the attention-weighted embedding vectors corresponding to all diagnostic codes. k The representation vector g k .
[0074]
[0075]
[0076] In the formula, CW k Given a trainable parameter matrix, cq k and cb k For a trainable parameter vector, For the parameter vector cq k The transpose of , ReLU() is the ReLU function, and "·" indicates multiplication, specifically vector multiplication.
[0077] (1-3) Recurrent network: This involves storing diagnostic code data CD1, CD2, ..., CD... N The corresponding representation vectors g1, g2, ..., g NInputting these vectors sequentially into an LSTM network yields N hidden vectors h1, h2, ..., h... N .
[0078] (1-4) Attention weighting of diagnostic code data: First, calculate the CD for each diagnostic code data according to formula (3). k Attention weight β k Then, based on formula (4) according to the attention weight β k The latent vectors corresponding to all diagnostic code data are averaged by attention weighting to obtain the representation vector x of user p.
[0079]
[0080]
[0081] In the formula, q R and b R W is a trainable parameter vector. R For a trainable parameter matrix, For the parameter vector q R transpose, For the parameter matrix W R The transpose of h k Let represent the k-th hidden vector among N hidden vectors.
[0082] (2) Medical examination data learning sub-model: Medical examination data is learned through feature extraction, self-attention mechanism and feature attention weighting.
[0083] like Figure 4 As shown, the specific learning process of the medical examination data learning sub-model is as follows:
[0084] (2-1) Feature extraction: The input is a matrix TT, which is first decomposed into L N-dimensional vectors fv. j fv j [k] represents the value of the j-th type of medical examination in the k-th visit. Then, the characteristics of each type of medical examination are calculated, i.e., for each fv j Calculate the mean, variance, latest value, maximum value, and minimum value of all values. Normalize all features to form a 5-dimensional feature vector, denoted as f. j Then, by performing feature extraction on the entire TT, L feature vectors f1, f2, ..., f3 are obtained. L .
[0085] (2-2) Self-attention mechanism: First, calculate each pair of feature vectors f according to formula (5). j and f q Self-attention weight δ jqThen, based on formula (6), according to the self-attention weight δ jq Calculate the augmented semantic vector u for each feature vector j .
[0086]
[0087]
[0088] In the formula, q j =f j ·W Q k q =f q ·W K v q =f q ·W V And W Q W K and W V All of these are trainable parameter matrices. For parameter k q The transpose of d, where d is k q Dimensions.
[0089] (2-3) Feature Attention Weighting: First, calculate the enhanced semantic vector u for each feature vector according to formula (7). j Attention weight σ j Then, based on formula (8), according to the attention weight σ j The enhanced semantic vectors of all feature vectors are averaged by attention weighting to obtain the representation vector y of user p.
[0090]
[0091]
[0092] In the formula, q F and b F W is a trainable parameter vector. F For a trainable parameter matrix, For the parameter vector q F The transpose of W F For the parameter matrix W F The transpose of .
[0093] (3) Risk prediction and interpretation sub-model: The outputs of the diagnostic code data learning sub-model and the medical examination data learning sub-model are integrated to predict the disease risk and obtain the risk prediction results, and the risk prediction results are interpreted.
[0094] (3-1) Risk prediction: Take the representation vector x of user p output by the diagnostic code data learning sub-model and the representation vector y of user p output by the medical examination data learning sub-model, concatenate the representation vector x and y of user p to obtain the representation vector z, and then use a Sigmoid layer as a classifier on the representation vector z to output the risk prediction result, which is either risky or no risk.
[0095] (3-2) Prediction Interpretation: If the risk prediction result is risky, then calculate the i-th diagnosis code of user p during the k-th medical visit according to formula (9). weight And calculate the weight w of the j-th type of medical examination for user p according to formula (10). j The system outputs the diagnostic codes and medical examination results with the highest weights as an explanation of the risk prediction results. The interpretation of the prediction results is achieved by backtracking the attention weights of the diagnostic code data and medical examination data.
[0096]
[0097]
[0098] like Figure 5 As shown, in another embodiment, a disease risk prediction device is provided, comprising: a data modeling module and an interpretable disease risk prediction module, wherein the interpretable disease risk prediction module includes a diagnostic code data learning submodule, a medical examination data learning submodule, and a risk prediction and interpretation submodule, wherein:
[0099] The data modeling module is used to decompose the user's electronic medical record data into diagnostic code data and medical examination data, and to characterize the diagnostic code data and medical examination data.
[0100] The diagnostic code data learning submodule is used to learn diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting (not shown in the figure).
[0101] The medical examination data learning submodule is used to learn from medical examination data through feature extraction, self-attention mechanism, and feature attention weighting.
[0102] The Risk Prediction and Interpretation submodule is used to integrate the outputs of the Diagnostic Code Data Learning submodule and the Medical Examination Data Learning submodule to predict disease risk, obtain risk prediction results, and interpret the risk prediction results.
[0103] In one specific embodiment, the data modeling module decomposes the user's electronic medical record data into diagnostic code data and medical examination data, and characterizes the diagnostic code data and medical examination data by performing the following operations:
[0104] Take user p's electronic medical record data as a medical treatment sequence D = <V1,V2,…,V N >, where V k Let V represent the medical data of user p's kth medical visit, where 1 ≤ k ≤ N, and the medical data V k ={CD k ,TD k}, where CD k and TD k These are the diagnostic code data and medical examination data for user p's kth medical visit, respectively. in Let i be the diagnosis code for user p's k-th medical visit, 1≤i≤M, and let M be the medical examination data. in Let be the value of the j-th type of medical examination during user p's k-th visit, where 1≤j≤L.
[0105] Diagnostic code data representation: Taking the set containing all types of diagnostic codes as set C, then each diagnostic code... Represented as a |C|-dimensional one-hot vector, for CD k If the number of diagnostic codes contained is less than M, pseudo-diagnostic codes are added to the end; if the number of diagnostic codes contained is more than M, the redundant diagnostic codes at the end are deleted. All diagnostic code data of user p is represented as a tensor CT of size N×M×|C|.
[0106] Medical examination data representation: For TD k It is represented as an L-dimensional vector tv k TV k [j] represents the value of the j-th type of medical examination. If no j-th type of medical examination is performed, then tv k [j] = 0, and all medical examination data of user p are represented as a matrix TT of size N×L.
[0107] In one specific embodiment, the diagnostic code data learning submodule learns the diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting, performing the following operations:
[0108] Diagnostic code embedding: Input is tensor CT, including CD1, CD2, ..., CD N It employs feature embedding technology based on multilayer perceptrons to analyze each diagnostic code. Will Transform a |C|-dimensional, sparse one-hot vector into a d-dimensional, dense embedding vector. but It can be represented as an M×d-dimensional embedding matrix
[0109] Diagnostic code attention weighting: First, for each CD k Calculate each diagnostic code Attention weights Then, based on attention weights CD k The CD is obtained by averaging the attention-weighted embedding vectors corresponding to all diagnostic codes. k The representation vector g k .
[0110] Recurrent network: This refers to the diagnostic code data CD1, CD2, ..., CD... N The corresponding representation vectors g1, g2, ..., g N Inputting these vectors sequentially into an LSTM network yields N hidden vectors h1, h2, ..., h... N .
[0111] Diagnostic code data attention weighting: First, calculate the CD for each diagnostic code data. k Attention weight β k Then, based on the attention weight β k The latent vectors corresponding to all diagnostic code data are averaged by attention weighting to obtain the representation vector x of user p.
[0112] In one specific embodiment, the medical examination data learning submodule learns the medical examination data through feature extraction, self-attention mechanism, and feature attention weighting, and performs the following operations:
[0113] Feature extraction: The input is a matrix TT, which is first decomposed into L N-dimensional vectors fv. j fv j [k] represents the value of the j-th type of medical examination in the k-th visit. Then, the characteristics of each type of medical examination are calculated, i.e., for each fv j Calculate five features for all values: mean, variance, latest value, maximum value, and minimum value. Normalize all features to form a 5-dimensional feature vector, denoted as f. j Then, by performing feature extraction on the entire TT, L feature vectors f1, f2, ..., f3 are obtained. L .
[0114] Self-attention mechanism: First, calculate each pair of feature vectors f j and fq Self-attention weight δ jq Then, based on the self-attention weight δ jq Calculate the augmented semantic vector u for each feature vector j .
[0115] Feature attention weighting: First, calculate the enhanced semantic vector u for each feature vector. j Attention weight σ j Then, based on the attention weight σ j The enhanced semantic vectors of all feature vectors are averaged by attention weighting to obtain the representation vector y of user p.
[0116] In one specific embodiment, the risk prediction and interpretation submodule integrates the outputs of the diagnostic code data learning submodule and the medical examination data learning submodule to predict disease risk, obtains a risk prediction result, and interprets the risk prediction result by performing the following operations:
[0117] Risk prediction: Take the representation vector x of user p output by the diagnostic code data learning sub-model and the representation vector y of user p output by the medical examination data learning sub-model, concatenate the representation vector x and y of user p to obtain the representation vector z, and then use a sigmoid layer as a classifier on the representation vector z to output the risk prediction result, which is either risky or no risk.
[0118] Prediction Interpretation: If the risk prediction result is risky, then calculate the i-th diagnosis code for user p's k-th medical visit. weight And calculate the weight w of the j-th type of medical examination for user p. j The system outputs the diagnostic codes and medical examination results with the highest weights as an interpretation of the risk prediction results.
[0119] For specific limitations on disease risk prediction devices, please refer to the limitations on the construction method of interpretable disease risk prediction models mentioned above, which will not be repeated here.
[0120] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0121] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A method for constructing an interpretable disease risk prediction model, characterized in that, The method for constructing an interpretable disease risk prediction model includes: The user's electronic medical record data is decomposed into diagnostic code data and medical examination data, and the diagnostic code data and medical examination data are characterized and used as training samples. The training samples are input into the interpretable disease risk prediction model to obtain the risk prediction results. The risk prediction results are compared with the actual results. The interpretable disease risk prediction model is optimized based on the comparison results to complete the construction of the interpretable disease risk prediction model. The interpretable disease risk prediction model includes a diagnostic code data learning sub-model, a medical examination data learning sub-model, and a risk prediction and interpretation sub-model. The diagnostic code data learning sub-model learns diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting. The medical examination data learning sub-model learns medical examination data through feature extraction, self-attention mechanism, and feature attention weighting. The risk prediction and interpretation sub-model fuses the outputs of the diagnostic code data learning sub-model and the medical examination data learning sub-model to predict disease risk and obtain risk prediction results, and then interprets the risk prediction results. The step of decomposing the user's electronic medical record data into diagnostic code data and medical examination data, and then using the characterized diagnostic code data and medical examination data as training samples, includes: Get user The electronic medical record data constitutes a medical treatment sequence. ,in On behalf of users No. Medical visit data, And medical data ,in and users respectively No. Diagnostic code data and medical examination data from the previous medical visit, diagnostic code data ,in For users No. The first time I went to the hospital A diagnostic code, Medical examination data ,in For users No. The first time I went to the hospital Values from medical examinations, ; Diagnostic code data representation: The collection containing all types of diagnostic codes is used as a set. Then each diagnostic code Represented as a A one-hot vector of dimension, for If the number of diagnostic codes included is insufficient If there are more than one, then add pseudo-diagnostic codes at the end; if the number of diagnostic codes included is more than one... If there are any redundant diagnostic codes at the end, then delete them. All diagnostic code data are represented as a single data set of size [size missing]. tensor ; Medical examination data representation: For Characterize it as a dimensional vector , For the first The values of similar medical examinations, if the first one has not been performed Medical examination, ,user All medical examination data are represented as a size of matrix ; The diagnostic code data learning sub-model learns diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting, including: Diagnostic code embedding: Input is a tensor ,include , … It employs feature embedding technology based on multilayer perceptrons to analyze each diagnostic code. ,Will of Transformation of 1D, sparse one-hot vectors into 3D, dense embedding vectors ,but It can be characterized as a dimensional embedding matrix ; Diagnostic code attention weighting: First, for each Calculate each diagnostic code Attention weights Then, based on attention weights right The embedding vectors corresponding to all diagnostic codes are averaged using attention weighting to obtain the result. representation vector ; Recurrent network: This integrates diagnostic code data. , … Corresponding representation vector , … Inputting the data sequentially into an LSTM network yields the following results: Hidden vectors , … ; Diagnostic code data attention weighting: First, calculate the attention weight for each diagnostic code data. Attention weights Then, based on attention weights The latent vectors corresponding to all diagnostic code data are averaged using attention-weighted methods to obtain the user's... representation vector . 2.The method of claim 1, wherein, The medical examination data learning sub-model learns from the medical examination data through feature extraction, self-attention mechanism, and feature attention weighting, including: Feature extraction: Input is a matrix First, break it down into indivual dimensional vector , Representing the Medical examination in the The values from each medical visit are then used to calculate the characteristics of each type of medical examination, i.e., for each... Calculate five features for all values: mean, variance, latest value, maximum value, and minimum value. Normalize all features to form a 5-dimensional feature vector, denoted as . Then for the whole Feature extraction was performed eigenvectors , … ; Self-attention mechanism: first, the self-attention weight of each pair of feature vectors and is calculated , and then the enhanced semantic vector of each feature vector is calculated according to the self-attention weight ; Feature attention weighting: First, compute the enhanced semantic vector for each feature vector. attention weights Then, based on attention weights The user's enhanced semantic vectors are then averaged using attention-weighted methods to obtain the result. representation vector . 3.The method of claim 1, wherein, The risk prediction and interpretation sub-model integrates the outputs of the diagnostic code data learning sub-model and the medical examination data learning sub-model to predict disease risk, and then interprets the risk prediction results, including: Risk prediction: Learning from diagnostic code data to develop a sub-model for user data output. representation vector And the user output of the medical examination data learning sub-model. representation vector splicing users representation vector and Obtain the representation vector Then, in the representation vector The above uses a Sigmoid layer as a classifier to output a risk prediction result, which is either risky or risk-free. Prediction Interpretation: If the risk prediction result is risky, then calculate the user's risk level. No. The first time I went to the hospital Diagnostic code weight and computing users The Weight of medical examination The system outputs the diagnostic codes and medical examination results with the highest weights as an interpretation of the risk prediction results.
4. A disease risk prediction apparatus characterized by comprising: The disease risk prediction device includes: a data modeling module and an interpretable disease risk prediction module. The interpretable disease risk prediction module includes a diagnostic code data learning submodule, a medical examination data learning submodule, and a risk prediction and interpretation submodule, wherein: The data modeling module is used to decompose the user's electronic medical record data into diagnostic code data and medical examination data, and to characterize the diagnostic code data and medical examination data. The diagnostic code data learning submodule is used to learn diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting. The medical examination data learning submodule is used to learn medical examination data through feature extraction, self-attention mechanism and feature attention weighting. The risk prediction and interpretation submodule is used to integrate the outputs of the diagnostic code data learning submodule and the medical examination data learning submodule to predict disease risk, obtain risk prediction results, and interpret the risk prediction results. The data modeling module decomposes the user's electronic medical record data into diagnostic code data and medical examination data, and represents the diagnostic code data and medical examination data by performing the following operations: Get user The electronic medical record data constitutes a medical treatment sequence. ,in On behalf of users No. Medical visit data, And medical data ,in and users respectively No. Diagnostic code data and medical examination data from the previous medical visit, diagnostic code data ,in For users No. The first time I went to the hospital A diagnostic code, Medical examination data ,in For users No. The first time I went to the hospital Values from medical examinations, ; Diagnostic code data representation: The collection containing all types of diagnostic codes is used as a set. Then each diagnostic code Represented as a A one-hot vector of dimension, for If the number of diagnostic codes included is insufficient If there are more than one, then add pseudo-diagnostic codes at the end; if the number of diagnostic codes included is more than one... If there are any redundant diagnostic codes at the end, then delete them. All diagnostic code data are represented as a single data set of size [size missing]. tensor ; Medical examination data representation: For Characterize it as a dimensional vector , For the first The values of this type of medical examination, if the first one has not been performed Medical examination, ,user All medical examination data are represented as a size of matrix ; The diagnostic code data learning submodule learns the diagnostic code data through diagnostic code embedding, diagnostic code attention weighting, recurrent networks, and diagnostic code data attention weighting, performing the following operations: Diagnostic code embedding: Input is a tensor ,include , … It employs feature embedding technology based on multilayer perceptrons to analyze each diagnostic code. ,Will of Transformation of 1D, sparse one-hot vectors into 3D, dense embedding vectors ,but It can be characterized as a dimensional embedding matrix ; Diagnostic code attention weighting: First, for each Calculate each diagnostic code attention weights Then, based on attention weights right The embedding vectors corresponding to all diagnostic codes are averaged using attention weighting to obtain the result. representation vector ; Recurrent network: This integrates diagnostic code data. , … Corresponding representation vector , … Inputting the data sequentially into an LSTM network yields the following results: Hidden vectors , … ; Diagnostic code data attention weighting: First, calculate the attention weight for each diagnostic code data. attention weights Then, based on attention weights The latent vectors corresponding to all diagnostic code data are averaged using attention-weighted methods to obtain the user's... representation vector .
5. The disease risk prediction apparatus according to claim 4, wherein The medical examination data learning submodule learns from the medical examination data through feature extraction, self-attention mechanism, and feature attention weighting, and performs the following operations: Feature extraction: Input is a matrix First, break it down into indivual dimensional vector , Representing the Medical examination in the The values from each medical visit are then used to calculate the characteristics of each type of medical examination, i.e., for each... Calculate five features for all values: mean, variance, latest value, maximum value, and minimum value. Normalize all features to form a 5-dimensional feature vector, denoted as . Then for the whole Feature extraction was performed eigenvectors , … ; Self-attention mechanism: First, calculate each pair of feature vectors. and Self-attention weights Then, based on the self-attention weights Calculate the augmented semantic vector for each feature vector ; Feature attention weighting: First, compute the enhanced semantic vector for each feature vector. Attention weights Then, based on attention weights The user's semantic vector is obtained by averaging the attention-weighted semantic vectors of all feature vectors. representation vector .
6. The disease risk prediction apparatus according to claim 4, wherein The risk prediction and interpretation submodule integrates the outputs of the diagnostic code data learning submodule and the medical examination data learning submodule to predict disease risk, obtains risk prediction results, and interprets the risk prediction results by performing the following operations: Risk prediction: Learning from diagnostic code data to develop a sub-model for user data output. representation vector And the user output of the medical examination data learning sub-model. representation vector splicing users representation vector and Obtain the representation vector Then, in the representation vector The above uses a Sigmoid layer as a classifier to output a risk prediction result, which is either risky or risk-free. Prediction Interpretation: If the risk prediction result is risky, then calculate the user's risk level. No. The first time I went to the hospital Diagnostic code weight and computing users The Weight of medical examination The system outputs the diagnostic codes and medical examination results with the highest weights as an interpretation of the risk prediction results.