Medical report generation method, model training method, system, device and medium

By extracting spatial and frequency domain visual features of medical images, combined with medical concepts, and updating model parameters, the problem of low reporting accuracy in the existing technology is solved, more efficient and accurate medical report generation is achieved, and the medical profession is relieved personnel burden.

CN118398155BActive Publication Date: 2024-10-11ANHUI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410842743.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-11
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

Existing medical report generation methods cannot effectively mine subtle features in medical images, resulting in low accuracy of generated reports and low clinical accuracy, increasing medical risks.

Method used

By obtaining comprehensive medical image sets and corresponding report sets, spatial and frequency domain visual features are extracted, and the enhanced fusion network and concept prediction network are used to generate predictive medical reports and concept sets, update model parameters, and combine medical concepts for report generation to improve Accuracy of reporting.

Benefits of technology

It improves the accuracy and efficiency of medical report generation, reduces the burden on medical professionals, enhances the clinical accuracy of reports, and reduces the risk of missed diagnosis and misdiagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118398155B_ABST
    Figure CN118398155B_ABST
Patent Text Reader

Abstract

The present invention provides a method for generating a medical report, a model training method, a system, a device and a medium. The training method includes: obtaining a comprehensive medical image set and a corresponding medical report set and a medical concept set; inputting the comprehensive medical image set into a feature extraction network to extract a spatial visual feature set and a frequency domain visual feature set; inputting the spatial visual feature set and the spatial average visual feature, the frequency domain visual feature set and the frequency domain average visual feature into an enhanced fusion network to obtain a spatial-frequency domain combined feature set; inputting the spatial-frequency domain combined feature set into a concept prediction network to generate a predicted medical concept set; inputting the predicted medical concept set and the spatial-frequency domain combined feature set into a report prediction network to generate a predicted medical report set; updating the parameters of the medical report generation model according to the difference between the predicted medical report set and the medical report set, and the difference between the predicted medical concept set and the medical concept set, to obtain a trained medical report generation model. The quality of the generated medical report is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical image-assisted diagnosis, and in particular to a medical report generation method, a model training method, a system, a device and a medium. Background Art

[0002] Medical images are currently widely used to diagnose and discover potential diseases, so writing a large number of reports based on the analysis of medical images has become an important task in the daily work of radiologists. Since writing medical reports is a time-consuming and requires a lot of expertise, many radiologists bear an excessive workload. This makes radiologists easily fatigued at work and affects the accuracy of diagnosis. Due to the shortage of radiologists, the method of automatically generating medical reports is used to assist diagnosis, reduce the labor intensity of radiologists, and speed up clinical workflow.

[0003] The current mainstream method has the following steps: when training the model, first preprocess the medical images used to generate medical reports; then input the preprocessed medical images into the convolutional neural network model to extract the spatial visual features of the images; then input the visual features of the images and the corresponding medical reports into the language generation model, and train the model to learn how to generate correct medical reports; finally, update the model parameters by calculating the difference between the medical report generated by the model and the real medical report corresponding to the image, and repeat this process until the model is trained. After the model training is completed, it can assist in diagnosis. The medical images to be diagnosed are input into the model, and the model can quickly generate a medical report.

[0004] However, the current mainstream methods ignore the mining of subtle features in medical images and cannot correctly describe the corresponding medical images, resulting in poor accuracy of the final generated medical report. Therefore, it is necessary to provide a medical report generation method, model training method, system, device and medium. Summary of the invention

[0005] The present invention provides a medical report generation model training method to solve the problem that the existing technology cannot mine fine-grained features in images, resulting in low accuracy of generated reports.

[0006] The present invention provides a method for training a medical report generation model, comprising: obtaining a comprehensive medical image set and a corresponding medical report set and a medical concept set; inputting the comprehensive medical image set into a feature extraction network of the medical report generation model to extract a spatial visual feature set and a frequency domain visual feature set; inputting the spatial visual feature set and a preset spatial average visual feature, the frequency domain visual feature set and a preset frequency domain average visual feature into an enhanced fusion network of the medical report generation model to obtain a spatial-frequency domain combined feature set; inputting the spatial-frequency domain combined feature set into a concept prediction network of the medical report generation model to generate a predicted medical concept set; inputting the predicted medical concept set and the spatial-frequency domain combined feature set into a report prediction network of the medical report generation model to generate a predicted medical report set; and updating the parameters of the medical report generation model according to the difference between the predicted medical report set and the medical report set, and the difference between the predicted medical concept set and the medical concept set, to obtain a trained medical report generation model.

[0007] In one embodiment of the present invention, the enhanced fusion network includes a first contrast unit, a second contrast unit, a first enhancement unit, a second enhancement unit and a fusion unit, and the spatial visual feature set and the preset spatial average visual feature, the frequency domain visual feature set and the preset frequency domain average visual feature are input into the enhanced fusion network of the medical report generation model to obtain a spatial-frequency domain combined feature set, including: inputting the spatial visual feature set and the spatial average visual feature into the first contrast unit, and extracting the spatial visual contrast feature set between the spatial visual feature set and the spatial average visual feature based on the weighted similarity of the projection matrix; inputting the spatial visual contrast feature set and the spatial visual feature set into the second contrast unit; An enhancement unit uses a spatial visual contrast feature set to enhance a spatial visual feature set to obtain an enhanced spatial visual feature set; the frequency domain visual feature set and the frequency domain average visual feature are input into the second contrast unit, and based on the weighted similarity of the projection matrix, the frequency domain visual contrast feature set between the frequency domain visual feature set and the frequency domain average visual feature is extracted; the frequency domain visual contrast feature set and the frequency domain visual feature set are input into the second enhancement unit, and the frequency domain visual feature set is enhanced by using the frequency domain visual contrast feature set to obtain an enhanced frequency domain visual feature set; the enhanced spatial visual feature set and the enhanced frequency domain visual feature set are input into the fusion unit, and the two are subjected to feature fusion to obtain a spatial-frequency domain combined feature set.

[0008] In one embodiment of the present invention, the spatial visual feature set and the spatial average visual feature are input into the first comparison unit, and the spatial visual comparison feature set between the spatial visual feature set and the spatial average visual feature is extracted based on the weighted similarity of the projection matrix, including: weighting the spatial visual feature set and the spatial average visual feature based on the projection matrix to obtain a spatial common visual feature set; and obtaining a spatial visual comparison feature set based on the difference between the spatial visual feature set and the spatial common visual feature set.

[0009] In one embodiment of the present invention, the report prediction network includes a medical concept guidance unit and a report generation unit, and the report prediction network inputs the predicted medical concept set and the space-frequency domain combined feature set into the medical report generation model to generate a predicted medical report set, including: inputting the space-frequency domain combined feature set and the predicted medical concept set into the medical concept guidance unit, capturing visual features associated with medical concepts based on a multi-head attention mechanism, and obtaining a comprehensive space-frequency domain combined feature set guided by medical concepts; inputting the comprehensive space-frequency domain combined feature set into the report generation unit, decoding the comprehensive space-frequency domain combined feature set into a text sequence set, and generating a predicted medical report set based on the decoded text sequence set; wherein the report generation unit is a Transformer model.

[0010] In one embodiment of the present invention, the difference between the predicted medical report and the medical report ;in, is the total number of all the generated characters or words. The length of the medical report is set. is the confidence of the jth word or term at the i-th position in the medical report, is the confidence of the jth word or term at the i-th position in the predicted medical report.

[0011] In one embodiment of the present invention, the difference between the predicted medical concept and the medical concept ;in, For the The actual existence of a medical concept in medical images. For medical imaging The predictive value of the existence of a medical concept, is the total number of medical concepts.

[0012] In one embodiment of the present invention, a method for generating a medical report is also provided, the method comprising: obtaining a medical image to be identified; inputting preset spatial average visual features, frequency domain average visual features and the medical image into a trained medical report generation model obtained by any of the above-mentioned medical report generation model training methods to generate a medical report.

[0013] In one embodiment of the present invention, a medical report generation model training system is also provided, the system comprising: a data acquisition module for acquiring a comprehensive medical image set and a corresponding medical report set and a medical concept set; a feature extraction module for inputting the comprehensive medical image set into the feature extraction network of the medical report generation model to extract a spatial visual feature set and a frequency domain visual feature set; a fusion module for inputting the spatial visual feature set and a preset spatial average visual feature, the frequency domain visual feature set and a preset frequency domain average visual feature into the enhanced fusion network of the medical report generation model to obtain a spatial-frequency domain combined feature set; a medical concept prediction module for inputting the spatial-frequency domain combined feature set into the concept prediction network of the medical report generation model to generate a predicted medical concept set; a report prediction module for inputting the predicted medical concept set and the spatial-frequency domain combined feature set into the report prediction network of the medical report generation model to generate a predicted medical report set; a parameter updating module for updating the parameters of the medical report generation model according to the difference between the predicted medical report set and the medical report set, and the difference between the predicted medical concept set and the medical concept set, to obtain a trained medical report generation model.

[0014] In one embodiment of the present invention, an electronic device is also provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements any of the medical report generation model training or medical report generation methods described above.

[0015] In one embodiment of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes any of the medical report generation model training or medical report generation methods described above.

[0016] The present invention proposes a method for generating a medical report, a model training method, a system, a device and a medium. By integrating spatial and frequency domain visual features, the model can not only capture subtle visual differences, but also capture the complex associations between images, thereby providing more comprehensive and multi-dimensional information for the analysis of medical images. In addition, by enhancing the fusion network and combining the preset average visual features, the key information in the image can be further enhanced, thereby improving the quality of the generated medical report. This method improves the accuracy and efficiency of medical report generation and greatly reduces the burden on medical professionals. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of a flow chart of a medical report generation model training method provided by an embodiment of the present invention;

[0018] Figure 2 Shown is an architecture diagram of a medical report generation model in one embodiment of the present invention;

[0019] Figure 3 Shown is a structural block diagram of a medical report generation model training system provided by an embodiment of the present invention;

[0020] Figure 4 Shown is a structural schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0022] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0023] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0024] The existing automatic medical report generation methods have made great progress compared to the initial ones, but there are still some problems: First, they ignore the mining of subtle features in medical images. Unlike natural images, different medical images have small differences in overall content, but it is common that the corresponding medical reports are very different. Existing methods often cannot mine these subtle features, resulting in no significant differences between the generated reports, and cannot correctly describe the situation of the corresponding medical images. Second, the clinical accuracy of the generated reports is not high. Existing methods often pay more attention to the fluency of automatically generated reports, and strive to make the generated reports more like human writing rather than machine generation, but reports with low clinical accuracy often lead to missed diagnoses and misdiagnoses, bringing high medical risks. A few methods consider improving the clinical accuracy of automatically generated reports through knowledge graphs, but the process of building knowledge graphs has a low degree of automation, which itself requires radiologists to invest a lot of time and energy, which runs counter to the purpose of automatic medical report generation. In addition, the quality of the knowledge graph cannot be guaranteed. On the contrary, low-quality knowledge graphs may further reduce the clinical accuracy of automatically generated reports.

[0025] The present invention provides a medical report generation model training method based on medical concept-guided spatial-frequency domain combined representation, which extracts features in the spatial and frequency domains, enhances spatial features using frequency domain features, and obtains contrast information by comparing the feature differences between the current medical image and the standard normal image. This contrast information is used to enhance visual features to reveal subtle visual differences that are difficult to capture in traditional methods. In addition, by aligning medical concepts with corresponding visual areas, the correlation between medical concepts and visual features is established, thereby incorporating potential medical knowledge into visual features and enhancing the clinical accuracy of automatically generated reports.

[0026] See also Figure 1 ,The medical report generation model training method includes the following steps:

[0027] S1. Obtain a comprehensive medical image set and the corresponding medical report set and medical concept set.

[0028] The comprehensive medical image set includes multiple medical images, each of which has a corresponding medical report in the medical report set and a corresponding medical concept sequence list in the medical concept set. Among them, medical images include both abnormal medical images and normal medical images. The types of medical images include but are not limited to X-rays, magnetic resonance imaging (MRI) or computed tomography (CT), etc. Technical personnel in this field can adaptively select the corresponding medical image type based on actual needs, and there is no limitation here. Each medical image has a corresponding medical report in text form, which records the content of the corresponding medical image and the doctor's diagnosis results. Use a word segmentation tool (such as the toolkit spaCy, etc.) to perform word segmentation processing on each medical report to obtain each word appearing in the medical report, and count the word frequency of each word, and delete the word whose word frequency is less than the preset threshold. From the remaining word segmentations, professional radiologists select the word segmentations containing medical knowledge to form a medical concept sequence list. ,in, It is the first participle, is the total number of segmented words in the medical concept sequence table. Since each medical image corresponds to a medical report, after the above processing, each medical image corresponds to a medical concept sequence table. .

[0029] S2. Input the comprehensive medical image set into the feature extraction network of the medical report generation model to extract the spatial domain visual feature set and the frequency domain visual feature set.

[0030] The comprehensive medical image set is input into the feature extraction network of the medical report generation model, and feature extraction is performed in the spatial domain and the frequency domain, respectively, to obtain the spatial domain visual feature set and the frequency domain visual feature set of the comprehensive medical image set. Specifically, the feature extraction network includes a spatial domain feature extraction unit and a frequency domain feature extraction unit, and each medical image in the comprehensive medical image set is preprocessed in the spatial domain to obtain a plurality of preprocessed spatial domain standard medical images, wherein the spatial domain preprocessing process includes but is not limited to downsampling to reduce the image size to a uniform scale, and performing random transformations such as rotation and flipping on the medical image. Each preprocessed spatial domain standard medical image is input into the spatial domain feature extraction unit, and a spatial domain visual feature set is generated by capturing the spatial details in the medical image. Similarly, the comprehensive medical image set is also preprocessed in the frequency domain to obtain a plurality of preprocessed frequency domain standard medical images, wherein the frequency domain preprocessing process includes but is not limited to downsampling to reduce the image size to a uniform scale, and performing discrete cosine transform on each downsampled image. Each pre-processed frequency domain standard medical image is input into the frequency domain feature extraction unit, and a frequency domain visual feature set is generated by identifying the frequency domain features in the image. The spatial domain feature extraction unit and the frequency domain feature extraction unit can be any convolutional neural network. Exemplarily, the spatial domain feature extraction unit and the frequency domain feature extraction unit are ResNet networks with classification layers deleted.

[0031] S3. Input the spatial domain visual feature set and the preset spatial domain average visual feature, the frequency domain visual feature set and the preset frequency domain average visual feature into the enhanced fusion network of the medical report generation model to obtain a spatial-frequency domain combined feature set.

[0032] The spatial visual feature set and the preset spatial average visual features, the frequency domain visual feature set and the preset frequency domain average visual features are input into the enhanced fusion network of the medical report generation model, the spatial visual feature set is enhanced with the spatial average visual features, the frequency domain visual feature set is enhanced with the frequency domain average visual features, and the two enhanced features are fused to obtain a spatial-frequency domain combined feature set. Among them, the spatial average visual features and the frequency domain average visual features are obtained by extracting features from a series of normal (i.e., normal) medical images. Specifically, these normal medical images are subjected to the frequency domain and spatial domain preprocessing steps described in S2 to generate frequency domain standard medical images and spatial domain standard medical images, and feature extraction is performed on these standard medical images to generate frequency domain average visual features and spatial domain average visual features, respectively. Specifically, these spatial domain standard medical images are processed by the preset spatial domain feature extraction network to form a visual feature set. ,in, It is The visual features of standard medical images in Zhang Kongyu, is the total amount of standard medical images in the spatial domain. The spatial average visual feature is calculated according to formula (1): :

[0033] (1)

[0034] In the same way, each frequency domain standard medical image is input into the preset frequency domain feature extraction network to obtain the frequency domain average visual feature It can be understood that the spatial domain feature extraction network and the frequency domain feature extraction network can be any convolutional network. As an example, the spatial domain feature extraction network and the frequency domain feature extraction network are ResNet networks with the classification layer removed.

[0035] The spatial visual feature set and the spatial average visual feature, the frequency domain visual feature set and the frequency domain average visual feature are input into the enhanced fusion network to enhance and fuse the spatial visual feature set and the frequency domain visual feature set with their respective average visual features. The final spatial-frequency domain combined feature set can more comprehensively capture the key information of medical images, thereby improving the accuracy of subsequent medical report generation.

[0036] In one embodiment of the present invention, the enhanced fusion network includes a first contrast unit, a second contrast unit, a first enhancement unit, a second enhancement unit and a fusion unit, and the spatial visual feature set and the preset spatial average visual feature, the frequency domain visual feature set and the preset frequency domain average visual feature are input into the enhanced fusion network of the medical report generation model to obtain the spatial and frequency domain combined feature set, including:

[0037] Inputting the spatial visual feature set and the spatial average visual feature into the first comparison unit, and extracting the spatial visual comparison feature set between the spatial visual feature set and the spatial average visual feature based on the weighted similarity of the projection matrix;

[0038] Inputting the spatial visual contrast feature set and the spatial visual feature set into the first enhancement unit, and using the spatial visual contrast feature set to enhance the spatial visual feature set to obtain an enhanced spatial visual feature set;

[0039] The frequency domain visual feature set and the frequency domain average visual feature are input into the second contrast unit, and based on the weighted similarity of the projection matrix, a frequency domain visual contrast feature set between the frequency domain visual feature set and the frequency domain average visual feature is extracted;

[0040] Inputting the frequency domain visual contrast feature set and the frequency domain visual feature set into the second enhancement unit, and using the frequency domain visual contrast feature set to enhance the frequency domain visual feature set to obtain an enhanced frequency domain visual feature set;

[0041] The enhanced spatial domain visual feature set and the enhanced frequency domain visual feature set are input into the fusion unit, and the two are subjected to feature fusion to obtain a spatial-frequency domain combined feature set.

[0042] Specifically, in one embodiment of the present invention, the spatial visual feature set and the spatial average visual feature are input into the first comparison unit, and based on the weighted similarity of the projection matrix, a spatial visual comparison feature set between the spatial visual feature set and the spatial average visual feature is extracted, including:

[0043] Based on the projection matrix, the spatial visual feature set and the spatial average visual feature are weighted to obtain the spatial common visual feature set;

[0044] According to the difference between the spatial visual feature set and the spatial common visual feature set, a spatial visual contrast feature set is obtained.

[0045] As shown in formula (2), the spatial common visual feature set between the spatial visual feature set and the spatial average visual feature is calculated using the projection matrix weighted :

[0046] (2)

[0047] in, for function, is the preset scaling factor, is the spatial visual feature set, is the spatial average visual feature, , and is a learnable projection matrix. The spatial visual contrast feature set is calculated by formula (3): :

[0048] (3)

[0049] The spatial visual contrast feature set represents the unique features in the spatial visual feature set, which can capture the visual characteristics of pathological changes, thereby improving the accuracy of subsequent diagnosis.

[0050] In the first enhancement unit, the spatial visual contrast feature set is used to enhance the spatial visual feature set, and feature enhancement is performed according to formula (4) to obtain the enhanced spatial visual feature set: :

[0051] (4)

[0052] in, is the learnable projection matrix, To transform the spatial visual feature set And spatial visual contrast feature set Through feature enhancement, the visual information related to the lesion in the medical image can be strengthened, thereby improving the robustness of the model.

[0053] Similarly, the frequency domain visual contrast feature set and the frequency domain visual feature set are input into the second contrast unit. As shown in formula (5), the frequency domain visual common feature set is first obtained by weighting the projection matrix: :

[0054] (5)

[0055] in, , and is the learnable projection matrix, is the frequency domain visual feature set, is the average visual feature in the frequency domain. Then the frequency domain visual contrast feature set can be obtained by formula (6): :

[0056] (6)

[0057] Then, the frequency domain visual contrast feature set and the frequency domain visual feature set are input into the second enhancement unit. As shown in formula (7), the frequency domain visual contrast feature set is used to enhance the frequency domain visual feature set to obtain the enhanced frequency domain visual feature set: :

[0058] (7)

[0059] in, is the learnable projection matrix, Represents the frequency domain visual feature set and frequency domain visual contrast feature set Connection processing. By performing the above feature enhancement in the frequency domain, the model can more easily identify subtle changes in texture, edges, etc., thereby improving the accuracy of the generated medical report. Furthermore, the enhanced spatial domain visual feature set And the enhanced frequency domain visual feature set Through the fusion unit, the features are fused according to formula (8) to obtain the spatial-frequency domain combined feature set V:

[0060] (8)

[0061] The generated space-frequency domain combined feature set can take into account information in both spatial and frequency domain dimensions, thereby providing a more comprehensive visual representation for subsequent analysis to make the model more robust and effective.

[0062] S4. Inputting the spatial-frequency domain combined feature set into the concept prediction network of the medical report generation model to generate a predicted medical concept set.

[0063] The spatial-frequency domain combined feature set is input into the concept prediction network, and a series of medical concepts existing in the medical image are predicted by capturing the relationship between the features in the feature set and the medical concepts. It can be understood that the concept prediction network can be any network structure that can perform classification. For example, the concept prediction network is a fully connected layer and Specifically, the fully connected layer generates N1 natural numbers between negative infinity and positive infinity as outputs, each of which corresponds to a medical concept. These N1 output results are input into Layer, by converting each output into a value between 0 and 1, the probability of the medical concept existing in the corresponding medical image is obtained, thereby forming a set of medical concepts contained in the medical image. .

[0064] S5. Input the predicted medical concept set and the space-frequency domain combined feature set into the report prediction network of the medical report generation model to generate a predicted medical report set.

[0065] The predicted medical concept set and space-frequency domain combined feature set generated above are input into the report prediction network to comprehensively analyze the medical concepts and visual features. Since the space-frequency domain combined feature set contains the key feature information of the spatial and frequency domains of medical images, this feature information accurately reflects the detailed content of the image. Combined with the medical concepts, the generated medical report can be more accurate.

[0066] In one embodiment of the present invention, the report prediction network includes a medical concept guiding unit and a report generating unit, and the step of inputting the predicted medical concept set and the space-frequency domain combined feature set into the report prediction network of the medical report generating model to generate the predicted medical report set includes:

[0067] Inputting the spatial-frequency domain combined feature set and the predicted medical concept set into the medical concept guiding unit, capturing the visual features associated with the medical concepts based on the multi-head attention mechanism, and obtaining a comprehensive spatial-frequency domain combined feature set guided by the medical concepts;

[0068] The comprehensive spatial-frequency domain combined feature set is input into the report generation unit, the comprehensive spatial-frequency domain combined feature set is decoded into a text sequence set, and a predictive medical report set is generated based on the decoded text sequence set; wherein the report generation unit is a Transformer model.

[0069] The spatial-frequency domain combined feature set and the predicted medical concept set are input into the medical concept guidance unit, and the predicted medical concept set can be positioned on the spatial-frequency domain combined feature set by using the multi-head attention mechanism. Specifically, the spatial-frequency domain combined feature set is used as the query vector, and the predicted medical concept set is used as the key vector and value vector. Through the multi-head attention mechanism, a comprehensive spatial-frequency domain combined feature set guided by medical concepts is obtained. , where MHA is a multi-head attention network. Through this mechanism, the model can assign higher weights to the parts of the spatial-frequency domain combined feature set that are related to the predicted medical concept set, so that the visual features with a higher correlation with medical concepts in the generated comprehensive spatial-frequency domain combined feature set are more prominent, greatly improving the directionality of the features.

[0070] Furthermore, the comprehensive spatial-frequency domain combined feature set guided by medical concepts is input into the report generation unit, and the key visual features of medical images and medical concepts are integrated through the multi-head self-attention mechanism to generate a text sequence, and the words appearing in the text sequence are arranged in order to form a medical report. Among them, the text sequence is composed of a series of words arranged in a grammatical order such as sequence.

[0071] S6. According to the difference between the predicted medical report set and the medical report set, and the difference between the predicted medical concept set and the medical concept set, the parameters of the medical report generation model are updated to obtain a trained medical report generation model.

[0072] Specifically, in one embodiment of the present invention, the difference between the predicted medical report set and the medical report set is obtained by predicting the difference between the medical reports and the medical reports. ;in, is the total number of all the generated characters or words. The length of the medical report is set. is the confidence of the jth word or term at the i-th position in the medical report, is the confidence of the jth word or term at the i-th position in the predicted medical report. By comparing the probability of each word appearing in the predicted medical report and the actual medical report, the error between the two can be quantified. During the model training process, the predicted medical report is constantly approaching the actual medical report, thereby improving the accuracy of medical report generation. In addition, in one embodiment of the present invention, the difference between the predicted medical concept set and the medical concept set is obtained by the difference between the predicted medical concept and the medical concept. ;in, For the The actual existence of a medical concept in medical images. For medical imaging The predictive value of the existence of a medical concept, is the total number of medical concepts. The cross entropy loss between the predicted medical concepts and the actual medical concepts is calculated to measure the accuracy of the model's prediction of medical concepts.

[0073] By weighting the above two losses, the total loss of the medical report generation model is obtained ,in, and To balance the hyperparameters of the two loss functions, we adjust and , the model can flexibly adjust the degree of emphasis on the accuracy of medical concepts and the quality of generated medical reports. Reasonable setting of these two hyperparameters can prevent the medical report generation model from focusing too much on one aspect and ignoring the other, so as to reduce the risk of overfitting and improve the expressiveness of the model. In the training phase, the total loss L is back-propagated layer by layer in the medical report generation model according to the gradient descent method to update the model parameters. The iterative training is completed until the total loss converges. Among them, the total loss convergence means that the total loss no longer decreases after the model is repeatedly iterated for a preset number of times (such as 5 times).

[0074] In one embodiment of the present invention, a method for generating a medical report is also provided, the generating method comprising:

[0075] Acquire medical images to be identified;

[0076] The preset spatial average visual features, frequency domain average visual features and the medical image are input into a trained medical report generation model obtained by any of the medical report generation model training methods described above to generate a medical report.

[0077] After the medical report generation model is trained, the medical image to be identified, the spatial average visual features extracted from the normal medical image, and the frequency domain average visual features are input into the trained medical report generation model. The model can automatically generate a medical report for the image based on the knowledge learned in the training.

[0078] See also Figure 2 In the present invention, the specific process of generating a medical report based on the medical image to be identified is as follows: the medical image to be identified is input into the feature extraction network of the medical report generation model, and the spatial domain visual features of the medical image are extracted respectively. and frequency domain visual features , the feature extraction network can be a ResNet network with the classification layer removed. In the enhanced fusion network, the spatial visual features are , frequency domain visual features The spatial and frequency domain features of the normal medical images are extracted by the first contrast unit. and spatial average visual features Perform spatial comparison and obtain spatial visual comparison features based on the weighted similarity of the projection matrix Then the spatial visual contrast features are used by the first enhancement unit Enhanced spatial visual features , and obtain the enhanced spatial visual features The second contrast unit transforms the spatial visual features and spatial average visual features Perform frequency domain comparison and obtain frequency domain visual comparison features based on the weighted similarity of the projection matrix Then the frequency domain visual contrast features are used by the second enhancement unit Enhanced frequency domain visual features , and obtain the enhanced frequency domain visual features Through the fusion unit, the enhanced features in the spatial domain and frequency domain are fused to obtain the spatial-frequency domain combined feature V. The spatial-frequency domain combined feature V is input into the prediction network to predict the medical concepts that may exist in the medical image, forming the predicted medical concept . Predictive Medicine Concepts The spatial-frequency domain combined feature V is input into the medical concept guidance unit of the report prediction network to predict the medical concept Positioning on the spatial-frequency domain combined feature V, obtaining the comprehensive spatial-frequency domain combined feature guided by medical concepts . Combine the spatial and frequency domains to The report is input into the report generation unit of the report prediction network to automatically generate a medical report R for the image.

[0079] See also Figure 3The medical report generation model training system 100 includes: a data acquisition module 110, a feature extraction module 120, a fusion module 130, a medical concept prediction module 140, a report prediction module 150 and a parameter update module 160. The data acquisition module 110 is used to obtain a comprehensive medical image set and a corresponding medical report set and a medical concept set. The feature extraction module 120 is used to input the comprehensive medical image set into the feature extraction network of the medical report generation model to extract a spatial visual feature set and a frequency domain visual feature set. The fusion module 130 is used to input the spatial visual feature set and the preset spatial average visual features, the frequency domain visual feature set and the preset frequency domain average visual features into the enhanced fusion network of the medical report generation model to obtain a spatial-frequency domain combined feature set. The medical concept prediction module 140 is used to input the spatial-frequency domain combined feature set into the concept prediction network of the medical report generation model to generate a predicted medical concept set. The report prediction module 150 is used to input the predicted medical concept set and the spatial-frequency domain combined feature set into the report prediction network of the medical report generation model to generate a predicted medical report set. The parameter updating module 160 is used to update the parameters of the medical report generation model according to the difference between the predicted medical report set and the medical report set, and the difference between the predicted medical concept set and the medical concept set, so as to obtain a trained medical report generation model.

[0080] For the specific limitations of the medical report generation model training system, please refer to the limitations of the medical report generation model training method above, which will not be repeated here. Each module in the above-mentioned medical report generation model training system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware format, or can be stored in the memory of the computer device in software format, so that the processor can call the operations corresponding to the above modules.

[0081] It should be noted that, in order to highlight the innovative part of the present invention, the present embodiment does not introduce modules that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other modules in the present embodiment.

[0082] See also Figure 4 The electronic device 1 may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a medical report generation model training program.

[0083] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 12 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as medical report generation model training or medical report generation code, but also can be used to temporarily store data that has been output or is to be output.

[0084] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect various components of the entire electronic device 1, and executes or executes programs or modules stored in the memory 12 (such as medical report generation model training or medical report generation program, etc.), and calls data stored in the memory 12 to execute various functions of the electronic device 1 and process data.

[0085] The processor 13 executes the operating system and various installed applications of the electronic device 1. The processor 13 executes the applications to implement the steps in the above-mentioned medical report generation model training or medical report generation method.

[0086] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a data acquisition module 110, a feature extraction module 120, a fusion module 130, a medical concept prediction module 140, a report prediction module 150, and a parameter update module 160.

[0087] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium, and the computer-readable storage medium can be non-volatile or volatile. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the medical report generation model training or the medical report generation method described in each embodiment of the present application.

[0088] In summary, the present invention discloses a method for generating a medical report, a model training method, a system, a device and a medium, which integrates spatial and frequency domain visual features so that the model can not only capture subtle visual differences, but also capture the complex associations between images, thereby providing more comprehensive and multi-dimensional information for the analysis of medical images. In addition, by enhancing the fusion network and combining the preset average visual features, the key information in the image can be further enhanced, thereby improving the quality of the produced medical reports. This method improves the accuracy and efficiency of medical report generation and greatly reduces the burden on medical professionals. Therefore, the present invention effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.

[0089] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A medical report generation model training method, characterized in that: The method comprises: Obtain a comprehensive medical image set and a corresponding medical report set and a medical concept set; Inputting the comprehensive medical image set into a feature extraction network of a medical report generation model to extract a spatial domain visual feature set and a frequency domain visual feature set; Inputting the spatial domain visual feature set and the preset spatial domain average visual feature, the frequency domain visual feature set and the preset frequency domain average visual feature into the enhanced fusion network of the medical report generation model to obtain a spatial-frequency domain combined feature set; Inputting the spatial-frequency domain combined feature set into the concept prediction network of the medical report generation model to generate a predicted medical concept set; Inputting the predicted medical concept set and the space-frequency domain combined feature set into the report prediction network of the medical report generation model to generate a predicted medical report set; According to the difference between the predicted medical report set and the medical report set, and the difference between the predicted medical concept set and the medical concept set, the parameters of the medical report generation model are updated to obtain a trained medical report generation model; The enhanced fusion network includes a first contrast unit, a second contrast unit, a first enhancement unit, a second enhancement unit and a fusion unit. The spatial visual feature set and the preset spatial average visual feature, the frequency domain visual feature set and the preset frequency domain average visual feature are input into the enhanced fusion network of the medical report generation model to obtain a spatial-frequency domain combined feature set, including: Inputting the spatial visual feature set and the spatial average visual feature into the first comparison unit, and extracting the spatial visual comparison feature set between the spatial visual feature set and the spatial average visual feature based on the weighted similarity of the projection matrix; Inputting the spatial visual contrast feature set and the spatial visual feature set into the first enhancement unit, and using the spatial visual contrast feature set to enhance the spatial visual feature set to obtain an enhanced spatial visual feature set; The frequency domain visual feature set and the frequency domain average visual feature are input into the second contrast unit, and based on the weighted similarity of the projection matrix, a frequency domain visual contrast feature set between the frequency domain visual feature set and the frequency domain average visual feature is extracted; Inputting the frequency domain visual contrast feature set and the frequency domain visual feature set into the second enhancement unit, and using the frequency domain visual contrast feature set to enhance the frequency domain visual feature set to obtain an enhanced frequency domain visual feature set; The enhanced spatial domain visual feature set and the enhanced frequency domain visual feature set are input into the fusion unit, and the two are subjected to feature fusion to obtain a spatial-frequency domain combined feature set.

2. The medical report generation model training method according to claim 1, characterized in that: The step of inputting the spatial visual feature set and the spatial average visual feature into the first comparison unit, and extracting the spatial visual comparison feature set between the spatial visual feature set and the spatial average visual feature based on the weighted similarity of the projection matrix, comprises: Based on the projection matrix, the spatial visual feature set and the spatial average visual feature are weighted to obtain the spatial common visual feature set; According to the difference between the spatial visual feature set and the spatial common visual feature set, a spatial visual contrast feature set is obtained.

3. The medical report generation model training method according to claim 1, characterized in that: The report prediction network includes a medical concept guiding unit and a report generating unit. The report prediction network inputs the predicted medical concept set and the space-frequency domain combined feature set into the medical report generating model to generate the predicted medical report set, including: Inputting the spatial-frequency domain combined feature set and the predicted medical concept set into the medical concept guiding unit, capturing the visual features associated with the medical concepts based on the multi-head attention mechanism, and obtaining a comprehensive spatial-frequency domain combined feature set guided by the medical concepts; The comprehensive spatial-frequency domain combined feature set is input into the report generation unit, the comprehensive spatial-frequency domain combined feature set is decoded into a text sequence set, and a predictive medical report set is generated based on the decoded text sequence set; wherein the report generation unit is a Transformer model.

4. The medical report generation model training method according to claim 1, characterized in that: The difference between the predicted medical report set and the medical report set is obtained by predicting the difference between the medical reports and the medical reports. ;in, is the total number of all the generated characters or words. The length of the medical report is set. is the confidence of the jth word or term at the i-th position in the medical report, is the confidence of the jth word or term at the i-th position in the predicted medical report.

5. The medical report generation model training method according to claim 1, characterized in that: The difference between the predicted medical concept set and the medical concept set is obtained by predicting the difference between the predicted medical concepts and the medical concepts. ;in, For the The actual existence of a medical concept in medical images. For medical imaging The predictive value of the existence of a medical concept, is the total number of medical concepts.

6. A method for generating a medical report, characterized in that: The method comprises: Acquire medical images to be identified; The preset spatial average visual features, frequency domain average visual features and the medical image are input into the trained medical report generation model obtained by the medical report generation model training method described in any one of claims 1 to 5 to generate a medical report.

7. A medical report generation model training system, characterized in that: The system comprises: A data acquisition module, used to acquire a comprehensive medical image set and a corresponding medical report set and a medical concept set; A feature extraction module, used for inputting the comprehensive medical image set into a feature extraction network of a medical report generation model to extract a spatial domain visual feature set and a frequency domain visual feature set; A fusion module, used for inputting the spatial domain visual feature set and the preset spatial domain average visual feature, the frequency domain visual feature set and the preset frequency domain average visual feature into the enhanced fusion network of the medical report generation model to obtain a spatial and frequency domain combined feature set; A medical concept prediction module, used for inputting the spatial-frequency domain combined feature set into the concept prediction network of the medical report generation model to generate a predicted medical concept set; A report prediction module, used for inputting the predicted medical concept set and the space-frequency domain combined feature set into the report prediction network of the medical report generation model to generate a predicted medical report set; A parameter updating module, used for updating the parameters of the medical report generation model according to the difference between the predicted medical report set and the medical report set, and the difference between the predicted medical concept set and the medical concept set, so as to obtain a trained medical report generation model; The enhanced fusion network includes a first contrast unit, a second contrast unit, a first enhancement unit, a second enhancement unit and a fusion unit. The spatial visual feature set and the preset spatial average visual feature, the frequency domain visual feature set and the preset frequency domain average visual feature are input into the enhanced fusion network of the medical report generation model to obtain a spatial-frequency domain combined feature set, including: Inputting the spatial visual feature set and the spatial average visual feature into the first comparison unit, and extracting the spatial visual comparison feature set between the spatial visual feature set and the spatial average visual feature based on the weighted similarity of the projection matrix; Inputting the spatial visual contrast feature set and the spatial visual feature set into the first enhancement unit, and using the spatial visual contrast feature set to enhance the spatial visual feature set to obtain an enhanced spatial visual feature set; The frequency domain visual feature set and the frequency domain average visual feature are input into the second contrast unit, and based on the weighted similarity of the projection matrix, a frequency domain visual contrast feature set between the frequency domain visual feature set and the frequency domain average visual feature is extracted; Inputting the frequency domain visual contrast feature set and the frequency domain visual feature set into the second enhancement unit, and using the frequency domain visual contrast feature set to enhance the frequency domain visual feature set to obtain an enhanced frequency domain visual feature set; The enhanced spatial domain visual feature set and the enhanced frequency domain visual feature set are input into the fusion unit, and the two are subjected to feature fusion to obtain a spatial-frequency domain combined feature set.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the medical report generation model training method described in any one of claims 1 to 5 or the medical report generation method described in claim 6.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the medical report generation model training method described in any one of claims 1 to 5 or the medical report generation method described in claim 6.