Medical intelligent decision-making method based on Deepseek and time sequence causal knowledge graph

By constructing a dynamic temporal causal knowledge graph and a lightweight DeepSeek model, the problems of knowledge update lag and insufficient reasoning in complex input processing in medical intelligent decision-making systems are solved, and accurate intelligent triage and disease risk prediction are achieved with interpretability and flexible deployment capabilities.

CN120636780AActive Publication Date: 2025-09-12QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)

Patent Information

Application Number
CN202511105778.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-09-12
Estimated Expiration
2045-08-08

AI Technical Summary

Technical Problem

Existing medical intelligent decision-making systems have problems with delayed knowledge updating, weak semantic understanding, and insufficient reasoning ability when processing complex, ambiguous, or context-dependent inputs. In particular, they lack traceability and stability in high-risk clinical decision-making tasks.

Method used

Construct a dynamic temporal causal knowledge graph, combine graph attention mechanism and multi-hop causal reasoning, fuse DeepSeek large model and lightweight model, migrate it to the lightweight model through knowledge distillation technology, and combine it with attention mechanism for intelligent triage and disease risk prediction.

Benefits of technology

It achieves accurate modeling of the temporal evolution of medical entities, improves the accuracy and reliability of matching symptoms with target departments, and is interpretable, facilitating flexible deployment on different platforms and clinical auxiliary diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120636780A_ABST
    Figure CN120636780A_ABST
Patent Text Reader

Abstract

The invention discloses a medical intelligent decision-making method based on Deepseek and a time sequence causal knowledge graph, and the method comprises the following steps: 1, constructing an initial static medical knowledge graph, and generating a dynamic time sequence causal knowledge graph; 2, finely adjusting and training the DeepSeek model to enable the DeepSeek model to adapt to the medical field; and step 3, receiving and analyzing the text uploaded by the patient, performing intelligent triage and disease risk prediction, and realizing accurate matching of patient symptoms and target departments and intelligent prediction and early warning of potential diseases. The method aims at providing accurate triage and disease risk prediction for patients, constructing a scientific and efficient medical intelligent decision-making mechanism and optimizing medical resource allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence and medical information technology, and in particular to a medical intelligent decision-making method based on Deepseek and a temporal causal knowledge graph. Background Art

[0002] With the acceleration of medical informatization and the rapid development of artificial intelligence technology, intelligent assisted diagnosis and treatment systems have become an important technical means to alleviate this problem. However, traditional medical intelligent decision-making systems still face many challenges in practical application, such as the strong heterogeneity of medical data, lagging knowledge updates, weak semantic understanding, and insufficient reasoning capabilities, which restrict their clinical application effectiveness and promotion value.

[0003] The current mainstream technology approaches mainly include structured knowledge-driven systems centered around knowledge graphs, and semantic understanding and conversational reasoning systems based on large language models. Knowledge graphs can effectively integrate the relationships between entities such as diseases, symptoms, and departments, and have good knowledge organization and interpretability; however, their reasoning capabilities are limited, making it difficult to handle complex, ambiguous, or context-dependent inputs. Large language models such as DeepSeek have powerful natural language understanding and generation capabilities, can recognize diverse expressions, and complete symptom analysis and preliminary diagnostic reasoning. However, due to the lack of structured medical knowledge support, their reasoning results are uncertain, especially in high-risk clinical decision-making tasks, lacking traceability and stability.

[0004] Furthermore, medical events are highly temporal and causal. For example, an abnormal test result may trigger a series of complications. A single static knowledge graph cannot accurately depict these causal relationships that evolve over time. Existing large models still have significant shortcomings in their ability to model temporal logic and causal pathways. Therefore, there is an urgent need for an intelligent medical decision-making system that integrates structured medical knowledge with the reasoning power of large models, and that possesses causal modeling and dynamic updating capabilities.

[0005] In view of this, this invention is proposed. Summary of the Invention

[0006] The purpose of this invention is to address the shortcomings of the existing technology and propose a medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph, aiming to provide patients with accurate triage and disease risk prediction, build a scientific and efficient medical intelligent decision-making mechanism, and optimize medical resource allocation.

[0007] In order to achieve the above object, the present invention also adopts the following technical solutions: A medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph includes the following steps: Step 1: Construct an initial static medical knowledge graph and inject the time and causal dimensions. Model the evolutionary relationship of medical events through the dynamic temporal graph modeling layer. Introduce the graph attention mechanism to realize causal path identification, and combine the multi-hop causal relationship reasoning method to generate a dynamic temporal causal knowledge graph. Step 2: Fine-tune the DeepSeek model to adapt it to the medical field. The fine-tuned DeepSeek model is used as the teacher model and migrated to a lightweight model through knowledge distillation. During the distillation process, key causal inference parameters are retained and causal path explanation labels are embedded. Step 3: Receive and parse the text uploaded by the patient, introduce the attention mechanism to extract key medical entities and contextual dependencies in the text, and combine it with the dynamic temporal causal knowledge graph to perform intelligent triage and disease risk prediction, achieve accurate matching of patient symptoms with target departments, and intelligent prediction and early warning of potential diseases.

[0008] Furthermore, the construction of the dynamic temporal causal knowledge graph in step 1 includes the following steps: Step 1.1: Integrate multi-source heterogeneous medical data; Step 1.2: Preprocess the integrated multi-source heterogeneous medical data; Step 1.3: Based on timestamp sequence Medical record events Create a time evolution graph , where the node set Represents medical entities, edge sets Represents time dependency; Step 1.4: Mining with Bayesian Causal Discovery Algorithm Entity pairs in The causal direction , building a causal graph , and finally form a joint graph , It represents the set of causal edges in the causal graph.

[0009] Furthermore, in the step of constructing a dynamic temporal causal knowledge graph in step 1, medical entities include one or more of patients, diseases, symptoms, departments, consultation times, examinations and treatment methods, and risk factors, and edge relationships include time dependencies and / or causal relationships.

[0010] Furthermore, the Bayesian causal discovery algorithm in step 1.4 includes the following steps: Step 1.4.1: Based on the time series data of medical entity pairs, calculate the conditional independence test to screen the potential causal direction; Step 1.4.2: Use a greedy equivalence class search algorithm based on BIC score to optimize the causal graph structure and eliminate reverse causal paths in combination with timing constraints; Step 1.4.3: Use medical experts’ experience rules to manually verify and correct the automatically discovered causal edges to ensure the clinical rationality of the graph.

[0011] Furthermore, the fine-tuning and distilling of the DeepSeek model in step 2 includes the following steps: Step 2.1: Build a structured medical knowledge dataset and fine-tune the base model DeepSeek-R1-Distill-Qwen-32B to enhance its understanding of medical entities and relationships by inserting an adaptation layer using the LoRA method, freezing the original parameters, and training only the newly added modules. Step 2.2: Use the fine-tuned model as a teacher model to generate standard answer data for patient consultation scenarios. Filter the generated content using a language model evaluation tool to construct a high-quality question-answer dataset. Step 2.3: Use the constructed high-quality question-answer pair dataset as the knowledge distillation input to train the lightweight student model Qwen2.5-7B. This model can maintain the clinical triage accuracy while reducing the model size and inference latency, making it easier to deploy in actual medical terminal devices.

[0012] Furthermore, in step 3, in the process of intelligent triage and disease risk prediction, structured retrieval is used to enhance the generation mechanism, including the following steps: Step 3.1: Perform medical entity recognition and context analysis on the text uploaded by the patient to extract key entity and relationship information; Step 3.2: Based on the extracted key entities and relationship information, perform multi-hop causal path retrieval in the dynamic temporal causal knowledge graph to obtain the disease evolution chain, potential cause nodes, and related department information related to the current input, forming a structured knowledge prompt set; Step 3.3: The retrieved atlas path information and the original patient input content are jointly encoded into structured prompts, which are input into the fine-tuned and distilled DeepSeek model to generate prediction results; Step 3.4: Introduce RAG to use graph knowledge as the retrieval source and complete accurate knowledge recall for clinical tasks through multi-hop entity reasoning.

[0013] Furthermore, in step 3.2, performing multi-hop causal path retrieval in the dynamic temporal causal knowledge graph includes the following steps: Step 3.2.1: Construct the representation vectors of the nodes in the graph and the weight matrix A of the causal edges, ,element Representing an entity arrive causal weights, where each node represents a medical entity, the edge represents the causal relationship or time evolution path, and the time information is introduced into the graph structure through timestamp or sequence embedding; Step 3.2.2: Use graph neural networks for multi-hop information propagation to update node state representations. The update rule is: the new state of each node is the weighted sum of the states of its neighboring nodes, processed by linear transformation and nonlinear activation function. The weight coefficient is calculated through the graph attention mechanism to measure the strength of causal relationships between nodes. Step 3.2.3: Starting from the patient input entity, the multi-hop path search algorithm is used to mine potential causal chains in the graph, and the set of causal chain paths with the highest weight is output as the knowledge prompt content of the generation module.

[0014] Furthermore, in step 3, intelligent triage uses a fusion decision strategy and a comprehensive graph reasoning scoring function. Semantic matching value with language model , the final target department matching decision function is: ; In the formula, C is the set of candidate departments, and α∈[0,1] is the weight factor.

[0015] Furthermore, in step 3, disease risk prediction is based on the dynamic knowledge graph and combined with the event sequence within the time window. , disease risk is calculated using the Bayesian risk score formula: ; And based on the causal path set Show key impact paths, path visualization by showing graph attention weights Heatmap of associations with entity nodes.

[0016] Furthermore, in step 3, patient information analysis uses a medical entity parsing network based on an attention mechanism, including the following steps: Step 3.5: Use the pre-trained medical model to extract token expressions from patient text , and combines features such as position coding and symptom temporal labels to form a multi-dimensional input; Step 3.6: Use a multi-head attention mechanism to model the contextual entity relationship. The attention calculation method is as follows: ; In the formula, Q, K, and V are query, key, and value vectors respectively. is the vector dimension scaling factor; Step 3.7: Output key medical entity set and its relationship with contexts such as time series, indicators, and parts, for subsequent graph entity mapping and knowledge retrieval.

[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. Introducing dynamic temporal causal modeling: By constructing a dynamic temporal causal knowledge graph, we can model medical entities and their evolutionary relationships over time, support multi-hop causal chain mining and evolutionary path reasoning, and more closely follow the actual clinical course of disease development, providing a traceable knowledge basis for disease prediction and auxiliary diagnosis.

[0018] 2. Integration of semantic understanding and causal reasoning: Deeply integrating the DeepSeek large model with strong semantic understanding capabilities with the structured causal knowledge graph makes up for the shortcomings of traditional triage systems in complex expression understanding and clinical causal reasoning, and significantly improves the accuracy and reliability of matching symptoms with target departments.

[0019] 3. Lightweight deployment based on knowledge distillation: Using knowledge distillation technology, DeepSeek's large model capabilities are migrated to lightweight models, significantly reducing model size and computing resource consumption while ensuring inference accuracy, facilitating flexible deployment on different platforms such as mobile terminals and in-hospital servers.

[0020] 4. Interpretability and decision transparency: By displaying the key causal chains in the decision-making process through graph path visualization and attention heat maps, the triage and prediction results are well interpretable, which helps clinical medical staff understand and review model recommendations and enhances its clinical auxiliary value. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a flowchart of a medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph; Figure 2 Construct a flow chart for a dynamic temporal causal knowledge graph of a medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph; Figure 3 This is a partial example diagram of a dynamic temporal causal knowledge graph for a medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph; Figure 4 This is an operational flow chart of a medical intelligent decision-making system based on Deepseek and temporal causal knowledge graph. DETAILED DESCRIPTION

[0022] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0023] Example 1: A medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph, such as Figure 1 As shown, the following steps are included: Step 1: Construct an initial static medical knowledge graph and inject the time and causal dimensions. Model the evolutionary relationship of medical events through the dynamic temporal graph modeling layer. Introduce the graph attention mechanism to realize causal path identification, and combine the multi-hop causal relationship reasoning method to generate a dynamic temporal causal knowledge graph. In this embodiment, a dynamic temporal causal knowledge graph is constructed through step 1.

[0024] Step 2: Fine-tune the DeepSeek model to adapt it to the medical field. The fine-tuned DeepSeek model is used as the teacher model and migrated to a lightweight model through knowledge distillation. During the distillation process, key causal inference parameters are retained and causal path explanation labels are embedded. In this embodiment, the DeepSeek model is adapted and lightweighted through step 2, which greatly reduces the model size and inference latency, making it suitable for the actual deployment needs of edge medical terminals.

[0025] Step 3: Receive and parse the text uploaded by the patient, introduce an attention mechanism to extract key medical entities and contextual dependencies in the text, and combine it with a dynamic temporal causal knowledge graph to perform intelligent triage and disease risk prediction, achieving accurate matching of patient symptoms with target departments, as well as intelligent prediction and early warning of potential diseases; In this embodiment, the text uploaded by the patient includes electronic medical records, examination reports, etc.; electronic medical records and examination reports include structured information and unstructured information; through step 3, functions such as patient information analysis and intelligent decision-making are completed.

[0026] The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph in this embodiment has the following beneficial effects: 1. Introducing dynamic temporal causal modeling: By constructing a dynamic temporal causal knowledge graph, we can model medical entities and their evolutionary relationships over time, support multi-hop causal chain mining and evolutionary path reasoning, and more closely follow the actual clinical course of disease development, providing a traceable knowledge basis for disease prediction and auxiliary diagnosis.

[0027] 2. Integration of semantic understanding and causal reasoning: Deeply integrating the DeepSeek large model with strong semantic understanding capabilities with the structured causal knowledge graph makes up for the shortcomings of traditional triage systems in complex expression understanding and clinical causal reasoning, and significantly improves the accuracy and reliability of matching symptoms with target departments.

[0028] 3. Lightweight deployment based on knowledge distillation: Using knowledge distillation technology, DeepSeek's large model capabilities are migrated to lightweight models, significantly reducing model size and computing resource consumption while ensuring inference accuracy, facilitating flexible deployment on different platforms such as mobile terminals and in-hospital servers.

[0029] 4. Interpretability and decision transparency: By displaying the key causal chains in the decision-making process through graph path visualization and attention heat maps, the triage and prediction results are well interpretable, which helps clinical medical staff understand and review model recommendations and enhances its clinical auxiliary value.

[0030] In an optional embodiment, constructing a dynamic temporal causal knowledge graph in step 1 includes the following steps: Step 1.1: Integrate multi-source heterogeneous medical data; In this optional embodiment, the sources of multi-source heterogeneous medical data include electronic medical records, medical literature, medical encyclopedias, expert experience rules, disease and drug databases, and real diagnosis and treatment data resources of hospitals.

[0031] Step 1.2: Preprocess the integrated multi-source heterogeneous medical data; In this optional embodiment, preprocessing includes removing duplicate, erroneous or irrelevant information, entity standardization, semantic ambiguity resolution and structural cleaning to improve the quality and consistency of downstream graph construction.

[0032] Step 1.3: Based on timestamp sequence Medical record events Create a time evolution graph , where the node set Represents medical entities, edge sets Indicates time dependency.

[0033] Step 1.4: Mining with Bayesian Causal Discovery Algorithm Entity pairs in The causal direction , building a causal graph , and finally form a joint graph , It represents the set of causal edges in the causal graph.

[0034] In an optional embodiment, in the step of constructing a dynamic temporal causal knowledge graph in step 1, the medical entities include one or more of patients, diseases, symptoms, departments, consultation times, examinations and treatment methods, and risk factors, and the edge relationships include time dependencies and / or causal relationships.

[0035] In an optional embodiment, the Bayesian causal discovery algorithm in step 1.4 includes the following steps: Step 1.4.1: Based on the time series data of medical entity pairs, calculate the conditional independence test to screen the potential causal direction.

[0036] Step 1.4.2: Use the greedy equivalence class search algorithm based on BIC score to optimize the causal graph structure and eliminate reverse causal paths in combination with timing constraints.

[0037] Step 1.4.3: Use medical experts’ experience rules to manually verify and correct the automatically discovered causal edges to ensure the clinical rationality of the graph.

[0038] In an optional embodiment, fine-tuning and distilling the DeepSeek model in step 2 includes the following steps: Step 2.1: Build a structured medical knowledge dataset and fine-tune the base model DeepSeek-R1-Distill-Qwen-32B to enhance its understanding of medical entities and relationships by inserting an adaptation layer using the LoRA method, freezing the original parameters, and training only the newly added modules. In this optional embodiment, during the fine-tuning process, the LoRA (Low-Rank Adaptation) method is used to insert a rank 8 and dimension 4096×8 (the hidden dimension of the base model) multi-head attention module in the 3rd, 6th, 9th, and 12th layers into the query and value weight matrices in the Transformer architecture. ) is a low-rank adaptation layer.

[0039] During the entire fine-tuning process, all native parameters of the base model are frozen, including the word embedding layer, feedforward network weights, and multi-head attention core weights. Only the newly added LoRA parameters are trained. The total number of newly added trainable parameters is 4 layers × 2 matrices × (4096 × 8) = 262,144, accounting for about 0.02% of the total number of base model parameters (32B).

[0040] The method of this optional embodiment can effectively avoid interference with the original language capabilities, while enhancing the model's representation capabilities in core tasks in the medical field such as symptom description, diagnosis and treatment pathways, and department affiliation.

[0041] In addition, the dataset used for fine-tuning is a structured medical knowledge dataset, which mainly contains three types of content: (1) symptom-disease-department mapping data; (2) real or semi-structured diagnosis and treatment pathway causal chain data; and (3) typical medical consultation scenario text annotated by manual or expert rules. The training parameters are set as follows: batch size 32, initial learning rate 3e-5, cosine annealing scheduling strategy, and a total of 3 rounds of training.

[0042] Step 2.2: Use the fine-tuned model as a teacher model to generate standard answer data for patient consultation scenarios. Filter the generated content using a language model evaluation tool to construct a high-quality question-answer dataset. In this optional embodiment, the fine-tuned model is used as a teacher model to generate standard answer data in patient consultation scenarios, and the generated content is screened through a language model evaluation tool to construct a high-quality question-answer dataset. The specific process is: use the teacher model to generate questions and answers for input prompts related to different diseases, departments, and treatment paths. After generation, the candidate answers are evaluated for semantic completeness, consistency, and medical rationality with the help of the GPT-4 scorer, and redundant, biased, or low-quality samples are filtered out to finally construct a high-quality medical question-answer dataset.

[0043] Step 2.3: Use the constructed high-quality question-answer pair dataset as the knowledge distillation input to train the lightweight student model Qwen2.5-7B. This model maintains clinical triage accuracy while reducing model size and inference latency, making it easier to deploy in actual medical terminal devices. In this optional embodiment, during the knowledge distillation stage, a black-box distillation method is used to directly train the student model Qwen2.5-7B using the high-quality question-answer pair dataset constructed above as a supervisory signal. This process does not rely on the intermediate representation or output probability distribution of the teacher model, but instead improves the clinical diagnosis ability of the student model by simulating its behavior (i.e., answer style and knowledge coverage). The distilled Qwen2.5-7B model significantly reduces the model size and inference latency while maintaining the diagnosis quality of the teacher model, making it suitable for the actual deployment needs of edge medical terminals.

[0044] In an optional embodiment, in step 3, in the process of intelligent triage and disease risk prediction, structured retrieval is used to enhance the generation mechanism, including the following steps: Step 3.1: Perform medical entity recognition and context analysis on the text uploaded by the patient to extract key entity and relationship information; In this optional embodiment, key entities include symptoms, diseases, indicators, and duration, etc.

[0045] Step 3.2: Based on the extracted key entities and relationship information, perform multi-hop causal path retrieval in the dynamic temporal causal knowledge graph to obtain the disease evolution chain, potential cause nodes and related department information related to the current input, and form a structured knowledge prompt set.

[0046] Step 3.3: The retrieved atlas path information and the original patient input content are jointly encoded into structured prompts, which are input into the fine-tuned and distilled DeepSeek model to generate prediction results; In this optional embodiment, the prediction results include recommended departments, suspected diseases and risk scores.

[0047] Step 3.4: Introduce RAG to use graph knowledge as the retrieval source and complete accurate knowledge recall for clinical tasks through multi-hop entity reasoning; In this optional embodiment, RAG refers to structured retrieval-augmented generation (RAG); RAG uses graph knowledge as a retrieval source and achieves precise knowledge recall for clinical tasks through multi-hop entity reasoning, which can improve the timeliness, accuracy, and explainability of triage recommendations.

[0048] In an optional embodiment, in step 3.2, performing multi-hop causal path retrieval in the dynamic temporal causal knowledge graph includes the following steps: Step 3.2.1: Construct the representation vectors of the nodes in the graph and the weight matrix A of the causal edges, ,element Representing an entity arrive causal weights, where each node represents a medical entity, the edge represents the causal relationship or time evolution path, and the time information is introduced into the graph structure through timestamp or sequence embedding.

[0049] Step 3.2.2: Use graph neural networks for multi-hop information propagation and update node state representations. The update rule is: the new state of each node is obtained by weighted summing the states of its neighboring nodes, and then processed by linear transformation and nonlinear activation function; the weight coefficient is calculated through the graph attention mechanism and is used to measure the strength of causal associations between nodes.

[0050] Step 3.2.3: Starting from the patient input entity, the multi-hop path search algorithm is used to mine potential causal chains in the graph, and the set of causal chain paths with the highest weight is output as the knowledge prompt content of the generation module.

[0051] In an optional embodiment, in step 3, intelligent triage uses a fusion decision strategy and a comprehensive graph reasoning scoring function. Semantic matching value with language model , the final target department matching decision function is: ; In the formula, C is the set of candidate departments, and α∈[0,1] is the weight factor.

[0052] In this optional embodiment, the weight factor α is dynamically adjusted according to the complexity of the input text; this mechanism can adapt to the differences in patients' text expressions and the inconsistency of their knowledge structures, thereby improving the robustness and accuracy of triage.

[0053] In an optional embodiment, in step 3, the disease risk prediction is based on the dynamic knowledge graph and combined with the event sequence in the time window. , disease risk is calculated using the Bayesian risk score formula: ; And based on the causal path set Show key impact paths, path visualization by showing graph attention weights Heatmap of associations with entity nodes; In this optional embodiment, it can help doctors understand the causal basis behind the model's decision-making and realize an explainable auxiliary warning function.

[0054] In an optional embodiment, in step 3, the patient information analysis adopts a medical entity resolution network based on an attention mechanism, including the following steps: Step 3.5: Use the pre-trained medical model to extract token expressions from patient text , and combines features such as position coding and symptom temporal labels to form a multi-dimensional input; Step 3.6: Use a multi-head attention mechanism to model the contextual entity relationship. The attention calculation method is as follows: ; In the formula, Q, K, and V are query, key, and value vectors respectively. is the vector dimension scaling factor.

[0055] Step 3.7: Output key medical entity set and its relationship with contexts such as time series, indicators, and parts, for subsequent graph entity mapping and knowledge retrieval.

[0056] Example 2: The following is an example of a medical intelligent decision-making method based on DeepSeek and temporal causal knowledge graph. It includes three steps: dynamic temporal causal knowledge graph construction, DeepSeek model adaptation and lightweighting, and patient information analysis and system function implementation.

[0057] Step 1: Construct an initial static medical knowledge graph and inject the time and causal dimensions. Model the evolutionary relationship of medical events through the dynamic temporal graph modeling layer. Introduce the graph attention mechanism to realize causal path identification, and combine the multi-hop causal relationship reasoning method to generate a dynamic temporal causal knowledge graph. Specifically, if Figure 2 The following is a flowchart for building a dynamic temporal causal knowledge graph, which includes the following aspects: Step 1.1: Data integration and preprocessing to build the initial static knowledge graph: Integrate multi-source heterogeneous medical data, including electronic medical records, medical literature, medical encyclopedias, expert experience rules, disease and drug databases, and desensitized real-world hospital diagnosis and treatment data resources.

[0058] Preprocessing of collected medical data resources includes: (1) Data deduplication and cleaning: Use the rule engine to remove duplicate records and erroneous data; (2) Entity standardization: For example, through UMLS (Unified Medical Language System), medical terms can be standardized and mapped. For example, "myocardial infarction" and "myocardial infarction" can be unified into "myocardial infarction" to eliminate term ambiguity and synonymy in multi-source data and improve the consistency of graph entities. (3) Semantic disambiguation: Based on the medical pre-trained language model BioBERT (Bidirectional Encoder Representations from Transformers for Biomedical Text Mining), the meaning of entities in the context is semantically distinguished to enhance the accuracy of entity recognition.

[0059] After processing, an initial static medical knowledge graph is constructed. The node types include diseases, symptoms, departments, examinations and treatment methods, indicators, risk factors, etc., and the edge relationships are static associations.

[0060] Step 1.2: Time evolution graph Build: Sequence of medical events for patients Perform time modeling and construct a directed graph representing time dependencies .in: (1) Node collection Represents a set of medical events, each node Corresponding events Entity and time attributes of (2) Edge set Represents the time dependency edge between events, each edge Representing an event and time association.

[0061] Edge weight Defined as: ; In the formula, , Representing an event 、 The time of occurrence of the event, the unit can be set to "hours", "days" etc. according to the data accuracy. The smaller the use, the weight The larger the value, the closer the time between events is.

[0062] The timestamp setting uses the real timestamp format, which is: YYYY-MM-DD HH:MM:SS, for example: 2024-05-20 14:00:00 Medical data, such as examinations, medications, and symptom records, typically have clear time records and are therefore suitable for precise modeling. When raw data lacks precise time information, it can be uniformly converted to numerical differences in equivalent units, such as days or hours. For coarse-grained data, "day difference" can be used as an interval metric.

[0063] Step 1.3: Causal graph construction ( ): Time evolution diagram and causal graphs Share the same medical entity node set V to ensure the semantic consistency of nodes in the joint graph G.

[0064] In order to model the potential causal relationship between medical entities, the Bayesian causal discovery algorithm is introduced to construct a causal graph. , including the following key steps: (1) Conditional independence test: Based on the time series data of medical entity pairs, the G-test (p < 0.05) was used to perform a conditional independence test, and edges with possible causal relationships were preliminarily screened out as the initial structure of the causal graph; (2) Bayesian structure search and temporal constraints: Based on the preliminary graph structure, a greedy equivalence class search algorithm based on BIC score is used to optimize the causal graph structure. Timestamp information is integrated to introduce temporal constraints to avoid the occurrence of obvious reverse causal paths (e.g., “increased blood sugar → diabetes” will be corrected to “diabetes → increased blood sugar”).

[0065] (3) Expert knowledge fusion and edge verification: Clinical experts manually review and correct the automatically generated causal edges to ensure the clinical rationality of the graph edges (for example, confirming “smoking → lung cancer” and eliminating “lung cancer → smoking”).

[0066] Step 1.4: Dynamic joint graph generation Supports incremental update mechanism. Newly entered medical data will be integrated into the graph through the following process. Real-time update is applicable to emergency data, and batch update is applicable to daily medical records: (1) Data preprocessing: Perform the same cleaning, standardization, and semantic disambiguation steps on the new data as on the original data.

[0067] (2) Timestamp and causal edge update: (2.1) Time evolution diagram Updates: Based on the timestamp of new events , according to the original weight formula Generate new time edges.

[0068] (2.1) Causal Graph Update: The Bayesian causal discovery algorithm is automatically triggered every 24 hours to recalculate causal edges based on the newly added data, and the rationality of the newly added edges is confirmed by the expert verification module.

[0069] (3) Joint atlas reconstruction: updated and The latest version of the dynamic map is generated by merging, and the old version of the map is archived for future reference.

[0070] like Figure 3 The figure shows some examples of a dynamic temporal causal knowledge graph, in which entity nodes with timestamps (such as "entity 1@timestamp") are connected through time-dependent edges (labeled with time weights) to form an event temporal chain. At the same time, they are connected to causal entity nodes without timestamps (such as "entity 3") through causal relationship edges (labeled with causal weights and BIC scores), forming a cross-temporal causal reasoning network.

[0071] The structure of the graph is: entity node ={symptoms, disease, examination, department...}, can be timestamped, Including time dependence ( , solid arrows) and causal relationships ( , dashed arrows). Edge attributes include temporal weight, causal weight, and BIC score. Temporal weight quantifies the temporal proximity between events, while causal weight and BIC score jointly measure the strength and statistical confidence of the causal relationship. The graph structure is stored in Neo4j, which supports multi-hop path retrieval operations and can perform reasoning tasks.

[0072] Combining the above content, take the following example as an example, Assume that the initial diagnosis and treatment data uploaded by a 56-year-old male patient A is as follows: The patient described their symptoms: "My headache has worsened over the past three days, my blood pressure has been high for the past two months, and today I'm having some difficulty moving my right hand." (System time: 2025-05-30 09:00:00) Upload electronic medical record structured data: Blood pressure record: 2025-05-26 08:30:00, systolic pressure 180mmHg, diastolic pressure 110mmHg; CT examination: 2025-05-28 15:00:00, "mild changes in brain white matter, no clear bleeding foci"; Routine blood test: 2025-05-28 09:00:00, elevated white blood cell count; Past medical history: 5-year history of hypertension; Current chief complaint: right hand weakness, headache; Preliminary physical signs: positive signs of right hemiparesis.

[0073] (1) Data preprocessing and initial graph construction: Automatically access the hospital EMR system, medical encyclopedia database, guideline literature and the hospital's self-built rule base to perform data fusion and entity standardization. For example, "high blood pressure" is unified as "hypertension", "right hand weakness" is parsed as "limb weakness", and BioBERT is used to semantically disambiguate "white matter changes" and identify them as "brain abnormalities".

[0074] After completion, a static knowledge graph is generated, including: entities: {hypertension, brain abnormalities, limb weakness, headache, CT changes, increased systolic blood pressure}; static edges: {hypertension-[complications]->stroke}.

[0075] (2) Construction of time evolution graph : Construct an event time series table based on the patient's specific time information, as shown in Table 1: Table 1 Event sequence table The following time evolution edges are constructed based on time information: side → , the time interval is 48.5 hours (2 days + 0.5 hours), and the weight is calculated as follows: = 1 / (48.5 + 1) ≈ 0.0202; side → , the time interval is 6 hours, and the weight is calculated as follows: = 1 / (6 + 1) ≈ 0.1429; side → , the time interval is 42 hours, and the weight is calculated as follows: = 1 / (42 + 1) ≈ 0.0233; The final generated time evolution subgraph is as follows: Hypertension records --(0.0202)-->Elevated white blood cell count --(0.1429)-->Brain abnormality --(0.0233)-->Limb weakness .

[0076] The time evolution diagram It is regarded as an important part of the dynamic temporal causal knowledge graph, and will form a joint graph with the causal edge in the future. , involved in multi-hop reasoning, disease evolution modeling and personalized risk prediction scoring.

[0077] (3) Causal graph construction :By integrating Bayesian causal discovery algorithm with domain knowledge, a graph reflecting the potential causal relationship between medical entities is constructed , the specific steps are as follows: First, a conditional independence test is performed. Based on the time series data of medical entity pairs, the G-test is used to perform the conditional independence test, and the significance threshold is set (p<0.05). Statistically significant entity pairs are screened to form the initial causal edge set. , for example: hypertension → stroke (p = 0.0078).

[0078] Then, Bayesian structure search and timing constraint optimization are carried out, and a greedy equivalence class search algorithm based on BIC score is used. Iteratively optimize the causal structure based on: ; in, is the number of model parameters (such as the variable dimensions involved in the causal edge), n is the sample size (data size), is the log-likelihood value of the model under the optimal parameters (reflecting the degree of fit between the data and the model).

[0079] The causal direction is forced to conform to the temporal logic. For example, "Hypertension diagnosis time (2025-05-26) → Stroke symptom onset time (2025-05-30)" takes precedence over the reverse path, and edges that violate the temporal order, such as "Limb weakness (2025-05-30) → Hypertension (2025-05-26)", are eliminated.

[0080] Finally, expert knowledge fusion and edge verification are carried out: clinical experts conduct three rounds of verification on the automatically generated causal edges: necessity verification, retaining edges that conform to medical common sense (such as "hypertension → stroke"), and removing edges with no direct correlation, such as "elevated white blood cell count → stroke"; strength calibration, adjusting the causal weight and BIC score, for example, the BIC score of "hypertension → stroke" is calibrated from the initial 0.65 to 0.78 (based on the clinical guideline evidence level); anomaly correction, correcting causal edges misjudged by the algorithm, for example: deleting the weakly associated edge of "elevated white blood cell count → abnormal brain CT" (elevated white blood cell count has no direct causal relationship with brain lesions).

[0081] (4) Joint graph generation and storage: Through the incremental update mechanism, the time evolution graph and causal graphs Fusion into a dynamic joint graph , supports real-time and batch data updates: Edge attributes include temporal weight, causal weight, and BIC score: temporal weight quantifies the temporal closeness of events (based on the inverse of the time interval); causal weight is based on the Bayesian posterior probability (range [0,1]); BIC score: statistical model goodness of fit (higher values ​​are more reliable); p-value: conditional independence test significance indicator (p<0.05, p-value is used for initial screening of causal graph construction and is not stored in the final graph) Neo4j graph database is used for storage, and its property graph model is used to efficiently represent node relationships: Node label classification: {Symptoms: headache, limb weakness; Diseases: hypertension, stroke; Examinations: CT scan, blood routine; Department: Neurology}; Edge type: includes temporal edges and causal edges. Temporal edges are labeled with temporal weights, while causal edges are labeled with causal weights and BIC scores.

[0082] Index optimization: Create a composite index based on node type and timestamp to speed up multi-hop path retrieval.

[0083] It supports path retrieval functions, such as querying the causal chain of "hypertension → stroke → limb weakness", or retrieving the disease progression path based on time sequence, providing an explainable knowledge network for clinical decision-making.

[0084] Step 2: Fine-tune the DeepSeek model to adapt it to the medical field. The fine-tuned DeepSeek model is used as the teacher model and migrated to a lightweight model through knowledge distillation. During the distillation process, key causal inference parameters are retained and causal path explanation labels are embedded. Specifically, the process of fine-tuning and distilling the DeepSeek-based medical large model is as follows: Step 2.1: First, use the structured medical knowledge graph constructed in step 1 to extract key information such as entity relationships, disease paths, and medical records to build a high-quality medical semantic training dataset.

[0085] Step 2.2: Based on a high-quality medical semantic training dataset, DeepSeek-R1-Distill-Qwen-32B was adapted using LoRA technology. An adaptation layer of rank 8 was injected into each layer of the Transformer while freezing the original parameters. After training, the performance of medical entity recognition was significantly improved, and key medical information could be more accurately identified and extracted.

[0086] Step 2.3: Use the fine-tuned model as a teacher model to generate a large amount of standard answers from patient consultation scenarios. After rule filtering and MedQA (Medical Question Answering) evaluation, a high-quality dataset of question-answer pairs is constructed.

[0087] Step 2.4: Use the filtered dataset as the input for knowledge distillation to train the lightweight student model Qwen2.5-7B. Training is optimized using a KL divergence loss combined with a causal inference parameter L2 regularization (λ = 0.1), using the following formula: KL Divergence Loss (Teacher-Student Output Alignment): ; Causal Inference Parameter Preserving (L2 Regularization): ; Total distillation loss: ; In the formula, T is the temperature coefficient (used to control the Softmax smoothness), λ=0.1 is the causal parameter constraint strength, and α and β are the loss term weighting coefficients, which can be adjusted according to the model performance requirements.

[0088] After fine-tuning and distillation, the DeepSeek-based large medical model can maintain a high clinical triage accuracy while significantly reducing the model size and inference latency, making it easier to deploy in actual medical terminal devices.

[0089] Combining the above content, take the following example: When preparing training data, simple data was extracted from the medical knowledge graph, such as: input: "high blood pressure, headache, right hand weakness" → output: "neurology, possible stroke", input: "fever, cough" → output: "respiratory department, possible pneumonia", and a total of 10,000 such "question-answer" pairs were prepared.

[0090] When fine-tuning the large model, we used LoRA technology to fine-tune the DeepSeek model, training only a small number of new parameters to teach it to recognize medical terms, such as renaming "high blood pressure" as "hypertension." After training, the large model can more accurately identify the relationship between words such as "headache" and "stroke."

[0091] During the standard answer generation stage, the big model generates answers based on the training data. For example, in response to the question "A patient has had high blood pressure for five years and now has a headache. Which department should he go to?", the big model answers "It is recommended to go to the neurology department. It may be a brain problem caused by high blood pressure." Then, it filters out coherent and professional answers, obtaining 5,000 high-quality data points.

[0092] When distilling the small model, the standard answers from the large model are used to teach the Qwen2.5-7B small model with 7 billion parameters. At the same time, KL divergence is used to ensure that the small model's answers are as close as possible to the large model. L2 regularization is used to force it to remember causal relationship parameters such as "hypertension → stroke". After training, the size of the small model is greatly reduced, while the accuracy of medical recommendations remains high.

[0093] Step 3: Receive and parse the text uploaded by the patient, introduce the attention mechanism to extract key medical entities and contextual dependencies in the text, and combine it with the dynamic temporal causal knowledge graph to perform intelligent triage and disease risk prediction, achieve accurate matching of patient symptoms with target departments, and intelligent prediction and early warning of potential diseases.

[0094] Specifically, the system uses a structured retrieval enhancement generation mechanism to achieve intelligent triage and disease risk prediction, which includes the following steps: Step 3.1: Medical Entity Recognition and Context Modeling: The system first uses a medical entity parsing network based on an attention mechanism to parse patient text. The network uses a pre-trained medical language model to extract token expressions. , combining information such as position encoding and symptom time series labels to form multi-dimensional input features, and modeling entity relationships in the context through a multi-head attention mechanism. The attention calculation follows the following formula: ; In the formula, Q, K, and V are query, key, and value vectors respectively. is the vector dimension scaling factor. The model output includes key medical entities such as symptoms, diseases, indicators, and duration. and its relationship with contexts such as time series, numerical values, and anatomical parts for subsequent atlas mapping.

[0095] Step 3.2: Graph-driven multi-hop causal path retrieval: The extracted entity information is mapped into a dynamic temporal causal knowledge graph. The graph consists of a node set V and a directed edge set with timestamps. The nodes represent medical entities, and the edges represent causal relationships or evolution paths. Time information is injected into the graph structure through timestamps or time series embedding.

[0096] A graph neural network performs multi-hop information propagation to update node representations. Each node's new state is derived by taking the weighted sum of its neighboring node states, applying a linear transformation and a nonlinear activation function. Weights are calculated using a graph attention mechanism to measure the strength of causal relationships between nodes. Subsequently, using the entity entered by the patient as a starting point, a path search algorithm is used to discover causal chains, outputting the set of paths with the highest weights, which form a set of structured knowledge prompts.

[0097] Step 3.3: Retrieval-enhanced structured generation: This graph path information is combined with the original patient input into a structured prompt input, which is fed into a large model fine-tuned and optimized through distillation of clinical knowledge to generate predictions, including recommended departments, suspected diseases, and risk scores. This mechanism uses graph knowledge as the core retrieval source and achieves precise knowledge recall for clinical tasks through multi-hop entity reasoning, enhancing the contextual relevance and professional accuracy of the generated results.

[0098] Step 3.4: Fusion decision matching with target department: The intelligent triage module introduces a fusion decision-making strategy and a comprehensive graph reasoning scoring function. Semantic matching function with language model , forming the final target department matching function: ; In the formula, C is the set of candidate departments, and α∈[0,1] is the weight factor. This strategy effectively integrates structured graph knowledge with the expressive power of language models, enhancing the system's robustness to inconsistencies in different text representations and knowledge structures.

[0099] Dynamic adjustment of the weight factor α: When the complexity of the patient input text is high, α is automatically reduced to 0.3 to enhance the language model semantic matching weight; when the input text is highly structured, α is increased to 0.7, and the graph reasoning score is prioritized. .

[0100] The adjustment strategy is implemented based on the entity density and semantic entropy calculation of the input text.

[0101] Step 3.5: Disease risk prediction and causal explainability: Further based on the dynamic temporal causal knowledge graph, combined with the event sequence within the time window , Bayesian risk scoring is used to assess the risk of suspected diseases: and based on high-risk diseases , showing its corresponding key causal path set , and use graph attention weights Construct a path visualization heat map to provide explainable auxiliary warning information and help doctors understand the basis of model reasoning and the source of results.

[0102] Example 3: The following is an example of a medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph. Figure 4 As shown, it mainly includes the following operation process modules: First, the patient input module is used to receive structured and unstructured data such as electronic medical records, symptom descriptions, examination reports, etc. uploaded by patients, providing the original information basis for subsequent reasoning.

[0103] The information extraction and structuring module then processes the input text to extract medical entities and their contextual relationships. This module performs entity standardization, semantic disambiguation, and contextual dependency modeling to provide accurate semantic units for graph matching.

[0104] On this basis, the system enters the dynamic temporal causal knowledge graph reasoning module, first mapping the structured entity information to the dynamic knowledge graph, constructing a temporal subgraph through timestamps and causal constraints, and combining graph neural networks with multi-hop path reasoning algorithms to identify key causal chains, disease evolution paths and their corresponding target departments, and output corresponding causal weights and path credibility.

[0105] The structured graph inference results are then fed into the graph-guided large-model diagnosis module. This module integrates the natural language reasoning capabilities of the DeepSeek large language model with graph knowledge prompts to complete a preliminary diagnosis of the patient's possible illness. Output from this module includes a list of suspected diseases, rationale for the recommendation (based on causal pathway explanations), and the distribution of key risk nodes, generating diagnostic results that can be explained in natural language.

[0106] With the support of the system reasoning core module, it enters two downstream sub-modules: The first is the intelligent triage analysis module, which uses the target department matching decision function and large-scale model inference diagnosis mechanism to recommend the most likely target department for the patient, and outputs the recommendation reasons and semantic confidence evaluation to improve the accuracy and comprehensibility of triage recommendations; The second is the disease risk prediction and analysis module, which is based on graph paths and event sequences, combined with the Bayesian scoring mechanism and large-model reasoning diagnosis to make probability predictions on the high-risk diseases currently faced by patients, and provide risk warning prompts and their corresponding causal explanation paths.

[0107] Ultimately, all analysis results are summarized by the system output module. The output content includes: recommended departments and confidence levels, reasons for recommendations, lists of suspected diseases, disease risk scores, causal pathway visualization information, and natural language explanation text, etc., supporting doctors or patients to view and understand in multiple dimensions, and improving the interpretability and intelligence of clinical applications.

[0108] Combining the above content, the following examples are given: First, we obtain the input of Patient A (a 56-year-old male) and process its information. In the medical entity resolution of Patient A, the token representation X = {x1, x2, …, xᵢ} is the set of semantic unit vectors obtained by segmenting the input text. Specifically, each xᵢ in X corresponds to the semantic vector of a token. For example, x1 corresponds to the token "headache," and x2 corresponds to the token "3 days." The token representation X is the vector representation of ["headache," "3 days," "high blood pressure," "2 months," "right hand stiffness"] extracted from the patient's input text. Positional encoding marks "headache" as the first position and "right hand stiffness" as the fifth position, identifying "3 days" and "2 months" as time features. Using an attention-based parsing network for entity extraction, we successfully identified key entities such as hypertension, headache, right hand stiffness, elevated white blood cell count, and white matter changes. We also extracted temporal labels such as "Headache worsened for three days," "High blood pressure for the past two months," and "Right hand stiffness today." We also modeled contextual relationships through multi-head attention calculations using the following formula: ; Clarify the correlation weight between "right hand inflexibility" and "white matter changes" and the correlation weight between "hypertension".

[0109] In graph-driven multi-hop causal path retrieval, targeting dynamic temporal causal knowledge graph retrieval, the entities "hypertension," "white matter changes," and "right hand weakness" are first mapped to graph nodes, and timestamps are injected into the graph structure, forming a temporal association of "hypertension (2025-05-26) → white matter changes (2025-05-28) → right hand weakness (2025-05-30)." Subsequently, multi-hop causal reasoning is performed starting with "hypertension." Node state updates are calculated using a graph neural network, and the graph attention mechanism is used to determine the causal weight of the neighboring node "stroke." Ultimately, two high-weight paths are discovered: "hypertension → stroke → right hand weakness" and "hypertension → white matter changes → right hand weakness," effectively mining and retrieving temporal causal relationships.

[0110] In the process of generating structured prompts and large model reasoning, the joint change prompt is: the patient's symptoms are headache for 3 days, high blood pressure for 2 months, and right hand inflexibility for 1 day. The graph path is hypertension → stroke → limb weakness, hypertension → white matter changes → right hand weakness. Please recommend a department and analyze to predict disease risk.

[0111] The large model generates the following results: Recommended department: Neurology (93% confidence level); Suspected disease: stroke (risk score 0.82).

[0112] Comprehensive graph inference score function Semantic matching function with language model , perform decision fusion and form the final target department matching function: ; When performing decision fusion, the α value needs to be set. Since the patient description contains clear time series (3 days, 2 months) and indicators (blood pressure values), it is highly structured, so α is dynamically adjusted to 0.7; Hypothesized graph reasoning score (Neurology) = 0.88, language model matching score (Neurology) = 0.85, so the final score is: 0.7×0.88 + 0.3×0.85 = 0.871, which is higher than other departments (such as cardiology 0.72).

[0113] When calculating Bayesian risk, the formula used is as follows: Prior probability P (stroke), the value is based on population statistics; likelihood probability P ({symptom} | stroke), the value is based on the graph causal weight.

[0114] Key causal path: hypertension → stroke → limb weakness (the attention weights of the corresponding edges are 0.87 and 0.91, respectively).

[0115] This weight is calculated by the graph attention mechanism combined with the following factors: For example, for hypertension, the probability of hypertensive patients developing stroke in historical cases is 87%; the patient has a 5-year history of hypertension, and the time interval between the stroke and the onset of stroke is consistent with the common clinical incubation period; through Bayesian structure search, it is determined that "hypertension → stroke" is the main causal direction (rather than the reverse).

[0116] The heat map display, through color depth and edge thickness, clearly shows the causal hierarchy of "hypertension drives stroke, and stroke directly leads to right hand weakness", helping doctors quickly locate the key cause (hypertension) and the direct pathogenic link (stroke).

[0117] Intelligent triage function output results: Recommended department: Neurology (93% confidence level); Reason for recommendation: The patient has long-term hypertension, combined with white matter changes and limb weakness, which are consistent with the typical manifestations of stroke.

[0118] Causal basis: Hypertension → Stroke (BIC score) → Limb weakness (Causal weight) Disease risk prediction function output results: High-risk diseases: stroke (disease risk score); Etiology path: 1. Hypertension (2025-05-26) → Stroke → Limb weakness (2025-05-30) 2. White matter changes (2025-05-28) → Neurological damage → Limb weakness.

[0119] Through the above-mentioned operating process, this system realizes a full-link closed loop from unstructured input to causal graph reasoning, large-model diagnosis, triage recommendation and disease risk prediction, and has significant advantages of structuring, intelligence and explainability.

[0120] In summary, the system provided by this invention can integrate intelligent triage and disease risk prediction functions into existing hospital registration systems. This integration not only enables intelligent and user-friendly upgrades to offline services, significantly improving registration accuracy, but also effectively optimizes the rational allocation of medical resources, providing strong support for the efficient operation of medical services.

[0121] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. A medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph, characterized by: The steps include: Step 1: Construct an initial static medical knowledge graph and inject the time and causal dimensions. Model the evolutionary relationship of medical events through the dynamic temporal graph modeling layer. Introduce the graph attention mechanism to realize causal path identification, and combine the multi-hop causal relationship reasoning method to generate a dynamic temporal causal knowledge graph. Step 2: Fine-tune the DeepSeek model to adapt it to the medical field. The fine-tuned DeepSeek model is used as the teacher model and migrated to a lightweight model through knowledge distillation. During the distillation process, key causal inference parameters are retained and causal path explanation labels are embedded. Step 3: Receive and parse the text uploaded by the patient, introduce the attention mechanism to extract key medical entities and contextual dependencies in the text, and combine it with the dynamic temporal causal knowledge graph to perform intelligent triage and disease risk prediction, achieve accurate matching of patient symptoms with target departments, and intelligent prediction and early warning of potential diseases.

2. The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph according to claim 1, characterized in that: Constructing a dynamic temporal causal knowledge graph in step 1 includes the following steps: Step 1.1: Integrate multi-source heterogeneous medical data; Step 1.2: Preprocess the integrated multi-source heterogeneous medical data; Step 1.3: Based on timestamp sequence Medical record events Create a time evolution graph , where the node set Represents medical entities, edge sets Represents time dependency; Step 1.4: Mining with Bayesian Causal Discovery Algorithm Entity pairs in The causal direction , building a causal graph , and finally form a joint graph , It represents the set of causal edges in the causal graph.

3. The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph according to claim 2, characterized in that: In the step of constructing a dynamic temporal causal knowledge graph in step 1, medical entities include one or more of patients, diseases, symptoms, departments, consultation times, examinations and treatment methods, and risk factors, and edge relationships include time dependency and / or causal relationships.

4. The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph according to claim 2, characterized in that: The Bayesian causal discovery algorithm in step 1.4 includes the following steps: Step 1.4.1: Based on the time series data of medical entity pairs, calculate the conditional independence test to screen the potential causal direction; Step 1.4.2: Use a greedy equivalence class search algorithm based on BIC score to optimize the causal graph structure and eliminate reverse causal paths in combination with timing constraints; Step 1.4.3: Use medical experts’ experience rules to manually verify and correct the automatically discovered causal edges to ensure the clinical rationality of the graph.

5. The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph according to claim 1, characterized in that: The fine-tuning and distillation of the DeepSeek model in step 2 includes the following steps: Step 2.1: Build a structured medical knowledge dataset and fine-tune the base model DeepSeek-R1-Distill-Qwen-32B to enhance its understanding of medical entities and relationships by inserting an adaptation layer using the LoRA method, freezing the original parameters, and training only the newly added modules. Step 2.2: Use the fine-tuned model as a teacher model to generate standard answer data for patient consultation scenarios. Filter the generated content using a language model evaluation tool to construct a high-quality question-answer dataset. Step 2.3: Use the constructed high-quality question-answer pair dataset as the knowledge distillation input to train the lightweight student model Qwen2.5-7B. This model can maintain the clinical triage accuracy while reducing the model size and inference latency, making it easier to deploy in actual medical terminal devices.

6. The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph according to claim 1, characterized in that: In step 3, during the process of intelligent triage and disease risk prediction, structured retrieval is used to enhance the generation mechanism, including the following steps: Step 3.1: Perform medical entity recognition and context analysis on the text uploaded by the patient to extract key entity and relationship information; Step 3.2: Based on the extracted key entities and relationship information, perform multi-hop causal path retrieval in the dynamic temporal causal knowledge graph to obtain the disease evolution chain, potential cause nodes, and related department information related to the current input, forming a structured knowledge prompt set; Step 3.3: The retrieved atlas path information and the original patient input content are jointly encoded into structured prompts, which are input into the fine-tuned and distilled DeepSeek model to generate prediction results; Step 3.4: Introduce RAG to use graph knowledge as the retrieval source and complete accurate knowledge recall for clinical tasks through multi-hop entity reasoning.

7. The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph according to claim 6, characterized in that: In step 3.2, performing multi-hop causal path retrieval in the dynamic temporal causal knowledge graph includes the following steps: Step 3.2.1: Construct the representation vectors of the nodes in the graph and the weight matrix A of the causal edges, ,element Representing an entity arrive causal weights, where each node represents a medical entity, the edge represents the causal relationship or time evolution path, and the time information is introduced into the graph structure through timestamp or sequence embedding; Step 3.2.2: Use graph neural networks for multi-hop information propagation to update node state representations. The update rule is: the new state of each node is the weighted sum of the states of its neighboring nodes, processed by linear transformation and nonlinear activation function; The weight coefficient is calculated through the graph attention mechanism and is used to measure the strength of the causal relationship between nodes; Step 3.2.3: Starting from the patient input entity, the multi-hop path search algorithm is used to mine potential causal chains in the graph, and the set of causal chain paths with the highest weight is output as the knowledge prompt content of the generation module.

8. The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph according to claim 6, characterized in that: In step 3, intelligent triage uses a fusion decision strategy and a comprehensive graph reasoning scoring function. Semantic matching value with language model , the final target department matching decision function is: ; In the formula, C is the set of candidate departments, and α∈[0,1] is the weight factor.

9. The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph according to claim 6, characterized in that: In step 3, disease risk prediction is based on dynamic knowledge graph and combined with event sequence in time window. , disease risk is calculated using the Bayesian risk score formula: ; And based on the causal path set Show key impact paths, path visualization by showing graph attention weights Heatmap of associations with entity nodes.

10. The medical intelligent decision-making method based on Deepseek and temporal causal knowledge graph according to claim 1, characterized in that: In step 3, patient information analysis uses a medical entity parsing network based on an attention mechanism, including the following steps: Step 3.5: Use the pre-trained medical model to extract token expressions from patient text , and combines position encoding and symptom temporal labels to form a multi-dimensional input; Step 3.6: Use a multi-head attention mechanism to model the contextual entity relationship. The attention calculation method is as follows: ; In the formula, Q, K, and V are query, key, and value vectors respectively. is the vector dimension scaling factor; Step 3.7: Output key medical entity set and its relationship with the context of time series, indicators, and parts for subsequent graph entity mapping and knowledge retrieval.

Citation Information

Patent Citations

  • Traditional Chinese medicine diagnosis and treatment knowledge discovery method based on clinical knowledge graph representation learning

    CN115687642A

  • Mixed local text entity causal structure learning method and device and electronic equipment

    CN118333162A

  • Intelligent pediatric disease diagnosis auxiliary system

    CN118538399A

  • Knowledge-enhanced causal chain reasoning event prediction method

    CN119416063A

  • Multi-level attribution and recommendation method and system for medical management decision

    CN119889617A

Cited By

  • Real-time whole course information acquisition method for orthopedic patient

    CN120913759A

  • Patient nutrition risk intelligent assessment system based on multi-parameter fusion

    CN121054270A

  • A multi-parameter fusion-based intelligent assessment system for patient nutritional risk

    CN121054270B

  • Medical behavior compliance auditing method and system based on AI model

    CN121122622A

  • Multi-modal evidence chain management and control method and device, computer equipment and medium

    CN121188059A