Internet-based online gynecological disease intelligent consultation system
By combining asymmetric encryption, knowledge graph reasoning and CART decision tree methods, the problems of low diagnostic accuracy and insufficient privacy protection in the diagnosis of gynecological diseases are solved, and diagnostic results with high accuracy, interpretability and privacy protection are achieved.
Patent Information
- Application Number
- CN202411775369.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing online medical platforms face problems such as low diagnostic accuracy, lack of interpretability, and insufficient patient privacy protection in the field of gynecological diseases.
A combination of asymmetric encryption, knowledge graph reasoning and CART decision tree is used to protect patient privacy through RSA asymmetric encryption, use the BERT model to perform semantic understanding, graph neural networks embed medical entities, gated recursive units calculate disease correlation, and finally diagnostic reasoning is performed through CART decision tree.
It improves the accuracy and interpretability of gynecological diseases diagnosis, while effectively protecting patient privacy and reducing the risk of leakage of diagnostic results during network transmission and storage.
Smart Images

Figure CN119673429A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to an Internet-based online gynecological disease intelligent consultation system. Background Art
[0002] With the rapid development of Internet technology, online medical services have been widely used. Online consultation, remote consultation and other services enable patients to obtain medical advice and preliminary diagnosis without leaving home, which greatly facilitates patients in remote areas and those with limited mobility.
[0003] Existing online medical platforms still face many challenges in the field of gynecological disease diagnosis. First, there are many types of gynecological diseases and various symptoms. Patients' descriptions of their conditions are often unprofessional and incomplete, which makes it difficult for doctors to diagnose. Secondly, due to the uneven distribution of medical resources, the level of gynecological diagnosis and treatment in primary medical institutions and remote areas is uneven, and the ability to diagnose difficult cases is limited. In addition, patients' concerns about privacy have also affected the popularity of online consultations. Gynecological diseases involve sensitive privacy. How to protect patient privacy in the process of data sharing is an urgent problem to be solved.
[0004] Most existing online consultation systems use rule-based or statistical learning methods to extract and classify features based on patient conversation texts and provide diagnostic results. This type of method has the following shortcomings: First, it does not fully utilize medical knowledge and is difficult to deal with complex clinical manifestations; second, it lacks interpretability and cannot explain the diagnostic reasoning process to patients; third, the diagnostic accuracy is not high and it is easy to miss or misdiagnose. In addition, patient privacy protection is insufficient, and sensitive information is at risk of leakage during network transmission and storage. Summary of the invention
[0005] In response to the problem of low diagnostic accuracy in online gynecological disease consultation in the prior art, the present application provides an Internet-based online gynecological disease intelligent consultation method and system, which adopts a combination of asymmetric encryption, knowledge graph reasoning and CART decision tree to improve diagnostic accuracy while protecting patient privacy.
[0006] The purpose of this application is achieved through the following technical solutions.
[0007] One aspect of the present application provides an Internet-based online gynecological disease intelligent consultation method for an online gynecological disease intelligent consultation system, comprising: authenticating the patient and using the RSA asymmetric encryption method to generate the patient's public-private key pair; the patient uses the private key to encrypt the inquiry information, and the inquiry information includes the patient's chief complaint, current medical history, and past medical history; the system uses the patient's public key to decrypt the encrypted inquiry information to obtain the decrypted inquiry information; uses the deep learning-based BERT model to process the decrypted inquiry information on a local device to obtain a structured description of the patient's condition; and uses the patient's public key to encrypt the condition description. Obtain an encrypted description of the patient's condition; upload the encrypted description of the patient's condition to the server, decrypt it using the system private key on the server, diagnose based on the patient's condition description using a reasoning method based on a knowledge graph to obtain a list of disease candidates; encrypt the disease candidate list using the patient's public key to obtain an encrypted list of disease candidates; transmit the encrypted candidate list to the patient's local device, decrypt it using the patient's private key, and use the CART decision tree to perform reasoning based on the disease candidate list to obtain the final diagnosis result; encrypt the final diagnosis result using the patient's public key and upload it to the server, and the patient uses the private key to decrypt and view the diagnosis result stored on the server.
[0008] Furthermore, a BERT model based on deep learning is used to process the decrypted query information on a local device to obtain a structured description of the patient's condition, including: using a BERT model pre-trained in the medical field to perform character-level segmentation on the decrypted query information to obtain a segmentation list of the query information; inputting the segmentation list into the BERT model, and extracting the semantic vector of each word through a multi-layer self-attention mechanism and a feedforward neural network; using a bidirectional long short-term memory network BiLSTM to encode the semantic vector of each word, and obtaining a contextual semantic vector of the query information through a bidirectional information transmission and gating mechanism; using a conditional random field CRF algorithm to perform medical named entity recognition on the contextual semantic vector, and extracting entities in the query information by learning the transition probability between entity labels, the entities including symptoms, signs, diseases and drugs; using a transfer-based syntactic dependency analysis method to construct a syntactic dependency tree of the query information and obtain the semantic dependency relationship between entities; according to the semantic dependency relationship, a rule-based method is used to convert the query information into a structured description of the patient's condition.
[0009] Furthermore, a reasoning method based on a knowledge graph is used for diagnosis to obtain a candidate disease list, including: constructing a patient electronic medical record based on the patient's condition description, the electronic medical record containing symptoms and duration; mapping the medical entities in the patient's electronic medical record to the corresponding nodes in the pre-constructed gynecological disease knowledge graph to obtain a patient condition subgraph; using a graph convolutional neural network to perform representation learning on the patient's condition subgraph, and generating a semantic embedding vector for each medical entity through node embedding and neighborhood aggregation; using a gated recurrent unit neural network based on an attention mechanism, with the semantic embedding vector of the medical entity as input, and calculating the semantic relevance between each entity and the disease through iterative reasoning and attention weighting; based on the semantic relevance, a rule-based reasoning method is used to screen out the top N diseases with the highest relevance to the patient's condition from the candidate diseases to form a candidate disease list.
[0010] Furthermore, the medical entities in the patient's electronic medical record are mapped to the corresponding nodes in the pre-constructed gynecological disease knowledge graph to obtain the patient's condition subgraph, including: extracting the medical entities in the patient's electronic medical record, including symptoms, signs, diseases, drugs and surgeries, and forming the extracted medical entities into a patient entity list; in the pre-constructed gynecological disease knowledge graph, semantically embedding the text description of each node in the knowledge graph and each medical entity in the patient entity list to obtain the knowledge graph node embedding vector and the patient entity embedding vector; calculating the semantic similarity between the patient entity embedding vector and the knowledge graph node embedding vector, for each medical entity in the patient entity list, selecting the knowledge graph node with the highest semantic similarity as the mapping node, and establishing a mapping dictionary from the patient medical entity to the knowledge graph node; based on the gynecological disease The graph neural network GAT model is constructed based on the disease knowledge graph, and the neighborhood information of the nodes is aggregated using the multi-head attention mechanism to obtain the embedding vector of each node; each patient medical entity in the mapping dictionary is traversed, and the corresponding mapping node is used as the central node in the gynecological disease knowledge graph to extract one-hop and two-hop nodes and the corresponding relationship edges through breadth-first search; the semantic relevance between the extracted mapping nodes and neighborhood nodes is calculated through the attention mechanism to obtain the attention weight matrix, and the attention weight matrix is filtered according to the preset threshold to remove the nodes and relationship edges with weights lower than the threshold; the filtered nodes and relationship edges are constructed into a patient condition subgraph, in which the node feature is the embedding vector of the corresponding node, and the edge weight is the weighted average of the attention weight between the connected nodes and the semantic similarity between the nodes.
[0011] Furthermore, a graph convolutional neural network is used to perform representation learning on the patient condition subgraph, and a semantic embedding vector of each medical entity is generated through node embedding and neighborhood aggregation, including: performing random walks on the patient condition subgraph to generate a node sequence, each node sequence containing a starting node and corresponding one-hop and two-hop neighborhood nodes; inputting the node sequence into the skip-gram model for training, and obtaining a distributed representation of the node by maximizing the co-occurrence probability of the node with the corresponding context node; using the trained skip-gram model, a D-dimensional embedding vector is generated for each node in the patient condition subgraph as the input feature of the graph convolutional neural network; using the graph convolution layer in the graph convolutional neural network, the node representation is updated by aggregating the neighborhood information of the node, and an attention mechanism is introduced to set different importance of different neighbor nodes; at the top layer of the graph convolutional neural network, an attention pooling operation is used to perform weighted summation on the output of the graph convolution to obtain a semantic embedding vector for each medical entity.
[0012] Furthermore, different importances of different neighbor nodes are set by the following formula: ,in, The attention weight representing the contribution of node u to node v is a scalar whose value range is [0, 1]; Represents the attention mechanism dimensional parameter vector, D is the hyperparameter of the attention mechanism, indicating the dimension of the attention weight. Each element of a is a parameter to be learned, which is optimized by the back-propagation algorithm; and They represent the D-dimensional feature vectors of nodes u and v during the k-1th layer of graph convolution, which is a D×1 column vector; represents the one-hop and two-hop neighboring node sets of node v in the patient condition subgraph; || represents the vector concatenation operation. and Splice into a 2Dx1 vector; represents the Leaky ReLU activation function; a^{T} represents the transpose of the attention mechanism parameter vector a, which is a 1×D row vector; w represents the one-hop or two-hop neighbor node of node v in the patient's condition subgraph, that is, w∈N(v). If node w is directly connected to node v, then w is the one-hop neighbor node of node v; if there is an intermediate node between node w and node v, then w is the two-hop neighbor node of node v. When representing the k-1th layer of graph convolution, the D-dimensional feature representation vector of the neighboring node w of node v. k represents the number of layers of graph convolution, k ≥ 1. The input of the kth layer of graph convolution is the output of the k-1th layer of graph convolution. D represents the dimension of the node feature vector, which is a pre-set hyperparameter. is a D×1 column vector, which represents the feature representation of node w in the k-1th layer of graph convolution. When k=1, Represents the initial feature vector of node w, which can be one-hot encoding, word embedding, etc.
[0013] Furthermore, the attention pooling operation is used to perform weighted summation on the output of the graph convolution to obtain the semantic embedding vector of each medical entity, through the following formula: , where z represents the final D-dimensional graph representation vector of the patient's condition subgraph; V represents the node set of the patient's condition subgraph; K represents the number of layers of the graph convolutional neural network; Represents the D-dimensional feature vector of node v during the K-th layer of graph convolution; Represents the attention weight of node v: , where q represents the attention mechanism dimensional parameter vector; W represents the attention mechanism dimensional parameter matrix; represents the hyperbolic tangent activation function; u represents a node; Furthermore, a gated recurrent unit neural network based on an attention mechanism is used, with the semantic embedding vector of the medical entity as input, and the semantic relevance between each entity and the disease is calculated through iterative reasoning and attention weighting, including: using a gated recurrent unit to construct an inference network of length T, inputting the semantic embedding vector of the medical entity into the network in sequence, and iteratively calculating the hidden state of the entity to model the semantic association between the entities; in each iteration of the gated recurrent unit, calculating the semantic relevance weight between the current medical entity and the candidate disease through the attention mechanism; after the iteration of the gated recurrent network is terminated, the attention weights at T moments are used to perform weighted summation on the semantic vectors of the candidate disease to obtain the final semantic relevance score vector s between each medical entity and the candidate disease.
[0014] Furthermore, the encrypted candidate list is transmitted to the patient's local device, decrypted using the patient's private key, and reasoned using the CART decision tree based on the disease candidate list to obtain the final diagnosis result, including: using the patient's private key to asymmetrically decrypt the disease candidate list to obtain a list containing multiple candidate diseases, each candidate disease in the list consists of a disease name and a corresponding semantic relevance score; extracting the patient's structured features based on the patient's electronic medical record, and constructing an N-dimensional patient feature vector, wherein the structured features include the patient's symptoms, signs, and examination results; inputting the N-dimensional patient feature vector into a pre-trained CART decision tree model; starting from the root node of the decision tree model, the root node represents a feature attribute and a branch condition, comparing the value of the corresponding attribute in the patient feature vector with the branch condition, and if If the branching condition is met, enter the left subtree, otherwise enter the right subtree, and execute recursively until reaching a leaf node; when reaching each leaf node, according to the value of the patient feature vector, select the disease with the highest semantic relevance score from the disease candidate list as the preliminary diagnosis result of the corresponding leaf node, and obtain a set of diagnosis results of M leaf nodes, where M is the number of leaf nodes; calculate the feature attribute matching degree of the N-dimensional patient feature vector on the path to each leaf node, and the matching degree is determined by the similarity between the feature attribute value on the path and the corresponding attribute value in the patient feature vector, and perform weighted voting on the preliminary diagnosis results of the M leaf nodes, with the weight being the matching degree of the corresponding path; according to the voting results, select the disease with the highest number of votes and exceeding the threshold as the final diagnosis result obtained by CART decision tree inference.
[0015] Another aspect of the present application also provides an Internet-based online gynecological disease intelligent consultation system for executing an Internet-based online gynecological disease intelligent consultation method of the present application.
[0016] Compared with the prior art, the advantages of this application are: This application uses the RSA asymmetric encryption method to generate an independent public-private key pair for each patient. The patient uses the private key to encrypt sensitive information on the local device before uploading it to the server. The server and other users cannot directly view the patient's privacy. At the same time, the diagnosis results are also protected by asymmetric encryption. Only the patient can use the private key to decrypt and view them, effectively preventing the risk of patient privacy leakage during network transmission and storage.
[0017] Traditional rule or statistical learning methods find it difficult to fully utilize large-scale medical knowledge bases. This application uses a pre-trained BERT model to semantically understand the patient's condition description and extract accurate structured information such as symptoms and signs. The patient information is then mapped to the gynecological disease knowledge graph, and the graph neural network is used to aggregate node neighborhood information to learn the semantic embedding representation of medical entities. Based on the medical entity embedding, a gated recurrent neural network with an attention mechanism is further used to calculate the semantic relevance of candidate diseases. The structured medical knowledge in the knowledge graph is maximized to make the diagnostic process explainable.
[0018] This application adopts a two-stage reasoning strategy to improve diagnostic accuracy. First, the semantic reasoning of the knowledge graph is used on the server side to obtain the Top N initial screening disease candidate list with semantic relevance. This stage focuses on the recall rate to minimize missed diagnosis of the disease. Secondly, the CART decision tree based on feature matching weighting is used locally on the patient to infer the final diagnosis result from the initial screening list. The decision tree model can make hierarchical diagnostic decisions based on structured features such as patient symptoms and signs, and the matching weighted voting fully considers the degree of fit between patient characteristics and decision paths, further improving the accuracy of diagnosis.
[0019] Large models such as BERT require a lot of computation. If they are all deployed on the server, the real-time performance of the system will be affected. This application deploys computational tasks such as semantic extraction and decision tree reasoning to the patient locally, using the computing resources on the device side to reduce the computing pressure on the server. At the same time, asymmetric encryption can ensure the security of transmitted data. While protecting privacy, this architecture achieves a balance in computing between the server and the patient's device, improving system throughput and response speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The present application will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein: Figure 1 is an exemplary flow chart of an Internet-based online gynecological disease intelligent consultation method according to some embodiments of the present application; Figure 2 is an exemplary flow chart for constructing a structured description of a patient's condition according to some embodiments of the present application; Figure 3 is an exemplary flow chart of constructing a patient condition subgraph according to some embodiments of the present application; Figure 4 is an exemplary flow chart of obtaining a semantic embedding vector of a medical entity according to some embodiments of the present application; Figure 5This is an exemplary flowchart for obtaining the final diagnosis result according to some embodiments of the present application. DETAILED DESCRIPTION
[0021] The method and system provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0022] Figure 1 It is an exemplary flow chart of an Internet-based online gynecological disease intelligent consultation method according to some embodiments of the present application, which is used in an online gynecological disease intelligent consultation system, including: for an online gynecological disease intelligent consultation system, including: authenticating the patient, and generating a public-private key pair of the patient using an RSA asymmetric encryption method; The patient uses a private key to encrypt the inquiry information, which includes the patient's chief complaint, current medical history and past medical history; the system uses the patient's public key to decrypt the encrypted inquiry information to obtain the decrypted inquiry information; the decrypted inquiry information is processed using the deep learning-based BERT model on the local device to obtain a structured description of the patient's condition; and the condition description is encrypted using the patient's public key to obtain an encrypted description of the patient's condition; the encrypted patient's condition description is uploaded to the server, decrypted using the system's private key on the server, and a diagnosis is made based on the patient's condition description using a knowledge graph-based reasoning method to obtain a list of disease candidates; the disease candidate list is encrypted using the patient's public key to obtain an encrypted list of disease candidates; the encrypted candidate list is transmitted to the patient's local device, decrypted using the patient's private key, and reasoning is performed using the CART decision tree based on the disease candidate list to obtain the final diagnosis result; the final diagnosis result is encrypted using the patient's public key and uploaded to the server, and the patient uses the private key to decrypt and view the diagnosis result stored on the server.
[0023] The patient's identity is authenticated and the patient's public and private key pair is generated using the RSA asymmetric encryption method. First, the patient registers an online consultation system account on a mobile device. When registering, the patient submits identity information such as ID number and mobile phone number. The system background performs real-name authentication on the patient's identity to prevent the registration of false accounts. After the authentication is passed, the system uses the RSA algorithm to generate a pair of public and private keys for the patient, recorded as Among them, the public key Used to encrypt data that needs to be transmitted to the patient, private key The patient holds it and uses it to decrypt the received data. The steps to generate the RSA key pair are as follows: select two different large prime numbers p and q, calculate According to the Euler function, we can calculate . Choose an integer e less than r, so that e and r are mutually prime. e is the public key Calculate the modular inverse element d of e with respect to r, so that d is the private key The public key and the private key The system stores the correspondence between the patient's uid and its public key in a secure KeyStore, and the private key is transmitted to the patient through a secure channel and saved on the patient's local device. When the patient logs in to the system later, the uid is used for identity verification. The system retrieves the public key corresponding to the uid from the KeyStore for subsequent encrypted data transmission. While the patient himself holds the private key for decrypting the received private data.
[0024] The patient uses the private key to encrypt the inquiry information, which includes the patient's chief complaint, current medical history, and past medical history; the system uses the patient's public key to decrypt the encrypted inquiry information to obtain the decrypted inquiry information; the patient fills in the inquiry information on the client interface of the online consultation system, including the following content: Chief complaint: The patient's main description of their current symptoms, such as "heavy menstrual flow and long duration". Current medical history: The patient's detailed description of the onset and development of the symptoms, such as "Three months ago, there was heavy menstrual flow without obvious cause, lasting for more than 10 days, accompanied by abdominal pain, requiring more than 10 sanitary pads, affecting daily life". Past medical history: Important medical information such as the patient's previous medical history, surgical history, allergy history, and childbirth history, such as "Previously healthy, no surgical history, no drug allergy history, married and has given birth, with 2 normal deliveries". The above inquiry information is represented by a string The patient's private key is and the public key is The patient uses the private key locally to encrypt to obtain the ciphertext The encryption process is as follows: Convert into a large integer m, where m < N and N is one of the parameters in the public key Calculate the ciphertext where d is one of the parameters in the private key Transmit the encrypted ciphertext to the server side of the online consultation system through the network. After receiving the ciphertext enc_data, the server side uses the patient's public key to decrypt it to obtain the original inquiry information The decryption process is as follows: Retrieve the public key corresponding to the patient's uid from the KeyStore Calculate the original text where e and N are the parameters in the public key Restore the integer m to the string format to obtain the original inquiry information filled in by the patient , which includes the chief complaint, present medical history, and past medical history.
[0025] Figure 2 This is an exemplary flow chart of obtaining a structured description of a patient's condition according to some embodiments of the present application, using a deep learning-based BERT model to decode the decrypted query information. Processing is performed on the patient's local device to obtain a structured description of the patient's condition . and use the patient's public key Description of the condition Encrypt and obtain the encrypted description of the patient's condition .
[0026] First, we use the BERT model pre-trained in the medical field to decode the decrypted query information. Perform character-level word segmentation. Specifically, build a medical dictionary from a medical text corpus The corpus includes medical textbooks, medical records, diagnosis and treatment guidelines, etc., covering multiple medical fields such as gynecology, internal medicine, and surgery. By preprocessing the corpus, discovering new words, and manually reviewing it, we can obtain a high-quality medical dictionary. , which contains various medical vocabulary types such as symptoms, signs, diseases, drugs, and surgeries, totaling about m words. Then, the Bi-LSTM+CRF model is used to train the medical dictionary The context features of the words in are learned. Each word w in is converted into a one-hot vector , and input it into Bi-LSTM. Bi-LSTM transmits information bidirectionally in the time dimension through two LSTM units, forward and backward, and extracts the contextual features of the vocabulary by combining the gating mechanism of input gate i, forget gate f, and output gate o. Set the hidden layer dimension of Bi-LSTM to , the weight matrix of the learnable parameters is , , , , the bias vector is , , , Through forward propagation and back propagation, the context feature vector of word w is obtained Next, the context feature vector As input, the CRF layer is used to learn the label transition probability of medical vocabulary. The label set of medical vocabulary is set to {B, I, O}, which respectively indicates that the vocabulary is located at the beginning position, middle position and non-entity of the medical entity. The CRF layer realizes the labeling of medical vocabulary by learning the transition probability matrix T between labels and the emission probability matrix E of each label. Among them, T is a 3×3 matrix, T[i, j] represents the probability of transferring from label i to label j; E is a matrix of the number of vocabulary × 3, and E[w, i] represents the probability that vocabulary w is labeled with label i. By training on the medical text corpus and continuously updating the parameters of T and E, the optimized CRF model parameters are obtained. and When asking patients for information When performing word segmentation, the forward maximum matching algorithm FMM and the reverse maximum matching algorithm BMM are first used, based on the medical dictionary right Perform preliminary word segmentation to obtain a list of candidate word segmentations Then, the Bi-LSTM+CRF model is used to segment the candidate word list. Re-label each word in . Each word w in is input into Bi-LSTM to obtain its context feature vector . Then Input to the CRF layer, through the Viterbi decoding algorithm, based on the transition probability matrix and the emission probability matrix , get the optimal label sequence for vocabulary w Finally, according to the label sequence List of candidate word segments For words with labels B or I, keep them as independent medical entities; for words with labels O, merge them with adjacent non-entity words. Through the above processing, we get the query information The final word list of , where each element is an independent medical entity or non-entity word.
[0027] Then, the word list The BERT model is input and uses a 12-layer Transformer encoder to learn the semantic vector of each word using a multi-head self-attention mechanism and a feedforward neural network. The BERT model is pre-trained on a large-scale medical text corpus and can model the semantic information of medical vocabulary. Each word w is mapped to a 768-dimensional semantic vector Next, the bidirectional long short-term memory network BiLSTM is used to encode the semantic vector of each word. BiLSTM transmits information bidirectionally in the time dimension through two LSTM units, forward and backward, and extracts the contextual semantic features of the query information by combining the gating mechanism of the input gate, forget gate and output gate. Input BiLSTM to get context semantic vector .
[0028] Obtaining information on enquiries The contextual semantic vector Finally, the conditional random field (CRF) algorithm is used to perform medical named entity recognition. CRF is a commonly used sequence labeling model that labels the input sequence by learning the transition probability between label sequences. First, define the label set of medical entities. , where sym represents symptoms, sign represents signs, dis represents diseases, drug represents drugs, and O represents non-entities. The BIO annotation method is used, that is, the entity start word is annotated as B-entity, the entity middle word and end word are annotated as I-entity, and the non-entity word is annotated as O. Then, the feature function of the CRF model is constructed. The feature function is used to characterize the correlation between the feature information and the label at each position in the input sequence. Common feature functions include: word features: Indicates the word at the i-th position. Part of speech features: Indicates the part of speech of the word at the ith position. Context features: Represents the context semantic vector of the word at position i. Transfer features: Representation Tags To Tags Transfer. Combining the above features, the characteristic function of the CRF model is defined as follows: ; ;......; ; ;......; ;in, It means that the value is 1 when condition is true, otherwise it is 0. arrive Indicates the correlation between word features and labels, arrive Represents the transfer correlation between labels.
[0029] In the training phase, the medical text corpus is used as training data to learn the feature weight parameter w of the CRF model through the maximum likelihood estimation algorithm. The goal is to maximize the log-likelihood function of the training data: ;in, represents the label sequence of the i-th sample, represents the contextual semantic vector sequence of the i-th sample, and λ is the L2 regularization coefficient. In the inference stage, the learned feature weight parameter w is used to perform the Viterbi algorithm on the query information. The contextual semantic vector Decode to get the optimal tag sequence According to the tag sequence , extract the medical entities in the query information and form a medical entity list entities, each entity contains entity type and entity content.
[0030] Figure 3 This is an exemplary flow chart for constructing a patient's condition subgraph according to some embodiments of the present application. In order to obtain the semantic dependency relationship between entities, a syntactic dependency analysis method based on transfer is used to construct a syntactic dependency tree of the query information. Common dependency analysis methods include transfer-based methods and graph-based methods. Here, a transfer-based method is adopted. First, a transfer action set A={SHIFT, LEFT-ARC, RIGHT-ARC} is defined, where SHIFT means moving the current word into the stack, LEFT-ARC (l) means taking the top element of the stack as the head node of the current word and connecting it with a relationship l, and RIGHT-ARC (l) means taking the current word as the head node of the top element of the stack and connecting it with a relationship l. Then, a transfer rule is defined. The transfer rule is used to determine what transfer action should be taken in the current state. It comprehensively considers feature information such as part of speech, entity type, and semantic role. Common transfer rules are as follows: If the current word is a verb, the SHIFT action is used first. If the current word is an entity, LEFT-ARC is used first to connect the entity and the verb. If the top element of the stack is an entity and the current word is a preposition or conjunction, RIGHT-ARC is used first. If both the top element of the stack and the current word are entities and of the same type, LEFT-ARC is used first. Based on the above transfer actions and transfer rules, a divide-and-conquer strategy is adopted to continuously execute transfer actions until the transfer is completed to obtain a syntactic dependency tree. . It is a directed acyclic graph, where the nodes represent each word in the query information and the edges represent the dependency relationship between words.
[0031] Finally, according to the syntactic dependency tree , using a rule-based approach to extract semantic dependencies between medical entities and convert query information into structured patient condition descriptions . First, define a set of medical semantic role labels R={Symptom, Duration, Frequency, Degree, ...} to characterize the semantic roles of medical entities in disease descriptions. Then, formulate medical semantic role labeling rules. The rules are used to map syntactic dependencies into semantic dependencies. For example: if there is a dependency relationship of "tmod" (time modification) between a symptom entity and a time entity, the time entity is labeled as the Duration role of the symptom. If there is a dependency relationship of "deg" (degree modification) between a symptom entity and a degree adverb, the degree adverb is labeled as the Degree role of the symptom. According to the semantic role labeling rules, traverse the syntactic dependency tree For each edge in the table, extract the medical semantic triples in the form of <entity, role, content> to form a semantic triple list. Finally, define the template of structured disease description, such as "symptoms + duration + severity", etc., fill the elements in the semantic triple list according to the corresponding template, and generate a structured patient disease description. After completing the above processing on the patient's local device, use the patient's public key Description of the condition Encrypt and obtain the encrypted description of the patient's condition .
[0032] Figure 4 This is an exemplary flow chart of obtaining the semantic embedding vector of a medical entity according to some embodiments of the present application. The encrypted patient condition description is uploaded to the server, decrypted using the system private key on the server, and a diagnosis is made based on the patient condition description using a reasoning method based on a knowledge graph to obtain a disease candidate list; the disease candidate list is encrypted using the patient's public key to obtain an encrypted disease candidate list. First, according to the structured patient condition description, , build the patient electronic medical record emr. The electronic medical record emr is stored in JSON format and mainly contains the following fields: : Unique identifier of the patient, used to link multiple visits of the patient. , a unique identifier for a patient's medical visit, used to distinguish different medical records of a patient. symptoms: a list of patient symptoms, each symptom contains two subfields: symptom (symptom name) and duration (duration). signs: a list of patient signs, each sign contains two subfields: sign (sign name) and value (sign value). diseases: a list of patient diseases, each disease contains two subfields: disease (disease name) and diagnosis_time (diagnosis time). drugs: a list of patient medications, each drug contains three subfields: drug (drug name), dosage (dose) and frequency (drug frequency). procedures: a list of patient surgeries, each surgery contains two subfields: procedure (surgery name) and operation_time (surgery time).
[0033] Then, the medical entities in the patient's electronic medical record (EMR) are mapped to the corresponding nodes in the pre-built gynecological disease knowledge graph to obtain the patient's condition subgraph. The medical entities in the patient's electronic medical record (EMR) are extracted, including symptoms, signs, diseases, drugs, and surgeries, and the extracted medical entities are combined into a patient entity list (p_entities). Semantic embedding of the text description of the knowledge graph node and the patient's medical entity: For each node in the knowledge graph (kg), , extract its text description , and use the pre-trained language model to Commonly used language models include: Word2Vec: text description Word segmentation to obtain word sequence , the Word2Vec model is used to learn the d-dimensional real-valued vector representation of each word, and then the node is obtained by averaging the word vectors. The embedding vector GloVe: Similar to Word2Vec, it also learns the real-valued vector representation of words and then obtains nodes by averaging the word vectors. The embedding vector . BERT: Use the pre-trained BERT model to describe text Encode to obtain the contextualized embedding representation of the text description, and take the hidden layer state at the [CLS] position as the node The embedding vector For the patient entity list Each medical entity in , using the same language model as the knowledge graph node to encode it and obtain the medical entity The embedding vector .
[0034] Calculate the semantic similarity between patient medical entities and knowledge graph nodes: For the patient entity list Each medical entity in And each node in the knowledge graph kg , calculate their embedding vectors and The semantic similarity between Commonly used similarity calculation methods include: Cosine similarity: and Consider them as two vectors in d-dimensional space and calculate the cosine of the angle between them as the similarity: ; where · represents the vector dot product, and Represents vectors and The L2 norm of . Euclidean distance: and Treat them as two points in d-dimensional space and calculate the Euclidean distance between them , and then convert the distance into similarity: ; ;in, and Represents vectors and The k-th dimension component of .
[0035] Establish a mapping dictionary from patient medical entities to knowledge graph nodes: For the patient entity list Each medical entity in , find the node with the highest semantic similarity among all nodes in the knowledge graph kg ,Will As The mapping node: ; Establish a mapping dictionary from patient medical entities to knowledge graph nodes , where key is the medical entity , value is the mapping node : .
[0036] Use the graph attention network GAT to embed the knowledge graph nodes: represent the knowledge graph kg as an undirected graph G = (V, E), where V is the node set and E is the edge set. , extract its feature vector , forming the feature matrix , where N is the number of nodes. Eigenvector It can be the attribute feature of the node, such as the TF-IDF vector of the text description. Construct the adjacency matrix A according to the edge set E of the knowledge graph, where A[i, j]=1 represents the node and There is an edge connection between them, and A[i, j]=0 means there is no edge connection. Use the graph attention network GAT to encode the feature matrix X and the adjacency matrix A to obtain the node embedding matrix :GAT uses a multi-head attention mechanism to aggregate the neighborhood information of nodes. For each node n_i, calculate its relationship with neighboring nodes The attention weight between : ; Where W is the weight matrix, a is the attention vector, · represents the vector dot product, || represents the vector concatenation, Representation Node The set of neighbor nodes of . Using attention weights Perform weighted summation on the features of neighboring nodes to obtain the node The embedding vector : ; where σ is an activation function, such as ReLU. In order to enhance the expressive power of GAT, a multi-head attention mechanism is used, that is, K independent attention mechanisms are used to transform node features to obtain K embedding vectors, which are then concatenated to obtain the final node embedding vector : .
[0037] Iterating over the mapping dictionary Each patient medical entity in : According to the mapping dictionary , get medical entity Corresponding knowledge graph mapping node In the gynecological disease knowledge graph kg, the mapping node As the central node, one-hop and two-hop nodes and corresponding relationship edges are extracted through breadth-first search BFS to form a subgraph :Initialize a queue queue and central node Join the queue. Initialize a set visited to record the nodes that have been visited, and add the central node Add to the visited collection. Initialize the subgraph , the central node Add a node set to the subgraph. When the queue is not empty, repeat the following steps: Take a node from the head of the queue , as the current node. Traverse the current node All neighbor nodes n_adj in the knowledge graph kg. For each neighbor node , if it has not been visited (i.e. is not in the visited set), then: the neighbor node Add the neighbor node to the queue. Add the visited set. Add subgraph The node collection. With neighbor nodes Add the relationship edge between the subgraph If the current node With the central node If the shortest path distance exceeds 2, the current node is skipped and its neighboring nodes are no longer traversed. Return the constructed subgraph , which contains the central node All nodes and relationship edges with a distance no greater than 2.
[0038] Subgraph The node embedding vector in The attention mechanism is used to calculate the semantic relevance between nodes and obtain the attention weight matrix : For subgraphs Each node in , get the corresponding embedding vector from the node embedding matrix H . Computing center node The embedding vector With subgraph All nodes in the embedding vector Attention weight: Calculate the center node embedding vector With each node embedding vector Similarity : ; for similarity Perform softmax normalization to obtain attention weight ; Return the attention weight matrix ,in Representing a subgraph Midpoint For the central node The attention weight.
[0039] According to the preset threshold For the attention weight matrix Filter and remove nodes and relationship edges whose weights are lower than the threshold to obtain the filtered subgraph : Traverse the attention weight matrix Each element in .if Less than the preset threshold , then: the node From the subgraph Remove the node from the node collection. The relationship edges with other nodes from the subgraph Remove the edge set from the filtered subgraph. , where only the attention weights above the threshold are retained The nodes and relationship edges of The nodes and relationship edges in the patient condition subgraph are constructed : Traverse the subgraph Each node in : Get the node from the node embedding matrix H The embedding vector , as the patient condition subgraph Midpoint Traverse the subgraph Each relationship edge in : From the attention weight matrix Get the node and The attention weight between Compute Node and The embedding vector and The semantic similarity between : ; Calculate the relationship edge according to the formula Weight : ; where α is a hyperparameter used to balance the influence of attention weight and semantic similarity. and its weight Add patient condition subgraph Returns the constructed patient condition subgraph , where the node feature is the embedding vector of the corresponding node, and the edge weight is the weighted average of the attention weight and the semantic similarity.
[0040] All patient medical entities Corresponding patient condition subgraph Merge to get a complete patient condition subgraph : Initialize the patient condition subgraph , the node set and edge set are empty. Traverse each patient medical entity Corresponding patient condition subgraph :Will The node set is merged into In the node collection of The edge set of For duplicate nodes and relationship edges, keep the one with the larger weight. Return the merged patient condition subgraph , which contains all medical entity nodes and semantic relationship edges related to the patient's condition.
[0041] Use graph convolutional neural networks to learn the representation of patient condition subgraphs, and generate semantic embedding vectors for each medical entity through node embedding and neighborhood aggregation; including: Perform random walks on the patient condition subgraph to generate a node sequence: Define the parameters of the random walk: Walk length L: the number of nodes passed by each random walk. Walk number N: the total number of random walks on the patient condition subgraph. For the patient condition subgraph Each node in , perform the following steps N times: As the starting node, initialize an empty node sequence . Add node sequence . Set the current node for , repeat the following steps L-1 times: from the current node The one-hop and two-hop neighbor node set N ( ) randomly selects a node . Add node sequence . Set the current node Updated to The generated node sequence Add to the node sequence set walks. Return the node sequence set walks, where each node sequence contains the starting node and the corresponding one-hop and two-hop neighboring nodes.
[0042] Input the node sequence into the skip-gram model for training to obtain the distributed representation of the node: Define the parameters of the skip-gram model: Embedding dimension D: the dimension of the node embedding vector. Window size C: the maximum distance of the context node. Negative sampling number K: the number of negative samples. For each node sequence in the node sequence set walks , perform the following steps: For the node sequence Each node in , taking it as the central node to generate positive sample pairs ,in for exist The context nodes whose distance does not exceed C. For each positive sample pair , generate K negative sample pairs according to the negative sampling strategy ,in From the patient condition subgraph Nodes randomly selected from . Using the binary cross entropy loss function, the positive and negative sample pairs are trained, and the optimization goal is to maximize the co-occurrence probability of the positive sample pairs and minimize the co-occurrence probability of the negative sample pairs. Return the trained skip-gram model, which contains the D-dimensional embedding vector representation of each node. Using the trained skip-gram model, generate a D-dimensional embedding vector for each node in the patient condition subgraph as the input feature of the graph convolutional neural network: For the patient condition subgraph Each node in , use the trained skip-gram model to generate its D-dimensional embedding vector The embedding vectors of all nodes are combined into a D×|V|-dimensional feature matrix H as the input of the graph convolutional neural network, where |V| is the number of nodes in the patient's condition subgraph.
[0043] Use graph convolutional neural network to learn the representation of patient condition subgraph: define the number of layers K of graph convolutional neural network and the output dimension D_k of each layer. The input feature matrix of layer 0 is , which is the node embedding vector generated by the skip-gram model. , perform the following steps: For the patient condition subgraph Each node in , calculate its feature representation vector at the kth layer :From the feature matrix of the previous layer Get the node of dimensional feature vector For the node Each neighbor node of , calculate the attention weight : From the feature matrix of the previous layer Get the node of dimensional feature vector .Will and Splice into dimensional vector, and input the parameter vector a of the attention mechanism to calculate the LeakyReLU activation value. Perform softmax normalization on the LeakyReLU activation values of all neighboring nodes to obtain the attention weight Using attention weights Perform weighted summation of neighbor node features and add them to node Its own characteristics Add, then through linear transformation and activation function, get the node At the kth level dimensional feature representation vector : ;in, is the kth layer of graph convolution dimensional weight matrix, σ is the activation function, such as ReLU, etc. The feature representation vectors of all nodes are composed The characteristic matrix of , as the input of the next layer of graph convolution. Return the output feature matrix of the last layer of graph convolution , where each column corresponds to a node dimensional embedding representation vector.
[0044] At the top layer of the graph convolutional neural network, the attention pooling operation is used to perform weighted summation on the output of the graph convolution to obtain the semantic embedding vector of each medical entity. At the top layer of the graph convolutional neural network, i.e., the Kth layer, the D-dimensional feature vector of each node is obtained: For the patient condition subgraph Each node in , from the output feature matrix of the K-th layer graph convolution Get its corresponding D-dimensional feature vector . Calculate the attention weight of each node :Define the parameters of the attention mechanism: parameter vector q, dimension is 1×D. parameter matrix W, dimension is D×D. For the patient condition subgraph Each node in , perform the following steps: The eigenvector of Multiply it with the parameter matrix W of the attention mechanism to get a D-dimensional vector . For vector Apply the hyperbolic tangent activation function tanh to get the D-dimensional activation vector . The parameter vector q is combined with the activation vector Perform dot product operation to get the node Attention score : ; Attention scores for all nodes Indexation and normalization are performed to obtain the node The attention weight : ; Where V represents the node set of the patient condition subgraph. Calculate the final graph representation vector z of the patient condition subgraph: For the patient condition subgraph Each node in , its feature vector And the corresponding attention weight Multiply them together to get the weighted eigenvector . Sum the weighted eigenvectors of all nodes to obtain the D-dimensional graph representation vector z of the patient's condition subgraph: .
[0045] Using a gated recurrent unit neural network based on an attention mechanism, with the semantic embedding vector of the medical entity as input, the semantic relevance between each entity and the disease is calculated through iterative reasoning and attention weighting, and the gated recurrent unit is used to build an inference network: Define the parameters of the inference network: Iteration number T: The iteration length of the inference network, that is, the number of input medical entities. Hidden layer dimension D: The dimension of the entity hidden state vector and the candidate disease embedding vector. Initialize the hidden state vector is a D-dimensional zero vector. For t=1, 2, ..., T, perform the following steps: embed the medical entity semantics at time t into the vector and the hidden state vector of the previous moment Concatenate as input to the update gate and reset gate. Calculate the update gate vector :Will and update gate parameter matrix Multiply them together to get a 2D vector. Apply the sigmoid activation function σ to this vector to get a D-dimensional update gate vector . Calculate the reset gate vector :Will and reset the gate parameter matrix Multiply them together to get a 2D vector. Apply the sigmoid activation function σ to this vector to get a D-dimensional reset gate vector . Calculate the hidden state vector :The hidden state of the previous moment and reset gate vector Multiply them together to get a D-dimensional vector .Will Embedded with current entity Splice to get a 2D vector .Will Multiply it with the hidden layer parameter matrix W and apply the hyperbolic tangent activation function tanh to get the D-dimensional hidden layer state vector . Calculate the hidden state vector at the current moment :The hidden state of the previous moment and Multiply them together to get a D-dimensional vector . The hidden state and update gate vector Multiply them together to get a D-dimensional vector .Will and Add together to get the D-dimensional hidden layer state vector at the current moment .
[0046] In each iteration, the attention mechanism is introduced to calculate the semantic relevance between the entity and the candidate disease: Define the parameters of the attention mechanism: Number of candidate diseases n: The total number of candidate diseases. Attention hidden dimension K: The hidden dimension of semantic relevance calculation. For t=1, 2, ..., T, perform the following steps: For i=1, 2, ..., n, calculate the entity hidden state at time t and the i-th candidate disease embedding The semantic relevance score of :Will and the attention parameter matrix Multiply them together to get a K-dimensional vector .Will and the attention parameter matrix Multiply them together to get a K-dimensional vector .Will , Add the bias term b and apply the hyperbolic tangent activation function tanh to get a K-dimensional vector . The parameter vector v is combined with Perform dot product operation to get the semantic relevance score . Semantic relevance scores for all candidate diseases Perform softmax normalization to obtain the attention weight of the i-th candidate disease at time t : .
[0047] Calculate the final semantic relevance score between the medical entity and the candidate disease: For i=1, 2, ..., n, calculate the sum of the attention weights of the i-th candidate disease at T iterations: ; Perform weighted summation on n candidate diseases to obtain the semantic relevance score vector s between the current medical entity and the candidate disease: ;in,( represents the sum of attention weights of the i-th candidate disease, Represents the semantic embedding vector of the i-th candidate disease.
[0048] Disease screening based on semantic relevance: Sorting candidate diseases: Sort candidate diseases in descending order according to the element values in the semantic relevance score vector s. Assume that the set of candidate diseases is , where n represents the total number of candidate diseases. The corresponding semantic relevance score vector is ,in represents the i-th candidate disease The semantic relevance score of The size of the candidate disease Sort in descending order to get a sorted list of candidate diseases ,in is the ranking index of candidate diseases. Select the top N diseases with the highest semantic relevance scores: select the ranked candidate disease list based on the preset threshold N The top N diseases form a candidate list of diseases The threshold N can be set according to actual needs. For example, N=5 means selecting the top five diseases with the highest semantic relevance scores. Disease candidate list Contains the N diseases that are most relevant to the patient's condition, namely . Use medical rules and knowledge graphs for further screening and verification: define a set of medical rule sets , where m represents the total number of rules. Each rule Represents a medical constraint used to verify whether a disease candidate meets specific medical standards or requirements. Each disease in , perform the following steps: according to the medical rule set R, check the disease in turn Is each rule satisfied? If the disease If all the rules are met, it is kept in the disease candidate list. If a rule is not met, it will be removed from the disease candidate list. After screening by medical rules, a subset of diseases that meet medical constraints is obtained. .
[0049] Figure 5 This is an exemplary flow chart for obtaining the final diagnosis result according to some embodiments of the present application. The encrypted candidate list is transmitted to the patient's local device, decrypted using the patient's private key, and the CART decision tree is used for reasoning based on the disease candidate list to obtain the final diagnosis result; including: asymmetric decryption of the disease candidate list using the patient's private key: the patient's local device receives the encrypted disease candidate list and asymmetric decrypts it using the patient's private key. Assume that the patient's private key is , the encrypted disease candidate list is , the decryption function is Decrypt. Execute the decryption operation: , get the decrypted disease candidate list . contains multiple candidate diseases, each candidate disease is represented by the disease name and the corresponding semantic relevance score Composition, that is , where k is the number of candidate diseases. Extract the structural features of the patient and construct an N-dimensional patient feature vector: Based on the patient's electronic medical record , extract the patient's structured features, including symptoms, signs, and examination results. Assume that the extracted structured features are , where N is the dimension of the feature. The extracted structural features are constructed into an N-dimensional patient feature vector .
[0050] Data preparation and feature engineering: Collecting a large amount of patient electronic medical record data , including the patient's symptoms, signs, examination results and corresponding diagnosis results. Preprocess the electronic medical record data, extract structured features, and construct the patient feature vector X and the corresponding diagnosis result label y. Assume that the extracted structured features are , where N is the dimension of the feature, and the patient feature vector The diagnosis result label y is the category of the disease. Assume that there are C different disease categories, y ∈ {1, 2, ..., C}. The extracted patient feature vector X and the corresponding diagnosis result label y form a training data set , where m is the number of training samples.
[0051] Building a CART decision tree model: Using a training dataset Building a CART decision tree model Starting from the root node, recursively build nodes and branches of the decision tree. For each node, select an optimal feature attribute and the corresponding branch conditions , so that when the data set is divided according to the feature attribute and branch condition, the impurity (such as Gini index or entropy) can be minimized. and branch conditions , divide the data set into the left subset and right subset . Recursively on the left subset and right subset The left subtree and the right subtree are constructed separately until the stopping condition is met (such as the number of samples in the node is less than the threshold, the depth of the tree reaches the limit, etc.). At the leaf node, the category of the leaf node is determined according to the diagnostic result label of the sample contained in the node. . Model training and optimization: Using the training dataset The constructed CART decision tree model Training. Optimize the model parameters by minimizing the loss function (such as cross entropy loss or mean square error) so that the model has the best prediction performance on the training data. You can use the gradient descent algorithm or its variants (such as the Adam optimizer) to update the model parameters, iterating multiple epochs until the model converges. During the training process, you can use cross-validation or leave-out validation to divide the data set into a training set and a validation set to evaluate the generalization performance of the model and select the optimal hyperparameters (such as the maximum depth of the tree, the minimum number of samples for leaf nodes, etc.).
[0052] Model evaluation and tuning: Using a test dataset For the trained CART decision tree model Evaluate and calculate the performance indicators of the model on the test set (such as accuracy, precision, recall, F1 value, etc.). By analyzing the performance of the model on the test set, identify possible problems (such as overfitting or underfitting) and make corresponding adjustments. The model performance can be optimized by adjusting the hyperparameters of the decision tree (such as the maximum depth of the tree, the minimum number of samples of leaf nodes, feature selection strategy, etc.). You can also consider using ensemble learning methods (such as random forests, gradient boosting trees, etc.) to further improve the performance and stability of the model. Model deployment and application: The trained CART decision tree model Save it in a deployable format (such as PMML, ONNX, etc.) for use in a production environment. Input to the deployed decision tree model Inference and prediction are performed in The decision tree starts from the root node and recursively moves to the corresponding leaf node according to the characteristic attributes and branch conditions of each node. After reaching the leaf node, the category of the leaf node is , and output the corresponding diagnosis results.
[0053] Recursively traverse the decision tree and make branch decisions based on the value of the patient's feature vector: From the root node of the decision tree Start by getting the root node's feature attributes and branch conditions . Compare patient feature vectors Corresponding attributes The value of Branch conditions with the root node .if satisfy , then enter the left subtree ; Otherwise enter the right subtree . Recursively execute the above steps until you reach a leaf node Assuming the maximum depth of the decision tree is H, the time complexity of the recursion is O(H). When reaching each leaf node, select the disease with the highest semantic relevance score as the preliminary diagnosis result: Assuming the leaf node reached is , where i is the number of the leaf node, i = 1, 2, ..., M, M is the total number of leaf nodes.
[0054] According to the patient feature vector The value of is selected from the disease candidate list Select the semantic relevance score in The highest disease As a leaf node Specifically, for each candidate disease , calculate its correlation with the patient's feature vector The semantic relevance score of . Select the disease with the highest semantic relevance score ,Right now , as a leaf node Get the preliminary diagnosis result set of M leaf nodes . Hypothetical Disease Candidate List The length of is k, then the time complexity of selecting the disease with the highest semantic relevance score at each leaf node is O(k). Calculate the matching degree of the feature attributes of the patient feature vector on the path to each leaf node, and perform weighted voting on the preliminary diagnosis results: For each leaf node , calculate the patient feature vector On the path to this node The matching degree of the characteristic attributes on .path The feature attribute set on , where L is the path length, For the path The characteristic attributes of each node. , calculate its feature vector in the patient The corresponding value in Branching conditions of nodes on the path Similarity .
[0055] Similarity Various similarity measurement methods can be used for calculation, such as Euclidean distance, cosine similarity, etc., and the appropriate method can be selected according to the type of feature attribute. By path The similarity of all feature attributes The weighted average is . The preliminary diagnosis result set for M leaf nodes Perform weighted voting, where the weight is the matching degree of the corresponding path The weighted voting result is Assuming that the average length of the path is L, the time complexity of calculating the matching degree of each leaf node is O(L), and the time complexity of weighted voting for M leaf nodes is O(M). According to the voting results, the disease with the highest number of votes and exceeding the threshold is selected as the final diagnosis result: According to the weighted voting results , count the number of votes for each disease. , whose votes are all weight The sum of Select the disease with the highest number of votes and above the preset threshold As the final diagnosis result obtained by CART decision tree inference. If no disease has a number of votes exceeding the threshold, it is considered that no definite diagnosis can be given. Assume that the disease candidate list The length of is k, then the time complexity of counting the number of votes for each disease and selecting the final diagnosis result is O(k). The final diagnosis result is encrypted with the patient's public key and uploaded to the server. The patient uses the private key to decrypt and view the diagnosis result stored on the server.
Claims
1. An Internet-based online gynecological disease intelligent consultation method, used in an online gynecological disease intelligent consultation system, characterized in that: include: Authentication of patients is performed, and RSA asymmetric encryption method is used to generate the patient's public and private key pair; The patient uses a private key to encrypt the inquiry information, which includes the patient's chief complaint, current medical history, and past medical history; the system uses the patient's public key to decrypt the encrypted inquiry information to obtain the decrypted inquiry information; The decrypted query information is processed using a deep learning-based BERT model on the local device to obtain a structured description of the patient's condition. The patient's public key is then used to encrypt the description of the condition to obtain an encrypted description of the patient's condition. The encrypted description of the patient's condition is uploaded to the server, where it is decrypted using the system private key. Based on the description of the patient's condition, a diagnosis is made using a reasoning method based on a knowledge graph to obtain a list of candidate diseases. Encrypt the disease candidate list using the patient's public key to obtain an encrypted disease candidate list; The encrypted candidate list is transmitted to the patient's local device, decrypted using the patient's private key, and the CART decision tree is used for reasoning based on the disease candidate list to obtain the final diagnosis result; The final diagnosis result is encrypted with the patient's public key and uploaded to the server. The patient uses the private key to decrypt and view the diagnosis result stored on the server.
2. The method for online gynecological disease intelligent consultation based on the Internet according to claim 1, characterized in that: Obtain a structured description of the patient's condition, including: Use the BERT model pre-trained in the medical field to perform character-level segmentation on the decrypted query information to obtain a segmentation list of the query information; The word list is input into the BERT model, and the semantic vector of each word is extracted through a multi-layer self-attention mechanism and a feedforward neural network. The bidirectional long short-term memory network BiLSTM is used to encode the semantic vector of each word, and the contextual semantic vector of the query information is obtained through bidirectional information transmission and gating mechanism; Use the conditional random field (CRF) algorithm to perform medical named entity recognition on the context semantic vector. By learning the transition probability between entity labels, the entities in the query information are extracted. The entities include symptoms, signs, diseases, and drugs. Use the transfer-based syntactic dependency analysis method to build a syntactic dependency tree of the query information and obtain the semantic dependency relationship between entities; According to semantic dependencies, a rule-based approach is used to convert query information into a structured description of the patient's condition.
3. The method for online gynecological disease intelligent consultation based on the Internet according to claim 2, characterized in that: Get a list of disease candidates, including: Based on the patient's condition description, the patient's electronic medical record is constructed, which includes symptoms and duration; Map the medical entities in the patient's electronic medical record to the corresponding nodes in the pre-built gynecological disease knowledge graph to obtain the patient's condition subgraph; Use graph convolutional neural networks to learn the representation of patient condition subgraphs, and generate semantic embedding vectors for each medical entity through node embedding and neighborhood aggregation; Using an attention-based gated recurrent unit neural network, the semantic embedding vector of the medical entity is used as input, and the semantic relevance between each entity and the disease is calculated through iterative reasoning and attention weighting. According to semantic relevance, a rule-based reasoning method is used to screen out the top N diseases with the highest relevance to the patient's condition from the candidate diseases to form a candidate disease list.
4. The method for online gynecological disease intelligent consultation based on the Internet according to claim 3 is characterized by: Get the patient's condition subgraph, including: Extract medical entities from the patient's electronic medical record, including symptoms, signs, diseases, drugs, and surgeries, and assemble the extracted medical entities into a patient entity list; In the pre-built gynecological disease knowledge graph, semantic embedding is performed on the text description of each node in the knowledge graph and each medical entity in the patient entity list to obtain the knowledge graph node embedding vector and the patient entity embedding vector. Calculate the semantic similarity between the patient entity embedding vector and the knowledge graph node embedding vector. For each medical entity in the patient entity list, select the knowledge graph node with the highest semantic similarity as the mapping node, and establish a mapping dictionary from the patient medical entity to the knowledge graph node. A graph neural network GAT model is constructed based on the gynecological disease knowledge graph, and a multi-head attention mechanism is used to aggregate the neighborhood information of the node to obtain the embedding vector of each node; Traverse each patient medical entity in the mapping dictionary, take the corresponding mapping node as the central node in the gynecological disease knowledge graph, and extract the one-hop and two-hop nodes and the corresponding relationship edges through breadth-first search; The embedded vectors of the extracted mapping nodes and neighboring nodes are used to calculate the semantic relevance between nodes through the attention mechanism to obtain the attention weight matrix. The attention weight matrix is filtered according to the preset threshold to remove nodes and relationship edges with weights lower than the threshold. The filtered nodes and relationship edges are constructed into a patient condition subgraph, where the node feature is the embedding vector of the corresponding node, and the edge weight is the weighted average of the attention weight between the connected nodes and the semantic similarity between the nodes.
5. The method for online gynecological disease intelligent consultation based on the Internet according to claim 4, characterized in that: Generate semantic embedding vectors for each medical entity, including: Perform random walks on the patient condition subgraph to generate node sequences, each of which contains a starting node and corresponding one-hop and two-hop neighboring nodes; The node sequence is input into the skip-gram model for training, and the distributed representation of the node is obtained by maximizing the co-occurrence probability of the node and the corresponding context node; Using the trained skip-gram model, a D-dimensional embedding vector is generated for each node in the patient's condition subgraph as the input feature of the graph convolutional neural network; Use the graph convolution layer in the graph convolutional neural network to update the node representation by aggregating the neighborhood information of the node, and introduce the attention mechanism to set different importance of different neighbor nodes; At the top layer of the graph convolutional neural network, an attention pooling operation is used to perform weighted summation on the output of the graph convolution to obtain the semantic embedding vector of each medical entity.
6. The method for online gynecological disease intelligent consultation based on the Internet according to claim 5, characterized in that: Set different importances for different neighbor nodes using the following formula: Where auv represents the attention weight of node u’s contribution to node v; a represents the D×1-dimensional parameter vector of the attention mechanism; and Respectively represent the D-dimensional feature vectors of nodes u and v in the k-1th layer of graph convolution; N(v) represents the set of one-hop and two-hop neighboring nodes of node v in the patient's condition subgraph; || represents the vector concatenation operation, which and concatenated into a 2Dx1 vector; LeakyReLU represents the Leaky ReLU activation function; T represents transpose; w represents the one-hop or two-hop neighboring node of node v in the patient's condition subgraph; When representing the k-1th layer of graph convolution, the D-dimensional feature representation vector of the neighborhood node w of node v.
7. The method for online gynecological disease intelligent consultation based on the Internet according to claim 6, characterized in that: The semantic embedding vector of each medical entity is obtained through the following formula: Wherein, z represents the final D-dimensional graph representation vector of the patient's condition subgraph; V represents the node set of the patient's condition subgraph; K represents the number of layers of the graph convolutional neural network; Represents the D-dimensional feature vector of node v during the K-th layer of graph convolution; β v Represents the attention weight of node v: Among them, q represents the 1×D dimensional parameter vector of the attention mechanism; W represents the D×D dimensional parameter matrix of the attention mechanism; tanh represents the hyperbolic tangent activation function; u represents the node.
8. The method for online gynecological disease intelligent consultation based on the Internet according to claim 7, characterized in that: Calculate the semantic relevance between each entity and the disease, including: A gated recurrent unit is used to construct an inference network of length T. The semantic embedding vectors of medical entities are sequentially input into the network. The hidden states of the entities are iteratively calculated to model the semantic associations between entities. In each iteration of the gated recurrent unit, the semantic relevance weight between the current medical entity and the candidate disease is calculated through the attention mechanism; After the iteration of the gated recurrent network is terminated, the candidate disease semantic vectors are weighted summed using the attention weights at T moments to obtain the final semantic relevance score vector s between each medical entity and the candidate disease.
9. The method for online gynecological disease intelligent consultation based on the Internet according to any one of claims 2 to 8, characterized in that: Get the final diagnosis, including: Use the patient's private key to asymmetrically decrypt the disease candidate list to obtain a list containing multiple candidate diseases, each candidate disease in the list consists of a disease name and a corresponding semantic relevance score; According to the patient's electronic medical record, the patient's structured features are extracted to construct an N-dimensional patient feature vector. The structured features include the patient's symptoms, signs, and examination results. Input the N-dimensional patient feature vector into the pre-trained CART decision tree model; Starting from the root node of the decision tree model, the root node represents a feature attribute and a branch condition. Compare the value of the corresponding attribute in the patient feature vector with the branch condition. If the branch condition is met, enter the left subtree, otherwise enter the right subtree, and execute recursively until reaching a leaf node; When reaching each leaf node, according to the value of the patient's feature vector, the disease with the highest semantic relevance score is selected from the disease candidate list as the preliminary diagnosis result of the corresponding leaf node, and a diagnosis result set of M leaf nodes is obtained, where M is the number of leaf nodes; Calculate the matching degree of the characteristic attributes of the N-dimensional patient feature vector on the path to each leaf node. The matching degree is determined by the similarity between the characteristic attribute value on the path and the corresponding attribute value in the patient feature vector. Perform weighted voting on the preliminary diagnosis results of the M leaf nodes, with the weight being the matching degree of the corresponding path. According to the voting results, the disease with the highest number of votes and exceeding the threshold is selected as the final diagnosis result obtained by CART decision tree reasoning.
10. An Internet-based online gynecological disease intelligent consultation system, characterized in that: include: At least one processing unit; used to execute instructions to implement the Internet-based online gynecological disease intelligent consultation method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Intelligent medical system with problem understanding function and diagnosis method thereof
CN111540461A
Interpretable smart medical auxiliary diagnosis system based on text retrieval
CN112687388A
MiRNA and disease incidence relation prediction method based on graph convolutional network
CN114496092A
Medical hospital guide method based on knowledge graph
CN117393120A
Double-graph neural network medical named entity recognition method based on multi-feature fusion
CN117408255A
Cited By
Dizziness inquiry information processing method and device based on knowledge graph constraint
CN121528579A