Clinical thinking reverse extraction method and device based on medical record data
Patent Information
- Application Number
- CN202610982021.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-02
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-07-02
AI Technical Summary
(1)传统临床思维教学依赖专家手工编写案例,效率低、成本高,难以规模化;
提取准确率高:临床推理链还原准确率较高,能够准确还原医生的诊断推理过程;完整性好:关键思维点覆盖率高,确保重要的诊断依据和推理步骤不被遗漏;可解释性强:每个诊断结论均可追溯到具体证据,便于医学教学和临床质控;效率提升显著:相比人工整理,效率得到明显提升,大幅降低临床教学案例制作成本;可持续优化:基于强化学习的优化框架支持根据专家反馈持续改进提取质量。
Smart Images

Figure CN122494197B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of medical artificial intelligence and natural language processing technology, specifically to a method and apparatus for reverse extraction of clinical thinking based on medical record data. Background Technology
[0002] Clinical reasoning is one of the core competencies in medical education. It refers to the thought process by which physicians logically reason from patients' symptoms, signs, and auxiliary examination results, form diagnostic hypotheses, and ultimately establish a diagnosis. Traditional teaching of clinical reasoning mainly relies on senior experts manually compiling teaching cases, which suffers from many problems such as low efficiency and high cost, including the following: (1) Traditional clinical thinking teaching relies on experts to manually write cases, which is inefficient, costly and difficult to scale up; (2) The clinical reasoning process implied in the medical record is difficult to extract explicitly and express in a structured manner. The doctor's diagnostic thinking is often implied in the medical record description rather than explicitly recorded. (3) Existing natural language processing methods mainly focus on extracting medical entities (such as disease names, drug names, etc.) and lack the ability to reconstruct the diagnostic reasoning chain; (4) The construction of medical knowledge graphs mainly relies on static rules and cannot capture dynamic diagnosis and treatment decision-making logic.
[0003] Therefore, how to reverse-engineer doctors' clinical thinking processes from unstructured medical record texts and form an interpretable and learnable reasoning chain is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] This application provides a method and apparatus for reverse extraction of clinical reasoning based on medical record data, which has a high extraction accuracy and can accurately reconstruct the diagnostic reasoning process.
[0005] In a first aspect, embodiments of this application provide a method for reverse extraction of clinical thinking based on medical record data, the method comprising: Acquire medical record data and perform structured parsing, including chief complaint extraction, present illness history analysis, and physical examination result analysis; Hypothesis generation, evidence association, and reasoning path tracing are performed based on the analysis results to reconstruct the reasoning chain; The reconstructed reasoning chain is processed into knowledge, and clinical thinking is extracted through reasoning pattern clustering. A triplet knowledge graph containing symptoms, reasoning, and diagnosis is constructed and output in an interpretable manner.
[0006] In conjunction with the first aspect, in one implementation, the acquisition of medical record data and the performing of structured parsing specifically includes: Obtain medical record data; Chief complaints are extracted from medical record data and converted into symptom feature vectors; Perform present illness history analysis on medical record data and generate a time-series symptom evolution graph; Medical records data are examined and test results are analyzed to obtain objective evidence.
[0007] In conjunction with the first aspect, in one implementation, the step of performing hypothesis generation, evidence association, and reasoning path tracing based on the analysis results to achieve reasoning chain extraction specifically includes: A hierarchical symptom encoder is used to encode the chief complaint and present medical history to obtain a symptom vector containing temporal features, and a diagnostic hypothesis is generated based on the symptom vector. The test results are used as evidence to correlate with diagnostic hypotheses, and an evidence-diagnostic hypothesis correlation matrix is constructed to represent the degree of support of each test result for each diagnostic hypothesis. Using the Bayesian backward reasoning method, starting from the final diagnosis result and combining the evidence-diagnosis hypothesis association matrix, the complete reasoning path from symptoms to diagnosis is derived in reverse, thus realizing the extraction of the reasoning chain.
[0008] In conjunction with the first aspect, in one implementation, the hierarchical symptom encoder is used to encode the chief complaint and present medical history to obtain a symptom vector containing temporal features, specifically including: The chief complaint and present medical history were segmented into medical terms, and a pre-trained BERT model was used for sequence labeling. Based on each word segmentation unit, a hierarchical symptom encoder is used for encoding, and combined with learnable temporal position encoding, to obtain a symptom vector containing temporal features. The hierarchical symptom encoder has a three-level structure, consisting of a word layer, a symptom phrase layer, and a symptom sequence layer from bottom to top. The lexical layer is used to map each lexical unit after word segmentation into an initial word vector through a pre-trained medical word embedding layer. ; The symptom phrase layer is used to aggregate multiple initial word vectors corresponding to each symptom entity phrase in the chief complaint and present medical history using an attention pooling mechanism. For symptom phrase vectors, specifically:
[0009]
[0010] in, , Indicates learnable parameters, Represents symptom phrase vectors. Indicates the first The attention weights of each lexical unit within the symptom entity phrase after softmax normalization. The first entity phrase containing the symptom is... The initial word vector of each word element. The first entity phrase containing the symptom is... The initial word vectors of each word element; The symptom sequence layer is used to arrange all symptom phrase vectors in the same medical record data into a sequence in chronological order, and then input it into a bidirectional LSTM network for temporal encoding. Specifically:
[0011]
[0012]
[0013] in, Indicates the first The hidden state vector output by the feedforward LSTM. Indicates a forward LSTM unit. Indicates the first The symptom phrase vector input at each step, Indicates the forward LSTM at the th The hidden state vector of the step, Indicates the first The hidden state vector output by the backward LSTM. Indicates the inverse LSTM cell. Indicates the inverse LSTM at the 1st The hidden state vector of the step, Indicates the first The hidden state vector output by the bidirectional LSTM. Represents the vector concatenation operator; The symptom vector Represented as:
[0014]
[0015] in, Represents the temporal position vector. Indicates frequency parameters, Indicates time offset.
[0016] In conjunction with the first aspect, in one implementation method, The process of correlating examination results as evidence with diagnostic hypotheses to construct an evidence-diagnostic hypothesis correlation matrix specifically includes: The examination results are extracted from the medical record data as evidence. This evidence is then correlated with the diagnostic hypothesis to construct an evidence-diagnosis hypothesis correlation matrix. The elements of this matrix are defined as follows:
[0017] in, Indicates the first The evidence against the first The degree of support for each diagnostic hypothesis Indicates the first A vector representing each piece of evidence. Indicates the first A vector representing a diagnostic hypothesis. Indicates the bias term. This represents the tanh activation function. Represents the learnable association weight matrix; The method employs Bayesian backward reasoning, starting with the final diagnosis and combining it with the evidence-diagnosis hypothesis correlation matrix to deduce the complete reasoning path from symptoms to diagnosis, thereby reconstructing the reasoning chain. Specifically, this includes: Based on the final diagnosis results Starting with Bayes' theorem, the posterior probability of each diagnostic hypothesis is calculated. Among them, the first is set The prior probabilities of the diagnostic hypotheses are Given all the evidence and assuming that the evidence is independent, the posterior probability is... for:
[0018] in, Indicates the total number of pieces of evidence. This represents the total number of diagnostic hypotheses. Indicates the first The prior probability of a diagnostic hypothesis. Indicates the first The evidence in the Conditional probability under a diagnostic hypothesis. For likelihood terms, , Indicates the first The evidence against the first The degree of support for each diagnostic hypothesis Indicates temperature parameter; Evidence is introduced sequentially in chronological order, and the information gain of each piece of evidence on the posterior probability distribution is calculated. Specifically:
[0019] in, Indicates before introduction The posterior probability distribution of each diagnostic hypothesis following the evidence. Indicates before introduction The posterior probability distribution of each diagnostic hypothesis following the evidence. Represents the KL divergence operator; A structured reasoning path is generated and transformed into a natural language reasoning chain to achieve reasoning chain extraction. The structured reasoning path includes a sequence of reasoning chain nodes, a hypothesis evolution trajectory, and annotations of key turning points. The inference chain node sequence is arranged in chronological order. This is used to record the evidence, posterior probability distribution, and information gain at each step; The hypothesis evolution trajectory is the curve of how the posterior probability of each diagnostic hypothesis changes with the introduction of evidence; The key inflection point is marked as evidence that the information gain exceeds a set threshold.
[0020] In conjunction with the first aspect, in one implementation method, After extracting clinical reasoning through clustering of reasoning patterns, the quality of clinical reasoning extraction is optimized through reinforcement learning. The optimization of clinical reasoning retrieval quality through reinforcement learning specifically includes: Multiple historical medical records were used as a training set to train the constructed basic model of clinical reasoning extraction, so that the trained basic model of clinical reasoning extraction has the ability to understand medical records and extract reasoning chains. Collect active preference ranking data for extracted clinical reasoning, including accuracy scores, reasoning chain integrity evaluation, and key reasoning point omission annotations, and train a reward model; Based on the proximal strategy optimization algorithm, and guided by the output of the reward model, the clinical reasoning extraction base model is optimized to improve the extraction strategy of clinical reasoning. An online learning mechanism is introduced to continuously iterate and optimize the clinical reasoning extraction base model.
[0021] In conjunction with the first aspect, in one implementation method, The basic model for extracting clinical reasoning includes a medical record encoder, a reasoning chain decoder, an evidence-hypothesis interaction module, and a reasoning pattern classification head. The medical record encoder is used to convert medical record data text into a high-dimensional semantic representation. It adopts a Transformer-based pre-trained language model architecture, and the output of the medical record encoder is a sequence of context representation vectors for each word. The inference chain decoder is used to autoregressively generate a structured inference chain based on the output of the medical record encoder. The evidence-hypothesis interaction module is located between the medical record encoder and the inference chain decoder. It is responsible for explicitly modeling the relationship between evidence and diagnostic hypothesis. Specifically, the evidence-hypothesis interaction module receives the representation vectors of the corresponding evidence and diagnostic hypothesis from the output of the medical record encoder, calculates the evidence-diagnostic hypothesis association matrix through a bilinear attention mechanism, and injects the evidence-diagnostic hypothesis association matrix into the cross-attention layer of the inference chain decoder. The inference pattern classification head is a multi-label classifier located above the inference chain decoder, used to classify patterns in the generated inference chain.
[0022] In conjunction with the first aspect, in one implementation, the optimization algorithm based on proximal strategy, using the reward model output as a guiding signal, optimizes the clinical reasoning extraction strategy of the basic clinical reasoning extraction model, specifically including: The policy network, i.e. the inference chain decoder, outputs the action probability distribution at each step of the inference chain based on the current state. The value network and the policy network share the parameters of the inference chain decoder, and an independent linear layer is added on top of the last layer of the inference chain decoder to output a scalar value estimate. The advantage function is calculated using generalized advantage estimation. :
[0023] in, Indicates the discount factor. This represents the GAE smoothing parameter. Indicates timing difference error. Indicates the current reasoning step To the end of the inference chain The number of remaining steps; The near-end policy optimization algorithm limits the policy update magnitude by using a pruning alternative objective function:
[0024] in, Indicates the probability ratio. Indicates the cutting range. Indicates the strategy parameters The determined proximal policy optimizes the loss function. This indicates the time step along the inference chain. Take the expected value. Represents the shearing function; Calculate the total training loss :
[0025] in, Represents the coefficient. This indicates that the near-end strategy optimizes the shear loss. This represents the mean squared error loss of the value network. This represents the KL divergence constraint term between the current policy and the pre-trained reference policy.
[0026] In conjunction with the first aspect, in one implementation method, the introduction of an online learning mechanism to continuously iteratively optimize the basic model for extracting clinical reasoning specifically includes: Provide multi-dimensional feedback on the reasoning chain output during the use of the basic model for extracting clinical thinking, including preference ranking feedback, step-by-step error correction feedback, and annotation of key thinking points; The feedback preference ranking is added to the training set, and the reward model is incrementally fine-tuned. Specifically, the newly added data is mixed proportionally with the original data in the training set, and the reward model is updated using the loss function of the Bradley-Terry preference model.
[0027] in, This represents the highest-ranking inference chain in the preference ranking. This represents the lowest-ranking inference chain in the preference ranking. Represents a reward model. Represents medical record data. Reward Model Bradley-Terry maximum likelihood loss on preference ranking data This indicates that expert preferences apply to the sample. Take the expected value. This represents the sigmoid activation function. This indicates that the reward model favors the better inference chain in the preference pair. The given scalar reward score, This indicates that the reward model favors the inferior inference chain in the preference pair. The given scalar reward score; After the reward model is updated, the PPO of the basic model for extracting clinical thinking is adjusted using the updated reward signal. The adjustment strategies include elastic weight consolidation, low-rank adaptation fine-tuning, quality monitoring and rollback mechanism. Specifically, the elastic weight consolidation involves adding an EWC regularization term to the PPO damage function.
[0028] in, Indicates the regularization strength. Represents the diagonal elements of the Fisher information matrix. This represents the parameters after the previous round of optimization. This indicates a regularization term that reinforces the elastic weights. This indicates the policy network's th iteration in the current online optimization round. One parameter component awaiting update.
[0029] Secondly, embodiments of this application provide a clinical reasoning reverse extraction device based on medical record data, the clinical reasoning reverse extraction device based on medical record data comprising: The parsing module is used to acquire medical record data and perform structured parsing, which includes chief complaint extraction, present illness history analysis, and physical examination result analysis. The reconstruction module is used to generate hypotheses, associate evidence, and trace inference paths based on the analysis results, so as to reconstruct the inference chain. The extraction module is used to process the reconstructed reasoning chain into knowledge, extract clinical thinking through reasoning pattern clustering, construct a triplet knowledge graph containing symptoms, reasoning, and diagnosis, and output interpretable results.
[0030] The beneficial effects of the technical solutions provided in this application include: High extraction accuracy: The accuracy of clinical reasoning chain reconstruction is high, accurately reconstructing the doctor's diagnostic reasoning process; Good completeness: High coverage of key thinking points ensures that important diagnostic evidence and reasoning steps are not omitted; Strong interpretability: Each diagnostic conclusion can be traced back to specific evidence, facilitating medical teaching and clinical quality control; Significantly improved efficiency: Compared with manual compilation, efficiency is significantly improved, greatly reducing the cost of producing clinical teaching cases; Continuous optimization: The reinforcement learning-based optimization framework supports continuous improvement of extraction quality based on expert feedback. Attached Figure Description
[0031] Figure 1 This is a flowchart illustrating the clinical reasoning reverse extraction method based on medical record data used in this application. Figure 2 This is a complete flowchart of the clinical thinking reverse extraction method based on medical record data in this application; Figure 3 A detailed flowchart illustrating the process of reconstructing the inference chain; Figure 4 A diagram illustrating the framework optimization for reinforcement learning; Figure 5 An example of visualizing the weights of diagnostic criteria based on attention mechanisms; Figure 6 This is a schematic diagram illustrating the evolution of time-series perception symptoms. Figure 7 This is a schematic diagram of the functional modules of the clinical thinking reverse extraction device based on medical record data in this application. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0033] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0034] In the first aspect, embodiments of this application provide a method for reverse extraction of clinical thinking based on medical record data, that is, a method for automatically reverse-extracting doctors' clinical thinking patterns from clinical medical records.
[0035] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating the clinical reasoning reverse extraction method based on medical record data used in this application. Figure 1 As shown, the clinical reasoning reverse extraction method based on medical record data includes: S1: Obtain medical record data and perform structured parsing, including chief complaint extraction, present illness history analysis, and physical examination result analysis; S2: Based on the analysis results, perform hypothesis generation, evidence association, and reasoning path tracing to reconstruct the reasoning chain; S3: The reconstructed reasoning chain is processed into knowledge; clinical thinking is extracted through reasoning pattern clustering; a tripartite knowledge graph containing symptoms, reasoning, and diagnosis is constructed; and interpretable output is provided, ultimately outputting the clinical thinking chain, reasoning basis, and differential diagnosis logic. See also Figure 2 The diagram shown is a complete flowchart of the clinical thinking reverse extraction method based on medical record data in this application.
[0036] Furthermore, in one embodiment, acquiring medical record data and performing structured parsing specifically includes: Obtain medical record data; Chief complaints are extracted from medical record data and converted into symptom feature vectors; Perform present illness history analysis on medical record data and generate a time-series symptom evolution graph; Medical records data are examined and test results are analyzed to obtain objective evidence.
[0037] Specifically, structured parsing of medical records involves extracting the chief complaint and converting it into a symptom feature vector; parsing the present illness history and generating a time-series symptom evolution diagram, preserving the chronological order of symptom occurrence; and parsing physical examination and test results to form objective evidence.
[0038] The following example will be used to illustrate the parsing of medical record data.
[0039] An excerpt from an original medical record reads: Chief complaint: Fever accompanied by cough and sputum for 3 days; Present illness: The patient developed a fever 3 days ago without any obvious cause, with a maximum temperature of 38.9°C, accompanied by chills but no rigors. Two days ago, the patient began to cough up small amounts of yellow, sticky sputum, occasionally experiencing chest tightness, but no chest pain or hemoptysis. One day ago, the cough worsened, and the amount of sputum increased. The patient presented to our outpatient department. The patient has a history of good health and denies any chronic diseases; Physical examination: T 38.5°C, P 92 bpm, R 22 bpm, BP 125 / 78 mmHg, alert and oriented, with an acute appearance, coarse breath sounds bilaterally, moist rales audible in the right lower lung field, heart rate 92 bpm, regular rhythm, no murmurs heard in any valvular area, soft abdomen, no tenderness; Auxiliary examinations: Blood routine showed WBC 12.3 × 10⁻⁶. 9 / L, N 82.5%, CRP 68mg / L, chest CT showed patchy high-density shadows in the posterior segment of the right lower lung with blurred edges.
[0040] First, the chief complaint is extracted and symptom features are vectorized. The chief complaint is segmented and named entity recognition is performed to extract core symptom entities and their time attributes. Specifically, the chief complaint text "fever with cough and sputum for 3 days" is processed as follows: Entity recognition result: [symptom: fever, symptom: cough, symptom: sputum, time: 3 days]; Symptom encoding: Each symptom entity is mapped to the ICD-10 symptom encoding system (e.g., fever → R50.9, cough → R05), and transformed into a multi-dimensional feature vector (256 dimensions in this application) through a pre-trained symptom embedding layer; Chief complaint feature vector: The symptom vectors are concatenated and mapped through a fully connected layer to generate the chief complaint feature vector.
[0041] Then, the present medical history is analyzed and a time-series symptom evolution map is generated. The present medical history undergoes time anchor extraction and symptom event serialization: Time anchor extraction: Relative time expressions such as "3 days ago," "2 days ago," and "1 day ago" are identified and normalized to the offset of the time of consultation. When the offset of the time of consultation is -3, the symptom event is fever, with the symptom attribute being a maximum body temperature of 38.9℃, accompanied by chills but no rigors. When the offset of the time of consultation is -2, the symptom event is cough and sputum, with the symptom attribute being a small amount of yellow viscous sputum and occasional chest tightness. When the offset of the time of consultation is -1, the symptom event is worsening cough, with the symptom attribute being increased sputum volume. When the offset of the time of consultation is 0, the symptom event is consultation, with the symptom attribute being outpatient. Time-series evolution map generation: The above time-series event sequence is input into a bidirectional LSTM encoder to generate a time-aware symptom evolution feature matrix. This matrix preserves the temporal order and evolution trend of symptoms (such as the worsening trend of "cough → worsening cough"). Figure 6 As shown.
[0042] Finally, the physical examination and results analysis are conducted to form objective evidence. The results of the physical examination and auxiliary examinations are extracted in a structured manner to form a set of evidence nodes. The physical examination evidence includes: vital signs T=38.5℃ (abnormal); vital signs P=92 bpm (abnormal, slightly increased); vital signs R=22 bpm (abnormal, slightly increased); and a positive sign of moist rales in the right lower lung. Auxiliary examination evidence includes: laboratory WBC=12.3×10⁻⁶. 9 / L, considered elevated; laboratory N%=82.5%, considered elevated; laboratory CRP=68mg / L, considered significantly elevated; radiographically, patchy shadows in the right lower lung posterior segment, with high density and blurred edges, considered possibly inflammatory exudation.
[0043] Each evidence node is also encoded into a multi-dimensional vector through an embedding layer, forming an evidence feature matrix, and the total number of evidence is obtained at the same time.
[0044] Furthermore, in one embodiment, hypothesis generation, evidence association, and reasoning path tracing are performed based on the analysis results to achieve reasoning chain extraction, specifically including: S201: A hierarchical symptom encoder is used to encode the chief complaint and present medical history to obtain a symptom vector containing temporal features, and a diagnostic hypothesis is generated based on the symptom vector. The hierarchical symptom encoder adopts a bidirectional LSTM structure. The input is the symptom description after word segmentation, and the output is a symptom vector containing temporal features. That is, a diagnostic hypothesis is generated based on the symptom description, simulating the differential diagnosis result list formed when a doctor first sees the symptoms. S202: The test results are used as evidence to correlate with the diagnostic hypothesis, and an evidence-diagnostic hypothesis correlation matrix is constructed to represent the degree of support of each test result for each diagnostic hypothesis. In the evidence-diagnosis hypothesis correlation matrix, rows represent examination results (such as physical examination, laboratory examination, imaging examination, etc.), columns represent diagnostic hypotheses, and matrix element values represent the degree of support of each examination result for each diagnostic hypothesis. Furthermore, represents the degree of support of the evidence in the examination results for the diagnostic hypothesis, with a value range of [-1, 1], where positive values indicate support and negative values indicate exclusion. S203: Employing Bayesian backward reasoning, starting with the final diagnosis and combining it with the evidence-diagnosis hypothesis correlation matrix, it reverse-engineers the complete reasoning path from symptoms to diagnosis, enabling reasoning chain extraction and identifying key diagnostic turning points and decisive evidence. See also Figure 3 The diagram shown is a detailed flowchart of the inference chain reconstruction process.
[0045] Furthermore, in one embodiment, a hierarchical symptom encoder is used to encode the chief complaint and present medical history to obtain a symptom vector containing temporal features, specifically including: S2011: Medical word segmentation is performed on the chief complaint and present medical history, and sequence labeling is performed using a pre-trained BERT model; The annotation adopts the BIO tag system, and the tag set includes B-SYMPTOM, I-SYMPTOM, B-BODYPART, I-BODYPART, B-DEGREE, I-DEGREE, B-TIME, I-TIME, and O; for example, the annotation result for the text "Coughing started 2 days ago, coughing up a small amount of yellow phlegm" is: 2 days ago / B-TIME, started / O, cough / B-SYMPTOM, / O, cough / B-SYMPTOM, small amount / B-DEGREE, yellow / B-DEGREE, phlegm / I-SYMPTOM; S2012: Based on each word segmentation unit, a hierarchical symptom encoder is used for encoding, and combined with learnable temporal position encoding, to obtain a symptom vector containing temporal features; The hierarchical symptom encoder has a three-level structure, consisting of a word layer, a symptom phrase layer, and a symptom sequence layer from bottom to top. The lexical layer is used to map each lexical unit after word segmentation into an initial word vector through a pre-trained medical word embedding layer. The medical term embedding layer was pre-trained on a corpus of Chinese medical literature. The symptom phrase layer is used to aggregate multiple initial word vectors corresponding to each symptom entity phrase in the chief complaint and present medical history (such as "coughing up a small amount of yellow phlegm") using an attention pooling mechanism. For symptom phrase vectors, specifically:
[0046]
[0047] in, , Indicates learnable parameters, Represents symptom phrase vectors. Indicates the first The attention weights of each lexical unit within the symptom entity phrase, after softmax normalization, are used for weighted aggregation. The first entity phrase containing the symptom is... The initial word vectors of each word, i.e., the softmax normalized traversal objects. The first entity phrase containing the symptom is... The initial word vector of each word element, that is, the word elements currently being weighted and aggregated; The symptom sequence layer is used to arrange all symptom phrase vectors in the same medical record data into a sequence in chronological order, and then input it into a bidirectional LSTM network for temporal encoding. Specifically:
[0048]
[0049]
[0050] in, Indicates the first The hidden state vector output by the feedforward LSTM. This indicates a forward LSTM cell, meaning it is generated sequentially from... arrive Recursively calculate the hidden state. Indicates the first The symptom phrase vector input at step one, i.e., the output of the symptom phrase layer. The first in chronological order item, Indicates the forward LSTM at the th The hidden state vector of the previous step (i.e., the previous time step). Indicates the first The hidden state vector output by the backward LSTM. This indicates a reverse LSTM cell, meaning it starts from the previous time sequence. arrive Recursively calculate the hidden state. Indicates the inverse LSTM at the 1st The hidden state vector at the next step (i.e., the next time step). Indicates the first The hidden state vector output by the bidirectional LSTM is obtained by concatenating the forward and backward hidden states. This represents the vector concatenation operator; it should be noted that the bidirectional LSTM network has 2 layers and a dropout rate of 0.3. The symptom vector Represented as:
[0051]
[0052] in, Represents the temporal position vector. Indicates frequency parameters, Indicates time offset.
[0053] In this application, in order to preserve the precise time information of symptom occurrence, a learnable temporal position encoding is introduced. For the normalized time offset, the temporal position vector is calculated, and the final symptom vector is the concatenation of the symptom sequence layer output and the temporal position vector.
[0054] Furthermore, in one embodiment, the examination results are used as evidence to correlate with diagnostic hypotheses, constructing an evidence-diagnostic hypothesis correlation matrix, specifically including: The examination results are extracted from the medical record data as evidence. This evidence is then correlated with the diagnostic hypothesis to construct an evidence-diagnosis hypothesis correlation matrix. The elements of this matrix are defined as follows:
[0055] in, Indicates the first The evidence against the first The degree of support for each diagnostic hypothesis is indicated by a positive value, meaning the evidence supports the corresponding diagnostic hypothesis, and a negative value, meaning it is excluded. Indicates the first A vector representing each piece of evidence. Indicates the first A vector representing a diagnostic hypothesis. Indicates the bias term. This represents the tanh activation function. This represents the learnable association weight matrix. This application extracts [the following data] from medical record data. One piece of evidence and A diagnostic hypothesis is derived, thereby constructing an evidence-diagnostic hypothesis correlation matrix.
[0056] Furthermore, in one embodiment, a Bayesian backward reasoning method is employed. Starting with the final diagnostic result and combining it with the evidence-diagnosis hypothesis correlation matrix, the complete reasoning path from symptoms to diagnosis is derived in reverse, thereby reconstructing the reasoning chain. Specifically, this includes: S2031: Based on the final diagnostic results Starting with Bayes' theorem, the posterior probability of each diagnostic hypothesis is calculated. Among them, the first is set The prior probabilities of the diagnostic hypotheses are It is based on disease epidemiological data and medical knowledge graphs, and then, given all the evidence and assuming that the evidence is independent of each other, the posterior probability is... for:
[0057] in, Indicates the total number of pieces of evidence. This represents the total number of diagnostic hypotheses. Indicates the first The prior probability of a diagnostic hypothesis. Indicates the first The evidence in the Conditional probability under a diagnostic hypothesis. The likelihood term is obtained by normalizing the elements of the evidence-diagnosis hypothesis correlation matrix using softmax. , Indicates the first The evidence against the first The degree of support for each diagnostic hypothesis This represents a temperature parameter used to control the sharpness of the probability distribution; the default value is 0.5. S2032: To reconstruct the doctor's reasoning path, evidence is introduced step by step in chronological order, and the information gain of each piece of evidence on the posterior probability distribution is calculated. Specifically:
[0058] in, Indicates before introduction The posterior probability distribution of each diagnostic hypothesis following the evidence. Indicates before introduction The posterior probability distribution of each diagnostic hypothesis following the evidence. This represents the KL (Kullback-Leibler) divergence operator, used to measure the divergence introduced by the first... The information gain of evidence on the posterior probability distribution of a post-introduction diagnosis is quantified by assessing the degree of shift in the posterior probability distribution relative to its initial state. Evidence with an information gain exceeding a set threshold is marked as a critical turning point (or critical diagnostic turning point), indicating that the introduction of this evidence leads to a substantial shift in the diagnostic bias. Furthermore, decisive evidence is defined as evidence that leads to the final diagnostic result. Evidence that the posterior probability first exceeds the confidence threshold; S2033: Generate a structured reasoning path and convert the structured reasoning path into a natural language reasoning chain to achieve reasoning chain extraction. The structured reasoning path includes a sequence of reasoning chain nodes, a hypothesis evolution trajectory, and annotations of key turning points. The inference chain node sequence is arranged in chronological order. This is used to record the evidence, posterior probability distribution, and information gain at each step; The hypothesis evolution trajectory is the curve of the change of the posterior probability of each diagnostic hypothesis as evidence is introduced, which is used to visually demonstrate the process of the diagnostic hypothesis being gradually supported or excluded. The key inflection point is marked as evidence that the information gain exceeds a set threshold, that is, the evidence corresponding to the key inflection point is marked.
[0059] Furthermore, it also includes the textual output of the reasoning path, which transforms the reasoning path obtained above into a natural language reasoning chain, for example: initial symptoms (fever + cough) → generating candidate hypotheses (upper respiratory tract infection 0.4, bronchitis 0.3, pneumonia 0.2) → increased WBC + increased neutrophil ratio → adjusted probability (pneumonia 0.45↑, bronchitis 0.3, upper respiratory tract infection 0.15↓) → [key turning point] patchy shadow in the right lower lung on chest CT → confirmed diagnosis (pneumonia 0.92).
[0060] Furthermore, in one embodiment, after extracting clinical reasoning through reasoning pattern clustering, the quality of clinical reasoning extraction is optimized through reinforcement learning; The optimization of clinical reasoning retrieval quality through reinforcement learning specifically includes: S301: Obtain multiple historical medical records (i.e., large-scale medical record data, generally more than 100,000 records) as a training set to train the constructed basic model of clinical reasoning extraction, so that the trained basic model of clinical reasoning extraction has the ability to understand medical records and extract reasoning chains. S302: Collect active preference ranking data for extracted clinical reasoning, including accuracy scores, reasoning chain integrity evaluation, and key reasoning point omission annotations, to train the reward model; that is, collect clinical experts' preference ranking data for the extracted clinical reasoning results. S303: Based on the Proximal Policy Optimization (PPO) algorithm, this algorithm uses the reward model output as a guiding signal to optimize the clinical reasoning extraction strategy of the basic clinical reasoning extraction model. It also introduces an online learning mechanism to continuously iteratively optimize the basic clinical reasoning extraction model based on new expert feedback.
[0061] See Figure 4The diagram illustrates a reinforcement learning optimization framework. It optimizes the quality of clinical reasoning extraction by introducing reinforcement learning based on clinical experts. In reinforcement learning, the state space is defined as the combination of medical record text and extracted partial reasoning chains; the action space is defined as the selection of the next reasoning step, including hypothesis generation, evidence association, and conclusion output; the reward function R1 is designed as a multi-dimensional comprehensive evaluation: R1 = α1·accuracy score + β1·completeness score + γ1·interpretability score - λ1·redundancy penalty - μ1·logical contradiction penalty; the training process includes: a pre-training phase using large-scale medical record data for basic capability training; a reward model training phase collecting clinical experts' preference ranking data for the extraction results; and a policy optimization phase using the PPO algorithm for optimization, with an online learning mechanism for continuous iterative optimization.
[0062] Furthermore, in one embodiment, the basic model for extracting clinical reasoning includes a medical record encoder, a reasoning chain decoder, an evidence-hypothesis interaction module, and a reasoning pattern classification head.
[0063] The medical record encoder is used to convert medical record data text into a high-dimensional semantic representation. It adopts a Transformer-based pre-trained language model architecture, and the output of the medical record encoder is a sequence of context representation vectors for each word. Specifically, the language model architecture includes 12 Transformer encoding layers, a hidden dimension of 768, 12 attention heads, and a feedforward layer dimension of 3072. The language model was pre-trained on a corpus of 5 million Chinese electronic medical records using two pre-training tasks: Masked Language Modeling (MLM) and Document Segment Order Prediction (DSOP). The DSOP task requires the model to determine whether the order of two paragraphs in the medical record (such as chief complaint and present illness, physical examination and auxiliary examinations) has been scrambled, in order to learn the internal logical structure of the medical record.
[0064] The inference chain decoder is used to autoregressively generate structured inference chains based on the output of the medical record encoder. Specifically, the inference chain decoder employs a 6-layer Transformer decoding layer, configured identically to the medical record encoder (768 hidden dimensions, 12 attention heads). At each step, the inference chain decoder generates an inference step token, whose types include: Hypothesis Generation Token ([HYP]), Evidence Citation Token ([EVD]), Inference Connection Token ([REASON]), and Conclusion Token ([CONC]). The inference chain decoder uses a cross-attention mechanism to monitor the encoder output, ensuring that the generated inference chain remains consistent with the original medical record content.
[0065] The evidence-hypothesis interaction module, located between the medical record encoder and the inference chain decoder, is responsible for explicitly modeling the relationship between evidence and diagnostic hypotheses. Specifically, the module receives the representation vectors of corresponding evidence and diagnostic hypotheses from the output of the medical record encoder, calculates the evidence-diagnostic hypothesis association matrix using a bilinear attention mechanism, and injects this matrix into the cross-attention layer of the inference chain decoder. The introduction of this module enables the inference chain decoder to explicitly perceive which evidence supports or excludes which hypotheses when generating the inference chain, rather than relying solely on implicit attention weights.
[0066] The inference pattern classification head is a multi-label classifier located above the inference chain decoder, used to classify patterns in the generated inference chains. The input to the inference pattern classification head is the vector from the last layer of the inference chain decoder, which passes through two fully connected layers and a sigmoid activation function, outputting the probability of each inference pattern. Predefined inference pattern categories include: Hypothetic-Deductive, Pattern Recognition, Diagnosis by Exclusion, and Probabilistic Reasoning. This inference pattern classification head undergoes supervised training using expert-annotated inference pattern labels during the pre-training phase. The pre-training phase uses a large number of Chinese electronic medical record datasets, and the training objective is the joint loss function of the four components mentioned above.
[0067] Furthermore, in one embodiment, based on the proximal strategy optimization algorithm, and using the reward model output as a guiding signal, the clinical reasoning extraction base model's extraction strategy for clinical reasoning is optimized, specifically including: S3031: Policy Network, i.e., the inference chain decoder outputs the action probability distribution (i.e. the selection of the next inference step) at each step of the inference chain based on the current state (including medical record encoding and the generated part of the inference chain). The value network and policy network share the parameters of the inference chain decoder, and an independent linear layer is added on top of the last layer of the inference chain decoder to output scalar value estimation. S3032: Calculate the advantage function using Generalized Advantage Estimation (GAE). :
[0068] in, This represents the discount factor, which can take a value of 0.99. This represents the GAE smoothing parameter, and its value can be 0.95. Indicates timing difference error. Indicates the current reasoning step To the end of the inference chain The remaining number of steps, i.e. the truncated upper bound of the GAE summation, is used to weight and accumulate future time-series difference errors on a finite-length inference chain. It should be noted that instant rewards Calculated by the reward model, specifically:
[0069] in, Indicates the current state. This indicates the choice of the next reasoning step. This represents the accuracy score of the reasoning steps, i.e., the degree to which the reasoning steps match the standard reasoning path. The completeness score represents the percentage of key thinking points covered. The interpretability score indicates whether the reasoning steps include sufficient citations of evidence. This represents the redundancy penalty, i.e., the number of times the reasoning steps are repeated. This represents the penalty for logical contradictions, specifically the number of contradictory conclusions found in the chain of reasoning. , , , , Indicates the weighting coefficient. The value is 0.3. The value is 0.3. The value is 0.2. The value is 0.1. The value is 0.1; S3033: The near-end policy optimization algorithm limits the policy update magnitude through a pruning alternative objective function.
[0070] in, Indicates the probability ratio. Indicates the cutting range. Indicates the strategy parameters The determined proximal policy optimizes the loss function. This indicates the time step along the inference chain. Take the expected value. The shearing function is used to limit the probability ratio to constrain the single-step update magnitude of the policy. Furthermore, a KL divergence constraint term can be introduced to prevent the optimized policy from deviating too far from the pre-trained model. S3034: Calculate the total training loss :
[0071] in, Represents the coefficient. This represents the near-end policy optimization shearing loss, used to optimize the policy network. This represents the mean squared error loss of the value network. This represents the KL divergence constraint term between the current policy and the pre-trained reference policy, used to prevent the policy from deviating too far from the pre-trained model during the online optimization phase. Training uses the AdamW optimizer with a learning rate of 3×10⁻⁶. 6 The batch size is 64, and 4 inference chains are sampled for each medical record in each round. During training, the quality of the inference chains (accuracy, completeness, and interpretability) is evaluated on the validation set every 500 steps. An early stopping strategy is adopted to prevent overfitting.
[0072] Furthermore, in one embodiment, an online learning mechanism is introduced to continuously iterate and optimize the basic model for extracting clinical reasoning, specifically including: S3131: Provide multi-dimensional feedback on the reasoning chain output during the use of the basic model for extracting clinical thinking, including preference ranking feedback, step-by-step error correction feedback, and annotation of key thinking points; Among them, the preference ranking feedback generates 2 to 4 candidate reasoning chains for the same medical record, and experts rank them from best to worst. The ranking data is used to update the reward model. The stepwise error correction feedback involves experts marking specific steps in the reasoning chain as "correct", "redundant", "incorrect" or "missing". For steps marked as "incorrect", experts can provide corrected reasoning steps. The key thinking point annotation involves experts annotating key thinking turning points and decisive evidence in the reasoning chain and comparing them with the results of automatic identification. S3132: Add the feedback preference ranking to the training set and incrementally fine-tune the reward model. Specifically, mix the newly added data with the original data in the training set proportionally (e.g., new data accounts for 30%, historical data accounts for 70%), and update the reward model using the loss function of the Bradley-Terry preference model.
[0073] in, This represents the highest-ranking inference chain in the preference ranking. This represents the lowest-ranking inference chain in the preference ranking. Represents a reward model. Represents medical record data. Reward Model Bradley-Terry maximum likelihood loss on preference ranking data This indicates that expert preferences apply to the sample. Take the expected value. This represents the sigmoid activation function. This indicates that the reward model favors the better inference chain in the preference pair. The given scalar reward score, This indicates that the reward model favors the inferior inference chain in the preference pair. The given scalar reward score; S3133: After the reward model is updated, the updated reward signal is used to adjust the clinical thinking extraction basic model using PPO (i.e., iterative RLHF). The adjustment strategy includes elastic weight consolidation, low-rank adaptation fine-tuning, quality monitoring and rollback mechanism. Specifically, the elastic weight consolidation involves adding an EWC regularization term to the PPO damage function.
[0074] in, Indicates the regularization strength. Represents the diagonal elements of the Fisher information matrix. This represents the parameters after the previous round of optimization. This indicates a regularization term that reinforces the elastic weights. This indicates the policy network's th iteration in the current online optimization round. One parameter component awaiting update.
[0075] Low-rank adaptation fine-tuning involves updating only the low-rank adaptation matrix injected into the policy network in each round of online optimization, freezing the backbone network parameters, and keeping the number of trainable parameters within 0.5% of the total parameters, balancing adaptability and stability. The quality monitoring and rollback mechanism calculates inference chain quality metrics (a weighted composite score of accuracy, completeness, and interpretability) on the retained validation set after each round of online optimization. If the composite score decreases by more than 2% compared to the previous version, it automatically rolls back to the previous version's parameters and issues a warning.
[0076] Furthermore, a priority sampling method can be adopted, whereby medical record samples marked as "erroneous" in the expert's step-by-step error correction feedback are included in the priority sampling pool. In subsequent PPO training, samples in the priority sampling pool are sampled with twice the probability of ordinary samples, enabling the model to accelerate learning for known weaknesses. The priority sampling pool adopts a first-in, first-out strategy, retaining the 5000 most recent erroneous samples.
[0077] Further, see Figure 5 For example, this application can also introduce diagnostic evidence weight learning based on attention mechanism, introduce an interpretable attention layer, automatically learn the contribution weight of each examination result to the final diagnosis, and output a visualized key evidence → diagnostic conclusion mapping diagram.
[0078] The following example illustrates the clinical reasoning reverse extraction method based on medical record data proposed in this application.
[0079] The patient's chief complaint is: fever for 3 days, cough and sputum for 2 days. First, symptom feature vectors are extracted to identify the two main symptoms, fever and cough / sputum, and their temporal relationship. Then, candidate diagnostic hypotheses are generated, including upper respiratory tract infection, acute bronchitis, and pneumonia. Combining this with the chest CT scan results showing patchy high-density shadows in the right lower lung, the posterior probability of each diagnostic hypothesis is calculated. Finally, the reasoning path from fever + cough → suspected lower respiratory tract infection → CT confirmation of pneumonia is traced.
[0080] Secondly, embodiments of this application also provide a clinical thinking reverse extraction device based on medical record data.
[0081] In one embodiment, reference is made to Figure 7 , Figure 7 This is a schematic diagram of the functional modules of the clinical thinking reverse extraction device based on medical record data in this application. Figure 7 As shown, the clinical thinking reverse extraction device based on medical record data includes: a parsing module, a reconstruction module, and an extraction module.
[0082] The parsing module is used to acquire medical record data and perform structured parsing, which includes chief complaint extraction, present illness history analysis, and physical examination result analysis. The reconstruction module is used to generate hypotheses, associate evidence, and trace reasoning paths based on the parsing results to reconstruct the reasoning chain. The extraction module is used to process the reconstructed reasoning chain into knowledge, extract clinical thinking through reasoning pattern clustering, construct a triplet knowledge graph containing symptoms, reasoning, and diagnosis, and output interpretable results.
[0083] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0084] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0085] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0086] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0087] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0088] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for reverse extraction of clinical reasoning based on medical record data, characterized in that, The clinical reasoning reverse extraction method based on medical record data includes: Acquire medical record data and perform structured parsing, including chief complaint extraction, present illness history analysis, and physical examination result analysis; Hypothesis generation, evidence association, and reasoning path tracing are performed based on the analysis results to reconstruct the reasoning chain; The reconstructed reasoning chain is processed into knowledge, and clinical thinking is extracted through reasoning pattern clustering. A triplet knowledge graph containing symptoms, reasoning, and diagnosis is constructed and output in an interpretable manner. Specifically, the process of generating hypotheses, associating evidence, and tracing inference paths based on the analysis results to extract the inference chain includes: A hierarchical symptom encoder is used to encode the chief complaint and present medical history to obtain a symptom vector containing temporal features, and a diagnostic hypothesis is generated based on the symptom vector. The test results are used as evidence to correlate with diagnostic hypotheses, and an evidence-diagnostic hypothesis correlation matrix is constructed to represent the degree of support of each test result for each diagnostic hypothesis. Using the Bayesian backward reasoning method, starting from the final diagnosis result and combining the evidence-diagnosis hypothesis correlation matrix, the complete reasoning path from symptoms to diagnosis is derived in reverse, thus realizing the extraction of the reasoning chain; Specifically, the process of correlating the examination results as evidence with the diagnostic hypothesis to construct an evidence-diagnostic hypothesis correlation matrix includes: The examination results are extracted from the medical record data as evidence. This evidence is then correlated with the diagnostic hypothesis to construct an evidence-diagnosis hypothesis correlation matrix. The elements of this matrix are defined as follows: in, Indicates the first The evidence against the first The degree of support for each diagnostic hypothesis Indicates the first A vector representing each piece of evidence. Indicates the first A vector representing a diagnostic hypothesis. Indicates the bias term. This represents the tanh activation function. Represents the learnable association weight matrix; The method employs Bayesian backward reasoning, starting with the final diagnosis and combining it with the evidence-diagnosis hypothesis correlation matrix to deduce the complete reasoning path from symptoms to diagnosis, thereby reconstructing the reasoning chain. Specifically, this includes: Based on the final diagnosis results Starting with Bayes' theorem, the posterior probability of each diagnostic hypothesis is calculated. Among them, the first is set The prior probabilities of the diagnostic hypotheses are Given all the evidence and assuming that the evidence is independent, the posterior probability is... for: in, Indicates the total number of pieces of evidence. This represents the total number of diagnostic hypotheses. Indicates the first The prior probability of a diagnostic hypothesis. Indicates the first The evidence in the Conditional probability under a diagnostic hypothesis. For likelihood terms, , Indicates the first The evidence against the first The degree of support for each diagnostic hypothesis Indicates temperature parameter; Evidence is introduced sequentially in chronological order, and the information gain of each piece of evidence on the posterior probability distribution is calculated. Specifically: in, Indicates before introduction The posterior probability distribution of each diagnostic hypothesis following the evidence. Indicates before introduction The posterior probability distribution of each diagnostic hypothesis following the evidence. Represents the KL divergence operator; A structured reasoning path is generated and transformed into a natural language reasoning chain to achieve reasoning chain extraction. The structured reasoning path includes a sequence of reasoning chain nodes, a hypothesis evolution trajectory, and annotations of key turning points. The inference chain node sequence is arranged in chronological order. This is used to record the evidence, posterior probability distribution, and information gain at each step; The hypothesis evolution trajectory is the curve of how the posterior probability of each diagnostic hypothesis changes with the introduction of evidence; The key inflection point is marked as evidence that the information gain exceeds a set threshold.
2. The method for reverse extraction of clinical reasoning based on medical record data as described in claim 1, characterized in that, The acquisition of medical record data and its structured parsing specifically includes: Obtain medical record data; Chief complaints are extracted from medical record data and converted into symptom feature vectors; Perform present illness history analysis on medical record data and generate a time-series symptom evolution graph; Medical records data are examined and test results are analyzed to obtain objective evidence.
3. The method for reverse extraction of clinical reasoning based on medical record data as described in claim 1, characterized in that, The hierarchical symptom encoder is used to encode the chief complaint and present medical history to obtain a symptom vector containing temporal features, specifically including: The chief complaint and present medical history were segmented into medical terms, and a pre-trained BERT model was used for sequence labeling. Based on each word segmentation unit, a hierarchical symptom encoder is used for encoding, and combined with learnable temporal position encoding, to obtain a symptom vector containing temporal features. The hierarchical symptom encoder has a three-level structure, consisting of a word layer, a symptom phrase layer, and a symptom sequence layer from bottom to top. The lexical layer is used to map each lexical unit after word segmentation into an initial word vector through a pre-trained medical word embedding layer. ; The symptom phrase layer is used to aggregate multiple initial word vectors corresponding to each symptom entity phrase in the chief complaint and present medical history using an attention pooling mechanism. For symptom phrase vectors, specifically: in, , Indicates learnable parameters, Represents symptom phrase vectors. Indicates the first The attention weights of each lexical unit within the symptom entity phrase after softmax normalization. The first entity phrase containing the symptom is... The initial word vector of each word element. The first entity phrase containing the symptom is... The initial word vectors of each word element; The symptom sequence layer is used to arrange all symptom phrase vectors in the same medical record data into a sequence in chronological order, and then input it into a bidirectional LSTM network for temporal encoding. Specifically: in, Indicates the first The hidden state vector output by the feedforward LSTM. Indicates a forward LSTM unit. Indicates the first The symptom phrase vector input at step 1. Indicates the forward LSTM at the th The hidden state vector of the step, Indicates the first The hidden state vector output by the backward LSTM. Indicates the inverse LSTM cell. Indicates the inverse LSTM at the 1st The hidden state vector of the step, Indicates the first The hidden state vector output by the bidirectional LSTM. Represents the vector concatenation operator; The symptom vector Represented as: in, Represents the temporal position vector. Indicates frequency parameters, Indicates time offset.
4. The method for reverse extraction of clinical reasoning based on medical record data as described in claim 1, characterized in that: After extracting clinical reasoning through clustering of reasoning patterns, the quality of clinical reasoning extraction is optimized through reinforcement learning. The optimization of clinical reasoning retrieval quality through reinforcement learning specifically includes: Multiple historical medical records were used as a training set to train the constructed basic model of clinical reasoning extraction, so that the trained basic model of clinical reasoning extraction has the ability to understand medical records and extract reasoning chains. Collect active preference ranking data for extracted clinical reasoning, including accuracy scores, reasoning chain integrity evaluation, and key reasoning point omission annotations, and train a reward model; Based on the proximal strategy optimization algorithm, and guided by the output of the reward model, the clinical reasoning extraction base model is optimized to improve the extraction strategy of clinical reasoning. An online learning mechanism is introduced to continuously iterate and optimize the clinical reasoning extraction base model.
5. The method for reverse extraction of clinical thinking based on medical record data as described in claim 4, characterized in that: The basic model for extracting clinical reasoning includes a medical record encoder, a reasoning chain decoder, an evidence-hypothesis interaction module, and a reasoning pattern classification head. The medical record encoder is used to convert medical record data text into a high-dimensional semantic representation. It adopts a Transformer-based pre-trained language model architecture, and the output of the medical record encoder is a sequence of context representation vectors for each word. The inference chain decoder is used to autoregressively generate a structured inference chain based on the output of the medical record encoder. The evidence-hypothesis interaction module is located between the medical record encoder and the inference chain decoder. It is responsible for explicitly modeling the relationship between evidence and diagnostic hypothesis. Specifically, the evidence-hypothesis interaction module receives the representation vectors of the corresponding evidence and diagnostic hypothesis from the output of the medical record encoder, calculates the evidence-diagnostic hypothesis association matrix through a bilinear attention mechanism, and injects the evidence-diagnostic hypothesis association matrix into the cross-attention layer of the inference chain decoder. The inference pattern classification head is a multi-label classifier located above the inference chain decoder, used to classify patterns in the generated inference chain.
6. The method for reverse extraction of clinical thinking based on medical record data as described in claim 5, characterized in that, The proximal strategy optimization algorithm, using the reward model output as a guiding signal, optimizes the clinical reasoning extraction strategy of the basic clinical reasoning extraction model, specifically including: The policy network, i.e. the inference chain decoder, outputs the action probability distribution at each step of the inference chain based on the current state. The value network and the policy network share the parameters of the inference chain decoder, and an independent linear layer is added on top of the last layer of the inference chain decoder to output a scalar value estimate. The advantage function is calculated using generalized advantage estimation. : in, Indicates the discount factor. This represents the GAE smoothing parameter. Indicates timing difference error. Indicates the current reasoning step To the end of the inference chain The number of remaining steps; The near-end policy optimization algorithm limits the policy update magnitude by using a pruning alternative objective function: in, Indicates the probability ratio. Indicates the cutting range. Indicates the strategy parameters The determined proximal policy optimizes the loss function. This indicates the time step along the inference chain. Take the expected value. Represents the shearing function; Calculate the total training loss : in, Represents the coefficient. This indicates that the near-end strategy optimizes the shear loss. This represents the mean squared error loss of the value network. This represents the KL divergence constraint term between the current policy and the pre-trained reference policy.
7. The method for reverse extraction of clinical thinking based on medical record data as described in claim 4, characterized in that, The introduction of an online learning mechanism to continuously iterate and optimize the basic model for extracting clinical reasoning specifically includes: Provide multi-dimensional feedback on the reasoning chain output during the use of the basic model for extracting clinical thinking, including preference ranking feedback, step-by-step error correction feedback, and annotation of key thinking points; The feedback preference ranking is added to the training set, and the reward model is incrementally fine-tuned. Specifically, the newly added data is mixed proportionally with the original data in the training set, and the reward model is updated using the loss function of the Bradley-Terry preference model. in, This represents the highest-ranking inference chain in the preference ranking. This represents the lowest-ranking inference chain in the preference ranking. Represents a reward model. Represents medical record data. Reward Model Bradley-Terry maximum likelihood loss on preference ranking data This indicates that expert preferences apply to the sample. Take the expected value. This represents the sigmoid activation function. This indicates that the reward model selects the better inference chain in the preference pair. The given scalar reward score, This indicates that the reward model favors the inferior inference chain in the preference pair. The given scalar reward score; After the reward model is updated, the PPO of the basic model for extracting clinical thinking is adjusted using the updated reward signal. The adjustment strategies include elastic weight consolidation, low-rank adaptation fine-tuning, quality monitoring and rollback mechanism. Specifically, the elastic weight consolidation involves adding an EWC regularization term to the PPO damage function. in, Indicates the regularization strength. Represents the diagonal elements of the Fisher information matrix. This represents the parameters after the previous round of optimization. This indicates a regularization term that reinforces the elastic weights. This indicates the policy network's th iteration in the current online optimization round. One parameter component awaiting update.
8. A clinical reasoning reverse extraction device based on medical record data, characterized in that, The clinical reasoning reverse extraction device based on medical record data includes: The parsing module is used to acquire medical record data and perform structured parsing, which includes chief complaint extraction, present illness history analysis, and physical examination result analysis. The reconstruction module is used to generate hypotheses, associate evidence, and trace inference paths based on the analysis results, so as to reconstruct the inference chain. The extraction module is used to process the reconstructed reasoning chain into knowledge, extract clinical thinking through reasoning pattern clustering, construct a triplet knowledge graph containing symptoms, reasoning, and diagnosis, and output interpretable results. Specifically, the process of generating hypotheses, associating evidence, and tracing inference paths based on the analysis results to extract the inference chain includes: A hierarchical symptom encoder is used to encode the chief complaint and present medical history to obtain a symptom vector containing temporal features, and a diagnostic hypothesis is generated based on the symptom vector. The test results are used as evidence to correlate with diagnostic hypotheses, and an evidence-diagnostic hypothesis correlation matrix is constructed to represent the degree of support of each test result for each diagnostic hypothesis. Using the Bayesian backward reasoning method, starting from the final diagnosis result and combining the evidence-diagnosis hypothesis correlation matrix, the complete reasoning path from symptoms to diagnosis is derived in reverse, thus realizing the extraction of the reasoning chain; Specifically, the process of correlating the examination results as evidence with the diagnostic hypothesis to construct an evidence-diagnostic hypothesis correlation matrix includes: The examination results are extracted from the medical record data as evidence. This evidence is then correlated with the diagnostic hypothesis to construct an evidence-diagnosis hypothesis correlation matrix. The elements of this matrix are defined as follows: in, Indicates the first The evidence against the first The degree of support for each diagnostic hypothesis Indicates the first A vector representing each piece of evidence. Indicates the first A vector representing a diagnostic hypothesis. Indicates the bias term. This represents the tanh activation function. Represents the learnable association weight matrix; The method employs Bayesian backward reasoning, starting with the final diagnosis and combining it with the evidence-diagnosis hypothesis correlation matrix to deduce the complete reasoning path from symptoms to diagnosis, thereby reconstructing the reasoning chain. Specifically, this includes: Based on the final diagnosis results Starting with Bayes' theorem, the posterior probability of each diagnostic hypothesis is calculated. Among them, the first is set The prior probabilities of the diagnostic hypotheses are Given all the evidence and assuming that the evidence is independent, the posterior probability is... for: in, Indicates the total number of pieces of evidence. This represents the total number of diagnostic hypotheses. Indicates the first The prior probability of a diagnostic hypothesis. Indicates the first The evidence in the Conditional probability under a diagnostic hypothesis. For likelihood terms, , Indicates the first The evidence against the first The degree of support for each diagnostic hypothesis Indicates temperature parameter; Evidence is introduced sequentially in chronological order, and the information gain of each piece of evidence on the posterior probability distribution is calculated. Specifically: in, Indicates before introduction The posterior probability distribution of each diagnostic hypothesis following the evidence. Indicates before introduction The posterior probability distribution of each diagnostic hypothesis following the evidence. Represents the KL divergence operator; A structured reasoning path is generated and transformed into a natural language reasoning chain to achieve reasoning chain extraction. The structured reasoning path includes a sequence of reasoning chain nodes, a hypothesis evolution trajectory, and annotations of key turning points. The inference chain node sequence is arranged in chronological order. This is used to record the evidence, posterior probability distribution, and information gain at each step; The hypothesis evolution trajectory is the curve of how the posterior probability of each diagnostic hypothesis changes with the introduction of evidence; The key inflection point is marked as evidence that the information gain exceeds a set threshold.
Citation Information
Patent Citations
Medical Named Entity Recognition Based on Context Relevance
CN109522546A
Bidirectional reasoning diagnosis method based on large model
CN120526966A
Dynamic knowledge graph construction and diagnosis reasoning method for intelligent inquiry
CN121706915A