A dynamic causal reinforcement intelligent medical hallucination detection and correction method and system

By constructing a dynamic medical causal graph and using adversarial training, combined with deep learning technology to evaluate causal chains and evidence consistency, the problem of medical hallucination detection and correction relying on human factors has been solved, achieving highly accurate and continuously evolving automated detection and correction.

CN121768645BActive Publication Date: 2026-05-15SUZHOU HEALTH & FAMILY PLANNING STATISTICS INFORMATION CENT +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU HEALTH & FAMILY PLANNING STATISTICS INFORMATION CENT
Filing Date
2026-03-04
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Current medical hallucination detection and correction technologies rely on human factors, making it difficult to guarantee the accuracy of detection results and to ensure the continuous evolution of correction capabilities and knowledge.

Method used

By constructing a dynamic medical causal graph, combining a medical hallucination discrimination model and a correction model for adversarial training, deep learning technology is used to evaluate the causal chain and evidence consistency of diagnostic results, determine the detection consistency coefficient, and optimize model performance through combined loss functions to achieve automated detection and correction.

Benefits of technology

It improves the accuracy and consistency of medical hallucination detection and correction, reduces the probability of hallucinations in the output text of the correction model, and ensures the model's continuous evolution capability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121768645B_ABST
    Figure CN121768645B_ABST
Patent Text Reader

Abstract

The application provides a dynamic causal reinforcement intelligent medical hallucination detection and correction method and system, and relates to the technical field of medical hallucination detection.The method comprises the following steps: acquiring relevant data sources, and constructing a dynamic medical causal graph according to the relevant data sources; determining a to-be-detected diagnosis result, a to-be-detected diagnosis result evidence source and a to-be-detected diagnosis result confidence; acquiring actual detection data; obtaining a first medical hallucination discrimination result; determining whether the to-be-detected text needs to be corrected; in the case that the to-be-detected text needs to be corrected, processing the to-be-detected text according to a medical hallucination correction model to obtain a first training generated text; obtaining a combination loss function; obtaining a trained medical hallucination discrimination model and a trained medical hallucination correction model; and obtaining a final medical hallucination discrimination result and a final generated text.According to the application, the efficiency and accuracy of medical hallucination detection and correction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical hallucination detection technology, and in particular to a dynamic causal reinforcement intelligent medical hallucination detection and correction method and system. Background Technology

[0002] In related technologies, medical hallucinations can be detected and corrected manually by professional technicians. However, this method relies heavily on human factors, resulting in a massive workload. Therefore, excessive reliance on human intervention may compromise the accuracy of the detection and correction results and hinder the continuous evolution of correction capabilities and knowledge. The information disclosed in the background section of this application is intended only to enhance understanding of the general background technology of this application and should not be construed as an admission or implication in any way that such information constitutes prior art known to those skilled in the art. Summary of the Invention

[0003] This invention provides a dynamic causal reinforcement intelligent medical hallucination detection and correction method and system, which can solve the technical problems that related technologies cannot guarantee the accuracy of detection and correction results, and cannot ensure the continuous evolution of correction capabilities and knowledge.

[0004] According to a first aspect of the present invention, a method for detecting and correcting dynamic causal reinforcement intelligent medical hallucinations is provided, comprising:

[0005] Obtain relevant data sources and construct a dynamic medical causal graph based on the relevant data sources;

[0006] Obtain the text to be detected, and based on the text to be detected, determine the diagnostic result to be detected, the source of evidence for the diagnostic result to be detected, and the confidence level of the diagnostic result to be detected;

[0007] Obtain actual test data;

[0008] The medical hallucination discrimination model is used to process the diagnostic result to be detected, the evidence source of the diagnostic result to be detected, the confidence level of the diagnostic result to be detected, the actual detection data, and the dynamic medical causality graph to obtain the first medical hallucination discrimination result.

[0009] Based on the first medical hallucination detection result, determine whether the text to be detected needs to be corrected;

[0010] If the text to be detected needs to be corrected, the text to be detected is processed according to the medical hallucination correction model to obtain the first training generated text;

[0011] Based on the first training text, obtain the combined loss function of the medical hallucination discrimination model and the medical hallucination correction model;

[0012] The medical hallucination discrimination model and the medical hallucination correction model are trained according to the combined loss function to obtain the trained medical hallucination discrimination model and the trained medical hallucination correction model.

[0013] The text to be detected is processed based on the trained medical hallucination discrimination model and the trained medical hallucination correction model to obtain the final medical hallucination discrimination result and the final generated text.

[0014] According to the present invention, a first medical hallucination discrimination result is obtained by processing the diagnostic result to be detected, the evidence source of the diagnostic result to be detected, the confidence level of the diagnostic result to be detected, the actual detection data, and the dynamic medical causal graph through a medical hallucination discrimination model, including:

[0015] Based on the diagnostic results to be detected and the dynamic medical causal graph, determine the causal chain related to the diagnostic results;

[0016] Based on the causal chain related to the diagnostic results, relevant causal detection data are determined;

[0017] Based on the relevant causal detection data and the actual detection data, a detection consistency coefficient is determined;

[0018] Determine the consistency coefficient of evidence based on the sources of evidence for the diagnostic results to be detected;

[0019] The evidence consistency coefficient, the confidence level of the diagnostic result to be detected, and the detection consistency coefficient are processed by the medical hallucination discrimination model to obtain the first medical hallucination discrimination result.

[0020] According to the present invention, determining the detection consistency coefficient based on the relevant causal detection data and the actual detection data includes:

[0021] Based on the relevant causal detection data, determine the degree of increase of the causal indicator for the rising indicator, the degree of decrease of the causal indicator for the falling indicator, and the causal detection image;

[0022] Based on the actual detection data, determine the actual degree of increase of the rising index, the actual degree of decrease of the falling index, and the actual detection image;

[0023] The causal detection image and the actual detection image are processed by an image detection model to determine the image consistency coefficient;

[0024] The detection consistency coefficient is determined based on the degree of increase of the causal index, the degree of decrease of the causal index, the degree of increase of the actual index, the degree of decrease of the actual index, and the image consistency coefficient.

[0025] According to the present invention, determining the detection consistency coefficient based on the degree of increase of the causal index, the degree of decrease of the causal index, the degree of increase of the actual index, the degree of decrease of the actual index, and the image consistency coefficient includes: according to the formula:

[0026]

[0027] Determine the consistency coefficient of detection Where min is the function for finding the minimum value, and max is the function for finding the maximum value. Let be the image consistency coefficient between the i-th causal detection image and the corresponding actual detection image. The actual degree of increase of the k-th rising indicator. The degree of increase of the causal indicator for the k-th increasing indicator. The actual degree of reduction of the j-th reduction indicator. Let represent the degree of causal index reduction for the j-th decreasing index, n be the number of causal detection images (i≤n), K be the number of increasing indicators (k≤K), and m be the number of decreasing indicators (j≤m). i, n, k, K, j, and m are all positive integers.

[0028] According to the present invention, determining the consistency coefficient of evidence based on the source of evidence for the diagnostic result to be detected includes:

[0029] Based on the evidence sources of the diagnostic results to be detected, obtain different evidence sources for the same fact;

[0030] Based on different sources of evidence for the same fact, determine the result of factual conflict detection;

[0031] Based on the evidence sources of the diagnostic results to be tested, obtain different evidence sources for medication recommendations;

[0032] Based on the different sources of evidence for the medication recommendations, determine the results of the logical tendency conflict detection;

[0033] Based on the results of the factual conflict detection and the results of the logical tendency conflict detection, the evidence consistency coefficient is determined.

[0034] According to the present invention, based on the first training-generated text, a combined loss function of the medical hallucination discrimination model and the medical hallucination correction model is obtained, including:

[0035] Obtain the first sample text where medical hallucinations do not exist;

[0036] Input the first sample text or the first training generated text into the medical hallucination discrimination model to obtain the training medical hallucination discrimination result;

[0037] Based on the training results of medical hallucination discrimination, a combined loss function of the medical hallucination discrimination model and the medical hallucination correction model is obtained.

[0038] According to the present invention, based on the training results of the medical hallucination discrimination, a combined loss function of the medical hallucination discrimination model and the medical hallucination correction model is obtained, including: according to the formula:

[0039]

[0040] Obtain the combined loss function of the medical hallucination discrimination model and the medical hallucination correction model. ,in, For the t-th first sample text, The training result for the medical hallucination discrimination of the first sample text output by the medical hallucination discrimination model. Generate text for the r-th first training element. The medical hallucination discrimination result is the r-th first training generated text output by the medical hallucination discrimination model. t is the number of first sample texts, t≤T, r is the number of first training generated texts, r≤R, and t, T, r and R are all positive integers.

[0041] According to a second aspect of the present invention, a dynamic causal reinforcement intelligent medical hallucination detection and correction system is provided, comprising:

[0042] A dynamic construction module is used to acquire relevant data sources and construct a dynamic medical causal graph based on the relevant data sources;

[0043] The text data module is used to acquire the text to be detected, and based on the text to be detected, to determine the diagnostic result to be detected, the source of evidence for the diagnostic result to be detected, and the confidence level of the diagnostic result to be detected;

[0044] The actual data module is used to acquire actual test data;

[0045] The first discrimination module is used to process the diagnostic result to be detected, the evidence source of the diagnostic result to be detected, the confidence level of the diagnostic result to be detected, the actual detection data and the dynamic medical causal graph through a medical hallucination discrimination model to obtain the first medical hallucination discrimination result;

[0046] The first correction module is used to determine whether the text to be detected needs to be corrected based on the first medical hallucination discrimination result.

[0047] The first text module is used to process the text to be detected according to the medical hallucination correction model when the text to be detected needs to be corrected, so as to obtain the first training generated text.

[0048] The loss function module is used to obtain a combined loss function of the medical hallucination discrimination model and the medical hallucination correction model based on the text generated by the first training.

[0049] The model training module is used to train the medical hallucination discrimination model and the medical hallucination correction model according to the combined loss function, so as to obtain the trained medical hallucination discrimination model and the trained medical hallucination correction model.

[0050] The final discrimination module is used to process the text to be detected based on the trained medical hallucination discrimination model and the trained medical hallucination correction model to obtain the final medical hallucination discrimination result and the final generated text.

[0051] Technical Effects: According to the present invention, a dynamic medical causal graph can be constructed, and adversarial training can be performed on the medical hallucination discrimination model and the medical hallucination correction model. This improves the ability of the medical hallucination discrimination model to discriminate medical hallucinations and reduces the probability of medical hallucinations in the text output by the medical hallucination correction model. Furthermore, medical hallucination detection and correction can be performed on the text to be detected based on the trained medical hallucination discrimination model and the trained medical hallucination correction model, improving the accuracy of medical hallucination detection and correction. When determining the detection consistency coefficient, the detection consistency coefficient can be determined based on the degree of increase of causal indicators, the degree of decrease of causal indicators, the degree of increase of actual indicators, the degree of decrease of actual indicators, and the image consistency coefficient. During the calculation process, the consistency between key causal expectations and facts can be evaluated based on three aspects: the difference between expected medical images and facts, the difference between expected increased indicators and facts, and the difference between expected decreased indicators and facts, thereby determining the detection consistency coefficient and improving the comprehensiveness and accuracy of the detection consistency coefficient. When determining the combined loss function, adversarial training can be used to determine the combined loss function, so as to achieve the goal of improving the discrimination ability of the medical hallucination discrimination model while reducing the probability of the first training generated text output by the medical hallucination correction model containing medical hallucinations, thereby balancing the performance of the two models.

[0052] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Other features and aspects of the invention will become clearer from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0054] Figure 1 An exemplary flowchart of a dynamic causal reinforcement intelligent medical hallucination detection and correction method according to an embodiment of the present invention is shown.

[0055] Figure 2 An exemplary schematic diagram illustrating the process of obtaining a first medical hallucination discrimination result according to an embodiment of the present invention is shown;

[0056] Figure 3 An exemplary diagram illustrates the combined loss function of the medical hallucination discrimination model and the medical hallucination correction model according to an embodiment of the present invention;

[0057] Figure 4 A block diagram of a dynamic causal reinforcement intelligent medical hallucination detection and correction system according to an embodiment of the present invention is shown as an example. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0059] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0060] Figure 1 An exemplary flowchart illustrates a dynamic causal reinforcement intelligent medical hallucination detection and correction method according to an embodiment of the present invention, the method comprising:

[0061] Step S1: Obtain relevant data sources and construct a dynamic medical causal graph based on the relevant data sources;

[0062] Step S2: Obtain the text to be detected, and determine the diagnostic result to be detected, the source of evidence for the diagnostic result to be detected, and the confidence level of the diagnostic result to be detected based on the text to be detected;

[0063] Step S3: Obtain actual detection data;

[0064] Step S4: The medical hallucination discrimination model is used to process the diagnostic result to be detected, the evidence source of the diagnostic result to be detected, the confidence level of the diagnostic result to be detected, the actual detection data and the dynamic medical causal graph to obtain the first medical hallucination discrimination result.

[0065] Step S5: Based on the first medical hallucination detection result, determine whether the text to be detected needs to be corrected;

[0066] Step S6: If the text to be detected needs to be corrected, the text to be detected is processed according to the medical hallucination correction model to obtain the first training generated text.

[0067] Step S7: Based on the first training generated text, obtain the combined loss function of the medical hallucination discrimination model and the medical hallucination correction model;

[0068] Step S8: Train the medical hallucination discrimination model and the medical hallucination correction model according to the combined loss function to obtain the trained medical hallucination discrimination model and the trained medical hallucination correction model.

[0069] Step S9: Process the text to be detected according to the trained medical hallucination discrimination model and the trained medical hallucination correction model to obtain the final medical hallucination discrimination result and the final generated text.

[0070] The dynamic causal reinforcement intelligent medical hallucination detection and correction method according to embodiments of the present invention can construct a dynamic medical causal graph and can perform adversarial training on a medical hallucination discrimination model and a medical hallucination correction model to improve the ability of the medical hallucination discrimination model to discriminate medical hallucinations and reduce the probability of medical hallucinations in the text output by the medical hallucination correction model. Furthermore, medical hallucination detection and correction can be performed on the text to be detected based on the trained medical hallucination discrimination model and the trained medical hallucination correction model, thereby improving the accuracy of medical hallucination detection and correction.

[0071] According to one embodiment of the present invention, in step S1, relevant data sources are obtained, and a dynamic medical causal graph is constructed based on the relevant data sources.

[0072] For example, it integrates structured knowledge (such as UMLS, MeSH), medical textbooks, clinical guidelines, and causal relationships extracted from massive amounts of literature, and achieves fine-grained alignment of medical images and text through multimodal dynamic coding. It combines graph counterfactual analysis of causal-enhanced temporal reasoning to locate logical breaks, and introduces a continuous evolution mechanism to achieve dynamic updates of the knowledge base. It uses knowledge graph technology to construct a dynamic medical causal graph based on the processed data source.

[0073] According to an embodiment of the present invention, in step S2, the text to be detected is obtained, and the diagnostic result to be detected, the source of evidence for the diagnostic result to be detected, and the confidence level of the diagnostic result to be detected are determined based on the text to be detected.

[0074] For example, the system acquires a text to be tested for the presence of medical hallucinations, and determines the diagnostic result (e.g., myocardial infarction) within the text. Using techniques such as Bayesian deep learning or Monte Carlo Dropout, the AI ​​generates the confidence score of the text while generating it, i.e., the confidence score of the diagnostic result. The AI ​​also provides evidence for generating the text (e.g., cited documents and data points), i.e., the evidence source for the diagnostic result.

[0075] According to one embodiment of the present invention, in step S3, actual detection data is acquired.

[0076] For example, the patient's actual test data (such as electrocardiogram, white blood cell count, etc.) can be obtained through the patient's electronic health record (EHR).

[0077] According to an embodiment of the present invention, in step S4, the diagnostic result to be detected, the evidence source of the diagnostic result to be detected, the confidence level of the diagnostic result to be detected, the actual detection data and the dynamic medical causal graph are processed by a medical hallucination discrimination model to obtain a first medical hallucination discrimination result.

[0078] Figure 2 An exemplary schematic diagram of obtaining a first medical hallucination discrimination result according to an embodiment of the present invention is shown.

[0079] According to an embodiment of the present invention, step S4 includes:

[0080] Step S41: Determine the causal chain related to the diagnostic result based on the diagnostic result to be detected and the dynamic medical causal graph;

[0081] Step S42: Determine relevant causal detection data based on the causal chain related to the diagnostic results;

[0082] Step S43: Determine the detection consistency coefficient based on the relevant causal detection data and the actual detection data;

[0083] Step S44: Determine the evidence consistency coefficient based on the evidence source of the diagnostic result to be detected;

[0084] Step S45: Process the evidence consistency coefficient, the confidence level of the diagnostic result to be detected, and the detection consistency coefficient using a medical hallucination discrimination model to obtain the first medical hallucination discrimination result.

[0085] For example, from a dynamic medical causal graph, all causal chains related to the diagnostic result to be tested are extracted. For instance, if the diagnostic result is "Disease D," then causal chains such as "If one has D, symptoms S1 and S2 should be present; laboratory indicator T should be elevated / decreased; similar diseases E should be excluded" are extracted. These are the causal chains related to the diagnostic result. Based on these causal chains, relevant causal detection data are determined. For example, when the diagnostic result is "Disease D," relevant causal detection data includes: the degree of elevation of laboratory indicator T, medical images of the corresponding site of Disease D, etc. Based on the relevant causal detection data and actual detection data, the consistency between key causal expectations and facts is assessed. Determine the consistency coefficient of the test; based on the evidence source of the diagnostic result to be tested, assess whether there is a conflict between the evidence and whether the causal logic between the evidence and the conclusion holds, and determine the consistency coefficient of the evidence; the medical hallucination discrimination model is a deep learning neural network model such as a convolutional neural network model, which can determine whether medical hallucination exists. The consistency coefficient of the evidence, the confidence of the diagnostic result to be tested, and the consistency coefficient of the test are processed by the medical hallucination discrimination model to obtain the first medical hallucination discrimination result. The first medical hallucination discrimination result is less than or equal to 1 and greater than or equal to 0. The larger the first medical hallucination discrimination result, the lower the probability that the diagnostic result to be tested belongs to medical hallucination.

[0086] According to an embodiment of the present invention, step S43 includes:

[0087] Step S431: Based on the relevant causal detection data, determine the degree of increase of the causal index of the rising index, the degree of decrease of the causal index of the falling index, and the causal detection image.

[0088] Step S432: Based on the actual detection data, determine the actual degree of increase of the rising index, the actual degree of decrease of the falling index, and the actual detection image;

[0089] Step S433: Process the causal detection image and the actual detection image using an image detection model to determine the image consistency coefficient;

[0090] Step S434: Determine the detection consistency coefficient based on the degree of increase of the causal index, the degree of decrease of the causal index, the degree of increase of the actual index, the degree of decrease of the actual index, and the image consistency coefficient.

[0091] For example, based on relevant causal detection data, the degree of increase of the causal indicator for the elevated indicator (e.g., theoretically, having disease D causes a 20% increase in test indicator T), the degree of decrease of the causal indicator for the decreased indicator (e.g., theoretically, having disease D causes a 20% decrease in test indicator E), and the causal detection image (theoretical medical images of the area related to disease D) are determined. Based on the patient's actual detection data, the actual degree of increase of the elevated indicator, the actual degree of decrease of the decreased indicator, and the actual detection image are determined. The image detection model is a type of deep learning model. It is trained on historical data to enable it to identify the similarity between two images at key lesion sites, i.e., consistency. The causal detection image and the actual detection image are processed by the image detection model to determine the image consistency coefficient. The higher the image consistency, the higher the similarity between the causal detection image and the actual detection image at the key lesion site. Based on the degree of increase of the causal indicator, the degree of decrease of the causal indicator, the degree of increase of the actual indicator, the degree of decrease of the actual indicator, and the image consistency coefficient, the consistency between the key causal expectation and the fact is evaluated, and the detection consistency coefficient is determined.

[0092] According to an embodiment of the present invention, step S434 includes: determining the detection consistency coefficient according to formula (1). ,

[0093] (1)

[0094] Where min is the function for finding the minimum value, and max is the function for finding the maximum value. Let be the image consistency coefficient between the i-th causal detection image and the corresponding actual detection image. The actual degree of increase of the k-th rising indicator. The degree of increase of the causal indicator for the k-th increasing indicator. The actual degree of reduction of the j-th reduction indicator. Let represent the degree of causal index reduction for the j-th decreasing index, n be the number of causal detection images (i≤n), K be the number of increasing indicators (k≤K), and m be the number of decreasing indicators (j≤m). i, n, k, K, j, and m are all positive integers.

[0095] According to one embodiment of the present invention, Let be the image consistency coefficient between the i-th causal detection image and the corresponding actual detection image. This represents the minimum image consistency coefficient between n causal detection images and their corresponding actual detection images. The above minimum value selection process is equivalent to identifying the situation where the key expected medical image (causal detection image) differs most from the actual image (actual detection image). The smaller the value, the greater the discrepancy between the critical expected medical image and the actual situation, the lower the consistency coefficient of the test, and the greater the possibility of medical illusion. This represents the relative difference between the actual increase in the k-th rising indicator and the increase in the causal indicator. The larger this ratio, the greater the relative difference between the actual and causal increases. To find the maximum relative difference between the actual and causal increases of the K rising indicators, the above process of finding the maximum value is equivalent to determining the situation where the difference between the expected increase of the key rising indicator (causal increase) and the actual increase is the largest. The greater the difference between the expected increase of the key rising indicator and the actual increase, the lower the consistency coefficient and the greater the possibility of medical illusion. This represents the relative difference between the actual degree of reduction of the j-th reduction indicator and the degree of reduction of the causal indicator. The larger this ratio is, the greater the relative difference between the actual degree of reduction of the j-th reduction indicator and the degree of reduction of the causal indicator. To find the maximum value of the relative difference between the actual reduction degree of the m reduction indicators and the causal reduction degree, the above maximum value method can be equivalent to determining the situation where the difference between the reduction degree of the key expected reduction indicator (the causal reduction degree) and the fact (the actual reduction degree) is the largest. The greater the difference between the reduction degree of the key expected reduction indicator and the fact, the lower the detection consistency coefficient and the greater the possibility of medical illusion.

[0096] According to one embodiment of the present invention, The consistency coefficient of detection is determined by assessing the degree of consistency between key causal expectations and facts based on three aspects: the difference between expected medical images and actual results, the difference between expected elevated indicators and actual results, and the difference between expected decreased indicators and actual results.

[0097] In this way, the detection consistency coefficient can be determined based on the degree of increase of causal indicators, the degree of decrease of causal indicators, the degree of increase of actual indicators, the degree of decrease of actual indicators, and the image consistency coefficient. During the calculation process, the degree of consistency between key causal expectations and facts can be evaluated based on three aspects: the difference between expected medical images and facts, the difference between expected increased indicators and facts, and the difference between expected decreased indicators and facts. This improves the comprehensiveness and accuracy of the detection consistency coefficient.

[0098] According to an embodiment of the present invention, step S44 includes:

[0099] Step S441: Based on the evidence sources of the diagnostic results to be detected, obtain different evidence sources for the same fact;

[0100] Step S442: Determine the factual conflict detection result based on different sources of evidence for the same fact;

[0101] Step S443: Based on the evidence sources of the diagnostic results to be detected, obtain different evidence sources for medication recommendations;

[0102] Step S444: Determine the logical tendency conflict detection results based on the different sources of evidence for the medication recommendation;

[0103] Step S445: Determine the evidence consistency coefficient based on the factual conflict detection results and the logical tendency conflict detection results.

[0104] For example, based on the evidence sources of the diagnostic result to be tested, different sources of evidence for the same fact can be obtained. For instance, when generating the diagnostic result, the AI ​​uses two data points: data point A (from the lab report): normal white blood cell count, and data point B (from the imaging report): the report suggests a high probability of severe bacterial infection. Data points A and B are different sources of evidence for this diagnostic result. Based on different sources of evidence for the same fact, a factual conflict detection result can be determined. For example, data A indicates a normal white blood cell count, while data B indicates a high probability of severe bacterial infection. However, severe bacterial infection usually leads to a significantly elevated white blood cell count. The "normal" white blood cell count contradicts the imaging suggestion of "severe bacterial infection," which is a contradiction in medical common sense. Therefore, the factual conflict detection result is 1; otherwise, it is 0. Based on the diagnostic result to be tested... The evidence sources are the different sources of evidence for obtaining medication recommendations. For example, if an AI-generated diagnostic result recommends the use of a certain antihypertensive drug, the evidence cited may include: Evidence A (from genetic testing): the patient metabolizes drug X slowly, posing a risk of accumulation; and Evidence B (from clinical guidelines): drug X is a first-line antihypertensive drug and is recommended. Evidence A and Evidence B are different sources of evidence for the medication recommendation. Based on the different sources of evidence for the medication recommendation, the logical tendency conflict detection result is determined. For example, if evidence A points to "avoid using drug X," while evidence B points to "drug X can be used," these two pieces of evidence have a logical tendency conflict in the "medication recommendation," and the logical tendency conflict detection result is 1. Conversely, if they do not conflict, the logical tendency conflict detection result is 0. The evidence consistency coefficient is determined by subtracting the factual conflict detection result and the logical tendency conflict detection result from 2.

[0105] According to an embodiment of the present invention, in step S5, it is determined whether the text to be detected needs to be corrected based on the first medical hallucination discrimination result.

[0106] For example, when the first medical hallucination discrimination result is less than 0.9, it is determined that the text to be detected needs to be corrected.

[0107] According to an embodiment of the present invention, in step S6, if the text to be detected needs to be corrected, the text to be detected is processed according to the medical hallucination correction model to obtain the first training generated text.

[0108] For example, the medical hallucination correction model is a deep learning neural network model such as a convolutional neural network model. It can correct text that is identified as having a medical environment based on a dynamic medical causal graph. It can generate a first training text. The first training text may still contain medical hallucinations. Therefore, the medical hallucination correction model can be trained to reduce the possibility of medical hallucinations in the text after it has been processed by the medical hallucination correction model.

[0109] According to an embodiment of the present invention, in step S7, a combined loss function of the medical hallucination discrimination model and the medical hallucination correction model is obtained based on the first training generated text.

[0110] For example, based on the text generated from the first training, a combined loss function of the medical hallucination discrimination model and the medical hallucination correction model is obtained. The medical hallucination discrimination model can be trained adversarially with the medical hallucination correction model. That is, the medical hallucination discrimination model can improve the discrimination accuracy during training, and the medical hallucination correction model can reduce the possibility of medical hallucinations in the processed text during training.

[0111] Figure 3 An exemplary diagram illustrates a combined loss function for obtaining a medical hallucination discrimination model and a medical hallucination correction model according to an embodiment of the present invention.

[0112] According to an embodiment of the present invention, step S7 includes:

[0113] Step S71: Obtain the first sample text indicating that medical hallucinations do not exist;

[0114] Step S72: Input the first sample text or the first training generated text into the medical hallucination discrimination model to obtain the training medical hallucination discrimination result;

[0115] Step S73: Based on the training results of medical hallucination discrimination, obtain the combined loss function of the medical hallucination discrimination model and the medical hallucination correction model.

[0116] For example, obtain the first sample text that has been determined by experts to be free of medical hallucinations; input the first sample text or the first training generated text into the medical hallucination discrimination model to obtain the training medical hallucination discrimination result; and obtain the combined loss function of the medical hallucination discrimination model and the medical hallucination correction model based on the training medical hallucination discrimination result.

[0117] According to an embodiment of the present invention, step S73 includes: obtaining the combined loss function of the medical hallucination discrimination model and the medical hallucination correction model according to formula (2). ,

[0118] (2)

[0119] in, For the t-th first sample text, The training result for the medical hallucination discrimination of the first sample text output by the medical hallucination discrimination model. Generate text for the r-th first training element. The medical hallucination discrimination result is the r-th first training generated text output by the medical hallucination discrimination model, where t is the number of first sample texts, t≤T, r is the number of first training generated texts, r≤R, and t, T, r and R are all positive integers.

[0120] According to one embodiment of the present invention, the first sample text is text without medical hallucinations, and the first training generated text is text output by the medical hallucination discrimination model. Theoretically, the training medical hallucination discrimination result of the first sample text discriminated by the medical hallucination discrimination model is 1, and the training medical hallucination discrimination result of the first training generated text discriminated by the medical hallucination discrimination model is less than 1. However, as the training process proceeds, the training medical hallucination discrimination result of the first training generated text discriminated by the medical hallucination discrimination model increases. Furthermore, as the medical hallucination discrimination model also improves its discrimination ability during the training process, its ability to detect medical hallucinations is strengthened, which can again lead to a decrease in the training medical hallucination discrimination result of the first training generated text discriminated by the medical hallucination discrimination model. Ultimately, the performance of the medical hallucination discrimination model and the medical hallucination correction model can be balanced. Thus, even when the discrimination accuracy of the medical hallucination discrimination model is very high, it is still difficult to detect the existence of medical hallucinations in the first training generated text, that is, the possibility of the existence of medical hallucinations in the first training generated text output by the medical hallucination discrimination model is reduced.

[0121] According to an embodiment of the present invention, in accordance with the training method described above that balances the performance of the medical hallucination discrimination model and the medical hallucination correction model, the medical hallucination discrimination model can be adjusted in the direction of maximizing the combined loss function represented by formula (1), and the medical hallucination correction model can be adjusted in the direction of minimizing the combined loss function.

[0122] According to an embodiment of the present invention, in formula (1), if the input text is the first sample text, then in the training of the medical hallucination discrimination model, make Maximize, that is, get as close to 1 as possible, so that it can make To maximize the accuracy of the medical hallucination discrimination model in identifying medical hallucinations, if the input image is the text generated during the first training, then during the training of the medical hallucination discrimination model, the accuracy of the model will be improved. Minimize, that is, get as close to 0 as possible, so that it can make This maximizes the accuracy of the medical hallucination discrimination model in identifying medical hallucinations in the first training generated text output by the medical hallucination correction model.

[0123] According to one embodiment of the present invention, on the other hand, in formula (1), if the input text is the first training generated text, then in the training of the medical hallucination correction model, make Maximize, that is, get as close to 1 as possible, so that it can make Minimizing this increases the probability that the first training text output by the medical hallucination correction model will be judged by the medical hallucination discrimination model as not having a medical hallucination, thereby improving the performance of the medical hallucination correction model.

[0124] In this way, adversarial training can be used to determine the combined loss function, which can simultaneously reduce the probability of medical hallucinations in the first training generated text output by the medical hallucination correction model and improve the discrimination ability of the medical hallucination discrimination model, thereby balancing the performance of the two models.

[0125] According to an embodiment of the present invention, in step S8, the medical hallucination discrimination model and the medical hallucination correction model are trained according to the combined loss function to obtain the trained medical hallucination discrimination model and the trained medical hallucination correction model.

[0126] For example, adversarial training can be performed on the medical hallucination discrimination model and the medical hallucination correction model based on the combined loss function to improve their performance and obtain trained medical hallucination discrimination model and trained medical hallucination correction model.

[0127] According to an embodiment of the present invention, in step S9, the text to be detected is processed according to the trained medical hallucination discrimination model and the trained medical hallucination correction model to obtain the final medical hallucination discrimination result and the final generated text.

[0128] For example, the text to be detected is processed according to the trained medical hallucination discrimination model to determine whether there is a hallucination in the text and to determine the medical hallucination discrimination result. If there is a medical hallucination, the text to be detected is processed according to the trained medical hallucination correction model to obtain the final generated text.

[0129] The dynamic causal reinforcement intelligent medical hallucination detection and correction method according to embodiments of the present invention can construct a dynamic medical causal graph and perform adversarial training on a medical hallucination discrimination model and a medical hallucination correction model. This improves the discrimination model's ability to detect medical hallucinations and reduces the probability of medical hallucinations in the text output by the correction model. Furthermore, it can perform medical hallucination detection and correction on the text to be detected based on the trained medical hallucination discrimination model and the trained medical hallucination correction model, thus improving the accuracy of medical hallucination detection and correction. When determining the detection consistency coefficient, it can be determined based on the degree of increase of causal indicators, the degree of decrease of causal indicators, the degree of increase of actual indicators, the degree of decrease of actual indicators, and the image consistency coefficient. During the calculation process, the consistency between key causal expectations and facts can be evaluated based on three aspects: the difference between expected medical images and facts, the difference between expected increased indicators and facts, and the difference between expected decreased indicators and facts, thus determining the detection consistency coefficient and improving its comprehensiveness and accuracy. When determining the combined loss function, adversarial training can be used to determine the combined loss function, so as to achieve the goal of improving the discrimination ability of the medical hallucination discrimination model while reducing the probability of the first training generated text output by the medical hallucination correction model containing medical hallucinations, thereby balancing the performance of the two models.

[0130] Figure 4 An exemplary block diagram of a dynamic causal reinforcement intelligent medical hallucination detection and correction system according to an embodiment of the present invention is shown, the system comprising:

[0131] A dynamic construction module is used to acquire relevant data sources and construct a dynamic medical causal graph based on the relevant data sources;

[0132] The text data module is used to acquire the text to be detected, and based on the text to be detected, to determine the diagnostic result to be detected, the source of evidence for the diagnostic result to be detected, and the confidence level of the diagnostic result to be detected;

[0133] The actual data module is used to acquire actual test data;

[0134] The first discrimination module is used to process the diagnostic result to be detected, the evidence source of the diagnostic result to be detected, the confidence level of the diagnostic result to be detected, the actual detection data and the dynamic medical causal graph through a medical hallucination discrimination model to obtain the first medical hallucination discrimination result;

[0135] The first correction module is used to determine whether the text to be detected needs to be corrected based on the first medical hallucination discrimination result.

[0136] The first text module is used to process the text to be detected according to the medical hallucination correction model when the text to be detected needs to be corrected, so as to obtain the first training generated text.

[0137] The loss function module is used to obtain a combined loss function of the medical hallucination discrimination model and the medical hallucination correction model based on the text generated by the first training.

[0138] The model training module is used to train the medical hallucination discrimination model and the medical hallucination correction model according to the combined loss function, so as to obtain the trained medical hallucination discrimination model and the trained medical hallucination correction model.

[0139] The final discrimination module is used to process the text to be detected based on the trained medical hallucination discrimination model and the trained medical hallucination correction model to obtain the final medical hallucination discrimination result and the final generated text.

[0140] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0141] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are merely examples and do not limit the present invention. The objectives of the present invention have been fully and effectively achieved. The functions and structural principles of the present invention have been shown and explained in the embodiments, and any modifications or variations of the embodiments of the present invention may be made without departing from the stated principles.

Claims

1. A dynamic causal reinforcement intelligent medical hallucination detection and correction method, characterized in that, include: Obtain relevant data sources and construct a dynamic medical causal graph based on the relevant data sources; Obtain the text to be detected, and based on the text to be detected, determine the diagnostic result to be detected, the source of evidence for the diagnostic result to be detected, and the confidence level of the diagnostic result to be detected; Obtain actual test data; The medical hallucination discrimination model processes the diagnostic result to be detected, the evidence source of the diagnostic result to be detected, the confidence level of the diagnostic result to be detected, the actual detection data, and the dynamic medical causal graph to obtain a first medical hallucination discrimination result, including: Based on the diagnostic results to be detected and the dynamic medical causal graph, determine the causal chain related to the diagnostic results; Based on the causal chain related to the diagnostic results, relevant causal detection data are determined; Based on the relevant causal detection data and the actual detection data, the detection consistency coefficient is determined, including: Based on the relevant causal detection data, determine the degree of increase of the causal indicator for the rising indicator, the degree of decrease of the causal indicator for the falling indicator, and the causal detection image; Based on the actual detection data, determine the actual degree of increase of the rising index, the actual degree of decrease of the falling index, and the actual detection image; The causal detection image and the actual detection image are processed by an image detection model to determine the image consistency coefficient; The detection consistency coefficient is determined based on the degree of increase of the causal index, the degree of decrease of the causal index, the degree of increase of the actual index, the degree of decrease of the actual index, and the image consistency coefficient. Determine the consistency coefficient of evidence based on the sources of evidence for the diagnostic results to be detected; The evidence consistency coefficient, the confidence level of the diagnostic result to be detected, and the detection consistency coefficient are processed by the medical hallucination discrimination model to obtain the first medical hallucination discrimination result; Based on the first medical hallucination detection result, determine whether the text to be detected needs to be corrected; If the text to be detected needs to be corrected, the text to be detected is processed according to the medical hallucination correction model to obtain the first training generated text; Based on the first training text, obtain the combined loss function of the medical hallucination discrimination model and the medical hallucination correction model; The medical hallucination discrimination model and the medical hallucination correction model are trained according to the combined loss function to obtain the trained medical hallucination discrimination model and the trained medical hallucination correction model. The text to be detected is processed based on the trained medical hallucination discrimination model and the trained medical hallucination correction model to obtain the final medical hallucination discrimination result and the final generated text.

2. The dynamic causal reinforcement intelligent medical hallucination detection and correction method according to claim 1, characterized in that, The detection consistency coefficient is determined based on the degree of increase of the causal index, the degree of decrease of the causal index, the degree of increase of the actual index, the degree of decrease of the actual index, and the image consistency coefficient, including: according to the formula: Determine the consistency coefficient of detection Where min is the function for finding the minimum value, and max is the function for finding the maximum value. Let be the image consistency coefficient between the i-th causal detection image and the corresponding actual detection image. The actual degree of increase of the k-th rising indicator. The degree of increase of the causal indicator for the k-th increasing indicator. The actual degree of reduction of the j-th reduction indicator. Let represent the degree of causal index reduction for the j-th decreasing index, n be the number of causal detection images (i≤n), K be the number of increasing indicators (k≤K), and m be the number of decreasing indicators (j≤m). i, n, k, K, j, and m are all positive integers.

3. The dynamic causal reinforcement intelligent medical hallucination detection and correction method according to claim 1, characterized in that, Based on the evidence sources for the diagnostic results to be tested, the consistency coefficient of evidence is determined, including: Based on the evidence sources of the diagnostic results to be detected, obtain different evidence sources for the same fact; Based on different sources of evidence for the same fact, determine the result of factual conflict detection; Based on the evidence sources of the diagnostic results to be tested, obtain different evidence sources for medication recommendations; Based on the different sources of evidence for the medication recommendations, determine the results of the logical tendency conflict detection; Based on the results of the factual conflict detection and the results of the logical tendency conflict detection, the evidence consistency coefficient is determined.

4. The method for detecting and correcting dynamic causal reinforcement intelligent medical hallucinations according to claim 1, characterized in that, Based on the text generated from the first training, a combined loss function for the medical hallucination discrimination model and the medical hallucination correction model is obtained, including: Obtain the first sample text where medical hallucinations do not exist; Input the first sample text or the first training generated text into the medical hallucination discrimination model to obtain the training medical hallucination discrimination result; Based on the training results of medical hallucination discrimination, a combined loss function of the medical hallucination discrimination model and the medical hallucination correction model is obtained.

5. The dynamic causal reinforcement intelligent medical hallucination detection and correction method according to claim 4, characterized in that, Based on the training results for medical hallucination discrimination, a combined loss function for the medical hallucination discrimination model and the medical hallucination correction model is obtained, including: according to the formula: Obtain the combined loss function of the medical hallucination discrimination model and the medical hallucination correction model. ,in, For the t-th first sample text, The training result for the medical hallucination discrimination of the first sample text output by the medical hallucination discrimination model. Generate text for the r-th first training element. The medical hallucination discrimination result is the r-th first training generated text output by the medical hallucination discrimination model. t is the number of first sample texts, t≤T, r is the number of first training generated texts, r≤R, and t, T, r and R are all positive integers.

6. A dynamic causal reinforcement intelligent medical hallucination detection and correction system, characterized in that, For performing the method according to any one of claims 1-5, comprising: A dynamic construction module is used to acquire relevant data sources and construct a dynamic medical causal graph based on the relevant data sources; The text data module is used to acquire the text to be detected, and based on the text to be detected, to determine the diagnostic result to be detected, the source of evidence for the diagnostic result to be detected, and the confidence level of the diagnostic result to be detected; The actual data module is used to acquire actual test data; The first discrimination module is used to process the diagnostic result to be detected, the evidence source of the diagnostic result to be detected, the confidence level of the diagnostic result to be detected, the actual detection data, and the dynamic medical causal graph through a medical hallucination discrimination model to obtain a first medical hallucination discrimination result, including: Based on the diagnostic results to be detected and the dynamic medical causal graph, determine the causal chain related to the diagnostic results; Based on the causal chain related to the diagnostic results, relevant causal detection data are determined; Based on the relevant causal detection data and the actual detection data, the detection consistency coefficient is determined, including: Based on the relevant causal detection data, determine the degree of increase of the causal indicator for the rising indicator, the degree of decrease of the causal indicator for the falling indicator, and the causal detection image; Based on the actual detection data, determine the actual degree of increase of the rising index, the actual degree of decrease of the falling index, and the actual detection image; The causal detection image and the actual detection image are processed by an image detection model to determine the image consistency coefficient; The detection consistency coefficient is determined based on the degree of increase of the causal index, the degree of decrease of the causal index, the degree of increase of the actual index, the degree of decrease of the actual index, and the image consistency coefficient. Determine the consistency coefficient of evidence based on the sources of evidence for the diagnostic results to be detected; The evidence consistency coefficient, the confidence level of the diagnostic result to be detected, and the detection consistency coefficient are processed by the medical hallucination discrimination model to obtain the first medical hallucination discrimination result; The first correction module is used to determine whether the text to be detected needs to be corrected based on the first medical hallucination discrimination result. The first text module is used to process the text to be detected according to the medical hallucination correction model when the text to be detected needs to be corrected, so as to obtain the first training generated text. The loss function module is used to obtain a combined loss function of the medical hallucination discrimination model and the medical hallucination correction model based on the text generated by the first training. The model training module is used to train the medical hallucination discrimination model and the medical hallucination correction model according to the combined loss function, so as to obtain the trained medical hallucination discrimination model and the trained medical hallucination correction model. The final discrimination module is used to process the text to be detected based on the trained medical hallucination discrimination model and the trained medical hallucination correction model to obtain the final medical hallucination discrimination result and the final generated text.