Intelligent generation method and system of medical quality control report based on retrieval enhancement
By constructing image-text data and multi-modal models based on retrieval enhancement methods, the problems of flexibility and low efficiency in medical quality control report generation are solved, and efficient and personalized report generation is realized to adapt to dynamic changes in the medical field. Improved reporting quality and accuracy.
Patent Information
- Application Number
- CN202411061731.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-05
AI Technical Summary
Existing medical quality control report generation methods lack flexibility and personalization, are difficult to accurately reflect complex medical data and clinical decision-making processes, are inefficient when processing large amounts of data, are difficult to update the latest medical information in real time, and suffer from data imbalance and long-tail problems. , Model parameter knowledge is not updated in time, resulting in performance degradation.
Adopt an intelligent generation method of medical quality control reports based on retrieval enhancement, construct image embedding models and text embedding models by constructing image-text data, design a ternary affine transformer to map image and text representations to a unified vector space, and deploy a vector database and multi-modal large models, using retrieval enhancement technology to generate quality control reports, and combining large language models for intent recognition and slot filling.
It improves the reliability and professionalism of medical quality control reports, solves data imbalance and long-tail problems, achieves continuous improvement and adaptability of model performance, improves the speed and accuracy of report generation, and ensures the timeliness of reports and relevance.
Smart Images

Figure CN118571402B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence and retrieval technology, and in particular to a method and system for intelligently generating medical quality control reports based on retrieval enhancement. Background Art
[0002] With the continuous improvement of the information level of the medical industry, the generation and management of medical quality control reports have become a key link in improving the quality of medical services and ensuring patient safety. Medical quality control involves the monitoring, evaluation and improvement of medical services to ensure that the quality of services meets the predetermined standards. However, the traditional method of generating medical quality control reports mainly relies on manual compilation by medical personnel, which is not only time-consuming and labor-intensive, but also easily affected by personal experience and subjective judgment, thus affecting the accuracy and consistency of the report.
[0003] Although there are automation technologies currently applied to medical report generation, such as through rule engines and template systems, and for example, the Chinese invention patent with application publication number CN115762721A discloses a medical image quality control method and system based on computer vision technology, including: collecting multiple historical image examination data of medical institutions within the medical image mutual recognition area within a preset time period; extracting DR images from the historical image examination data, preprocessing the DR images, and generating a set of DR images with the same angle after annotation; using computer vision technology to construct an initial DR image recognition model for quality control evaluation, training, verifying and testing the initial DR image recognition model based on the DR image set, and generating a DR image prediction module; based on the medical image data to be evaluated, obtaining the DR image to be evaluated, inputting the DR image to be evaluated into the DR image prediction module, and obtaining the prediction results; the prediction results include various indicators of image quality control. However, these methods usually lack flexibility and personalization, and it is difficult to accurately reflect complex medical data and clinical decision-making processes. In addition, these methods are inefficient when processing large amounts of data, and it is difficult to update the latest medical information in real time.
[0004] In order to solve these problems, retrieval-augmented generation (RAG) has been introduced as an emerging solution in recent years. Retrieval-augmented generation combines natural language processing and deep learning. By accessing large-scale medical databases and knowledge bases, it can not only extract relevant information to enhance the content quality and relevance of reports, but also achieve in-depth analysis of complex medical data. This technology supports the generation of more accurate, detailed and timely medical quality control reports, thereby significantly improving the quality and generation efficiency of reports.
[0005] Despite this, existing technologies have not yet fully tapped the potential of retrieval enhancement technology in the generation of medical quality control reports. The main problems include: 1. Medical image quality control data are often unevenly distributed and have a long tail problem; 2. Model parameter knowledge cannot be updated in a timely manner, and training performance degrades due to catastrophic forgetting. Summary of the invention
[0006] The present invention aims to solve the above problems. To this end, the present invention provides a method and system for intelligently generating medical quality control reports based on retrieval enhancement, which can effectively integrate clinical data and the latest medical knowledge, intelligently and efficiently generate medical quality control reports, and improve the reliability and professionalism of medical quality control reports.
[0007] The present invention provides a method for intelligently generating a medical quality control report based on retrieval enhancement, and the technical solution adopted is as follows: comprising the following steps:
[0008] Step 1: Construct image-text pair data for medical image quality control, wherein the image-text pair data is a pair of images and texts, and the text is a description of the image quality control problem of the image;
[0009] Step 2: construct an image embedding model and a text embedding model, wherein the image embedding model is used to encode the image into a vector of a fixed length to obtain an image representation, and the text embedding model is used to encode the text into a text vector of a fixed length to obtain a text representation;
[0010] Step 3: construct a ternary affine transformer, and train the ternary affine transformer using the prompt word, image representation, and text representation to obtain a trained ternary affine transformer, wherein the ternary affine transformer is used to align the prompt word, image representation, and text representation, and map the image representation and text representation to a unified vector space;
[0011] Step 4: deploying a vector database, wherein the vector database is used to store the image representation and text representation mapped to a unified vector space, and pairs of image representation and text representation are bound by a unique identifier;
[0012] Step 5: deploying a multimodal large model, and training the multimodal large model based on retrieval enhancement to obtain a trained multimodal large model;
[0013] Step 6: deploy a large language model, which is used to perform intent recognition and slot filling on the text answers output by the trained multimodal large model, and generate a quality control report;
[0014] Step 7: Connect the image embedding model, the trained ternary affine transformer, the vector database, the trained multimodal large model, and the large language model in sequence, connect the image embedding model with the trained multimodal large model to obtain a medical quality control report intelligent generation system; input the image and prompt words into the medical quality control report intelligent generation system to generate a medical quality control report.
[0015] Furthermore, the image embedding model is constructed based on Vision Transformer or convolutional neural network, and the text embedding model adopts Transformer architecture.
[0016] Furthermore, in step 2, the image representation The way to obtain is:
[0017]
[0018] Text Representation The way to obtain is:
[0019]
[0020] in, represents the image embedding model, represents the text embedding model, Represents an image, Represents text.
[0021] Furthermore, the ternary affine transformer includes N superimposed text affixers and N superimposed image prompt word cross affixers, the text affixer includes a self-attention module A, a normalization module, a feedforward neural network module A and a residual connection module A connected in sequence, the image prompt word cross affixer includes a self-attention module B, a cross-attention module, a feedforward neural network module B and a residual connection module B connected in sequence, the text is represented as the input of the text affixer, the image is represented as the input of the image prompt word cross affixer, the prompt word is the input of all the cross-attention modules, and the self-attention module A of the text affixer and the self-attention module B of the image prompt word cross affixer at the corresponding position share weights.
[0022] Furthermore, in step 3, the contrastive learning loss function is calculated based on the output of the last text affine and the last image prompt word cross affine. :
[0023]
[0024] in, represents the function of the natural exponential, Represents the temperature coefficient, and the paired image representation and text representation are considered as positive samples , unpaired image representations and text representations are considered as negative samples ;
[0025] The last text affine and the last image prompt word cross affine of the ternary affine transformer are both connected to the feedforward neural network module C, and the image-text discrimination loss function is calculated according to the output of the feedforward neural network module C. :
[0026]
[0027] in, Represents all images and text representation The values of are weighted average or expected calculation, represents the complete set of data samples, and The value of is generated according to the probability distribution of the entire data sample set D. y indicates whether the input comes from the true label of the same image-text pair. express The probability of occurrence, represents the cross entropy function.
[0028] Furthermore, in step 5, the training process of the multimodal large model is: taking the image and the prompt word as input, the image is subjected to the image embedding model to obtain an image representation, the image representation and the prompt word are input into the trained ternary affine transformer, and the text representation with the highest similarity is retrieved from the vector database according to the output result of the ternary affine transformer, and paired image representation and text representation are obtained according to the text representation with the highest similarity, and image retrieval and text retrieval are calculated, and the image retrieval and text retrieval are used as prompts and input into the multimodal large model together with the image representation.
[0029] Furthermore, the probability of retrieval for:
[0030]
[0031] in, Represents the parameters of the image embedding model and the text embedding model, Represents image representation, represents the function of the natural exponential, Indicates similarity, Indicates The text representation with the highest similarity is retrieved. , Indicates the total number of text representations with the highest similarity, represents image retrieval, Represents text retrieval,
[0032]
[0033]
[0034] in, Indicates that a unique identifier is used with An image representation of the binding.
[0035] Furthermore, the loss function for:
[0036]
[0037] in, Indicates that in a given image representation , Retrieved Image Retrieval , retrieved text retrieval , and all previously generated output Under the condition of probability; Represents the length of the target sequence output by the multimodal large model; Represents the parameters of the multimodal large model.
[0038] Furthermore, in the intent recognition stage, the large language model identifies quality control results and analysis processes from the text answers output by the multimodal large model; in the slot filling stage, the large language model fills in detailed information based on the identified quality control results and analysis processes.
[0039] The present invention also provides a medical quality control report intelligent generation system based on retrieval enhancement, and the technical scheme adopted is as follows: for the medical quality control report intelligent generation system in the above-mentioned medical quality control report intelligent generation method based on retrieval enhancement, an image and a prompt word are input into the medical quality control report intelligent generation system, the image is subjected to an image embedding model to obtain an image representation, the image representation and the prompt word are input into a trained ternary affine transformer, and the text representation with the highest similarity is retrieved from the vector database according to the output result of the ternary affine transformer, and paired image representations and text representations are obtained according to the text representation with the highest similarity, and image retrieval and text retrieval are calculated, and the image retrieval and text retrieval are used as prompts and input into a trained multimodal large model together with the image representation to obtain a text answer, and the text answer is subjected to a large language model to generate a medical quality control report.
[0040] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects:
[0041] 1. The present invention designs a ternary affine transformer, which can align prompt words, image representations and text representations, and map the image representations and text representations into a unified vector space. It is more accurate and efficient in processing and matching cross-modal content, making it an ideal choice for medical diagnosis support that requires fast and accurate retrieval.
[0042] 2. The present invention obtains image retrieval and text retrieval by retrieving relevant text representations with the highest similarity, and uses image retrieval and text retrieval to train a large multimodal model, thereby providing a mechanism for enhanced learning that can continuously improve model performance through actual clinical cases, helping to overcome the catastrophic forgetting problem in traditional model training and enabling the model to continuously adapt to dynamic changes in the medical field.
[0043] 3. The present invention can generate quality control reports more effectively by cascading a large language model with a multimodal model. This cascading method optimizes the conversion process from graphic data to text reports, and improves the speed and accuracy of report generation.
[0044] 4. The present invention can update and utilize the latest medical data in real time by deploying a vector database and utilizing search enhancement technology. Compared with the existing technology, this approach can adapt to new medical conditions and knowledge updates more quickly, thereby improving the timeliness and relevance of reports.
[0045] 5. The present invention designs an intelligent generation system for medical quality control reports based on retrieval enhancement, processes medical image quality control data, and solves the data imbalance and long tail problems. Existing technologies often ignore the processing of niche categories or rare cases, while the present invention focuses on these data and can effectively improve the quality and accuracy of report generation in these cases, which is crucial to improving the comprehensiveness and meticulousness of medical quality control.
[0046] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 It is a flow chart of the method provided by the present invention.
[0049] Figure 2It is a schematic diagram of the image embedding model, text embedding model and ternary affine transformer provided by the present invention.
[0050] Figure 3 It is a schematic diagram of the system structure provided by the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. The following embodiments are used to illustrate the present invention, but cannot be used to limit the scope of the present invention.
[0052] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0053] Combine the following Figures 1 to 3 The present invention is further described in detail, and a method and system for intelligently generating medical quality control reports based on retrieval enhancement are described as follows:
[0054] In this embodiment, Figure 1 As shown, a method for intelligently generating a medical quality control report based on retrieval enhancement is provided, comprising the following steps:
[0055] Step 1: Construct image-text pair data for medical image quality control, wherein the image-text pair data is a pair of images and texts, and the text is a description of the image quality control problem of the image.
[0056] The present invention first constructs the image-text pair data of medical images and quality control problem descriptions, which needs to cover various quality control problems, especially rare problems in the long tail. The present invention uses medical institutions as the main data source to obtain image-text pair data. By conducting a detailed review and annotation of the image-text pair data, it is ensured that each case has an accurate problem description and is classified. Finally, a structured database is constructed to store the sorted data and ensure its availability and consistency. The medical image quality control data constructed by the present invention has obvious data imbalance and even long tail problems. It covers a series of X-ray images, and each image is equipped with a detailed quality control evaluation text record. These records highlight the key quality parameters of the image, such as midline alignment, exposure quality, accuracy of patient positioning, image integrity, and detection of foreign body interference. A total of 1,000 images are included, each with a resolution of 1024*768, and the size of the entire data set is about 2.3GB.
[0057] Step 2: Build image embedding models and text embedding models to convert images and texts into vector representations, respectively, to provide a representation basis for alignment modality and vector retrieval. Paired images and texts are used as a set of parallel inputs and are input into the image embedding model and text embedding model, respectively, to obtain paired image representations and text representations.
[0058] The image embedding model is used to encode the image into a vector of fixed length to obtain an image representation. The image embedding model is built based on Vision Transformer (ViT) or a convolutional neural network (such as ResNet). The image embedding model receives an image as input, extracts features of the image through multi-layer visual processing, and encodes the features into a vector of fixed length, aiming to capture the key visual information of the image.
[0059] Image Representation The way to obtain is:
[0060]
[0061] in, represents the image embedding model, Represents an image.
[0062] The text embedding model is used to encode the text into a fixed-length text vector to obtain a text representation. The text embedding model adopts the Transformer architecture. The text embedding model receives text as input, first decomposes the text into words or tokens, then converts each word of the text into a vector through the embedding layer, and then processes these vectors through the self-attention layer to capture the contextual relationship between words, and outputs a fixed-length text vector that represents the semantic content of the text.
[0063] Text Representation The way to obtain is:
[0064]
[0065] in, represents the text embedding model, Represents text.
[0066] Step 3: Construct a ternary affine transformer, and train the ternary affine transformer using the prompt word, image representation, and text representation to obtain a trained ternary affine transformer. The ternary affine transformer is used to align the prompt word, image representation, and text representation, and map the image representation and text representation to a unified vector space for cross-modal retrieval and query.
[0067] Paired images and texts are input into the image embedding model and the text embedding model respectively to obtain paired image representation and text representation. There is an obvious semantic gap between the paired image representation and text representation. In order to make them in the same latent space, the present invention proposes a ternary affine transformer, such as Figure 2 As shown, the ternary affine transformer accepts three inputs: prompt words, image representation and text representation. The ternary affine transformer includes N superimposed text affines and N superimposed image prompt word cross affines. The text affine includes a self-attention module A, a normalization module, a feedforward neural network module A and a residual connection module A connected in sequence, and the image prompt word cross affine includes a self-attention module B, a cross attention module, a feedforward neural network module B and a residual connection module B connected in sequence. The text representation is the input of the text affine, the image representation is the input of the image prompt word cross affine, and the prompt word is the input of all the cross attention modules. The self-attention module A of the text affine and the self-attention module B of the image prompt word cross affine at the corresponding position share weights. For example, the self-attention module A of the first text affine has the same weight as the self-attention module B of the first image prompt word cross affine.
[0068] When the ternary affine transformer is trained, the present invention proposes two improved loss functions, namely, contrastive learning loss function And the image-text discrimination loss function . Using contrastive learning loss function, the ternary affine transformer is trained to make different modal data with the same semantics closer in vector space. The image-text discrimination loss function is used to enhance the discrimination ability of the ternary affine transformer. The performance of the ternary affine transformer is evaluated through the validation set; according to the evaluation results, the parameters and structure of the ternary affine transformer are adjusted to further optimize the ternary affine transformer. In this embodiment, N is determined to be 12.
[0069] Calculate the contrastive learning loss function based on the output of the last text affine and the last image prompt word cross affine :
[0070]
[0071] in, represents the function of the natural exponential, Represents the temperature coefficient, which is used to control the smoothness of the distribution. Paired image representations and text representations are considered as positive samples. , unpaired image representations and text representations are considered as negative samples . It compares the cosine similarity of a positive sample and a negative sample, and is used to shorten the distance between positive samples and increase the distance between negative samples in the latent space.
[0072] The last text affine and the last image prompt word cross affine of the ternary affine transformer are both connected to the feedforward neural network module C. The last fully connected layer of the feedforward neural network module C maps the 768-dimensional input to the 2-dimensional output and then performs Softmax processing. The image-text discrimination loss function is calculated based on the output of the feedforward neural network module C. :
[0073]
[0074] in, Represents all images and text representation The values of are weighted average or expected calculation, represents the complete set of data samples, and The value of is generated according to the probability distribution of the entire data sample set D. y indicates whether the input comes from the true label of the same image-text pair, and represents an indicator variable used to indicate that in the current batch, and Are they describing the same sample? and If the data describe the same sample, y usually takes the value of 1; if the data describe different samples, y takes the value of 0. express The probability of occurrence, i.e., the weight, is the image representation With text representation The predicted value finally output by each network. represents the cross entropy function.
[0075] The ternary affine transformer can map different modalities into a unified vector space to avoid out-of-distribution queries. After training with contrastive learning loss and image-text discrimination loss functions, the semantics of the image embedding model and the text embedding model will be interoperable and convenient for cross-modal retrieval.
[0076] In the actual training process, the present invention first collects and preprocesses medical quality control images, text descriptions and prompt words, and uses the pre-trained BERT and ResNet50 models to initialize text representation and image representation. Among them, the prompt words are intended to help evaluate the quality of the image, identify possible problems, and provide suggestions on how to improve the image acquisition process. Therefore, the prompt word template setting is diverse. The present invention gives the following examples: "Generate a quality control report based on this medical image"; "Please describe the basic information of this medical image, including the acquisition date, device type, patient information (age, gender), and the specific medical use of the image"; "Please evaluate the overall quality of this medical image based on the clarity, contrast, and detail of the image. Point out any problems that may affect the accuracy of the diagnosis"; "Analyze the technical parameters of this medical image, including exposure level, image resolution, and imaging technology used (such as MRI, CT scan, etc.). Evaluate whether these parameters are suitable for the required medical application"; "Describe in detail the identifiable diagnostic elements in the image (such as tissue structure, lesion area, etc.), and evaluate whether the visualization of these elements meets clinical needs." The prompt words cannot be directly recognized by the cross-attention module. They can be converted into vectors through a text embedding model (such as the Transformer architecture) and then input into the cross-attention module.
[0077] Define training parameters, such as Batch Size is 32 and learning rate is 0.001. After each epoch, evaluate the performance of the ternary affine transformer through the validation set, adjust the hyperparameters and save the ternary affine transformer, and finally deploy the trained ternary affine transformer for actual cross-modal retrieval tasks.
[0078] The ternary affine transformer is trained for 50 epochs using the contrastive learning loss function and the image-text discriminant loss function. The performance is compared with CLIP and ViLBERT. The comparison results are shown in Table 1. The indicators include retrieval accuracy, retrieval recall, and data coverage. CLIP (Contrastive Language-Image Pre-training): A model developed by OpenAI that jointly understands images and text through large-scale pre-training. ViLBERT (Vision-and-Language BERT): Extends the BERT architecture to vision and language tasks, processes visual input and text input separately through a two-stream structure, and interacts in the later stage to achieve cross-modal understanding.
[0079] Table 1 Cross-modal retrieval performance comparison results
[0080]
[0081] Table 1 shows the significant advantages of the ternary affine transformer over CLIP and ViLBERT in the field of cross-modal retrieval, which are manifested in higher retrieval accuracy (92%), higher recall (85%), and wider data coverage (95%). These indicators show that the ternary affine transformer is more accurate and efficient in processing and matching cross-modal content (images and text), making it an ideal choice for application scenarios that require fast and accurate retrieval, such as real-time medical diagnosis support.
[0082] Step 4: deploy a vector database, where the vector database is used to store the image representation and text representation mapped to a unified vector space, and pairs of image representation and text representation are bound by a unique identifier.
[0083] Since vector retrieval is required, vector databases designed specifically for efficient retrieval can use databases such as Faiss, Annoy, or Milvus. These databases optimize approximate nearest neighbor (ANN) search and can provide fast and accurate retrieval performance in large-scale datasets. For retrieval-based datasets, the top 5 nearest neighbors of the target text embedding are found by applying a ternary affine transformer as a retriever. It is worth noting that for both training and test samples, the target samples are excluded from the retrieval information, which avoids any access to the target data during the training and inference stages.
[0084] Step 5: Deploy a large multimodal model, such as LLaVA or GPT-4V, and configure the required operating system, software dependencies, and operating environment on a target deployment environment (such as a cloud server or a local server). Train the large multimodal model based on retrieval enhancement to obtain a trained large multimodal model.
[0085] The training process of the multimodal large model is as follows: taking an image and a prompt word as input, the image is subjected to an image embedding model to obtain an image representation, the image representation and the prompt word are input into a trained ternary affine transformer, the text representation with the highest similarity is retrieved from the vector database according to the output result of the ternary affine transformer, a paired image representation and text representation are obtained according to the text representation with the highest similarity, image retrieval and text retrieval are calculated, the image retrieval and text retrieval are used as prompts, and are input into the multimodal large model together with the image representation, and the multimodal large model generates a text answer.
[0086] Among them, the probability of retrieval for:
[0087]
[0088] in, Represents the parameters of the image embedding model and the text embedding model, Represents image representation, represents the function of the natural exponential, Indicates similarity, Indicates The text representation with the highest similarity is retrieved. , Indicates the total number of text representations with the highest similarity, represents image retrieval, Represents text retrieval,
[0089]
[0090]
[0091] in, Indicates that a unique identifier is used with An image representation of the binding.
[0092] Paired image and text representations It is obtained by retrieving the dataset by selecting the top-k neighbor nodes through similarity comparison; Indicates that multiple tensors are concatenated according to the specified dimension. In this embodiment, k=5.
[0093] Loss function for large multimodal models for:
[0094] in, Indicates that in a given image representation , Retrieved Image Retrieval , retrieved text retrieval , and all previously generated output Under the condition of probability; Represents the length of the target sequence output by the multimodal large model; Represents the parameters of the multimodal large model. Optimize the parameters of the multimodal large model by minimizing the prediction error at each position , to improve the overall prediction accuracy. The multimodal large model needs to be able to handle additional embedding inputs and use these embeddings in the visual projection layer to improve the performance of the generation task. During training, the model parameters will be adjusted to minimize the loss function , so that the model can effectively fuse features extracted directly from the input image and related information obtained through retrieval during the generation process.
[0095] In this embodiment, LLaVA is used as the multimodal large model. In actual training, the image representation is handed over to the visual projection layer module of LLaVA to guide the generation process. Image retrieval and text retrieval are used as supplementary information to help improve the modeling of imbalanced events in the training phase. In the inference phase, the retrieval enhancement strategy also provides references related to text prompts to ensure more accurate quality control report generation results. LLaVA is 5.0×10 -5 The learning rate is optimized, and the training is performed for a maximum of 80 epochs, with a batch size of 4 and an evaluation every 100,000 steps.
[0096] Step 6: Deploy a large language model, which is used to perform intent recognition and slot filling on the text answers output by the trained multimodal large model to generate a quality control report. In the intent recognition stage, the large language model identifies the quality control results and analysis process from the text answers output by the multimodal large model; in the slot filling stage, the large language model fills in detailed information such as quality control results, image descriptions, image types, etc. based on the identified quality control results and analysis processes.
[0097] The large language model deployed in this embodiment uses GPT-4, which is cascaded with the trained multimodal large model. GPT-4 recognizes the specific intent of the medical image quality control results (text answers), and fills the corresponding slots in the report template according to these intents to generate a structured report. The slot template needs to define many variables related to quality control. The cascade system optimizes the presentation of information through natural language processing technology, so that the generated report not only contains all the necessary technical information, but also has smooth language and is easy to understand. Schematically, the medical quality control report includes images (original input), as well as keywords such as report number, patient number, examination date, image type, image description, image quality assessment, quality control opinions, and conclusions. The keywords are directly generated by the large language model, and the content of the keywords comes from the output of the multimodal large model and is sorted by the large language model. For example: Image type: X-ray shoulder lateral view. Image description: The image shows a lateral view of the shoulder, including the humeral head, scapula, and part of the clavicle. Image quality assessment: The bone structure is clearly outlined, and no obvious imaging distortion is seen; the exposure is appropriate, the bone and soft tissue contrast is moderate, and the details are discernible. Quality Control Comments: If not medically necessary, it is recommended to remove all non-essential external metal objects before re-photographing. Conclusion: The current images can be used for initial evaluation. However, to ensure the best diagnostic quality, it is recommended to confirm the nature of the foreign body based on medical records and take appropriate action if necessary.
[0098] Step 7: Connect the image embedding model, the trained ternary affine transformer, the vector database, the trained multimodal large model, and the large language model in sequence, connect the image embedding model with the trained multimodal large model to obtain a medical quality control report intelligent generation system; input the image and prompt words into the medical quality control report intelligent generation system to generate a medical quality control report.
[0099] In this embodiment, Figure 3 As shown, a medical quality control report intelligent generation system based on retrieval enhancement is also provided, and the technical scheme adopted is as follows: it is the medical quality control report intelligent generation system in the above-mentioned medical quality control report intelligent generation method based on retrieval enhancement, an image and a prompt word are input into the medical quality control report intelligent generation system, the image is subjected to an image embedding model to obtain an image representation, the image representation and the prompt word are input into a trained ternary affine transformer, and the text representation with the highest similarity is retrieved from the vector database according to the output result of the ternary affine transformer, and paired image representations and text representations are obtained according to the text representation with the highest similarity, and image retrieval and text retrieval are obtained by splicing calculation, and the image retrieval and text retrieval are used as prompts and input into a trained multimodal large model together with the image representation to obtain a text answer, and the text answer is subjected to a large language model to generate a medical quality control report.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for intelligently generating medical quality control reports based on retrieval enhancement. It is characterized in that The following steps are involved: Step 1: Construct image-text pair data for medical image quality control, wherein the image-text pair data is a pair of images and texts, and the text is a description of the image quality control problem of the image; Step 2: construct an image embedding model and a text embedding model, wherein the image embedding model is used to encode the image into a vector of a fixed length to obtain an image representation, and the text embedding model is used to encode the text into a text vector of a fixed length to obtain a text representation; Step 3: construct a ternary affine transformer, and train the ternary affine transformer using the prompt word, image representation, and text representation to obtain a trained ternary affine transformer, wherein the ternary affine transformer is used to align the prompt word, image representation, and text representation, and map the image representation and text representation to a unified vector space; The ternary affine transformer includes N superimposed text affines and N superimposed image prompt word cross affines, the text affine includes a self-attention module A, a normalization module, a feedforward neural network module A and a residual connection module A connected in sequence, the image prompt word cross affine includes a self-attention module B, a cross attention module, a feedforward neural network module B and a residual connection module B connected in sequence, the text is represented as the input of the text affine, the image is represented as the input of the image prompt word cross affine, the prompt word is the input of all the cross attention modules, and the self-attention module A of the text affine and the self-attention module B of the image prompt word cross affine at the corresponding position share weights; In step 3, the contrastive learning loss function is calculated based on the output of the last text affine and the last image prompt word cross affine. : in, represents the function of the natural exponential, Represents the temperature coefficient, and the paired image representation and text representation are considered as positive samples , unpaired image representations and text representations are considered as negative samples ; The last text affine and the last image prompt word cross affine of the ternary affine transformer are both connected to the feedforward neural network module C, and the image-text discrimination loss function is calculated according to the output of the feedforward neural network module C. : in, Represents all images and text representation The values of are weighted average or expected calculation, represents the full set of data samples, y represents whether the input comes from the true label of the same image-text pair, express The probability of occurrence, represents the cross entropy function; Step 4: deploying a vector database, wherein the vector database is used to store the image representation and text representation mapped to a unified vector space, and pairs of image representation and text representation are bound by a unique identifier; Step 5: deploying a multimodal large model, and training the multimodal large model based on retrieval enhancement to obtain a trained multimodal large model; In step 5, the training process of the multimodal large model is as follows: taking an image and a prompt word as input, the image is subjected to an image embedding model to obtain an image representation, the image representation and the prompt word are input into a trained ternary affine transformer, the text representation with the highest similarity is retrieved from the vector database according to the output result of the ternary affine transformer, a paired image representation and text representation are obtained according to the text representation with the highest similarity, image retrieval and text retrieval are calculated, the image retrieval and text retrieval are used as prompts, and are input into the multimodal large model together with the image representation; Probability of retrieval for: in, Represents the parameters of the image embedding model and the text embedding model, Represents image representation, represents the function of the natural exponential, Indicates similarity, Indicates The text representation with the highest similarity among the retrieved ones is , Indicates the total number of text representations with the highest similarity, represents image retrieval, Represents text retrieval, in, Indicates that a unique identifier is used with The bound image representation is, Indicates concatenating multiple tensors according to the specified dimension; Step 6: deploy a large language model, which is used to perform intent recognition and slot filling on the text answers output by the trained multimodal large model, and generate a quality control report; Step 7: Connect the image embedding model, the trained ternary affine transformer, the vector database, the trained multimodal large model, and the large language model in sequence, connect the image embedding model with the trained multimodal large model to obtain a medical quality control report intelligent generation system; input the image and prompt words into the medical quality control report intelligent generation system to generate a medical quality control report.
2. The method for intelligently generating medical quality control reports based on retrieval enhancement as claimed in claim 1, It is characterized in that The image embedding model is built based on Vision Transformer or convolutional neural network, and the text embedding model adopts Transformer architecture.
3. The method for intelligently generating medical quality control reports based on retrieval enhancement according to claim 1 or 2, It is characterized in that In step 2, the image represents The way to obtain is: Text Representation The way to obtain is: in, represents the image embedding model, represents the text embedding model, Represents an image, Represents text.
4. The method for intelligently generating medical quality control reports based on retrieval enhancement according to claim 1, It is characterized in that Loss function for large multimodal models for: in, Indicates that in a given image representation , Retrieved Image Retrieval , retrieved text retrieval , and all previously generated output Under the condition of probability; Represents the length of the target sequence output by the multimodal large model; Represents the parameters of the multimodal large model.
5. The method for intelligently generating medical quality control reports based on retrieval enhancement as claimed in claim 1, It is characterized in that In the intent recognition stage, the large language model identifies the quality control results and analysis process from the text answers output by the multimodal large model; in the slot filling stage, the large language model fills in the detailed information based on the identified quality control results and analysis process.
6. An intelligent generation system for medical quality control reports based on retrieval enhancement, It is characterized in that The medical quality control report intelligent generation system in the medical quality control report intelligent generation method based on retrieval enhancement as described in any one of claims 1 to 5, inputs an image and a prompt word into the medical quality control report intelligent generation system, the image is subjected to an image embedding model to obtain an image representation, the image representation and the prompt word are input into a trained ternary affine transformer, the text representation with the highest similarity is retrieved from the vector database according to the output result of the ternary affine transformer, a paired image representation and text representation are obtained according to the text representation with the highest similarity, image retrieval and text retrieval are calculated, the image retrieval and text retrieval are used as prompts, and are input into a trained multimodal large model together with the image representation to obtain a text answer, the text answer is subjected to a large language model to generate a medical quality control report.
Citation Information
Patent Citations
Pre-training method and device for medical multi-modal model
CN114972929A
Medical image quality control method and system based on computer vision technology
CN115762721A
