A medical large model hallucination suppression method based on adaptive retrieval and bidirectional inference verification
By using a closed-loop system of adaptive retrieval and bidirectional reasoning verification, the hallucination problem in the generated reports of large medical models was solved, the logical consistency and factual accuracy were improved, and the reliability and noise resistance of the model were enhanced.
Patent Information
- Application Number
- CN202611655794.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-26
- Publication Date
- 2026-11-27
AI Technical Summary
Existing large medical models are prone to hallucination problems when dealing with complex clinical scenarios. The generated content may seem reasonable, but it does not actually match medical facts and has serious logical contradictions. Furthermore, traditional methods cannot guarantee the accuracy of the reported facts and the consistency of the logic.
A closed-loop system based on adaptive retrieval and bidirectional reasoning verification is constructed. Noise is filtered through adaptive retrieval strategy, a bidirectional reasoning mechanism is introduced for logical self-consistency verification, and the model is optimized by combining direct preference optimization algorithm to form a closed-loop process of retrieval-generation-verification-correction.
It significantly improves the logical reliability and factual accuracy of medical reports, reduces logical contradictions and illusions, enhances the system's resistance to noise interference, and improves the alignment accuracy between the model and the diagnostic logic of medical experts.
Smart Images

Figure CN123182984A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision, natural language processing, and medical artificial intelligence, specifically to a method for suppressing hallucinations in large medical models based on adaptive retrieval and bidirectional reasoning verification. Background Technology
[0002] With the rapid development of artificial intelligence technology, medical multimodal large models have shown great application potential in fields such as assisted diagnosis, medical image analysis, and report generation, greatly improving the efficiency and intelligence of medical services. However, although these models can generate fluent text, they often face a serious "illusion" problem when dealing with complex clinical scenarios. That is, the generated content seems reasonable but is actually inconsistent with medical facts or contains logical contradictions, which seriously limits their reliability and safety in actual clinical applications.
[0003] To alleviate this problem, existing technical solutions typically employ Retrieval Augmentation (RAG) techniques, attempting to assist model generation by introducing external knowledge bases. However, traditional RAG methods mostly adopt a fixed retrieval quantity strategy, ignoring the differences in the complexity of different cases and the density of similar cases in the database. This rigid retrieval mechanism is prone to introducing irrelevant noise or omitting key reference information, thus misleading the model's judgment. Furthermore, existing large-scale medical model generation mechanisms often rely solely on one-way "forward reasoning," that is, simply deriving diagnostic conclusions from images or symptoms. This model lacks inherent reflection and verification capabilities, failing to verify whether the generated diagnostic conclusions can logically deduce the original imaging features or clinical symptoms, leading to the logical illusion that "diagnostic conclusions contradict descriptive features" in the generated reports. Simultaneously, in terms of model alignment optimization, traditional reinforcement learning methods based on human feedback are not only unstable in the training process, requiring the construction of complex reward models, but also struggle to accurately capture the highly specialized and subtle preference differences in the medical field. These existing methods still have significant shortcomings in ensuring the factual accuracy, logical consistency, and standardization of medical reports, and require further improvement and optimization. Summary of the Invention
[0004] The technical problem this invention aims to solve is to provide a method for suppressing hallucinations in large medical models based on adaptive retrieval and bidirectional reasoning verification, addressing the aforementioned issues in existing technologies. This method constructs a closed-loop system of "retrieval-generation-verification-correction," dynamically filtering noise through an adaptive retrieval strategy to ensure input quality, introducing a bidirectional reasoning mechanism for logical consistency verification, and combining direct preference optimization to replace complex reward models. This comprehensively solves the hallucination problem in large medical models, improving the clinical value and reliability of generated reports.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification includes the following steps: Build and fine-tune a medical multimodal retrieval tool; The target medical image is input into the medical multimodal retrieval tool. The medical multimodal retrieval tool filters the seed report set of the target medical image from all candidate reports in the database. Then, density expansion and density collapse point detection are performed, and the candidate reports before the detected density collapse points are added to the context. Construct prompt words and input the target medical image and the context into the medical big model to obtain an initial diagnosis report. Then, construct reverse prompt words and input the initial diagnosis report into the medical big model again to obtain the theoretical features of the target medical image. The theoretical features of the target medical image are compared with the real features of the target medical image. If the comparison results are consistent, the initial diagnostic report is marked as a candidate report that passes the consistency check. Otherwise, the initial diagnostic report is marked as a non-preference response, and the real reference report corresponding to the target medical image is marked as a preference response. Based on the target medical image, the corresponding context, the preference response and the non-preference response, preference sample pairs are constructed and added to the preference dataset. The medical big model is fine-tuned using a preference dataset to obtain an updated medical big model. The updated medical big model is then used to obtain the target medical image and corresponding prompt words for the next round and generate the corresponding initial diagnostic report to reduce the probability of generating reports containing hallucinations or logical contradictions.
[0006] Furthermore, when constructing and fine-tuning the medical multimodal retrieval system, the dual-tower encoder is fine-tuned using medical image-report pairs as training data, and the training objective adopts a contrastive learning loss function to obtain the medical multimodal retrieval system.
[0007] Furthermore, the formula for calculating the contrastive learning loss function is as follows:
[0008] in, Represents the image loss term. This represents the text loss term, where N represents the total number of medical image-report pairs. Let be the similarity matrix between image and text modalities, representing the similarity between the image representation of the i-th sample and the text representation of the j-th sample. The calculation formula is:
[0009] in, and Let i represent the image representation of the i-th sample and the text representation of the j-th sample, respectively. When j=i This represents the similarity between the image representation of the i-th sample and the text representation of the i-th sample.
[0010] Furthermore, when using the medical multimodal retrieval tool to filter the seed report set of the target medical image from all candidate reports in the database, the cosine similarity between the input target medical image and all candidate reports in the database is calculated. All candidate reports are sorted from high to low similarity to form an ordered sequence. The first few highly similar candidate reports in the sequence are selected as the seed report set and added to the retrieval set.
[0011] Furthermore, the detection of density expansion and density collapse specifically includes: Candidate reports outside the seed report set are retrieved sequentially according to their ordered order. For the current candidate report retrieved, calculate the cosine similarity between the current candidate report and the target medical image, and calculate the similarity density change rate of the current candidate report based on the change between the cosine similarity of the current candidate report and the cosine similarity of the previous candidate reports added to the retrieval set. If the similarity density change rate does not exceed the preset threshold, the current candidate report is added to the search set, and the search for the next candidate report continues to expand. If the similarity density change rate is greater than a preset threshold, a density collapse point is detected, and the search and expansion of subsequent candidate reports is stopped.
[0012] Furthermore, when comparing the theoretical features of the target medical image with the real features of the target medical image, the similarity between the theoretical features and the real features in the semantic space is calculated. If the similarity is greater than or equal to a specified threshold, the comparison results are consistent; otherwise, the comparison results are inconsistent.
[0013] Furthermore, before fine-tuning the large medical model using the preference dataset, the following steps are also included: Select the source medical image that is least similar to the target medical image and introduce diffuse noise to generate an interfering image; Construct prompt words and input the context of the interference image and the target medical image into a large medical model to obtain a generated report corresponding to the interference image. If the generated report is similar or consistent with the initial diagnosis report corresponding to the target medical image in medical semantics, then the generated report is marked as a non-preference response and the real reference report corresponding to the source medical image is marked as a preference response. Based on the interference image, the context, the preferred response, and the non-preferred response, a preference sample pair is constructed, and the preference sample pair is added to the preference dataset.
[0014] Furthermore, when introducing diffuse noise to generate interfering images, the calculation formula is as follows:
[0015] in, Indicates interference image, This indicates the source medical image that is least similar to the target medical image. Represents the diffuse noise vector. This is the mixing ratio coefficient.
[0016] Furthermore, after marking the initial diagnostic report as a candidate report that has passed the consistency check, the method further includes adding the candidate report to the database.
[0017] Furthermore, when fine-tuning the large medical model using the preference dataset, the expression for the objective function is as follows:
[0018] in, This represents the direct preference optimization loss function; Represents a preference dataset; This indicates the input criteria, including the medical image and the corresponding search context; Indicates a preference response; Indicates a non-preferred response; This represents a large medical model that requires fine-tuning. This represents the parameters of the large medical model to be optimized; This represents the reference model that was fixed before fine-tuning; This indicates the preference optimization intensity adjustment coefficient; Represents the Sigmoid function; Represents the preference dataset Expectation calculation is performed on the preferred sample pairs; and These represent the input conditions of the large medical model to be fine-tuned. The conditional probabilities of generating preferred and unpreferred responses.
[0019] Compared with the prior art, the advantages of the present invention are as follows: This invention employs a closed-loop generation architecture based on bidirectional reasoning verification and adaptive retrieval, which significantly improves the logical reliability and factual accuracy of medical report generation. First, addressing the logical illusion problem of "interpreting images but arriving at incorrect conclusions" caused by the unidirectional generation in existing technologies, this invention introduces a bidirectional reasoning mechanism. This forces the model to deduce the expected visual features or clinical symptoms from the generated diagnostic conclusion and compare them with the original input, ensuring logical corroboration between the diagnostic conclusion and image features, fundamentally reducing logical contradictions. Second, addressing the problem of traditional fixed-k-value retrieval easily introducing noise or missing key information, this invention adopts a density-based adaptive retrieval strategy. It automatically adjusts the amount of reference information based on the uniqueness of the case and the distribution density of similar cases. This effectively avoids irrelevant reports misleading the model while ensuring that cases with complex illnesses receive sufficient reference information, thereby enhancing the system's resistance to noise interference. Finally, to solve the problem of difficult and inefficient alignment in traditional reinforcement learning, this invention uses logical verification failure cases generated during bidirectional reasoning as highly targeted negative samples. Combined with a direct preference optimization algorithm, it directly optimizes the model strategy, efficiently achieving accurate alignment between the model and the diagnostic logic of medical experts without training a complex reward model. Attached Figure Description
[0020] Figure 1 This is a diagram illustrating the overall implementation framework of the method of the present invention.
[0021] Figure 2 This is a flowchart of the method of the present invention. Detailed Implementation
[0022] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.
[0023] Table 1. Main symbols used in this embodiment
[0024] This embodiment proposes a method for suppressing hallucinations in large medical models based on adaptive retrieval and bidirectional reasoning verification. It constructs a closed-loop system of "retrieval-generation-verification-correction," aiming to comprehensively address the hallucination problem in medical report generation. For example... Figure 1 As shown, the method consists of the following four main steps: 1) Fine-tuning and construction of a medical multimodal retrieval system.
[0025] The dual-tower encoder was fine-tuned using medical image-report pairs as training data, with the training objective employing a contrastive learning loss function, resulting in a medical multimodal retrieval system.
[0026] 2) Implementation of density-based adaptive retrieval strategy.
[0027] The target medical image is input into the medical multimodal retrieval tool. The medical multimodal retrieval tool filters the seed report of the target medical image from all reports in the database. Then, density expansion and density collapse point detection are performed, and the report before the detected density collapse point is added to the context.
[0028] 3) Generation and verification based on bidirectional reasoning.
[0029] Construct prompt words and input the target medical image and the context into the medical big model to obtain an initial diagnosis report. Then, construct reverse prompt words and input the initial diagnosis report into the medical big model again to obtain the theoretical features of the target medical image. The theoretical features of the target medical image are compared with the real features of the target medical image. If the comparison results are consistent, the initial diagnostic report is marked as a candidate report that passes the consistency check. Otherwise, the initial diagnostic report is marked as a non-preference response, and the real reference report corresponding to the target medical image is marked as a preference response. Based on the target medical image, the corresponding context, the preference response and the non-preference response, preference sample pairs are constructed and added to the preference dataset.
[0030] 4) Model fine-tuning based on direct preference optimization.
[0031] The medical big model is fine-tuned using a preference dataset to obtain an updated medical big model. The updated medical big model is then used to obtain the target medical image and corresponding prompt words for the next round and generate the corresponding initial diagnostic report to reduce the probability of generating reports containing hallucinations or logical contradictions.
[0032] The following section uses the generation of medical images and corresponding medical reports as an example to explain in detail the specific implementation of each step.
[0033] In order to retrieve the most relevant medical knowledge from the database to the input image, this embodiment first constructs and fine-tunes a medical-specific multimodal retrieval tool in step 1.
[0034] The retrieval module draws inspiration from CLIP's design principles and includes a visual encoder and a text encoder. In this embodiment, the visual encoder uses ResNet-50, and the text encoder uses a Transformer architecture.
[0035] For N medical image-report pairs in the training set, the image set is denoted as . The report set is denoted as .
[0036] Visual encoder Encode images into representations ,Right now ; Text encoder Encode the report as a characterization ,Right now .
[0037] To better adapt general-purpose visual and text encoders to the medical field, this invention uses training data to fine-tune the encoder. The training objective employs a contrastive learning loss function, defined as follows:
[0038] in, Represents the image loss term. This represents the text loss term, where N represents the total number of medical image-report pairs. Let be the similarity matrix between image and text modalities, representing the similarity between the image representation of the i-th sample and the text representation of the j-th sample. Its calculation method is as follows:
[0039] Each element in the formula represents the similarity between the image representation of the i-th sample and the text representation of the j-th sample. and Let represent the image representation of the i-th sample and the text representation of the j-th sample, respectively; when j=i, Let represent the similarity between the image representation of the i-th sample and the text representation of the i-th sample. The goal of Equation (1) is to learn cross-modal aligned representations by maximizing the image-text modal similarity of the same sample while minimizing the image-text modal similarity of different samples.
[0040] In the inference phase of large-scale multimodal medical models, the amount of retrieval context significantly impacts the reliability of the generated response. Too few retrievals may lead to insufficient information coverage, while too many retrievals may introduce irrelevant or even erroneous noise, thus triggering the "illusion" problem. Existing RAG methods typically set a fixed number of retrievals k based on empirical values, but this approach ignores the significant differences in the similarity distribution between images and text across different input samples, making it difficult to guarantee the robustness of retrieval quality.
[0041] Therefore, this embodiment proposes an adaptive retrieval strategy based on the similarity density change rate in step 2. This strategy borrows the "density expansion" and "density collapse" mechanisms from the DBSCAN clustering algorithm, no longer relying solely on the absolute value of similarity, but dynamically determining the optimal retrieval cutoff point by analyzing the rate of change of similarity in the retrieval result sequence. The specific implementation steps are as follows: 2.1) Initialize retrieval and sorting.
[0042] The medical multimodal retrieval tool is used to filter the seed report set of the target medical image from all candidate reports in the database. Specifically, the aforementioned fine-tuned medical multimodal retrieval tool is used to calculate the input target medical image. With all candidate reports in the database The cosine similarity between them is used. All candidate reports are sorted from highest to lowest similarity to form an ordered sequence. And the corresponding similarity sequence is denoted as .in, Indicates the first One candidate report, Indicates the first The cosine similarity between each candidate report and the target medical image is used. The first few high-similarity reports in the sequence are selected as the initial seed report set and added to the retrieval set.
[0043] 2.2) Calculation of density expansion and rate of change.
[0044] Based on the initial seed report set, and in order of the candidate report sequence The search is performed on subsequent candidate reports in the seed report set according to the sorting order. For the current candidate report... Obtain the cosine similarity between it and the target medical image. Based on the change in cosine similarity between the current candidate report and the cosine similarity between the current candidate report and the preceding candidate reports already added to the retrieval set, the similarity density change rate of the current candidate report is calculated. .
[0045] The similarity density change rate This is used to characterize the degree of change in the cosine similarity of the current candidate report relative to the similarity distribution of previous candidate reports. When the similarity change in the ordered sequence of candidate reports is small, i.e., the similarity density change rate... If the threshold is not exceeded, it indicates that the current candidate report is still in the candidate report region with high relevance to the target medical image, and the current candidate report will be... Add the report to the search set and continue to expand the density of subsequent candidate reports. When the similarity density change rate of the current candidate report does not exceed the preset threshold, add the current candidate report to the search set and continue to expand the search for the next candidate report.
[0046] 2.3) Similarity density collapse point detection and retrieval truncation.
[0047] During density expansion, the rate of change in similarity density is monitored in real time. When the current candidate report Corresponding similarity density change rate Greater than the preset threshold At that time, determine the current candidate report. The location is a similarity density collapse point.
[0048] The similarity density collapse point indicates a significant change in the cosine similarity within the ordered sequence of candidate reports, leading to a decrease in the relevance between subsequent candidate reports and the target medical image. Therefore, upon detecting a similarity density collapse point, the search for subsequent candidate reports is stopped to prevent relatively low-relevance candidate reports from entering the search context.
[0049] 2.4) Output the adaptive retrieval context set.
[0050] After detecting a similarity density collapse point, the candidate reports that have been added to the search set before the similarity density collapse point are determined as the adaptive search context set, denoted as . .in, This represents the last candidate report before the similarity density collapse point.
[0051] In this way, the retrieval context is determined by the continuous relevance boundaries in the candidate report sequence, rather than simply by a pre-set fixed number of reports. This retrieval context assists the large medical model in generating an initial diagnostic report, ensuring that the initial report contains case reference information related to the target medical image. The theoretical image features derived from the initial diagnostic report are also indirectly constrained by the retrieval context, thereby reducing the impact of low-relevance candidate reports on subsequent diagnostic report generation, theoretical image feature derivation, and preferred sample labeling.
[0052] In step 3 of this embodiment, the Large Language and Vision Assistant for BioMedicine (LLaVA-Med), a biomedical-specific large multimodal model proposed by the Microsoft team, is used as the backbone network. To address the illusion problem during model generation, such as... Figure 2 As shown, this embodiment introduces a bidirectional reasoning mechanism in the generation phase to construct a high-quality preference dataset. Specific steps include: 3.1) Forward reasoning.
[0053] Construct prompts for the input image. and adaptively retrieved context Input the LLaVA-Med model.
[0054] The model combines the target medical image with the retrieval context to analyze the location, morphology, imaging features, and possible diagnostic conclusions of lesions in the target image, generating an initial diagnostic report. .
[0055] 3.2) Backward reasoning.
[0056] Leveraging the reasoning capabilities of the LLaVA-Med model, reverse cue words are constructed to inform the initial diagnosis. As input, the theoretical set of visual features should be derived in reverse. .
[0057] Specifically, the initial diagnostic report As input, construct reverse prompts. For example: "Based on the diagnostic conclusion and lesion description in the following diagnostic report, deduce the lesion location, lesion morphology, density or signal characteristics, and key imaging features that should be present in medical images when the diagnostic conclusion is valid, and output only the imaging features that support the diagnostic conclusion."
[0058] Based on the aforementioned reverse prompts, the medical big data model derives a theoretical set of imaging features from the diagnostic conclusions and lesion descriptions in the initial diagnostic report. The theoretical image feature set Indicates: If the initial diagnostic report If the diagnostic conclusion is valid, then the imaging features that should be presented in the target medical image are as follows.
[0059] 3.3) Consistency verification and sample screening.
[0060] The theoretical characteristics of reverse deduction With the original image The actual features of the two are compared to calculate their similarity in the semantic space.
[0061] If the two are highly consistent, i.e., the initial diagnostic report If the initial diagnostic report is logically consistent with the real image features of the target medical image, it is marked as a candidate report that has passed the consistency check. This candidate report can be added to the database to update the candidate report set in the database. If there is a contradiction between the two, i.e., the initial diagnostic report If the initial diagnostic report does not logically align with the actual image features of the target medical image, then the initial diagnostic report will be... Marked as a non-preference response and the corresponding real reference report for the target medical image. Marked as a preference response Construct sample preference pairs: .in, For target medical images, For the retrieval context corresponding to the target medical image, A true reference report corresponding to the target medical image.
[0062] Furthermore, for constructing non-preferred responses, this embodiment also employs a method for generating diffused noise negative samples to address contextual interference in medical image retrieval. This method does not merely randomly perturb the target medical image, but rather constructs error reports under the condition of "image content not matching the retrieval context," to identify the hallucination phenomenon caused by the large medical model over-reliance on the retrieval context and ignoring actual image information. For example... Figure 2 As shown, the specific steps are as follows: First, select the target medical image. Medical images with the lowest similarity and acquire the medical images. Corresponding real reference report .
[0063] Then, diffuse noise is introduced. Generate interference image The calculation formula is as follows:
[0064] in, Represents the diffuse noise vector. This is a mixing ratio coefficient. The noise mixing ratio coefficient is used to introduce noise perturbation while preserving the basic image structure of the source medical image, in order to obtain an interfering image that does not match the retrieval context of the target medical image.
[0065] Construct prompts to interfere with images With target medical images Corresponding search context Input a large medical model and obtain a report corresponding to the interfering image. If the generated report Initial diagnostic report with target medical images If the medical semantics are similar or consistent, it indicates that the model still repeatedly generates reports related to the target image even when the image content changes, suggesting that the model relies too much on the retrieval context and fails to effectively utilize the input image information.
[0066] At this point, a report will be generated. Marked as a non-preference response and the source image of the interfering image Corresponding real reference report Marked as a preference response Construct the second type of preference sample pair Add the preference dataset. Among them, For interfering images, For the retrieval context corresponding to the target image, Source image Corresponding real reference report, This is a report generated under the conditions of the interfering image and the retrieval context. In this way, the model is trained to prioritize generating a report based on the input medical image itself, even if the retrieval context contains reference information inconsistent with the current input image, avoiding direct copying or incorrect reliance on disease descriptions in the retrieval context.
[0067] In order for the LLaVA-Med model to internalize the logic of the aforementioned bidirectional reasoning and align with medical facts, this embodiment constructs a preference dataset. The model was fine-tuned using the Direct Preference Optimization (DPO) algorithm. Includes images and retrieval context. For preference response, This is a non-preference response.
[0068] The preferred response is a medical report that is consistent with the actual image features of the current input medical image; the non-preferred response includes: the initial diagnostic report corresponding to the case where the theoretical image features derived from the initial diagnostic report are inconsistent with the actual features of the original medical image, and the medical report generated under the condition that the interfering image and the mismatched retrieval context are both input, which is inconsistent with the actual content of the current input image.
[0069] The first type of non-preference response reflects situations where the diagnostic conclusion lacks real image evidence or contradicts the actual characteristics of the medical image; the second type of non-preference response reflects situations where the model incorrectly relies on the disease description in the retrieval context to generate a report even when the content of the input image changes. Therefore, the preference dataset not only represents the preference relationship between different report texts, but also the consistency relationship of medical facts between the input medical image, the retrieval context, and the generated report.
[0070] DPO eliminates the need to train a reward model; it directly optimizes the model strategy. This increases the probability of the model generating a preferred response and decreases the probability of generating a non-preferred response.
[0071] The objective function of DPO is as follows:
[0072] in, This represents the direct preference optimization loss function; Represents a preference dataset; This indicates the input criteria, including the medical image and the corresponding search context; Indicates a preference response; Indicates a non-preferred response; This represents a large medical model that requires fine-tuning. This represents the parameters of the large medical model to be optimized. This represents the reference model that was fixed before fine-tuning; in this embodiment, it is the original LLaVA-Med-1.5 model. This indicates the preference optimization intensity adjustment coefficient; Represents the Sigmoid function; Represents the preference dataset Expectation calculation is performed on the preferred sample pairs; and These represent the input conditions of the large medical model to be fine-tuned. The conditional probabilities of generating preferred and unpreferred responses.
[0073] By minimizing formula (4), the model prioritizes generating diagnostic reports supported by current medical image evidence when receiving medical images and their retrieval context. At the same time, it reduces the probability of generating reports whose diagnostic conclusions are inconsistent with the features of medical images, as well as reports that incorrectly use retrieval context information when the image content does not match the retrieval context.
[0074] In this embodiment, the direct preference optimization algorithm is used as a model fine-tuning method to learn medical preference sample pairs constructed by bidirectional inference consistency verification and diffusion noise interference mechanisms. These preference sample pairs address the issues of inconsistent image evidence and erroneous retrieval context dependencies in medical image retrieval report generation scenarios. This allows the model to maintain priority on the currently input medical image while utilizing the retrieval context to assist in report generation, thereby improving the consistency between the generated medical report and the actual image features.
[0075] In summary, this invention first utilizes a dual-tower encoder finely tuned for medical applications to encode medical images and implements an adaptive retrieval strategy based on the similarity density change rate. By dynamically analyzing the local density trends of the retrieval results to determine the optimal cutoff point, this strategy effectively filters out irrelevant noise while retaining high-confidence reference reports, ensuring the quality of input data from the source. Building upon this, the method combines forward inference generation with backward inference logic verification, i.e., bidirectional inference. After generating the initial diagnostic report, the system uses the diagnostic conclusion as input for backward inference, deriving the theoretical visual features or clinical symptoms that the disease should possess, and comparing them with the true features of the original images. This mechanism endows the model with self-reflection capabilities; once logical inconsistencies are detected, self-correction is triggered, thereby ensuring the logical consistency between the diagnostic conclusion and image features. Finally, to further improve the model's standardization and accuracy, this method utilizes positive and negative samples generated during bidirectional inference to construct a preference dataset and employs Direct Preference Optimization (DPO) technology to directly optimize the model strategy. This process eliminates the need to train complex reward models, efficiently aligning the model to the diagnostic logic of medical experts, significantly reducing factual errors and logical illusions.
[0076] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0077] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification, characterized in that, Includes the following steps: Build and fine-tune a medical multimodal retrieval tool; The target medical image is input into the medical multimodal retrieval tool. The medical multimodal retrieval tool filters the seed report set of the target medical image from all candidate reports in the database. Then, density expansion and density collapse point detection are performed, and the candidate reports before the detected density collapse points are added to the context. Construct prompt words and input the target medical image and the context into the medical big model to obtain an initial diagnosis report. Then, construct reverse prompt words and input the initial diagnosis report into the medical big model again to obtain the theoretical features of the target medical image. The theoretical features of the target medical image are compared with the real features of the target medical image. If the comparison results are consistent, the initial diagnostic report is marked as a candidate report that passes the consistency check. Otherwise, the initial diagnostic report is marked as a non-preference response, and the real reference report corresponding to the target medical image is marked as a preference response. Based on the target medical image, the corresponding context, the preference response and the non-preference response, preference sample pairs are constructed and added to the preference dataset. The medical big model is fine-tuned using a preference dataset to obtain an updated medical big model. The updated medical big model is then used to obtain the target medical image and corresponding prompt words for the next round and generate the corresponding initial diagnostic report to reduce the probability of generating reports containing hallucinations or logical contradictions.
2. The method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification according to claim 1, characterized in that, When constructing and fine-tuning the medical multimodal retrieval system, the dual-tower encoder is fine-tuned using medical image-report pairs as training data, and the training objective adopts a contrastive learning loss function to obtain the medical multimodal retrieval system.
3. The method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification according to claim 2, characterized in that, The formula for calculating the contrastive learning loss function is as follows: in, Represents the image loss term. This represents the text loss term, where N represents the total number of medical image-report pairs. Let be the similarity matrix between image and text modalities, representing the similarity between the image representation of the i-th sample and the text representation of the j-th sample. The calculation formula is: in, and Let i represent the image representation of the i-th sample and the text representation of the j-th sample, respectively. When j=i This represents the similarity between the image representation of the i-th sample and the text representation of the i-th sample.
4. The method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification according to claim 1, characterized in that, When using a medical multimodal retrieval tool to filter the seed report set of a target medical image from all candidate reports in the database, the specific steps are as follows: calculate the cosine similarity between the input target medical image and all candidate reports in the database; sort all candidate reports from high to low similarity to form an ordered sequence; and select the first few highly similar candidate reports in the sequence as the seed report set and add them to the retrieval set.
5. The method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification according to claim 4, characterized in that, When performing density expansion and density collapse detection, the specific steps include: Candidate reports outside the seed report set are retrieved sequentially according to their ordered order. For the current candidate report retrieved, calculate the cosine similarity between the current candidate report and the target medical image, and calculate the similarity density change rate of the current candidate report based on the change between the cosine similarity of the current candidate report and the cosine similarity of the previous candidate reports added to the retrieval set. If the similarity density change rate does not exceed the preset threshold, the current candidate report is added to the search set, and the search for the next candidate report continues to expand. If the similarity density change rate is greater than a preset threshold, a density collapse point is detected, and the search and expansion of subsequent candidate reports is stopped.
6. The method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification according to claim 1, characterized in that, When comparing the theoretical features of a target medical image with the actual features of the target medical image, the similarity between the theoretical features and the actual features in the semantic space is calculated. If the similarity is greater than or equal to a specified threshold, the comparison results are consistent; otherwise, the comparison results are inconsistent.
7. The method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification according to claim 1, characterized in that, Before fine-tuning the large medical model using the preference dataset, the following steps are also included: Select the source medical image that is least similar to the target medical image and introduce diffuse noise to generate an interfering image; Construct prompt words and input the context of the interference image and the target medical image into a large medical model to obtain a generated report corresponding to the interference image. If the generated report is similar or consistent with the initial diagnosis report corresponding to the target medical image in medical semantics, then the generated report is marked as a non-preference response and the real reference report corresponding to the source medical image is marked as a preference response. Based on the interference image, the context, the preferred response, and the non-preferred response, a preference sample pair is constructed, and the preference sample pair is added to the preference dataset.
8. The method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification according to claim 7, characterized in that, When introducing diffuse noise to generate interfering images, the calculation formula is as follows: in, Indicates interference image, This indicates the source medical image that is least similar to the target medical image. Represents the diffuse noise vector. This is the mixing ratio coefficient.
9. The method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification according to claim 1, characterized in that, After marking the initial diagnostic report as a candidate report that has passed the consistency check, the method further includes adding the candidate report to the database.
10. The method for suppressing hallucinations in a large medical model based on adaptive retrieval and bidirectional reasoning verification according to claim 1, characterized in that, When fine-tuning the large medical model using the preference dataset, the objective function is expressed as follows: in, This represents the direct preference optimization loss function; Represents a preference dataset; This indicates the input criteria, including the medical image and the corresponding search context; Indicates a preference response; Indicates a non-preferred response; This represents a large medical model that requires fine-tuning. This represents the parameters of the large medical model to be optimized; This represents the reference model that was fixed before fine-tuning; This indicates the preference optimization intensity adjustment coefficient; Represents the Sigmoid function; Represents the preference dataset Expectation calculation is performed on the preferred sample pairs; and These represent the input conditions of the large medical model to be fine-tuned. The conditional probabilities of generating preferred and unpreferred responses.
