Training method, retrieval method and electronic device for similar medical record retrieval model
By using similar medical record search models in traditional Chinese medicine scenarios, the subjective perturbation in traditional Chinese medicine clinical information is improved, and the robustness of the model and the search efficiency of similar patient medical records are improved.
Patent Information
- Application Number
- CN202411428291.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The prior art is difficult to effectively deal with potential subjective perturbations in the acquisition of clinical information of traditional Chinese medicine in the traditional Chinese medicine scenario, affecting the model's learning of patient characterization and the accuracy of patient graph topology.
By obtaining the sample patient subgraph of the patient's medical record, using the neural network of the similar medical record search model for feature extraction and similarity calculation, sharing weight parameters and adjusting model parameters based on the predicted results and real results, enhancing the robustness of the model.
It improves the retrieval efficiency of similar patients' medical records, enhances the robustness of the model, and can better learn and process symptom information with subjective interference.
Smart Images

Figure CN118968099B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence technology and medical technology, and in particular to a training method, a retrieval method and an electronic device for a similar medical record retrieval model. Background Art
[0002] Traditional Chinese medicine doctors mainly diagnose patients through four methods: observation, auscultation, inquiry and palpation. With the development of intelligence and informatization, artificial intelligence technology has been widely used in medical decision-making and auxiliary diagnosis and treatment tasks. Among many tasks, similar patient retrieval can play a basic and crucial role in personalized medical care.
[0003] However, there are few studies on similar patient retrieval in TCM scenarios, and the design of graph reasoning algorithms for TCM data lacks sufficient consideration, which makes it challenging to extract patient representations based on TCM data. Specifically, in the training process of existing models, TCM doctors rely on their clinical experience and observation, smell, questioning, and palpation to describe and record patient symptom information (such as Figure 1A As shown in the figure, due to different clinical experience and consultation methods, doctors may have different symptom descriptions for the same patient. These factors lead to potential subjective disturbances in the acquisition of TCM clinical information, which have a certain impact on the learning of patient representation and the topological structure of the patient graph during model training. Summary of the invention
[0004] In view of the above problems, the present invention provides a training method, a retrieval method and an electronic device for a similar medical record retrieval model.
[0005] According to a first aspect of the present invention, a training method for a similar medical record retrieval model is provided, comprising: obtaining a sample patient subgraph of a first patient's medical record and a sample patient subgraph of a second patient's medical record, wherein the sample patient subgraph comprises a plurality of sample nodes and edges representing an association relationship between any two sample nodes, and the sample nodes comprise a sample patient node and a plurality of sample symptom nodes corresponding to the sample patient nodes; using a first neural network of the similar medical record retrieval model to perform feature extraction on the sample patient subgraph of the first patient's medical record to obtain a first sample graph embedding; using a second neural network of the similar medical record retrieval model to perform feature extraction on the sample patient subgraph of the second patient's medical record The first neural network and the second neural network share weight parameters; the third neural network of the similar medical record retrieval model is used to calculate the similarity between the first sample graph embedding and the second sample graph embedding to obtain the predicted result of the medical record similarity between the first patient's medical record and the second patient's medical record; the parameters of the similar medical record retrieval model are adjusted using the predicted result and the actual result of the medical record similarity between the first patient's medical record and the second patient's medical record to obtain a trained similar medical record retrieval model, wherein the actual result is calculated through the Traditional Chinese Medicine attribute information of the first patient's medical record and the second patient's medical record.
[0006] The second aspect of the present invention provides a similar medical record retrieval method, which is applied to the field of traditional Chinese medicine, comprising: obtaining a patient subgraph of a first patient's medical record and a patient subgraph of a second patient's medical record, wherein the patient subgraph includes multiple nodes and edges representing the association relationship between a sample patient node and each sample symptom node, and the nodes include a patient node and multiple symptom nodes corresponding to the patient node; inputting the patient subgraph of the first patient's medical record and the patient subgraph of the second patient's medical record into a trained similar medical record retrieval model to obtain a retrieval result of the medical record similarity between the first patient's medical record and the second patient's medical record, wherein the trained similar medical record retrieval model is obtained by training according to any of the above methods.
[0007] A third aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0008] The fourth aspect of the present invention further provides a computer-readable storage medium on which a computer program or instruction is stored, and the steps of the above method are implemented when the above computer program or instruction is executed by a processor.
[0009] The fifth aspect of the present invention also provides a computer program product, including a computer program or instructions, which implement the steps of the above method when executed by a processor.
[0010] According to an embodiment of the present invention, a sample patient subgraph of a first patient's medical record is input into a first neural network to obtain a first sample graph embedding; a sample patient subgraph of a second patient's medical record is input into a second neural network to obtain a second sample graph embedding. The first sample graph embedding and the second sample graph embedding are input into a third neural network for similarity calculation to obtain a medical record similarity prediction result between the first patient's medical record and the second patient's medical record, and the parameters of the similar medical record retrieval model are adjusted based on the prediction result and the actual result to obtain a trained similar medical record retrieval model. This solves the technical problem in the prior art that in the TCM scenario, due to the potential subjective disturbance in the process of acquiring TCM clinical information, the learning of patient representation and the patient graph topology results in the model training process have a certain impact, thereby enhancing the robustness of the model and improving the retrieval efficiency of similar patient medical records. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0012] Figure 1A A schematic diagram showing the work of evaluating clinical information of TCM patients in TCM scenarios is shown;
[0013] Figure 1B A diagram showing an application scenario of a training method, a retrieval method and an apparatus for a similar medical record retrieval model according to an embodiment of the present invention;
[0014] Figure 2 A flow chart showing a method for training a similar medical record retrieval model according to an embodiment of the present invention is shown;
[0015] Figure 3 A flowchart of a method for obtaining a first sample graph embedding according to an embodiment of the present invention is shown;
[0016] Figure 4 A flowchart of a similar medical record retrieval method according to an embodiment of the present invention is shown;
[0017] Figure 5 A schematic diagram of obtaining a first sample graph embedding according to an embodiment of the present invention is shown;
[0018] Figure 6 A schematic diagram showing a training method for a similar medical record retrieval model according to an embodiment of the present invention is shown;
[0019] Figure 7 A structural block diagram of a training device for a similar medical record retrieval model according to an embodiment of the present invention is shown;
[0020] Figure 8 It shows a structural block diagram of a similar medical record retrieval device according to an embodiment of the present invention;
[0021] Fig. 9 A block diagram of an electronic device suitable for implementing a training method and a retrieval method for a similar medical record retrieval model according to an embodiment of the present invention is schematically shown. DETAILED DESCRIPTION
[0022] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.
[0023] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0024] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0025] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0026] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0027] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0028] An embodiment of the present invention provides a training method for a similar medical record retrieval model, which is applied to the field of traditional Chinese medicine. The method comprises: obtaining a sample patient subgraph of a first patient's medical record and a sample patient subgraph of a second patient's medical record, wherein the sample patient subgraph comprises a plurality of sample nodes and edges representing an association relationship between any two sample nodes, and the sample nodes comprise a sample patient node and a plurality of sample symptom nodes corresponding to the sample patient nodes; using a first neural network of a similar medical record retrieval model to perform feature extraction on the sample patient subgraph of the first patient's medical record to obtain a first sample graph embedding; using a second neural network of a similar medical record retrieval model to perform feature extraction on the sample patient subgraph of the second patient's medical record Feature extraction is performed on the patient subgraph to obtain a second sample graph embedding, wherein the first neural network and the second neural network share weight parameters; similarity is calculated between the first sample graph embedding and the second sample graph embedding using the third neural network of the similar medical record retrieval model to obtain a predicted result of the medical record similarity between the first patient's medical record and the second patient's medical record; parameters of the similar medical record retrieval model are adjusted using the predicted result and true result of the medical record similarity between the first patient's medical record and the second patient's medical record to obtain a trained similar medical record retrieval model, wherein the true result is calculated through the Traditional Chinese Medicine attribute information of the first patient's medical record and the second patient's medical record.
[0029] Figure 1B A diagram showing an application scenario of a training method, a retrieval method, and an apparatus for a similar medical record retrieval model according to an embodiment of the present invention.
[0030] like Figure 1B As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0031] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0032] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0033] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0034] It should be noted that the training method and the retrieval method of the similar medical record retrieval model provided in the embodiment of the present invention can generally be executed by the server 105. Accordingly, the training device and the retrieval device of the similar medical record retrieval model provided in the embodiment of the present invention can generally be set in the server 105. The training method and the retrieval method of the similar medical record retrieval model provided in the embodiment of the present invention can also be executed by a server or a server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the training device and the retrieval device of the similar medical record retrieval model provided in the embodiment of the present invention can also be set in a server or a server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0035] It should be understood that the number of terminal devices, networks and servers in Figure 1 is only illustrative. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0036] Figure 2 A flow chart of a method for training a similar medical record retrieval model according to an embodiment of the present invention is shown.
[0037] like Figure 2 As shown, the method 200 includes: operations S210 to S250.
[0038] In operation S210 , a sample patient subgraph of a first patient's medical record and a sample patient subgraph of a second patient's medical record are acquired.
[0039] According to an embodiment of the present invention, the sample patient subgraph of the first patient's medical record and the sample patient subgraph of the second patient's medical record may be obtained by extracting a traditional Chinese medicine medical graph.
[0040] According to an embodiment of the present invention, the sample patient subgraph includes a plurality of sample nodes and edges representing the association relationship between any two sample nodes, and the sample nodes include a sample patient node and a plurality of sample symptom nodes corresponding to the sample patient nodes.
[0041] According to an embodiment of the present invention, the sample patient node in the sample patient subgraph represents the identity attribute of the patient, and the sample symptom node corresponding to the sample patient node represents the TCM symptom information exhibited by the patient.
[0042] According to an embodiment of the present invention, the edge of the association relationship between any two sample nodes can represent whether there is an association between the any two sample nodes. If there is an edge, it means that there is an association between the any two sample nodes, otherwise, there is no association.
[0043] According to an embodiment of the present invention, before obtaining relevant information of a sample patient subgraph of a patient's medical record, the patient's consent or authorization may be obtained.
[0044] In operation S220, a first neural network of a similar medical record retrieval model is used to extract features from a sample patient subgraph of the first patient's medical record to obtain a first sample graph embedding.
[0045] In operation S230, a second neural network of a similar medical record retrieval model is used to extract features from a sample patient subgraph of the second patient's medical record to obtain a second sample graph embedding.
[0046] According to an embodiment of the present invention, the similar medical record retrieval model may be a Siamese network, the first neural network and the second neural network may share weight parameters, and both the first neural network and the second neural network may be graph neural networks.
[0047] According to an embodiment of the present invention, data processing can be performed on the sample patient subgraph of the first patient's medical record to obtain a sample node feature matrix and a sample adjacency matrix of the sample patient subgraph of the first patient's medical record. The sample adjacency matrix represents whether there is an edge between two nodes. If there is an edge, it is represented by 1, indicating that there is an association relationship between the two nodes; if there is no edge, it is represented by 0, indicating that there is no association relationship between the two nodes.
[0048] According to an embodiment of the present invention, the sample node feature matrix and the sample adjacency matrix of the first patient's medical record can be input into the first neural network, a self-attention mechanism can be implemented on each sample node feature matrix, and based on the probability of an edge appearing in each node pair in the adjacency matrix, the optimized sample node feature matrix of each sample node can be determined, and based on the node feature matrix of each sample node, the first sample graph embedding can be obtained.
[0049] According to an embodiment of the present invention, the first sample graph embedding may be a graph network structure obtained after optimizing each sample node through a first neural network.
[0050] According to an embodiment of the present invention, a second neural network is used to perform feature extraction on a sample patient subgraph of a second patient's medical record, and a method for obtaining a second sample graph embedding is the same as the method for obtaining the first sample graph embedding described above, and is not described in detail in the present invention.
[0051] In operation S240, a third neural network of the similar medical record retrieval model is used to calculate the similarity between the first sample graph embedding and the second sample graph embedding to obtain a prediction result of the medical record similarity between the first patient's medical record and the second patient's medical record.
[0052] According to an embodiment of the present invention, the first sample graph embedding and the second sample graph embedding can be combined and reconstructed by a third neural network to obtain correlation score information between the first sample graph embedding and the second sample graph embedding, and the prediction result of the medical record similarity between the first patient medical record and the second patient medical record can be determined based on the correlation score information.
[0053] In operation S250, the parameters of the similar medical record retrieval model are adjusted using the predicted result and the actual result of the medical record similarity between the first patient's medical record and the second patient's medical record to obtain a trained similar medical record retrieval model, wherein the actual result is calculated based on the TCM attribute information of the first patient's medical record and the second patient's medical record.
[0054] According to an embodiment of the present invention, the actual result of the medical record similarity between the first patient's medical record and the second patient's medical record can be calculated by obtaining the Traditional Chinese Medicine attribute information of the first patient and the second patient.
[0055] According to an embodiment of the present invention, the TCM medical attribute information may include information such as disease category, herbal category, herbal dosage, symptom category, etc. Based on the medical attribute information, the similarity between the first patient medical record and the second patient medical record may be calculated as a true result.
[0056] According to an embodiment of the present invention, the actual result and the predicted result can be calculated to obtain a difference value, and the parameters of the similar medical record retrieval model can be adjusted based on the difference value until the preset conditions are met, and the training is terminated to obtain a trained similar medical record retrieval model.
[0057] According to an embodiment of the present invention, a sample patient subgraph of a first patient's medical record is input into a first neural network to obtain a first sample graph embedding; a sample patient subgraph of a second patient's medical record is input into a second neural network to obtain a second sample graph embedding. The first sample graph embedding and the second sample graph embedding are input into a third neural network for similarity calculation to obtain a medical record similarity prediction result between the first patient's medical record and the second patient's medical record, and the parameters of the similar medical record retrieval model are adjusted based on the prediction result and the actual result to obtain a trained similar medical record retrieval model. This solves the technical problem in the prior art that in the TCM scenario, due to the potential subjective disturbance in the process of acquiring TCM clinical information, the learning of patient representation and the patient graph topology results in the model training process have a certain impact, thereby enhancing the robustness of the model and improving the retrieval efficiency of similar patient medical records.
[0058] Figure 3 A flow chart of a method for obtaining a first sample graph embedding according to an embodiment of the present invention is shown.
[0059] like Figure 3 As shown, the method 300 includes: operations S310 to S350.
[0060] In operation S310, self-attention calculation is performed on the i-th sample node of the l-1-th layer and the j-th sample node of the l-1-th layer to obtain the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer, and the importance coefficient between any two sample nodes among the N sample nodes is obtained, wherein the importance coefficient between the sample nodes represents the importance of the association relationship between any two sample nodes.
[0061] In operation S320, self-supervised calculation is performed on the i-th sample node of the l-1-th layer and the j-th sample node of the l-1-th layer to obtain the sample node edge pair probability between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer, and the sample node edge pair probability between any two sample nodes among the N sample nodes is obtained, wherein the sample node edge pair probability represents the probability of the existence of an edge between any two sample nodes.
[0062] In operation S330, based on the importance coefficient between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer and the sample node edge pair probability, the attention coefficient between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer is obtained, and the attention coefficient between any two sample nodes among the N sample nodes is obtained.
[0063] In operation S340, based on the attention coefficient between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer and the node feature corresponding to the ith sample node of the l-1th layer, the ith sample node embedding of the first neural network of the lth layer is obtained, and the N sample node embeddings corresponding to the first neural network of the lth layer are obtained.
[0064] In operation S350, the N sample node embeddings are aggregated to obtain a first sample graph embedding.
[0065] According to an embodiment of the present invention, the first neural network includes an attention layer and a pooling layer, and the attention layer has L layers. The sample nodes of the sample patient subgraph of the first patient's medical record have N number of sample nodes. The feature matrix of the sample nodes of the sample patient subgraph of the first patient's medical record can be expressed as ,in, Represents the feature vector of sample node i, and N is the number of sample nodes. Wherein, L and N are both positive integers ≥ 1; 1≤l≤L; 1≤i≤N; 1≤j≤N.
[0066] According to an embodiment of the present invention, when the first layer of the first neural network is the first layer, feature extraction is performed on each sample node in the sample patient subgraph of the first patient's medical record, and the feature vector of the i-th sample node can be extracted. , the feature vector of the i-th sample node and the feature vector of the jth sample node To perform the self-attention mechanism, specifically, the feature vector of the i-th sample node corresponding to the first neural network of the 0th layer can be and the feature vector of the jth sample node As the input of the first neural network in layer 1, based on the feature vector of the i-th sample node and the feature vector of the jth sample node , the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the first layer can be determined Based on the above method, the importance coefficient between any two sample nodes among the N sample nodes corresponding to the first neural network of the first layer can be obtained.
[0067] According to an embodiment of the present invention, the importance coefficient between any two sample nodes can characterize the importance of the association relationship between the any two sample nodes. For example, when node i and node j are symptom nodes, the importance of the association relationship when the patient has symptom node i and when the patient has symptom node j at the same time can be determined.
[0068] According to an embodiment of the present invention, the feature vector of the i-th sample node corresponding to the first neural network of the 0th layer can be and the feature vector of the jth sample node By performing self-supervised calculation, we can obtain the probability of the sample node edge pair between the i-th sample node and the j-th sample node corresponding to the first neural network of the first layer. Based on the above method, the probability of a sample node edge pair between any two sample nodes among the N sample nodes corresponding to the first neural network of the first layer can be obtained.
[0069] According to an embodiment of the present invention, the sample node edge pair probability can characterize the probability of the existence of an edge between any two sample nodes. For example, when node i and node j are symptom nodes, it can be determined whether symptom node j will appear when the patient has symptom node i. If symptom node j appears, there is an edge between node i and node j, otherwise, there is no edge.
[0070] According to an embodiment of the present invention, the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the first layer can be obtained. and the probability of the sample node edge pair between the i-th sample node and the j-th sample node corresponding to the first neural network of the first layer , we can get the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the first layer Based on the above method, the attention coefficient between any two sample nodes among the N sample nodes corresponding to the first neural network of the first layer can be obtained.
[0071] According to an embodiment of the present invention, the feature vector of the i-th sample node corresponding to the first neural network of the 0th layer can be obtained. The attention coefficient between the i-th sample node and the j-th sample node of the first neural network in the first layer , we can get the i-th sample node embedding corresponding to the first neural network of layer 1 Based on the above method, N sample node embeddings corresponding to the first neural network of layer 1 can be obtained.
[0072] According to an embodiment of the present invention, based on the above method, the i-th sample node corresponding to the first neural network of the first layer can be embedded into and the jth sample node embedding Input the first neural network of layer 2, based on the i-th sample node embedding corresponding to the first neural network of layer 1 and the jth sample node embedding , get the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the second layer , based on the i-th sample node embedding corresponding to the first neural network in layer 1 and the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the second layer , we can get the embedding of the i-th sample node corresponding to the first neural network in the second layer Based on the above method, N sample node embeddings corresponding to the first neural network of the second layer can be obtained.
[0073] According to an embodiment of the present invention, based on the above method, the i-th sample node corresponding to the first neural network of the l-1th layer can be embedded into and the jth sample node embedding Input the first neural network of layer l, based on the i-th sample node embedding corresponding to the first neural network of layer l-1 and the jth sample node embedding , get the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer , based on the i-th sample node embedding corresponding to the first neural network in layer l-1 and the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer , we can get the i-th sample node embedding corresponding to the first neural network of the l-th layer Based on the above method, N sample node embeddings corresponding to the first neural network of the lth layer can be obtained.
[0074] According to an embodiment of the present invention, based on the above method, the i-th sample node embedding corresponding to the first neural network of the L-th layer can be obtained: Based on the above method, we can get the N sample node embeddings corresponding to the first neural network of the Lth layer, thereby obtaining the optimized node feature matrix .
[0075] According to an embodiment of the present invention, the optimized node feature matrix obtained above can be input into the pooling layer for aggregation processing to obtain the first sample graph embedding Specifically, the first sample graph embedding can be obtained by formula (1), that is:
[0076] (1);
[0077] in, is the transposed matrix of the optimized node feature matrix; tanh is the activation function, which is applied to the global upper and lower levels to obtain the global context after the node embedding transformation; is the sigmoid activation function; is the weight matrix of the pooling layer; N is the number of sample nodes.
[0078] According to an embodiment of the present invention, combined with the above formula (2), the global context can be calculated by multiplying the optimized node feature matrix with the weight matrix of the pooling layer using the tanh activation function and taking the average value, and the attention score is calculated by the sigmoid activation function, and the representation of the first sample graph embedding is obtained by performing matrix multiplication on the transposed optimized node feature matrix and the attention score. .
[0079] According to an embodiment of the present invention, self-attention calculation is performed on the i-th sample node of the l-1th layer and the j-th sample node of the l-1th layer to obtain an importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-1th layer, including: using the weight matrix corresponding to the first neural network of the l-1th layer, respectively performing dimensionality increase processing on the i-th sample node of the l-1th layer and the j-th sample node of the l-1th layer to obtain the i-th sample node after dimensional increase and the j-th sample node after dimensional increase; determining the attention weight vector corresponding to the first neural network of the l-1th layer; according to the attention weight vector, the i-th sample node after dimensional increase and the j-th sample node after dimensional increase, obtaining the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-1th layer.
[0080] According to an embodiment of the present invention, the weight matrix corresponding to the first neural network of the lth layer may be an adjustable weight matrix The adjusted weight matrix corresponding to the first neural network of the lth layer can be used The linear mapping to the first neural network of the l-1 layer corresponds to the i-th sample node Perform dimensionality increase processing, using the adjusted weight matrix corresponding to the first neural network of the lth layer The linear mapping to the first neural network of the l-1 layer corresponds to the jth sample node By performing the dimension increase processing, the i-th sample node after the dimension increase and the j-th sample node after the dimension increase can be obtained.
[0081] According to an embodiment of the present invention, the attention weight vector corresponding to the first neural network of the lth layer can be a learnable attention weight vector that is continuously updated with the training results of the similar medical record retrieval model. Its purpose is to make the two node feature vectors reach the optimal value after splicing.
[0082] According to an embodiment of the present invention, the i-th sample node after dimensional increase and the j-th sample node after dimensional increase can be concatenated, and then multiplied with the attention weight vector to obtain the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer. , can be obtained by formula (2), that is:
[0083] (2);
[0084] in, is the attention weight vector The transpose of Indicates splicing.
[0085] According to an embodiment of the present invention, based on the importance coefficient between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer and the sample node edge pair probability, the attention coefficient between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer is obtained, including: performing inner product calculation on the importance coefficient and the sample node edge pair probability between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer to obtain the intermediate attention coefficient between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer; regularizing the intermediate attention coefficient to obtain the attention coefficient between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer.
[0086] According to an embodiment of the present invention, the node edge pair probability between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer is It can be obtained by formula (3), that is:
[0087] (3);
[0088] in, is the transpose of the i-th sample node after dimension increase.
[0089] According to the embodiment of the present invention, it can be known from the above formula (3) that the i-th sample node of the l-1th layer can be dimensionally increased and then transposed to obtain the i-th sample node after dimension increase; the i-th sample node of the l-1th layer can be dimensionally increased to obtain the j-th sample node after dimension increase; the sigmoid activation function is used to calculate the i-th sample node after dimension increase and the j-th sample node after dimension increase to obtain the node edge pair probability between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer. .
[0090] According to an embodiment of the present invention, the node edge pair probability between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer can be calculated as Introducing the attention coefficient calculation process can reduce the impact of subjective interfering symptom information in the TCM scenario, allowing the model to better learn the representation of patients with subjective interfering symptom information.
[0091] According to an embodiment of the present invention, the node edge pair probability between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer can be calculated as The importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer By performing inner product calculation, we can get the intermediate attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer. . It can be obtained by formula (4), that is:
[0092] (4);
[0093] Here, · represents the inner product operation.
[0094] According to an embodiment of the present invention, the intermediate attention coefficient Regularization is performed to obtain the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer. . It can be obtained by formula (5), that is:
[0095] (5);
[0096] in, is the importance coefficient between the i-th sample node and the j-th sample node; N(i) represents the neighboring nodes of the i-th sample node (including node i itself).
[0097] According to an embodiment of the present invention, the second neural network of the similar medical record retrieval model is used to extract features from the sample patient subgraph of the second patient's medical record to obtain the second sample graph embedding The method is the same as above to get the first sample graph embedding The method is the same as that of the present invention, and the present invention will not be repeated here.
[0098] According to an embodiment of the present invention, a third neural network of a similar medical record retrieval model is used to calculate the similarity between the first sample graph embedding and the second sample graph embedding to obtain a prediction result of the medical record similarity between the first patient medical record and the second patient medical record, including:
[0099] The feature fusion module is used to fuse the first sample graph embedding and the second sample graph embedding to obtain the fused sample graph embedding; the fully connected layer module is used to calculate the similarity of the fused sample graph embedding to obtain the prediction result of the medical record similarity between the first patient's medical record and the second patient's medical record.
[0100] According to an embodiment of the present invention, the third neural network may include a feature fusion module and a fully connected layer module.
[0101] According to an embodiment of the present invention, the first sample graph embedding and the second sample graph embedding may be input into a third neural network for feature fusion, and the first sample graph embedding and the second sample graph embedding may be subjected to feature fusion and feature reconstruction to obtain a fused sample graph embedding.
[0102] According to an embodiment of the present invention, the fused sample graph embeddings are linearly combined to obtain a correlation score between the first sample graph embedding and the second sample graph embedding: That is, as shown in formula (6), that is:
[0103] (6);
[0104] in, is the transpose of the first sample image embedding; , is the learnable weight matrix; b is the bias vector; is a nonlinear activation function; K is used to control the number of correlation scores generated.
[0105] According to an embodiment of the present invention, the obtained correlation score is input into the fully connected layer module of the third neural network to obtain the medical record of the first patient. With the second patient's medical record Prediction results of medical record similarity .
[0106] According to an embodiment of the present invention, the parameters of the similar medical record retrieval model are adjusted using the predicted results of the similarity between the medical records of a first patient and the medical records of a second patient to obtain a trained similar medical record retrieval model, including: determining the actual results of the similarity between the medical records of a first patient and the medical records of a second patient; based on a loss function, determining the loss function value according to the actual results and predicted results of the medical record similarity; based on the loss function value, adjusting the parameters of the similar medical record retrieval model to obtain a trained similar medical record retrieval model.
[0107] According to an embodiment of the present invention, determining the true result of the medical record similarity between a first patient's medical record and a second patient's medical record may include: obtaining first preset TCM medical attribute information of the first patient's medical record and second preset TCM medical attribute information of the second patient's medical record, wherein the first preset TCM medical attribute information and the second preset TCM medical attribute information both include disease category, herbal category, herbal dosage and symptom category; calculating the similarity information between the first preset medical attribute information and the second preset medical attribute information; and determining the true result of the medical record similarity between the first patient's medical record and the second patient's medical record based on the similarity information between the first preset medical attribute information and the second preset medical attribute information.
[0108] According to an embodiment of the present invention, in a TCM scenario, a patient instance may have multiple TCM medical attribute information. Based on three commonly used clustering algorithms, the present invention compares the effects of each TCM medical feature dimension under similar patient subgroups of different granularities (dividing patients into 10, 100, and 200 subgroups, respectively) from four TCM medical feature dimensions of disease category, herb category, herb dose, and syndrome category. As shown in Table 1.
[0109] Table 1
[0110]
[0111] According to an embodiment of the present invention, it can be seen from Table 1 that as the division of similar patient subgroups becomes more and more fine-grained, the measurement of the feature dimensions considering herbal dosage and syndrome category achieves better results on the dataset, which indicates that the two feature dimensions of herbal dosage and syndrome category have a significant improvement in the effect of dividing similar patients into fine-grained patient subgroups.
[0112] According to an embodiment of the present invention, based on the analysis of Table 2 above, the present invention proposes to comprehensively consider disease categories, symptom categories, herbal categories and herbal dosages as preset medical attribute information, and combine them into a similarity measure suitable for TCM scenarios as a true result of case similarity.
[0113] According to an embodiment of the present invention, specifically, the first patient medical record with disease category, symptom category, herbal medicine category and herbal medicine dosage as dimensions can be calculated using equations (7) to (10) respectively. With the second patient's medical record The true result of the case similarity between , namely:
[0114] (7);
[0115] (8);
[0116] (9);
[0117] (10);
[0118] in, Indicates the similarity between the first patient and the second patient in the dimension of medical characteristics of disease category; A binary vector representing the disease category of the first and second patients, where m is the length of the vector; It indicates the similarity between the first patient and the second patient in the dimension of medical characteristics of symptom category; a binary vector representing the symptom category of the first patient and the second patient; represents the similarity between the first and second patients in the dimension of medical characteristics of herbal medicine category; a binary vector representing the herbal medicine category for the first and second patients; It indicates the similarity between the first patient and the second patient in the dimension of medical characteristics of herbal dosage; Binary vector representing the herbal medicine category for the first and second patient.
[0119] According to an embodiment of the present invention, the similarities in the above formulas (7) to (10) can be combined linearly to obtain the true result of the similarity between the medical record of the first patient and the medical record of the second patient. As shown in formula (11):
[0120] (11);
[0121] Among them, α, β, , λ are the weights of each part of the indicators.
[0122] According to an embodiment of the present invention, the actual result of medical record similarity can be used based on the loss function. and prediction results , determine the loss function value. The loss function is as shown in formula (12), that is:
[0123] (12);
[0124] Where M is the total number of patient medical records.
[0125] According to the above formula (12), the loss function value can be determined. Based on the loss function value, the parameters of the similar medical record retrieval model are adjusted, and the training is continued. When the training reaches the preset condition, the training can be terminated to obtain the trained similar medical record retrieval model. The preset condition can be that the loss function value reaches a preset value, or that the number of iterations reaches a preset number.
[0126] According to an embodiment of the present invention, the parameters of the similar medical record retrieval model may include but are not limited to: the weight matrix of the pooling layer , adjustable weight matrix , is the learnable weight matrix and and the learnable attention weight vector The parameters of the similar medical record retrieval model can be adjusted according to the training results of the similar medical record retrieval model until the training reaches a preset condition, and then the training is terminated to obtain a trained similar medical record retrieval model.
[0127] According to an embodiment of the present invention, obtaining a sample patient subgraph of a first patient's medical record and a sample patient subgraph of a second patient's medical record includes: forming a triple data set from medical record data in a traditional Chinese medicine electronic medical record database, wherein each triple data set includes entity pairs and relationships between entity pairs; performing graph data processing on the triple data set to construct a traditional Chinese medicine medical atlas, wherein the traditional Chinese medicine medical atlas includes multiple independent patient subgraphs; and obtaining a sample patient subgraph of the first patient's medical record and a sample patient subgraph of the second patient's medical record from the traditional Chinese medicine medical atlas.
[0128] According to an embodiment of the present invention, the medical record data in the TCM electronic medical record database can be subjected to entity extraction and relationship extraction from three aspects: demographic information, symptoms and signs, and herbs and dosages, and the entities and relationships can be constructed into a triple data set. Each triple data can include entity pairs and the relationship between entity pairs, for example, (entity, relationship, entity). The triple description of the medical record data is shown in Table 2.
[0129] Table 2
[0130]
[0131] According to an embodiment of the present invention, the triplet data set is processed into graph data to construct a TCM medical atlas. Each patient instance in the TCM medical atlas is presented as a separate patient subgraph.
[0132] According to an embodiment of the present invention, a sample patient node can be extracted from the TCM medical atlas using a triple description of (patient, manifestation, symptom) and a sample symptom node connected to it to obtain a sample patient subgraph of the first patient's medical record and a sample patient subgraph of the second patient's medical record.
[0133] Table 3 shows the results of model evaluation indicators obtained by the present invention and other methods.
[0134] Table 3
[0135]
[0136] According to the embodiments of the present invention, it can be seen from Table 3 above that the method of the present invention has achieved the best performance in all evaluation indicators, which indicates that the method can better learn the representation of patients with subjective interference symptom information in the TCM scenario, enhance the robustness of the model, and thus improve the retrieval efficiency of similar patients.
[0137] Figure 4 A flow chart of a similar medical record retrieval method according to an embodiment of the present invention is shown.
[0138] like Figure 4 As shown, the method 400 includes: operation S410 to operation S420.
[0139] In operation S410, a patient subgraph of the first patient medical record and a patient subgraph of the second patient medical record are obtained, wherein the patient subgraph includes multiple nodes and edges representing the association relationship between the sample patient node and each sample symptom node, and the nodes include a patient node and multiple symptom nodes corresponding to the patient node.
[0140] In operation S420, the patient subgraph of the first patient's medical record and the patient subgraph of the second patient's medical record are input into a trained similar medical record retrieval model to obtain a retrieval result of the medical record similarity between the first patient's medical record and the second patient's medical record, wherein the trained similar medical record retrieval model is obtained by training according to the above method.
[0141] According to an embodiment of the present invention, the patient subgraph of the first patient's medical record may be used as the target patient subgraph to be retrieved, and the patient subgraph of the second patient's medical record may be stored in the electronic medical record database. The patient subgraph of the second patient's medical record may also be used as the target patient subgraph to be retrieved, and the patient subgraph of the first patient's medical record may be stored in the electronic medical record database.
[0142] According to an embodiment of the present invention, the patient subgraph of the first patient's medical record and the patient subgraph of the second patient's medical record can be input into a trained similar medical record retrieval model, and the first neural network of the similar medical record retrieval model can be used to extract features from the patient subgraph of the first patient's medical record. Specifically, the attention coefficient for each node can be determined based on the importance coefficient between nodes and the probability of node edge pairs in the patient subgraph, and then based on the attention coefficient and the weight matrix, an optimized node feature vector can be obtained, thereby obtaining the optimized patient subgraph of the first patient's medical record; similarly, the second neural network of the similar medical record retrieval model can be used to extract features from the patient subgraph of the second patient's medical record to obtain the optimized patient subgraph of the second patient's medical record; the third neural network of the similar medical record retrieval model can be used to retrieve the medical record similarity between the optimized patient subgraph of the first patient's medical record and the optimized patient subgraph of the second patient's medical record; based on the retrieval result, the medical record similarity between the first patient's medical record and the second patient's medical record is determined. Wherein, the trained similar medical record retrieval model can be obtained by the above-mentioned training method.
[0143] Figure 5 A schematic diagram of obtaining the embedding of a first sample graph according to an embodiment of the present invention is shown.
[0144] like Figure 5 As shown in the schematic diagram 500, the sample patient subgraph 501 of the first patient's medical record includes a sample patient node, a sample symptom node of TCM subjective interference, and a sample symptom node of expression. The node feature matrix 502 corresponding to the sample patient subgraph 501 of the first patient's medical record is input into the first neural network of the similar medical record retrieval model to determine the attention coefficient between the sample patient node i and the sample symptom node j of TCM subjective interference as an example. Based on the self-attention mechanism, the sample patient node i and the sample symptom node j of TCM subjective interference are respectively dimensionally increased and then spliced, that is, expressed as , and then multiply the concatenated node features by the attention weight vector a 503 to obtain the importance coefficient 504 between the two nodes; based on self-supervised learning, the sample patient node i and the TCM subjective interference sample symptom node j are respectively increased in dimension and then the inner product is calculated and the sigmoid function is used to calculate 505 to obtain the node edge pair probability 506 between the two nodes; the importance coefficient 504 between the two nodes and the node edge pair probability 506 between the two nodes are calculated by inner product and regularized softmax to obtain the attention coefficient 507; then based on the attention coefficient, the optimized feature matrix of each node 508 is obtained, and based on the feature matrix of each node 508, the first sample graph embedding 509 is obtained.
[0145] Figure 6A schematic diagram of a training method for a similar medical record retrieval model according to an embodiment of the present invention is shown.
[0146] like Figure 6 As shown, in the schematic diagram 600, a sample patient subgraph 601 of the first patient's medical record and a sample patient subgraph 602 of the second patient's medical record are obtained; the sample patient subgraph of the first patient's medical record is input into the first neural network 611-a of the similar medical record model, and for any two sample nodes i and j in the sample patient subgraph of the first patient's medical record, the i-th sample node 603 of the sample patient subgraph of the first patient's medical record is dimensionally increased to obtain the i-th sample node 604 after dimension increase; the j-th sample node 605 of the sample patient subgraph is dimensionally increased to obtain the j-th sample node 606 after dimension increase; the i-th sample node 604 after dimension increase and the j-th sample node 606 after dimension increase are spliced and compared with the attention weight vector Multiply to obtain the importance coefficient 607 between the ith sample node and the jth sample node; perform inner product operation on the ith sample node 604 after dimension increase and the jth sample node 606 after dimension increase and perform sigmoid function calculation to obtain the node edge pair probability 608 between the ith sample node and the jth sample node; perform inner product operation on the importance coefficient 607 and the node edge pair probability 608 between the ith sample node and the jth sample node and regularize them to obtain the attention coefficient 609 between the ith sample node and the jth sample node; then based on the attention coefficient 609, obtain the optimized ith sample node embedding, aggregate the N sample node embeddings to obtain the first sample graph embedding 610.
[0147] Based on the above method, the sample patient subgraph 602 of the second patient's medical record is input into the second neural network 611-b of the similar medical record retrieval model to obtain the second sample graph embedding 612. The first sample graph embedding 610 and the second sample graph embedding 612 are input into the third neural network 611-c of the similar medical record retrieval model to perform similarity calculation to obtain the predicted result 613 of the medical record similarity; based on the predicted result 613 and the actual result 614 of the medical record similarity, the loss function value 615 is obtained; based on the loss function value 615, the model parameters are adjusted 616 to obtain the trained similar medical record retrieval model 617.
[0148] Based on the above-mentioned training method of similar medical record retrieval model, the present invention also provides a training device for similar medical record retrieval model. Figure 7 The device is described in detail.
[0149] Figure 7 A structural block diagram of a training device for a similar medical record retrieval model according to an embodiment of the present invention is shown.
[0150] like Figure 7As shown, the device 700 includes: a sample patient sub-graph acquisition module 710, a first sample graph embedding acquisition module 720, a second sample graph embedding acquisition module 730, a prediction result acquisition module 740 and a parameter adjustment module 750.
[0151] The sample patient subgraph acquisition module 710 is used to obtain the sample patient subgraph of the first patient's medical record and the sample patient subgraph of the second patient's medical record, wherein the sample patient subgraph includes multiple sample nodes and edges representing the association relationship between any two sample nodes, and the sample nodes include sample patient nodes and multiple sample symptom nodes corresponding to the sample patient nodes.
[0152] The first sample graph embedding obtaining module 720 is used to extract features from the sample patient subgraph of the first patient's medical record by using the first neural network of the similar medical record retrieval model to obtain the first sample graph embedding.
[0153] The second sample graph embedding obtaining module 730 uses the second neural network of the similar medical record retrieval model to extract features from the sample patient subgraph of the second patient's medical record to obtain the second sample graph embedding, wherein the first neural network and the second neural network share weight parameters.
[0154] The prediction result acquisition module 740 is used to calculate the similarity between the first sample graph embedding and the second sample graph embedding using the third neural network of the similar medical record retrieval model to obtain the prediction result of the medical record similarity between the first patient medical record and the second patient medical record.
[0155] The parameter adjustment module 750 is used to adjust the parameters of the similar medical record retrieval model using the predicted results and actual results of the similarity between the first patient's medical record and the second patient's medical record to obtain a trained similar medical record retrieval model, wherein the actual results are calculated using the Traditional Chinese Medicine attribute information of the first patient's medical record and the second patient's medical record.
[0156] According to an embodiment of the present invention, the first neural network has L layers and N sample nodes.
[0157] According to an embodiment of the present invention, the first sample graph embedding obtaining module 720 includes: an importance coefficient obtaining submodule, a sample node edge pair probability obtaining submodule, an attention coefficient obtaining submodule, a node embedding obtaining submodule and a first sample graph embedding obtaining submodule.
[0158] The importance coefficient obtaining submodule is used to perform self-attention calculation on the i-th sample node of the l-1th layer and the j-th sample node of the l-1th layer for the i-th sample node in the sample patient subgraph of the l-th layer of the first neural network and the first patient's medical record, to obtain the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer, and to obtain the importance coefficient between any two sample nodes among the N sample nodes, wherein the importance coefficient between the sample nodes represents the importance of the association relationship between any two sample nodes.
[0159] The sample node edge pair probability acquisition submodule is used to perform self-supervised calculations on the i-th sample node of the l-1th layer and the j-th sample node of the l-1th layer, obtain the sample node edge pair probability between the i-th sample node and the j-th sample node corresponding to the first neural network of the lth layer, and obtain the sample node edge pair probability between any two sample nodes among the N sample nodes, wherein the sample node edge pair probability represents the probability of the existence of an edge between any two sample nodes.
[0160] The attention coefficient obtaining submodule is used to obtain the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer according to the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer and the sample node edge pair probability, and obtain the attention coefficient between any two sample nodes among the N sample nodes.
[0161] The node embedding acquisition submodule is used to obtain the i-th sample node embedding of the first neural network of the l-th layer according to the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer and the node feature corresponding to the i-th sample node of the l-1-th layer, and obtain the N sample node embeddings corresponding to the first neural network of the l-th layer.
[0162] The first sample graph embedding obtaining submodule is used to perform aggregation processing on N sample node embeddings to obtain the first sample graph embedding.
[0163] According to an embodiment of the present invention, the importance coefficient obtaining submodule includes: a sample node obtaining unit, an attention weight vector obtaining unit and an importance coefficient obtaining unit.
[0164] The sample node obtaining unit is used to use the weight matrix corresponding to the first neural network of the lth layer to perform dimension increase processing on the i-th sample node of the l-1th layer and the j-th sample node of the l-1th layer, respectively, to obtain the i-th sample node after dimension increase and the j-th sample node after dimension increase.
[0165] The attention weight vector obtaining unit is used to determine the association information between the i-th sample node of the l-1-th layer and the remaining N-1 sample nodes among the N sample nodes of the l-1-th layer, and obtain the attention weight vector corresponding to the first neural network of the l-th layer.
[0166] The importance coefficient obtaining unit is used to obtain the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer according to the attention weight vector, the i-th sample node after dimensionality increase and the j-th sample node after dimensionality increase.
[0167] According to an embodiment of the present invention, the attention coefficient obtaining submodule includes: an intermediate attention coefficient obtaining unit and an attention coefficient obtaining unit.
[0168] The intermediate attention coefficient obtaining unit is used to calculate the inner product of the importance coefficient and the sample node edge pair probability between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer, and obtain the intermediate attention coefficient between the ith sample node and the jth sample node corresponding to the first neural network of the lth layer.
[0169] The attention coefficient obtaining unit is used to perform regularization processing on the intermediate attention coefficient to obtain the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer.
[0170] According to an embodiment of the present invention, the third neural network includes a feature fusion module and a fully connected layer module.
[0171] According to an embodiment of the present invention, the prediction result obtaining module 740 includes: a sample graph embedding obtaining submodule and a prediction result obtaining submodule.
[0172] The sample graph embedding obtaining submodule is used to use the feature fusion module to perform feature fusion on the first sample graph embedding and the second sample graph embedding to obtain a fused sample graph embedding.
[0173] The prediction result acquisition submodule is used to use the fully connected layer module to perform similarity calculation on the fused sample graph embedding to obtain the prediction result of the medical record similarity between the first patient's medical record and the second patient's medical record.
[0174] According to an embodiment of the present invention, the parameter adjustment module 750 includes: a true result determination submodule, a loss function value determination submodule and a parameter adjustment submodule.
[0175] The true result determination submodule is used to determine the true result of the medical record similarity between the first patient's medical record and the second patient's medical record.
[0176] The loss function value determination submodule is used to determine the loss function value based on the loss function and the actual result and the predicted result of the medical record similarity.
[0177] The parameter adjustment submodule is used to adjust the parameters of the similar medical record retrieval model based on the loss function value to obtain a trained similar medical record retrieval model.
[0178] According to an embodiment of the present invention, the true result determination submodule includes: a medical attribute information acquisition unit, a similarity information calculation unit and a true result determination unit.
[0179] The medical attribute information acquisition unit is used to acquire first preset TCM medical attribute information of a first patient's medical record and second preset TCM medical attribute information of a second patient's medical record, wherein the first preset TCM medical attribute information and the second preset TCM medical attribute information both include disease category, herbal category, herbal dosage and symptom category.
[0180] The similarity information calculation unit is used to calculate the similarity information between the first preset medical attribute information and the second preset medical attribute information.
[0181] The true result determination unit is used to determine the true result of the medical record similarity between the first patient's medical record and the second patient's medical record based on the similarity information between the first preset medical attribute information and the second preset medical attribute information.
[0182] According to an embodiment of the present invention, the sample patient subgraph acquisition module 710 includes: a triple data set construction submodule, a TCM medical atlas construction submodule and a sample patient subgraph acquisition submodule.
[0183] The triple data set construction submodule is used to construct a triple data set from the medical record data in the traditional Chinese medicine electronic medical record database, wherein each triple data includes entity pairs and the relationship between the entity pairs.
[0184] The TCM medical graph construction submodule is used to perform graph data processing on the triple data set to construct a TCM medical graph, wherein the TCM medical graph includes multiple independent patient subgraphs.
[0185] The sample patient subgraph acquisition submodule is used to acquire the sample patient subgraph of the first patient's medical record and the sample patient subgraph of the second patient's medical record from the traditional Chinese medicine medical atlas.
[0186] Based on the above similar medical record retrieval method, the present invention also provides a similar medical record retrieval device. Figure 8 The device is described in detail.
[0187] Figure 8 A structural block diagram of a similar medical record retrieval device according to an embodiment of the present invention is shown.
[0188] like Figure 8 As shown, the device 800 includes: a patient sub-image acquisition module 810 and a search result acquisition module 820.
[0189] The patient subgraph acquisition module 810 is used to obtain the patient subgraph of the first patient medical record and the patient subgraph of the second patient medical record, wherein the patient subgraph includes multiple nodes and edges representing the association relationship between the sample patient node and each sample symptom node, and the nodes include a patient node and multiple symptom nodes corresponding to the patient node.
[0190] The retrieval result acquisition module 820 is used to input the patient subgraph of the first patient's medical record and the patient subgraph of the second patient's medical record into a trained similar medical record retrieval model to obtain a retrieval result of the medical record similarity between the first patient's medical record and the second patient's medical record, wherein the trained similar medical record retrieval model is obtained by training according to the above method.
[0191] According to an embodiment of the present invention, any multiple modules among the sample patient subgraph acquisition module 710, the first sample graph embedding acquisition module 720, the second sample graph embedding acquisition module 730, the prediction result acquisition module 740 and the parameter adjustment module 750 or the patient subgraph acquisition module 810 and the retrieval result acquisition module 820 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the sample patient sub-graph acquisition module 710, the first sample graph embedding acquisition module 720, the second sample graph embedding acquisition module 730, the prediction result acquisition module 740 and the parameter adjustment module 750 or the patient sub-graph acquisition module 810 and the retrieval result acquisition module 820 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the sample patient sub-graph acquisition module 710, the first sample graph embedding acquisition module 720, the second sample graph embedding acquisition module 730, the prediction result acquisition module 740 and the parameter adjustment module 750 or the patient sub-graph acquisition module 810 and the retrieval result acquisition module 820 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0192] Fig. 9A block diagram of an electronic device suitable for implementing a training method and a retrieval method for a similar medical record retrieval model according to an embodiment of the present invention is schematically shown.
[0193] like Fig. 9 As shown, the electronic device 900 according to an embodiment of the present invention includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 to a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0194] In RAM 903, various programs and data required for the operation of electronic device 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other via bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in one or more memories.
[0195] According to an embodiment of the present invention, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the input / output (I / O) interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage portion 908 as needed.
[0196] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0197] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 902 and / or RAM 903 described above and / or one or more memories other than ROM 902 and RAM 903.
[0198] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the training method and retrieval method of the similar medical record retrieval model provided by the embodiment of the present invention.
[0199] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 901. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0200] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0201] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0202] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0203] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0204] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention may be combined and / or combined in various ways. All of these combinations and / or combinations fall within the scope of the present invention.
[0205] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A training method for a similar medical record retrieval model, applied in the field of traditional Chinese medicine, characterized in that: The method comprises: Obtain a sample patient subgraph of the first patient's medical record and a sample patient subgraph of the second patient's medical record, wherein the sample patient subgraph includes a plurality of sample nodes and an edge representing an association relationship between any two of the sample nodes, and the sample nodes include a sample patient node and a plurality of sample symptom nodes corresponding to the sample patient nodes; Using a first neural network of a similar medical record retrieval model to extract features from a sample patient subgraph of the first patient medical record, to obtain a first sample graph embedding; Using a second neural network of the similar medical record retrieval model to extract features from a sample patient subgraph of the second patient medical record to obtain a second sample graph embedding, wherein the first neural network and the second neural network share weight parameters; Utilizing the third neural network of the similar medical record retrieval model to perform similarity calculation on the first sample graph embedding and the second sample graph embedding, and obtaining a prediction result of the medical record similarity between the first patient medical record and the second patient medical record; Using the predicted result and the actual result of the medical record similarity between the first patient's medical record and the second patient's medical record, the parameters of the similar medical record retrieval model are adjusted to obtain a trained similar medical record retrieval model, wherein the actual result is calculated based on the TCM medical attribute information of the first patient's medical record and the second patient's medical record; The first neural network has L layers, and the number of sample nodes is N; The first neural network using the similar medical record retrieval model performs feature extraction on the sample patient subgraph of the first patient medical record to obtain a first sample graph embedding, including: For the i-th sample node in the sample patient subgraph of the l-th layer of the first neural network and the first patient medical record, Performing self-attention calculation on the i-th sample node of the l-1th layer and the j-th sample node of the l-1th layer, obtaining an importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the lth layer, and obtaining an importance coefficient between any two of the N sample nodes, wherein the importance coefficient between the sample nodes represents the importance of the association relationship between any two of the sample nodes; Performing self-supervised calculation on the i-th sample node of the l-1th layer and the j-th sample node of the l-1th layer to obtain the sample node edge pair probability between the i-th sample node and the j-th sample node corresponding to the first neural network of the lth layer, and obtaining the sample node edge pair probability between any two of the N sample nodes, wherein the sample node edge pair probability represents the probability of an edge existing between any two of the sample nodes; According to the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer and the sample node edge pair probability, an attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer is obtained, and an attention coefficient between any two of the N sample nodes is obtained; According to the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer and the node feature corresponding to the i-th sample node of the l-1-th layer, the i-th sample node embedding of the first neural network of the l-th layer is obtained, and the N sample node embeddings corresponding to the first neural network of the l-th layer are obtained; Aggregating the N sample node embeddings to obtain the first sample graph embedding; The self-attention calculation is performed on the i-th sample node of the l-1th layer and the j-th sample node of the l-1th layer to obtain the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the lth layer, including: Using the weight matrix corresponding to the first neural network of the lth layer, respectively perform dimension increase processing on the i-th sample node of the l-1th layer and the j-th sample node of the l-1th layer to obtain the i-th sample node after dimension increase and the j-th sample node after dimension increase; Determine an attention weight vector corresponding to the first neural network of the l-th layer; Obtaining an importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer according to the attention weight vector, the i-th sample node after dimension increase, and the j-th sample node after dimension increase; The step of obtaining the attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer according to the importance coefficient between the i-th sample node and the j-th sample node and the sample node edge pair probability comprises: Performing an inner product calculation on the importance coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer and the probability of the sample node edge pair to obtain an intermediate attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer; Regularization is performed on the intermediate attention coefficient to obtain an attention coefficient between the i-th sample node and the j-th sample node corresponding to the first neural network of the l-th layer.
2. The method according to claim 1, characterized in that The third neural network includes a feature fusion module and a fully connected layer module; The method of using the third neural network of the similar medical record retrieval model to perform similarity calculation on the first sample graph embedding and the second sample graph embedding to obtain a prediction result of the medical record similarity between the first patient medical record and the second patient medical record includes: Using the feature fusion module to perform feature fusion on the first sample image embedding and the second sample image embedding to obtain a fused sample image embedding; The fully connected layer module is used to perform similarity calculation on the fused sample graph embedding to obtain a prediction result of the medical record similarity between the first patient's medical record and the second patient's medical record.
3. The method according to claim 1, characterized in that The method of adjusting the parameters of the similar medical record retrieval model by using the prediction result of the medical record similarity between the first patient's medical record and the second patient's medical record to obtain a trained similar medical record retrieval model includes: determining a true result of medical record similarity between the first patient medical record and the second patient medical record; Based on the loss function, determining a loss function value according to the actual result and the predicted result of the medical record similarity; Based on the loss function value, the parameters of the similar medical record retrieval model are adjusted to obtain a trained similar medical record retrieval model.
4. The method according to claim 3, characterized in that The actual result of determining the medical record similarity between the first patient medical record and the second patient medical record includes: Obtaining first preset TCM medical attribute information of the first patient's medical record and second preset TCM medical attribute information of the second patient's medical record, wherein the first preset TCM medical attribute information and the second preset TCM medical attribute information both include disease category, herbal medicine category, herbal medicine dosage, and symptom category; Calculating similarity information between the first preset TCM medical attribute information and the second preset TCM medical attribute information; According to the similarity information between the first preset TCM medical attribute information and the second preset TCM medical attribute information, the true result of the medical record similarity between the first patient medical record and the second patient medical record is determined.
5. The method according to claim 1, characterized in that The step of obtaining a sample patient subgraph of the first patient's medical record and a sample patient subgraph of the second patient's medical record includes: The medical record data in the TCM electronic medical record database are formed into a triple data set, wherein each triple data includes an entity pair and a relationship between the entity pairs; Performing graph data processing on the triple data set to construct a TCM medical atlas, wherein the TCM medical atlas includes a plurality of independent patient subgraphs; A sample patient subgraph of the first patient's medical record and a sample patient subgraph of the second patient's medical record are obtained from the traditional Chinese medicine medical atlas.
6. A similar medical record retrieval method, applied in the field of traditional Chinese medicine, characterized in that: The method comprises: Obtain a patient subgraph of the first patient's medical record and a patient subgraph of the second patient's medical record, wherein the patient subgraph includes a plurality of nodes and edges representing an association relationship between the sample patient node and each of the sample symptom nodes, and the nodes include a patient node and a plurality of symptom nodes corresponding to the patient node; The patient subgraph of the first patient medical record and the patient subgraph of the second patient medical record are input into the trained similar medical record retrieval model to obtain a retrieval result of the medical record similarity between the first patient medical record and the second patient medical record, wherein the trained similar medical record retrieval model is trained by the method according to any one of claims 1 to 5.
7. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Interpretable smart medical auxiliary diagnosis system based on text retrieval
CN112687388A
Similar patient retrieval method based on sorting learning
CN112836012A