Medical decision tree automatic construction method based on flow chart recognition
By constructing a multimodal large model dataset and fine-tuning the F2D model using LoRA technology, and combining a large language model and a medical knowledge base to optimize the decision tree, the problems of flowchart recognition and decision tree generation in existing methods are solved. This achieves high-precision flowchart conversion and interactive differential diagnosis, improving the accuracy and clinical applicability of medical decision trees.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EAST CHINA UNIV OF SCI & TECH
- Filing Date
- 2026-01-12
- Publication Date
- 2026-04-24
AI Technical Summary
Existing methods for constructing medical decision trees mainly rely on manual rule extraction, which is time-consuming and labor-intensive. Furthermore, existing automated methods struggle to accurately identify complex decision logic from medical flowcharts and generate decision trees that conform to clinical reasoning norms.
A multimodal large model dataset is constructed through a reverse generation mechanism. LoRA technology is used to fine-tune the model F2D for flowchart recognition. The decision tree is optimized by combining a large language model and a medical knowledge base. A diagnostic evidence integrity assessment algorithm is introduced to realize the end-to-end transformation of flowcharts into standardized decision trees and interactive differential diagnosis.
It achieves high-precision flowchart recognition and parsing, generates decision trees that conform to clinical standards, and improves the accuracy and evidence completeness of interactive differential diagnosis, which is significantly better than existing methods.
Smart Images

Figure CN121920479A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and smart healthcare, specifically to the construction of multimodal large language models (MLLMs) and medical decision trees (MDTs). More specifically, it relates to a technical method based on multimodal flowchart recognition that automatically converts flowcharts in medical literature into structured and standardized medical decision trees, and applies them to interactive differential diagnosis. Background Technology
[0002] Medical decision trees, as a key component of intelligent healthcare systems, are widely used to assist clinicians in disease diagnosis and decision-making due to their strong interpretability and clear structure. However, traditional construction methods mainly rely on medical professionals manually extracting rules from unstructured texts such as clinical guidelines and medical textbooks. This process is not only time-consuming and labor-intensive but also difficult to scale up to large-scale practical applications. Existing automated methods, such as Text2DT, focus primarily on extracting decision rules from clinical texts. Decision trees constructed using this approach often only capture fragmented segments of the clinical decision-making process and cannot cover the complete diagnostic workflow.
[0003] In contrast, flowcharts in medical literature typically reflect the complete decision-making logic chain of experts in real clinical settings. However, generating decision trees from flowcharts faces significant technical challenges: existing flowchart recognition algorithms such as Arrow R-CNN and FlowLearn exhibit low accuracy when processing medical flowcharts with complex topological structures; simultaneously, methods based on general multimodal large models also show significant performance degradation when handling such complex diagrams. Furthermore, issues such as non-standardized expression of decision rules in flowcharts, difficulties in structural parsing, and irregular rule formats hinder their practical application in the medical field. Therefore, there is an urgent need for a method that can accurately identify complex information in medical flowcharts and automatically transform them into medical decision trees with standardized structures that conform to clinical reasoning logic, in order to support more efficient interactive differential diagnosis. Summary of the Invention
[0004] This invention proposes an automated method for constructing medical decision trees based on flowchart recognition, comprising: constructing a large-scale "image-Dot script" instruction fine-tuning dataset through a reverse generation mechanism; fine-tuning a multimodal large model using Low-Rank Adaptation (LoRA) technology to obtain a dedicated model F2D, thereby realizing the end-to-end transformation of complex medical flowchart images into structured Dot script descriptions; performing structured parsing on the generated Dot scripts; using a large language model combined with an external medical knowledge base to rewrite condition judgment result nodes, standardize medical terminology, and split multi-condition composite logic nodes based on the initial logical topology, thereby constructing a standardized medical decision tree that conforms to clinical diagnosis and treatment pathway specifications; deconstructing the standardized medical decision tree into mutually independent atomic decision paths; using a medical-specific pre-trained model PubMedBERT for vector space mapping; and re-ranking and retrieving based on the semantic relevance between the patient's real-time status and the decision path to locate the optimal candidate decision path. This invention introduces a diagnostic evidence integrity assessment algorithm based on thought chain and few-sample prompts to quantitatively score the currently collected medical evidence. Based on the score, it dynamically schedules follow-up questioning agents or diagnostic decision-making agents to achieve efficient and evidence-based interactive consultation and diagnostic prediction. To achieve the above objectives, this invention provides the following solution:
[0005] 1. A method for automatically constructing medical decision trees based on flowchart recognition, Flow2MDT (Flowchart to medical decision tree), characterized by comprising:
[0006] S1: Flow2Dot, a flowchart recognition method based on a multimodal large-scale language model, is characterized by constructing an "image-Dot script" instruction fine-tuning dataset through a reverse generation mechanism, using LoRA technology to fine-tune the multimodal large-scale model, and training an end-to-end flowchart recognition model F2D through a hierarchical multimodal feature alignment framework, thereby mapping the complex topological structure and node text features in medical flowchart images into structured Dot script descriptions;
[0007] S2: The Dot2MDT method for constructing decision trees based on Dot scripts is characterized by performing structured parsing on the Dot scripts, extracting node sets and edge sets, identifying the legality of leaf nodes and pruning abnormal paths through a semantic judgment mechanism, and establishing an initial medical decision tree with preliminary logical topology; combining a large language model and an external medical knowledge base, semantic rewriting and structural optimization are performed on condition judgment result nodes, professional terminology nodes and composite logic nodes in the initial decision tree, transforming intermediate judgment nodes into edge attribute labels, and transforming flowchart logic into a standardized medical decision tree that conforms to clinical pathway specifications;
[0008] S3: Construct an atomic decision path index and retrieval mechanism, characterized in that the standardized medical decision tree is decomposed into mutually independent atomic decision paths, the PubMedBERT medical pre-trained model is used for vector space mapping to realize the vectorized representation of the decision path, and a retrieval re-ranking model is constructed based on the real-time status of the patient to extract the optimal candidate path.
[0009] S4: To realize interactive differential diagnosis and decision generation, characterized by introducing a diagnostic evidence integrity assessment algorithm based on thought chain and few-sample prompts, using a large language model to quantify and score the currently known evidence, and dynamically scheduling follow-up questions to generate intelligent agents or diagnostic decision agents according to a preset reliability threshold, and outputting an interpretable final diagnostic result.
[0010] 2. The method according to claim 1, characterized in that the dataset construction in S1 adopts a reverse generation mechanism, specifically including:
[0011] 1) Using medical encyclopedia corpus as the source, guide the large language model to generate structured Dot scripts that conform to the logic of medical diagnosis;
[0012] 2) Use a drawing engine to render the script as a flowchart image, forming "image-Dot script" paired samples;
[0013] 3) Perform structural constraint pruning: for any node If it exceeds the limit Then from its successor node set The first 5 valid branches are retained and loops are removed;
[0014] 4) Introduce a style randomization strategy: By changing the node shape, color scheme and connection topology, simulate the typesetting style of different medical documents to enhance the model's generalization ability.
[0015] 3. The method according to claim 1, wherein the model recognition process in S1 adopts a hierarchical feature alignment framework, wherein the visual modality extracts the spatial layout features of the flowchart through a graph attention network; the text modality captures the hierarchical semantics of the script through a hierarchical Transformer encoder; and a dynamic gating fusion module is used to achieve deep alignment between visual features and text representations.
[0016] 4. The method according to claim 1, wherein the node optimization processing in S3 specifically includes:
[0017] 1) Logical transformation: Identify and remove intermediate result nodes, and transform their corresponding branch logic "condition → result → next step" into the edge label between parent and child nodes "condition [result] → next step";
[0018] 2) Terminology standardization: Using a large language model to expand abbreviations or non-standard terms into natural language statements that conform to the standard medical terminology set;
[0019] 3) Path disambiguation: The joint knowledge base performs atomic decomposition of complex judgment nodes to ensure the rigor of the decision path.
[0020] 5. The method according to claim 1, characterized in that the vectorization representation process of the atomic decision path in S4 is as follows:
[0021] 1) Extract the path set by depth-first traversal ;
[0022] 2) Convert the question-and-answer sequence in the path into a sequence of declarative sentences. ;
[0023] 3) Calculate the comprehensive representation vector of the path using the PubMedBERT model. The calculation formula is as follows:
[0024]
[0025] in, This represents the vector concatenation operator.
[0026] 6. The method according to claim 1, characterized in that the retrieval re-ranking in S4 adopts a hybrid relevance scoring mechanism, and the calculation formula is:
[0027]
[0028] in, The set of symptoms in the decision-making path. For the patient's current state set, This is a preliminary set of candidate diseases identified based on the patient's chief complaint. The pre-set correlation balance coefficient, This is an indicator function.
[0029] 7. The method according to claim 1, wherein the interaction logic in S5 specifically comprises:
[0030] Diagnostic evidence integrity score generated based on the thought chain strategy ;when When this happens, the system calls the medical knowledge guidance module to generate supplementary consultation questions; when At that time, the system directly outputs a diagnosis suggestion based on the confidence path.
[0031] Compared with the prior art, the present invention has the following core advantages:
[0032] 1) A novel paradigm for constructing medical decision trees based on flowchart recognition is proposed: This invention innovatively introduces medical flowcharts as a structured knowledge source, overcoming the limitations of existing text extraction-based methods in terms of structural expressiveness and decision chain coverage. Through the proposed Flow2MDT framework, high-quality modeling of complex diagnostic and treatment logic can be achieved, generating medical decision trees containing complete decision chains.
[0033] 2) Achieved end-to-end high-precision flowchart recognition and parsing: Addressing the shortcomings of existing methods in complex flowchart recognition, this invention constructs a large-scale "flowchart-Dot script" instruction fine-tuning dataset and fine-tunes a dedicated recognition model, F2D, based on the InternVL2.5 multimodal large language model. This model can convert complex medical flowchart images into structured Dot scripts end-to-end, significantly improving the ability to parse complex topological structures. The Node-F1 score on the automatically generated test set is 13.47% higher than GPT-4o.
[0034] 3) A standardized decision tree conforming to clinical reasoning norms was constructed: This invention utilizes the Dot2MDT module, combined with a large language model and an external medical knowledge base, to deeply optimize the initial decision tree. Through algorithms such as rewriting conditional judgment result nodes, standardizing professional terminology nodes, and splitting multi-condition composite nodes, the problems of inconsistent descriptions and logical redundancy in the flowchart were resolved. The generated decision tree significantly outperforms baseline methods such as zero-sample and thought chain methods in terms of node accuracy and path logic.
[0035] 4) Improved accuracy and evidence completeness of interactive differential diagnosis: Based on the generated decision tree, this invention proposes an interactive differential diagnosis method, IDD-PaCA. This method introduces a diagnostic evidence completeness assessment module, which can dynamically retrieve the optimal decision path based on real-time patient information and intelligently determine whether to continue questioning or generate a diagnostic conclusion. Experimental results show that this method outperforms existing multi-agent diagnostic methods in key indicators such as true pathological accuracy and effective evidence recall in differential diagnosis tasks, significantly enhancing the interpretability and clinical applicability of the diagnostic process. Attached Figure Description
[0036] After reading the detailed embodiments of the present invention with reference to the accompanying drawings, the reader will gain a clearer understanding of various aspects of the present invention, wherein:
[0037] Figure 1The overall flowchart of the Flow2MDT framework proposed in this invention is shown. The framework consists of two stages: the first stage is Flow2Dot, which converts the input medical flowchart image into a Dot script through a fine-tuned multimodal model F2D; the second stage is Dot2MDT, which parses the Dot script, classifies nodes, and enhances nodes by incorporating medical knowledge (including rewriting condition judgment results, standardizing terminology, and splitting composite nodes), ultimately generating a structured medical decision tree.
[0038] Figure 2 The flowchart illustrates the interactive differential diagnosis method IDD-PaCA proposed in this invention, based on diagnostic decision path and evidence integrity assessment. The flowchart demonstrates how the optimal path in the decision tree is retrieved based on patient information, how the current evidence is scored by the integrity assessment module, and how the scoring results dynamically determine whether to invoke the follow-up questioning agent to obtain more information or to invoke the diagnostic decision agent to output the final diagnostic result. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments. Due to the lack of open-source datasets, a medical decision tree generation dataset, MFMDT, was constructed to verify the effectiveness of the method. The construction process included extracting flowcharts from medical literature, recognizing the content using a multimodal large language model, conducting manual verification, and inviting clinical experts to refine the decision tree content based on the identified flowcharts. The final annotated MF-MDT dataset contains 174 flowchart-medical decision tree pairing cases, covering 2548 decision paths, 2712 diseases, and 5213 clinical symptoms.
[0040] Specifically, the present invention provides an automated method for constructing medical decision trees based on flowchart recognition, comprising the following steps:
[0041] like Figure 1 As shown, the Flow2MDT framework proposed in this invention includes two core stages: the Flow2Dot stage for flowchart recognition based on a multimodal large model and the Dot2MDT stage for decision tree construction based on Dot scripts.
[0042] Step S1 constructs an "image-Dot script" instruction fine-tuning dataset through a reverse generation mechanism, uses LoRA technology to fine-tune the multimodal large model, and trains an end-to-end flowchart recognition model F2D through a hierarchical multimodal feature alignment framework, thereby mapping the complex topological structure and node text features in medical flowchart images into structured Dot script descriptions.
[0043] S11: The large-scale aligned "flowchart image-Dot script" dataset is constructed through a reverse generation mechanism. The overall process includes three main steps: Dot script generation, flowchart image generation, and task instruction generation. Details are as follows:
[0044] 1) Dot Script Generation Stage: Using medical encyclopedias (e.g., Wikipedia) as the corpus, covering approximately 30 departments and 5200 diseases, the focus is on extracting paragraphs related to disease descriptions, symptoms, pathology, and diagnostic methods. A structured Dot script is generated by guiding the DeepSeek-V3 large-scale language model using Chain of Thought (CoT) and few-shot prompt templates. The prompt templates include task descriptions, formatting specifications, and script examples, ensuring that the generated results maintain medical semantic correctness and structural standardization.
[0045] 2) Flowchart Image Generation Stage: The generated Dot scripts are syntax-validated using the Pygraphviz tool, and samples containing syntax errors are removed. To improve the usability and diversity of the dataset, two post-processing strategies are implemented, specifically including:
[0046] Abnormal branch pruning: The breadth-first search algorithm sets a condition for the out-degree... A node, only from its set of successor nodes Five successor nodes are randomly selected to limit excessive horizontal growth. Furthermore, if a cycle is encountered (i.e., a child node has already been visited), redundant child nodes are discarded.
[0047] Randomized design style: Simulating a literary style, 60% of the flowcharts use full rectangular nodes, while the remaining 40% use combinations of "circle-diamond-rectangle" nodes. Colors are randomly assigned from 12 commonly used color schemes. Node borders are removed from 30% of the flowcharts. Connecting lines are set to straight lines, polylines, or curves in a 4:3:3 ratio, with some connecting lines replaced by undirected lines.
[0048] 3) Task instruction generation stage: Inspired by the Self-Instruct method, 12 manually written seed instructions were used to guide DeepSeek in generating diverse new instructions through a small number of sample prompts. After manual screening, 64 task instructions with different expression styles were obtained.
[0049] Based on the above method, this step constructs a Flow2Dot instruction fine-tuning dataset containing 13,054 data samples, and divides the dataset into training set, validation set and test set in a ratio of 7:2:1.
[0050] S12: The InternVL2.5-8B model is fine-tuned using LoRA technology, and the generated F2D model is deployed using the LMDeploy framework for efficient inference. To effectively align the image and text modalities in the fine-tuning dataset, a hierarchical multimodal feature alignment framework is designed: For the visual modality, this step uses a graph attention network to extract the topology by modeling the spatial dependencies between nodes; for the text modality, this step performs syntactic analysis on the Dot script and uses a hierarchical Transformer encoder to capture its structured semantics; a cross-modal fusion module with a dynamic gating mechanism adaptively weights the modalities according to their semantic relevance, thereby ensuring consistency between the visual layout and the text representation.
[0051] S13: This step experimentally evaluates the trained F2D model to further verify its effectiveness. Two datasets were used: an automatically constructed Flow2Dot test set and a manually validated flowchart dataset, MF-MDT. This step compares the F2D model with four multimodal large language models: Qwen-VLPlus, GPT-4o-mini, GPT-4o, and InternVL2.5-Instrut. The main evaluation metrics include Node-F1 and Route-F1, which reflect the accuracy of decision tree nodes and connections. Node-F1 measures the consistency between generated and labeled nodes based on conditional rules. This consistency is verified using a large language model from natural language descriptions, and the calculation formula is:
[0052]
[0053] in This represents the number of nodes that were correctly predicted. This represents the total number of predicted nodes. This indicates the total number of labeled nodes.
[0054] Route-F1 assesses the degree of matching between the generated diagnostic path and clinical logic, evaluates the completeness of the reasoning chain and the relevance of nodes, and is calculated using the following formula:
[0055]
[0056] in, This represents the number of correctly predicted paths. This represents the total number of predicted paths. This indicates the total number of marked paths.
[0057] Table 1 Comparison Experiment of Flowchart Recognition Models
[0058]
[0059] Based on the experimental results in Table 1, the F2D model of this invention demonstrates excellent performance on both the automatically generated test set and manually labeled real flowchart datasets. On the automatically constructed Flow2Dot test set, the Node-F1 score of this invention is improved by 13.47% compared to the state-of-the-art multimodal large language model GPT-4o. To further verify the effectiveness of the F2D model, testing with real flowchart datasets is crucial, as the distribution of these datasets differs from the training dataset. Experimental results show that the F2D model still outperforms existing multimodal large language models, with its Node-F1 score improving by 3.77% compared to GPT-4o.
[0060] Step S2 performs structured parsing on the Dot script output from step S1, extracting the node and edge sets. A semantic judgment mechanism is used to identify the legitimacy of leaf nodes and prune abnormal paths, establishing an initial medical decision tree with preliminary logical topology. Then, by combining a large language model and an external medical knowledge base, semantic rewriting and structural optimization are performed on conditional judgment result nodes, technical terminology nodes, and complex logic nodes in the initial decision tree. Intermediate judgment nodes are transformed into edge attribute annotations, and the flowchart logic is transformed into a standardized medical decision tree conforming to clinical pathway specifications. Specifically, this includes:
[0061] S21: Parse the Dot script output by the F2D model, extract all nodes and connecting lines, and represent them as a set of nodes and a set of edges, respectively; the parsing process is implemented through regular expressions and a syntax analyzer to extract the identifiers, text content and attributes of nodes, as well as the start, end and label information of edges; convert the extracted nodes and edges into JSON format for storage.
[0062] S22: Classify the nodes in the initial decision tree into three categories: root nodes, condition nodes, and decision nodes. The root node corresponds to the starting point of the medical flowchart. If there are multiple starting points, each starting point is used as a root node. Extract the largest traversable subtree starting from the root node to form an independent decision tree. To ensure that all leaf nodes are decision nodes (representing the final diagnosis or treatment recommendation), use a large language model to analyze the semantic content of the leaf nodes. If a leaf node represents a condition judgment, the path is considered to have terminated improperly and needs to be pruned. In addition to root nodes and leaf nodes, all non-leaf nodes are uniformly classified as condition nodes, representing the diagnostic or evaluation criteria in the clinical workflow.
[0063] S23: To address the problem of ambiguous or semantically incomplete node representations in the initial decision tree, this step proposes a node enhancement algorithm driven by a large language model. This method identifies and optimizes three key problem nodes that hinder clinical interpretability: conditional judgment result nodes, technical terminology nodes, and multi-condition composite nodes. Specifically, it includes:
[0064] 1) Rewriting condition judgment result nodes: To eliminate structural redundancy, intermediate judgment nodes are removed and their labels are converted into edge labels between condition nodes and child nodes. That is, the logic is changed from "condition → result → next step" to the direct "condition [result] → next step", ensuring that all leaf nodes represent deterministic results;
[0065] 2) Terminology node rewriting: Using a large language model, nodes containing abbreviations are rewritten into complete natural language statements, making full use of the contextual understanding capabilities of the large language model to improve interpretability and ensure clinical clarity, without relying on a static dictionary;
[0066] 3) Multi-condition composite node decomposition: For composite condition nodes, semantic decomposition is performed by combining a large language model and an external "disease-symptom" knowledge base. The knowledge base is used to verify the correctness of the logical decomposition, prevent illusions, and ensure a medically reasonable decision-making path. This is a key advantage over purely data-driven methods.
[0067] S24: This experiment aims to evaluate the effectiveness of the Flow2MDT method proposed in this invention. Three end-to-end baseline methods are designed here for comparison with Flow2MDT, including:
[0068] 1) Zero-shot method: This method uses the multimodal large language model GPT-4o to generate a decision tree from the flowchart with the prompts of detailed task instructions;
[0069] 2) Mind Chain: This method utilizes the mind chain to improve performance through intermediate thinking steps;
[0070] 3) Mind Chain + Few Samples: This method enhances the mind chain by adding few sample examples, thereby achieving rapid learning and better generalization ability.
[0071] The experiment used the same test dataset to compare the Flow2MDT method with the three baseline methods mentioned above, and evaluated the quality of the generated medical decision trees. The main evaluation metrics included Node-F1 and Route-F1. As shown in Table 2, the Flow2MDT method achieved the highest Node-F1 and Route-F1 scores, exceeding the zero-shot method by 27.73%, the thought chain method by 18.74%, and the thought chain + few-shot method by 14.46%. The experimental results demonstrate that the method of this invention effectively extracts medical decision rules from the flowchart and successfully supplements decision knowledge.
[0072] Table 2 Experimental results of the medical decision tree construction task
[0073]
[0074] like Figure 2As shown, based on the generated medical decision tree, this invention proposes an interactive differential diagnosis method, IDD-PaCA, which mainly includes two modules: diagnostic decision path retrieval and diagnostic evidence integrity assessment.
[0075] Step S3 decomposes the standardized medical decision tree into independent atomic decision paths, uses the PubMedBERT medical pre-trained model for vector space mapping to achieve vectorized representation of the decision paths, and constructs a retrieval re-ranking model based on the patient's real-time status to extract the optimal candidate path. Specifically, this includes:
[0076] S31: To alleviate the semantic ambiguity of traditional vectorization methods, a structured decomposition strategy is introduced to transform the composite medical decision tree. Decompose the decision path into atomic decision paths using depth-first traversal. The depth-first search algorithm starts from the root node and recursively visits all reachable leaf nodes. Each path from the root node to a leaf node constitutes an atomic decision path. For each node in the path, its question-answer pair is... Standardizing a large language model into declarative statements can be formally represented as follows:
[0077]
[0078] in, A normalized representation of the problem. A standardized representation of the answer. This represents a string concatenation operation. This represents a declarative statement. A descriptive sequence is formed based on the above operations. The PubMedBERT model is used to encode the description sequence, a process that can be formally represented as follows:
[0079]
[0080] in, The hidden state of the location serves as a representation of the entire path, ultimately generating a vector database. It uses FAISS (Facebook AI Similarity Search) for indexing, supporting efficient similarity retrieval.
[0081] S32: Employs two intelligent agents for multi-round doctor-patient dialogue, interaction process Structured into a set of states Initial state Based on the patient's gender, age, and chief complaint, each subsequent round of dialogue... Transformed into declarative updates, dynamically refining patient symptom characteristics for path matching, patient state set Updated dynamically with each round of dialogue; in addition, the candidate disease set Retrieved from disease databases based on the patient's initial information.
[0082] S33: For each candidate disease Compare it with the patient's condition Combine to form a query Using PubMedBERT encoding for queries in a vector database Before searching The most similar path.
[0083] S34: Use a mixture function to evaluate path relevance for the retrieved paths. The correlation score is calculated as follows:
[0084]
[0085] in Representing a path The set of symptoms mentioned in the text This indicates the size of the intersection between path symptoms and patient status. This score is used to check the degree of diagnostic matching; paths that do not match a diagnosis receive a score of 0. The score is based on relevance. Sort in descending order, first The path enters the reordering phase.
[0086] S35: Patient status Candidate Path The data is input into GPT-4o and a specialized sorting template is used to generate the final ordered list. The path with the highest ranking after reordering is selected as the final output.
[0087] Step S4 introduces a diagnostic evidence integrity assessment algorithm based on thought chain and few-shot prompts. It utilizes a large language model to quantify and score the currently known evidence, and dynamically schedules follow-up questions to generate agents or diagnostic decision-making agents based on pre-set reliability thresholds, outputting an interpretable final diagnostic result. Specifically, it includes:
[0088] S41: To determine whether the current patient information during an interactive consultation is sufficient to support a definitive diagnosis, a diagnostic evidence completeness assessment method based on the diagnostic decision path is proposed. Given a set of currently known patient information... and retrieved candidate diagnostic paths The DeepSeek large language model is used for evaluation. Using a thought chain and few-shot hint strategy, DeepSeek generates a completeness score for the current evidence, with a score range of [1, 2, 3, 4, 5], defined as follows:
[0089] 5 points (sufficient evidence): Confirms the accurate diagnosis while ruling out other possibilities;
[0090] 4 points (highly relevant): 1-2 additional supporting pieces of evidence are needed;
[0091] 3 points (multiple diagnostic directions): Further questioning is needed to narrow down the possibilities;
[0092] 2 points (limited information): Much additional evidence is still needed;
[0093] 1 point (insufficient evidence): Unable to make a reliable diagnosis.
[0094] S42: Based on the evidence integrity assessment module, develop a questioning-generating agent and a diagnostic decision-making agent to achieve behavioral selection under different confidence levels. When the integrity score... Time (of which) (To pre-set a reliability threshold), the system calls a follow-up questioning agent to obtain additional medical evidence, constructing follow-up questioning instructions using domain-knowledge-guided prompt templates. And call the follow-up question generation function Output targeted follow-up questions; when completeness score is given When the chain of evidence is sufficiently complete, the diagnostic decision-making agent is activated, and the final diagnostic result is output based on the currently known symptoms.
[0095] S43: This step evaluates the performance difference between the diagnostic method of this invention and existing methods through comparative experiments. This step selects a representative multi-agent method in this field as a baseline to ensure comparability. The comparison method is briefly described below:
[0096] 1) MediQ: This method uses a concession strategy to estimate model confidence, thereby enabling multi-turn interactions in differential diagnosis and optimizing the dialogue to improve diagnosis;
[0097] 2) MEDDxAgent: This method has a DDxDriver scheduler for differential diagnosis workflow control, a medical history acquisition simulator for rapid acquisition of patient medical history, and two dedicated intelligent agents for knowledge retrieval and diagnostic strategies to complete disease diagnosis.
[0098] 3) DR-CoT: This method extends the thinking chain prompting method to medical reasoning for automatic diagnosis, and designs a special diagnostic reasoning thinking chain method;
[0099] 4) CoD: This method proposes a diagnostic chain approach that enhances the interpretability of medical diagnoses by simulating the doctor's thought process as a transparent reasoning path and outputting the disease confidence distribution.
[0100] The experiment used 1048 screened patient records from the DDxPlus dataset. This dataset covers 1.3 million synthetic patient records across 49 diseases. To verify the effectiveness of the method, the same evaluation metrics as those used in the DDxPlus dataset were employed: GPTA@k, DDR, DDP, DDF1, PER, and IL. The meanings of these metrics are explained below:
[0101] 1) GPTA@k, or True Pathology Accuracy, is used to assess whether the patient's true pathology appears among the top k most likely diagnoses in the model's predicted differential diagnosis list. Its calculation formula is as follows:
[0102]
[0103] 2) PER, or Positive Evidence Recall, is an indicator that quantifies the effective medical evidence collected during interactive differential diagnosis. A higher value indicates better diagnostic quality. The formula for calculating this indicator is:
[0104]
[0105] 3) DDR, or Detection Recall, is a metric that evaluates the recall between the agent's predicted differential diagnoses and the actual diagnoses. The calculation formula is as follows:
[0106]
[0107] 4) DDP, or Diagnostic Precision, is an indicator used to evaluate the accuracy of an agent. Its calculation formula is as follows:
[0108]
[0109] 5) DDF1, or differential diagnosis F1, is the harmonic mean of precision and recall. It comprehensively measures these two metrics and is calculated by combining DDR and DDP metrics. The calculation formula is:
[0110]
[0111] 6) IL, or Interaction Duration, is used to evaluate dialogue efficiency by measuring the average number of interaction rounds. Ideally, interaction duration should balance comprehensiveness (avoiding too few rounds) and simplicity (avoiding too many rounds).
[0112] Based on the experimental results in Table 3, the method proposed in this invention demonstrates superior performance across all metrics of the differential diagnosis task, significantly outperforming existing methods. This novel framework leverages diagnostic decision-making pathways and evidence completeness to achieve significant improvements in three key areas: Regarding differential diagnostic accuracy, compared to MEDDxAgent, the accuracy of GPTA@1 and GPTA@3 using GPT-4o is improved by 10.43% and 7.82%, respectively. Similar improvements of at least 5% were also observed using Qwenplus-latest and DeepSeek-V3, highlighting its diagnostic precision; Regarding the efficiency of effective medical evidence collection, PER is improved by 2.79% and 5.11% compared to GPT-4o and DeepSeek-V3, respectively, indicating that unnecessary inquiries are reduced while collecting relevant clinical data, thus improving efficiency; The framework optimizes the number of interaction rounds, maintaining an average IL of 6, achieving a balance between sufficient evidence collection and avoiding excessive or ineffective interactions. These results collectively underscore the robustness of this method in improving diagnostic accuracy and consultation efficiency.
[0113] Table 3. Experimental results for different differential diagnostic tasks
[0114]
Claims
1. A method for automatically constructing medical decision trees based on flowchart recognition, characterized in that, include: S1: Flow2Dot, a flowchart recognition method based on a multimodal large-scale language model, is characterized by constructing an "image-Dot script" instruction fine-tuning dataset through a reverse generation mechanism, using low-rank adaptation technology to fine-tune the multimodal large-scale model, and training an end-to-end flowchart recognition model F2D through a hierarchical multimodal feature alignment framework, thereby mapping the complex topological structure and node text features in medical flowchart images into structured Dot script descriptions; S2: The Dot2MDT method for constructing decision trees based on Dot scripts is characterized by performing structured parsing on the Dot scripts, extracting node sets and edge sets, identifying the legality of leaf nodes and pruning abnormal paths through a semantic judgment mechanism, and establishing an initial medical decision tree with preliminary logical topology; combining a large language model and an external medical knowledge base, semantic rewriting and structural optimization are performed on condition judgment result nodes, professional terminology nodes and composite logic nodes in the initial decision tree, transforming intermediate judgment nodes into edge attribute labels, and transforming flowchart logic into a standardized medical decision tree that conforms to clinical pathway specifications; S3: Construct an atomic decision path index and retrieval mechanism, characterized in that the standardized medical decision tree is decomposed into mutually independent atomic decision paths, the PubMedBERT medical pre-trained model is used for vector space mapping to realize the vectorized representation of the decision path, and a retrieval re-ranking model is constructed based on the real-time status of the patient to extract the optimal candidate path. S4: To realize interactive differential diagnosis and decision generation, characterized by introducing a diagnostic evidence integrity assessment algorithm based on thought chain and few-sample prompts, using a large language model to quantify and score the currently known evidence, and dynamically scheduling follow-up questions to generate intelligent agents or diagnostic decision agents according to a preset reliability threshold, and outputting an interpretable final diagnostic result.
2. The method according to claim 1, characterized in that, The dataset construction in S1 employs a reverse generation mechanism, specifically including: 1) Using medical encyclopedia corpus as the source, guide the large language model to generate structured Dot scripts that conform to the logic of medical diagnosis; 2) Use a drawing engine to render the script as a flowchart image, forming "image-Dot script" paired samples; 3) Perform structural constraint pruning: for any node If it exceeds the limit Then from its successor node set The first 5 valid branches are retained and loops are removed; 4) Introduce a style randomization strategy: By changing the node shape, color scheme and connection topology, simulate the typesetting style of different medical documents to enhance the model's generalization ability.
3. The method according to claim 1, characterized in that, The model recognition process in S1 adopts a hierarchical feature alignment framework, in which the visual modality extracts the spatial layout features of the flowchart through a graph attention network; The text modality captures the hierarchical semantics of the script through a layered Transformer encoder; and achieves deep alignment between visual features and text representations using a dynamic gating fusion module.
4. The method according to claim 1, characterized in that, The node optimization process in S3 specifically includes: 1) Logical transformation: Identify and remove intermediate result nodes, and transform their corresponding branch logic "condition → result → next step" into the edge label between parent and child nodes "condition [result] → next step"; 2) Terminology standardization: Using a large language model to expand abbreviations or non-standard terms into natural language statements that conform to the standard medical terminology set; 3) Path disambiguation: The joint knowledge base performs atomic decomposition of complex judgment nodes to ensure the rigor of the decision path.
5. The method according to claim 1, characterized in that, The vectorization representation process of the atomic decision path in S4 is as follows: 1) Extract the path set by depth-first traversal ; 2) Convert the question-and-answer sequence in the path into a sequence of declarative sentences. ; 3) Calculate the comprehensive representation vector of the path using the PubMedBERT model. The calculation formula is as follows: in, This represents the vector concatenation operator.
6. The method according to claim 1, characterized in that, The retrieval re-ranking in S4 adopts a hybrid relevance scoring mechanism, and the calculation formula is as follows: in, For the set of symptoms in the decision-making path, For the patient's current state set, This is a preliminary set of candidate diseases identified based on the patient's chief complaint. The pre-set correlation balance coefficient, This is an indicator function.
7. The method according to claim 1, characterized in that, The specific interaction logic in S5 is as follows: Diagnostic evidence integrity score generated based on the thought chain strategy ;when When this happens, the system calls the medical knowledge guidance module to generate supplementary consultation questions; when At that time, the system directly outputs a diagnosis suggestion based on the confidence path.