Ophthalmology ultrasound report generation method and system based on knowledge graph

By constructing an ophthalmology knowledge graph and applying knowledge graph technology, the problems of disease relationship mining and cross-modal information alignment in ophthalmology report generation are solved, the accuracy and quality of the report are improved, and the workload of doctors is reduced.

CN118748058APending Publication Date: 2024-10-08NORTH CHINA UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410907131.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing medical report generation methods lack the relationship mining and cross-modal information alignment between ophthalmic diseases, resulting in low accuracy of generated reports, especially in areas where medical resources are relatively scarce, which affects patient outcomes and treatment.

Method used

The ophthalmology ultrasound report generation method based on knowledge graph is adopted. By constructing a complete ophthalmology knowledge graph, the knowledge graph attention mechanism and the knowledge visual attention mechanism are used to deeply explore the medical relationships between ophthalmic diseases and obtain knowledge-enhanced image features and cross-sensory knowledge graphs. Modal alignment features to generate high-quality ultrasound reports.

Benefits of technology

It improves the quality of ophthalmic ultrasound report generation, reduces doctors' diagnosis and report writing pressure, enhances the clinical reference value of the report, and improves the diagnostic accuracy of ophthalmic diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118748058A_ABST
    Figure CN118748058A_ABST
Patent Text Reader

Abstract

The invention provides an ophthalmology ultrasonic report generation method and system based on a knowledge graph. The method comprises the steps that S1, feature extraction is conducted on an ultrasonic image and a diagnosis report of a sample; s2, constructing a knowledge graph, updating node features of the knowledge graph, and fusing the updated node features and the image features to obtain knowledge enhanced image features; s3, cross-modal alignment features of the knowledge-enhanced image features and the knowledge-enhanced text features are obtained based on a memory matrix; s4, based on the cross-modal alignment feature of the knowledge enhanced image feature and the cross-modal alignment feature of the text feature, outputting an ultrasonic report text through an encoder and a decoder; completing the construction of an ultrasonic report generation model; and S5, inputting the ultrasonic image into the model to generate a corresponding ultrasonic report. The problem that disease relevance and cross-modal information alignment are not considered in an existing medical report generation model is solved, and the quality of generated ultrasonic reports is effectively 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 diagnosis auxiliary technology, and more specifically, to a method and system for generating an ophthalmic ultrasound report based on a knowledge graph. Background Art

[0002] Eyes are important organs of human beings, and there are many types of diseases. In clinical practice, ultrasound images can be used to understand the morphology and structure of the eyes, and preliminary diagnosis can be made for patients with eye diseases, which helps to choose treatment plans. Eye ultrasound images are widely used in ophthalmology to diagnose and evaluate eye diseases such as vitreous opacities and vitreous hemorrhage. Traditional eye ultrasound image diagnosis requires doctors to manually interpret and write reports. Completing a high-quality imaging diagnosis report requires a comprehensive understanding of the normal anatomical structure of the eye and the basic case manifestations of eye diseases, rich relevant medical knowledge and clinical experience. However, the process from diagnosis to report writing is time-consuming and labor-intensive. For some remote areas where medical resources are relatively scarce, due to lack of medical experience or low professional level of ophthalmologists, this will have a certain impact on the patient's medical results and subsequent treatment. Therefore, the study of automatic report generation of eye images is of great significance to reducing the burden on doctors and promoting the development of medical automation.

[0003] With the development of artificial intelligence technology, a variety of deep learning algorithms have been widely used in the field of auxiliary medical diagnosis. The correlation between medical findings is crucial to the clinical accuracy of report generation, but the existing medical report generation methods lack the relationship mining between diseases, which leads to unsatisfactory report generation results; in addition, the process from image to report generation involves two different modalities, and the existing medical report generation model has the problem of difficulty in aligning cross-modal information, resulting in low accuracy of the generated reports. Summary of the invention

[0004] In view of the above problems, the purpose of the present invention is to provide an ophthalmic ultrasound report generation method and system based on a knowledge graph, which has the characteristics of recognizing ultrasound images and generating corresponding diagnostic reports, constructing a complete ophthalmic knowledge graph, deeply exploring the medical relationship between ophthalmic diseases, forming knowledge-enhanced image features, and cross-modally aligning image features and text features of diagnostic reports. It solves the problems of lack of consideration of disease correlation and difficulty in aligning cross-modal information in existing medical report generation models, effectively improves the quality of generated reports, and brings higher reference value to ophthalmologists.

[0005] The present invention provides a method for generating an ophthalmic ultrasound report based on a knowledge graph, comprising the following steps:

[0006] S1: Extract features from the ultrasound image of the sample and its corresponding diagnostic report to obtain image features and text features;

[0007] S2: construct a knowledge graph according to the diagnosis reports in the sample set, use the knowledge graph attention mechanism to update the node features of the knowledge graph, and use the knowledge visual attention mechanism to fuse the updated node features with the image features to obtain knowledge-enhanced image features;

[0008] S3: Obtaining cross-modal alignment features of the knowledge-enhanced image features and the text features based on a memory matrix;

[0009] S4: Based on the cross-modal alignment features of the knowledge-enhanced image features and the cross-modal alignment features of the text features, an encoder and a decoder are used to output the ultrasound report text, thereby completing the construction of an ultrasound report generation model;

[0010] S5: Inputting the ophthalmic examination ultrasound image into the ultrasound report generation model to generate a corresponding ophthalmic ultrasound report.

[0011] In step S1, feature extraction is performed on the ultrasound image of the sample and its corresponding diagnosis report respectively, including:

[0012] A convolutional neural network based on a ResNet101 network architecture pre-trained with an ImageNet dataset is used to extract features of the ultrasound image. After the ultrasound image is input into the convolutional neural network, it is decomposed into regions of equal size. The last convolutional layer of the convolutional neural network extracts regional features of each region, and each of the regional features is connected in series and expanded into a sequence, wherein the sequence represents image features of the ultrasound image.

[0013] The word embedding layer of Transformer is used to convert the diagnostic report into word vectors to extract the text features of the diagnostic report.

[0014] In step S2, a knowledge graph is constructed according to the diagnostic reports in the sample set, including:

[0015] The Jieba word segmentation tool is used to perform word segmentation on the text of the diagnosis report in the sample set, and a word frequency analysis is performed, and the words with the top X frequencies among all words about eye structure and the top Y frequencies among all words about pathological description are used as nodes of the knowledge graph; the nodes are associated according to the medical laws of the diagnosis report to construct the knowledge graph.

[0016] The nodes are associated according to the medical rules of the diagnosis report, including:

[0017] The node of the eye structure is associated with the node of the corresponding pathological description, and the node of the corresponding pathological description is associated with the nodes of other pathological descriptions triggered by it.

[0018] In step S2, the node features of the knowledge graph are updated using a knowledge graph attention mechanism, including:

[0019] The initial feature representation of the node and its neighboring nodes is used as the input of the knowledge graph attention mechanism, the attention coefficient of each neighboring node relative to the node is calculated, each attention coefficient is normalized using the Softmax function, and the initial feature representation of each neighboring node is weighted and summed according to the normalized attention coefficient to update the feature of the node.

[0020] In the step S2, the updated node features and the image features are fused using a knowledge visual attention mechanism, including:

[0021] A knowledge visual attention mechanism is used to calculate the attention representation of the image feature with respect to the node sequence formed by the updated node feature, and based on the attention representation, the knowledge-enhanced image feature is generated through two fully connected layers; wherein a ReLU activation function is provided between the two fully connected layers.

[0022] In the step S3, the cross-modal alignment features of the knowledge-enhanced image features and the text features are respectively obtained based on the memory matrix, including:

[0023] Obtain the distances between the features in the image features after knowledge enhancement and each memory vector in the memory matrix, and extract the nearest K of the distances as the first relevant distances, and form the memory vector of the first relevant distance as the first relevant memory vector; Obtain the distances between the features in the text features and each memory vector in the memory matrix, and extract the nearest K of the distances as the second relevant distances, and form the memory vector of the second relevant distance as the second relevant memory vector;

[0024] Normalizing the first correlation distance to obtain an importance weight of each first correlation distance, thereby obtaining an importance weight of each first correlation memory vector, and normalizing the second correlation distance to obtain an importance weight of each second correlation distance, thereby obtaining an importance weight of each second correlation memory vector;

[0025] A weighted sum is performed on each first relevant memory vector and its importance weight to obtain the cross-modal alignment feature of the knowledge-enhanced image feature, and a weighted sum is performed on each second relevant memory vector and its importance weight to obtain the cross-modal alignment feature of the text feature.

[0026] In the step S4, based on the cross-modal alignment features of the knowledge-enhanced image features and the cross-modal alignment features of the text features, an encoder and a decoder are used to output an ultrasound report text, including:

[0027] Inputting the cross-modal alignment features of the knowledge-enhanced image features into the encoder;

[0028] The decoder sequentially and cyclically inputs the output of the encoder and (t-1) cross-modal alignment features of the text features, and the decoder sequentially predicts and outputs each predicted word, and all the predicted words constitute the ultrasound report text.

[0029] After step S4, it also includes adding a term weighted loss function to the ultrasound report generation model training, calculating the word weight of each term in the diagnostic report set in the diagnostic report by word frequency and inverse document frequency, integrating each word weight into the cross entropy loss function to form the term weighted loss function, and minimizing the term weighted loss function.

[0030] Another aspect of the present invention provides an ophthalmic ultrasound report generation system based on a knowledge graph, comprising:

[0031] Feature extraction module: used to extract features from the ultrasound image of the sample and its corresponding diagnostic report, respectively, to obtain image features and text features;

[0032] Knowledge graph construction module: used to construct a knowledge graph based on the diagnostic reports in the sample set, and update the node features of the knowledge graph using the knowledge graph attention mechanism;

[0033] A knowledge-enhanced image feature acquisition module is used to fuse the updated node features with the image features using a knowledge visual attention mechanism to obtain knowledge-enhanced image features;

[0034] A cross-modal alignment feature acquisition module: used to respectively acquire the cross-modal alignment features of the knowledge-enhanced image features and the text features based on a memory matrix;

[0035] A training report text output module is used to output the ultrasound report text through an encoder and a decoder based on the cross-modal alignment features of the image features enhanced by the knowledge and the cross-modal alignment features of the text features, so as to complete the construction of the ultrasound report generation model;

[0036] Report generation module: used for inputting ophthalmic ultrasound images into the ultrasound report generation model to generate corresponding ophthalmic ultrasound reports.

[0037] The above-mentioned method and system for generating ophthalmic ultrasound reports based on knowledge graph according to the present invention use a large number of samples to construct a complete ophthalmic knowledge graph, deeply explore the medical relationship between ophthalmic diseases, use the knowledge graph attention mechanism to update the node features of the knowledge graph, effectively aggregate node information by assigning different attention weights, and fuse the updated node features with the image features to obtain knowledge-enhanced image features, which can better understand the complex information in the ultrasound image and improve the performance of image processing tasks by combining knowledge; cross-modal alignment of image features and text features of diagnostic reports can alleviate the data deviation problem between the two different modalities of image and text, and help the model generate more accurate reports. The model proposed by the present invention generates a diagnostic report that is more in line with clinical applications based on ultrasound images, which reduces the pressure on doctors to write ophthalmic ultrasound reports in clinical practice.

[0038] In order to achieve the above and related purposes, one or more aspects of the present invention include features that will be described in detail later and are particularly pointed out in the claims. The following description and the accompanying drawings describe some exemplary aspects of the present invention in detail. However, these aspects indicate only some of the various ways in which the principles of the present invention can be used. In addition, the present invention is intended to include all of these aspects and their equivalents. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] By referring to the following description in conjunction with the accompanying drawings, and with a more comprehensive understanding of the present invention, other objects and results of the present invention will become more apparent and easy to understand. In the accompanying drawings:

[0040] Figure 1 It is a flowchart of a method for generating an ophthalmic ultrasound report based on a knowledge graph according to Embodiment 1 of the present invention;

[0041] Figure 2 This is a schematic diagram of the structure of the knowledge graph according to Example 1 of the present invention;

[0042] Figure 3 It is a structural schematic diagram of an ophthalmic ultrasound report generation system based on a knowledge graph according to Embodiment 2 of the present invention;

[0043] The same reference numerals throughout the drawings indicate similar or corresponding features or functions. DETAILED DESCRIPTION

[0044] In the following description, for the purpose of illustration, in order to provide a comprehensive understanding of one or more embodiments, many specific details are set forth. However, it is apparent that these embodiments may also be implemented without these specific details. In other examples, for ease of describing one or more embodiments, known structures and devices are shown in the form of block diagrams.

[0045] The present invention can be subjected to various changes and can have various embodiments, and specific embodiments are illustrated and described in the accompanying drawings. However, the present invention is not limited to the specific implementation, and all changes, equivalents and substitutes falling within the concept and technical scope of the present invention are included, and should be understood to be included.

[0046] Ordinal terms such as first, second, etc. may be used to describe various constituent elements, but the constituent elements are not limited to the terms. The terms are only used to distinguish one constituent element from another constituent element. For example, without departing from the scope of the claims of the present invention, the second constituent element may be named as the first constituent element, and similarly, the first constituent element may be named as the second constituent element. The terms and / or include a combination of multiple associated items or a certain item among multiple associated items.

[0047] It should be understood that when a certain component is mentioned to be "connected" or "contacted" with other components, this includes not only the case where it is directly connected or contacted with other components, but also the case where other components exist in between. Conversely, when a certain component is mentioned to be "directly connected" or "directly contacted" with other components, it should be understood that there are no other components in between.

[0048] In the description of the embodiments, when it is described that a certain component is formed "on or under" another component, on or under includes two components directly contacting each other or at least one other component is arranged and formed between the two components. Moreover, when it is expressed as on or under, it refers to not only the upper direction but also the lower direction based on a certain component.

[0049] The terms used in this application are only used to illustrate specific embodiments and are not intended to limit the present invention. Unless the context clearly provides otherwise, singular expressions include plural expressions. In this application, it should be understood that terms such as "including" or "having" are used to specify the presence of features, numbers, steps, operations, constituent elements, parts or combinations thereof recorded in the specification, and do not preclude the presence or additional possibility of one or more other features, numbers, steps, operations, constituent elements, parts or combinations thereof.

[0050] Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as those generally understood by those skilled in the art. Terms defined in commonly used dictionaries should be interpreted as having the same meaning as in the context of the relevant technology, and if not clearly defined in this application, they should not be interpreted as ideal or overly formal meanings.

[0051] Glossary:

[0052] Knowledge Graph: It is called knowledge domain visualization or knowledge domain mapping map in the library and information industry. It is a series of various graphs that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and mine, analyze, construct, draw and display knowledge and their mutual connections. Node: The basic unit of the graph, representing the entity in the graph. Edge: The line connecting the nodes, representing the relationship between the nodes. Neighbor node: The node directly connected to a specific node.

[0053] ImageNet dataset: is a large visual database used for research in visual object recognition software. More than 14 million image URLs have been manually annotated by ImageNet to indicate the objects in the picture; in at least one million images, bounding boxes are also provided.

[0054] ResNet101 network architecture: It is a deep residual network and one of the ResNet series.

[0055] Transformer model: It is a neural network model structure proposed by Google in 2017 and first applied to machine translation. The goal of machine translation is to convert from source language to target language. The meaning of words can be encoded through the embedding layer. The Transformer model consists of two main parts: encoder and decoder.

[0056] Jieba word segmentation tool: is an open source Chinese word segmentation tool that can segment Chinese text into words.

[0057] Bert (Bidirectional Encoder Representations from Transformers) model: It is an advanced pre-trained language model released by Google at the end of 2018. It is based on the Transformer architecture and uses a multi-layer self-attention mechanism to achieve deep bidirectional representation learning. The BERT model learns rich language knowledge through the pre-training stage, including the meaning of vocabulary, the relationship between words, the structure of sentences, etc. This information is stored in the model in the form of parameters and can be used to understand and generate new texts.

[0058] Knowledge graph attention mechanism: is a mechanism used in graph neural networks that aims to aggregate node information more efficiently by assigning different attention weights. It is very useful in processing graph structured data (such as social networks, molecular structures, knowledge graphs, etc.).

[0059] LeakyReLU function: is a rectified linear unit that maintains linearity in the non-negative part and introduces a small slope (usually a small positive number) in the negative part to prevent the gradient disappearance problem.

[0060] Multi-head attention mechanism: an enhanced attention mechanism widely used in various deep learning models, especially in graph neural networks and Transformer models. The core idea of ​​multi-head attention is to capture different relational features through multiple attention heads, thereby improving the performance and robustness of the model. The basic process of the multi-head attention mechanism is as follows: linear transformation: linear transformation of the input to generate query, key and value vectors; calculation of attention: each head independently calculates the similarity between the query and the key, and then weighted sums the values ​​to generate different attention outputs; splicing: splicing the outputs of all heads; linear transformation: linear transformation of the spliced ​​output again. This mechanism enables the model to focus on different parts of the input on different attention heads and capture richer feature information.

[0061] Knowledge Visual Attention: A technique that combines knowledge graphs and visual attention mechanisms to improve the performance of computer vision tasks such as image classification, object detection, and image description generation. By combining external knowledge (such as knowledge graphs) with visual attention mechanisms, models can more intelligently understand and process complex information in images.

[0062] ReLU activation function: Linear rectification function, also known as rectified linear unit, is a commonly used activation function in artificial neural networks, usually referring to nonlinear functions represented by ramp functions and their variants.

[0063] Memory Matrix: A tool for organizing and managing information, often used to learn and memorize large amounts of information. It helps people organize information in a logical way, making it easier to remember and retrieve. Memory matrices can take many forms, but the most common is a two-dimensional table where rows and columns represent different categories or attributes.

[0064] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0065] Example 1

[0066] Figure 1 It is a flowchart of a method for generating an ophthalmic ultrasound report based on a knowledge graph according to Embodiment 1 of the present invention;

[0067] like Figure 1As shown, the knowledge graph-based ophthalmic ultrasound report generation method proposed in this embodiment can be used to generate ophthalmic ultrasound reports, which helps to accurately identify lesions in ophthalmic ultrasound images and accurately and automatically generate ophthalmic ultrasound reports.

[0068] The method for generating ophthalmic ultrasound reports based on knowledge graph includes the following steps:

[0069] S1: Extract features of the ultrasound image of the sample and its corresponding diagnostic report to obtain image features and text features.

[0070] In order to ensure the comprehensiveness and accuracy of the data, a large number of samples should be collected. The samples in this embodiment include ophthalmic ultrasound images and their diagnostic reports. A total of more than 20,000 ultrasound images and corresponding diagnostic reports were collected, all of which are actual hospital cases. More than 15,000 samples were taken as training sets, more than 2,000 samples were taken as validation sets, and more than 4,000 samples were taken as test sets.

[0071] The ultrasound report generation model constructed in this embodiment is trained using samples in the training set.

[0072] The ultrasound images of the samples in the data set and their corresponding diagnostic reports are converted into numerical representations for feature extraction.

[0073] The feature extraction of ultrasound images may include: using a convolutional neural network with a ResNet101 network architecture pre-trained with the ImageNet dataset as the backbone to extract the features of ultrasound images. First, the ultrasound image is input into the convolutional neural network and decomposed into regions of equal size. The last convolutional layer of the convolutional neural network extracts the regional features x of each region, and each regional feature is concatenated and expanded into a sequence. The obtained sequence is represented as X = {x1, x2, ...x s ,...x s}, x s is the regional feature of the sth region, and the sequence X represents the image features of the ultrasound image.

[0074] The entire image feature extraction process can be formalized as {x1, x2, ...x s ,...x s} = f v (UI), where f v (·) represents the feature extractor, and UI represents the ultrasound image.

[0075] Feature extraction of the diagnosis report may include: using the word embedding layer of Transformer to perform word vector conversion on the diagnosis report and extracting text features of the diagnosis report.

[0076] The diagnostic report is input into the Transformer model, then Y = {y1, y2, ...y t ,...y T} is the result of the word vector transformation of this diagnostic report, and the text features extracted from this diagnostic report. t are the tokens generated by the diagnostic report (a token is an independent word or symbol that is segmented into a text), Y is the set of tokens of this diagnostic report, and T is the length of this diagnostic report. V is the set of tokens extracted from all diagnostic reports in the dataset.

[0077] S2: Build a knowledge graph based on the diagnostic reports in the sample set, use the knowledge graph attention mechanism to update the node features of the knowledge graph, and use the knowledge visual attention mechanism to fuse the updated node features and image features to obtain knowledge-enhanced image features.

[0078] In order to explore the complex relationships between numerous eye structures and pathological descriptions in ophthalmology, such as the relationship between "vitreous body" and "opacity", the relationship between "posterior sclera" and "staphyloma", etc., and to generate ultrasound reports with higher clinical accuracy in the future, this embodiment adopts the construction of an ophthalmic knowledge graph.

[0079] The knowledge graph represents a large number of common clinical abnormalities and normal results, as well as the relationship between eye structures and pathological descriptions. It is composed of nodes and edges connecting these nodes. Nodes represent entities in the knowledge graph. Nodes are set to the names of eye structures and words describing the pathological descriptions of diagnoses. Edges represent the relationship between nodes. Edges are the relationship between eye structures and pathological descriptions. In order to make the connection between nodes closer, bidirectional edges are used to connect adjacent nodes to ensure that information can flow in both directions.

[0080] Constructing a knowledge graph based on the diagnostic reports in the sample set may include: constructing a knowledge graph based on the contents of the diagnostic reports of a large number of samples in the data set, using the Jieba word segmentation tool to segment the text of the diagnostic reports in the data set, and then performing a word frequency analysis, and selecting all words related to eye structure that appear in the top X positions in frequency, and all words related to pathological descriptions that appear in the top Y positions in frequency as nodes of the knowledge graph. Associate each node based on the medical laws and ophthalmic medical knowledge in all diagnostic reports to construct a knowledge graph.

[0081] A large number of diagnostic reports can be segmented into a large number of words, among which words about pathological descriptions and words about eye structure are key words. Pathological descriptions are terms that describe pathological phenomena that may occur on the eye structure. The words about eye structure and words about pathological description that appear more frequently are selected as nodes of the knowledge graph.

[0082] In this embodiment, the first X position is taken as the first 18, and the first 18 eye structure words almost include the main eye structures. The first Y position is taken as the first 44, and the first 44 pathological description words almost include the main examination results, which can cover all situations of ophthalmic ultrasound examination.

[0083] The top 18 words with the highest frequency of occurrence among all eye structure words are defined as nodes 1-18, and the top 44 words with the highest frequency of occurrence among all pathological description words are defined as nodes 19-62, for a total of 62 nodes. The 62 nodes are shown in the following table.

[0084]

[0085]

[0086] Among them, 19-detectable and 55-missing are commonly used action words for ultrasound examination, and are also used as nodes. After the nodes are determined, the nodes are associated according to the medical laws and medical knowledge in the diagnosis report to establish the connection between the nodes. In the knowledge graph, each node can be represented by a number.

[0087] When making specific associations, the nodes of the eye structures can be first associated with the nodes of the corresponding pathological descriptions. For example, the vitreous body can produce pathological manifestations such as turbidity, so the "vitreous body" node can be associated with the "turbidity" node. The posterior sclera can produce pathological manifestations such as staphyloma, so the "posterior sclera" node can be associated with the "staphyloma" node.

[0088] The same eye structure may produce multiple pathological manifestations. In the associated knowledge graph network, the node of the same eye structure may be associated with multiple pathological description nodes, and a pathological description node may also be associated with multiple eye structure nodes.

[0089] Secondly, the corresponding pathological description nodes are associated with the nodes of other pathological descriptions that may be triggered. In medical images, diseases occurring in the same eye structure often show a high correlation. For example, vitreous hemorrhage can cause vitreous opacity, and vitreous opacity and posterior vitreous detachment occur together more frequently. Based on this, the "opaque" node is associated with the "posterior detachment" node, and the "opaque" node is associated with the "blood accumulation" node.

[0090] We can also build a complete knowledge graph based on other ophthalmic medical knowledge association nodes, such as Figure 2 shown.

[0091] Common eye diseases include vitreous opacities, vitreous hemorrhage, posterior vitreous detachment, posterior scleral staphyloma, lens dislocation, vitreous stellate degeneration, retinal detachment, choroidal edema, subretinal hemorrhage, silicone oil filling surgery, choroidal detachment, vitreous hemorrhage organization, vitreous opacities organization, eyeball atrophy, eyeball wall ossification, etc.

[0092] In order to effectively aggregate the information of each node, the knowledge graph attention mechanism is used to calculate the attention weights between the node and each neighboring node in the knowledge graph to update the node features. This may include: obtaining the initial feature representation of each node through BERT; using the initial feature representation of the central node and its neighboring nodes as the input of the knowledge graph attention mechanism, calculating the attention coefficient of each neighboring node relative to the central node, using the Softmax function to normalize each attention coefficient, and weighting and summing the initial feature representation of each neighboring node according to the normalized attention coefficient to update the features of the central node. Each node is treated as a central node and updated.

[0093] Specifically, BERT is a pre-trained language model that can generate an embedding representation for each node. The initial feature representation of the node is obtained through BERT. i , n i Represents the initial feature representation of the i-th node, and all nodes form a sequence KG represents the number of nodes, Indicates n i is a KG×d-dimensional real number set, n1, n2, ...n i Each element is a KG×d-dimensional vector.

[0094] The knowledge graph attention mechanism is used to update the features of each node, and the initial feature representation of node i as the center node and its neighbor nodes is used as the input of the knowledge graph attention mechanism.

[0095] First, calculate the attention coefficient between node i and its neighboring nodes to emphasize the importance of different neighboring nodes to this node. As shown in the following formula:

[0096]

[0097] Q i =n i W Q ,K j =n j W K ,V j =n j W V

[0098] Among them, e ij Represents the attention coefficient of neighbor node j to node i, j∈li , l i is the set of all neighbor nodes associated with node i, n i represents the initial feature representation of node i, n j represents the initial feature representation of neighbor node j, Q i is the query matrix of node i, K j and V j are the key matrix and value matrix of neighbor node j, is the scaling factor, W Q It's Q i The learnable parameters, W K It's K j The learnable parameters, W V Yes V j The learnable parameters.

[0099] Then use the softmax function to normalize the attention coefficients of all neighbor nodes j to ensure that the sum of the attention coefficients of each neighbor node is 1, and obtain the weight distribution of each neighbor node relative to node i, as shown in the following formula:

[0100]

[0101] α ij represents the normalized attention coefficient of the neighboring nodes associated with node i, e ij represents the attention coefficient of neighbor node j to node i, e ik represents the attention coefficient of neighbor node k associated with node i, l i Represents the set of neighbor nodes associated with node i.

[0102] Finally, the initial feature representation of each neighboring node is weighted and summed according to the normalized attention coefficient to update the feature of node i. Node i aggregates the information of each neighboring node, as shown in the following formula:

[0103]

[0104] Among them, n′ i represents the updated feature of node i, α ij represents the normalized attention weight representation of neighbor node j associated with node i, l i represents the set of neighbor nodes associated with node i, W is a learnable parameter, n j Represents the initial feature representation of node j. The updated feature of node i is obtained through the LeakyReLU function.

[0105] In order to obtain more information, the knowledge graph attention mechanism can use a multi-head attention mechanism to update node features, as shown in the following formula:

[0106]

[0107] Among them, || represents the connection operation, is the normalized attention weight of neighbor node j calculated by the kth attention head. There are K attention heads in total. W k is the learnable parameter of the kth attention head, n j represents the initial feature representation of node j, l i represents the set of neighbor nodes associated with node i, n′ i Represents the features of node i after updating using multi-head attention.

[0108] Multi-head attention mechanism, each attention head independently calculates the attention weight and weighted sum. Since each attention head has independent parameters, they can learn different features in different subspaces to capture the diversity of input data. Multiple attention heads can be processed in parallel, allowing the model to process more information in the same time. The parallel use of multiple attention heads enables the model to more effectively capture the complex patterns and relationships of input data.

[0109] Each node is used as node i to update the features, and the updated node set is

[0110]

[0111] In order to enable the model to better understand ultrasound images and express the content of ultrasound images, generate accurate report text, and integrate the node features of the knowledge graph into the ultrasound images, the knowledge-visual attention mechanism can be used to fuse the updated node features and image features to obtain knowledge-enhanced image features.

[0112] Specifically, it may include: using a knowledge visual attention mechanism to calculate the attention representation of the image features about the node sequence formed by the updated node features, and based on the attention representation, generating knowledge-enhanced image features through two fully connected layers; wherein there is a ReLU activation function between the two fully connected layers.

[0113] The knowledge visual attention mechanism is used to calculate the attention of image features and updated node sequences, as shown in the following formula:

[0114]

[0115] Among them, X represents the image feature, N' represents the calculated updated node sequence, and the image feature X is used as the query matrix Q. represents the learnable parameter matrix about Q in the i-th attention head, the node sequence N' as the key matrix W and the value matrix V, represents the learnable parameter matrix about K in the i-th attention head, represents the learnable parameter matrix about V in the i-th attention head, Represents the scaling factor.

[0116] In order to obtain more information, multi-head attention is used to realize image features and updated node sequence knowledge-visual attention representation, as shown in the following formula:

[0117] KVA(X, N′)=[Att1(X, N′), Att2(X, N′),...Att n (X, N′)]W O

[0118] Among them, KVA represents knowledge-visual attention, X represents image features, N' represents the calculated updated node sequence, Att n represents the nth attention head, W o are learnable parameters.

[0119] The knowledge-enhanced image features can be expressed as follows:

[0120] X′=F(KVA(X,N,))

[0121] Among them, X' represents the knowledge-enhanced image feature representation, F is two fully connected layers, and there is a ReLU activation function between the two layers. The image features and the attention of the updated node sequence pass through two fully connected layers, and the final knowledge-enhanced image feature is X'={x'1, x'2,..., x' S},x′ S Represents the sth feature of the knowledge-enhanced image feature.

[0122] The knowledge visual attention mechanism calculates the knowledge embedding attention about image features, combining image features with node features of the knowledge graph to enhance the expressiveness of image features.

[0123] In this embodiment, the knowledge graph attention mechanism is used to update the node features of the knowledge graph, and the central node information is effectively aggregated through the attention weights between nodes to deeply explore the medical relationship between ophthalmic diseases; the knowledge-visual attention is used to calculate the attention between the image features and the updated sequence of node features, and the updated node features are fused with the image features to obtain the knowledge-enhanced image feature representation, which can better understand the complex information in the ultrasound image, and improve the performance of image processing tasks by combining knowledge, and improve the ability to identify clinical abnormalities and normal results. The model integrates text and visual information and uses a complex attention mechanism to enhance feature representation, thereby improving the ability to identify and classify clinical abnormalities and normal results.

[0124] S3: Based on the memory matrix, the cross-modal alignment features of the knowledge-enhanced image features and text features are obtained respectively.

[0125] The knowledge-enhanced image features obtained in S2 and the text features obtained in S1 are fused with the memory matrix. This requires two processes, query and response. Both query and response are performed in multiple threads. Then, the image features and text features after information alignment are output, which helps to generate further image description tasks.

[0126] First, the knowledge-enhanced image features {x′1, x′2, ..., x′ S}、Text features {y1,y2,...,y t-1}, the vectors of the memory matrix are linearly transformed to convert to the same feature dimension to facilitate comparison and calculation operations in the same feature space, as shown in the following formula,

[0127] x″ s = x′ s ·W x , y′ t =y t ·W y , m′ i =m i ·W m

[0128] Among them, x″ s The feature representation of the sth feature of the knowledge-enhanced image feature after linear transformation, x′ s represents the sth feature of the knowledge-enhanced image feature, W x represents the learnable parameters about feature x, y′ t The feature representation of the tth feature after linear transformation of the text feature, y t represents the tth feature of the text feature, W y Represents the feature y t The learnable parameters, m irepresents the feature representation after the linear transformation of the memory vector, m i represents the i-th memory vector, W m represents the learnable parameters about the memory vector m.

[0129] Then execute the query process and add the memory matrix To implement the query process, the memory matrix in this embodiment is a structure for storing information, which includes previously learned feature representations, which may include text features and image features.

[0130] The memory vectors in the query memory matrix that are most relevant to the feature vectors of the image features and the feature vectors of the text features after knowledge enhancement.

[0131] By comparing the feature vector of the linearly transformed image feature with each vector in the memory matrix, the most relevant memory vector about this feature vector is found. By comparing the feature vector in the linearly transformed text feature with each vector in the memory matrix, the most relevant memory vector about this feature vector is found. To calculate the distance between each memory vector and each feature in the image feature, calculate the distance between each memory vector and each feature in the text feature, as shown in the following formula,

[0132]

[0133] in, Represents the distance between the sth feature and the i-th memory vector in the image feature, x″ s represents the sth feature of the image after linear transformation, represents the transpose of the i-th memory vector after linear transformation, represents the scaling factor; Represents the distance between the tth feature in the text feature and the i-th memory vector, y′ t The feature representation of the yth feature representing the text feature after linear transformation. The closer the distance, the greater the correlation, and vice versa.

[0134] The distance between the sth feature in the image feature and each memory vector is calculated as the first distance, until the first distance of each feature in the image feature is calculated; the distance between the tth feature in the text feature and each memory vector is calculated as the second distance, until the second distance of each feature in the text feature is calculated.

[0135] The K closest first distances are extracted as the first relevant distances, and the memory vectors of the K first relevant distances are formed as the first relevant memory vectors of this feature. The K closest second distances are extracted as the second relevant distances, and the memory vectors of the K second relevant distances are formed as the second relevant memory vectors of this feature.

[0136] The two extracted correlation distances are normalized respectively, and the importance weight of each first correlation distance is calculated, and the importance weight of each second correlation distance is calculated, as shown in the following formula:

[0137]

[0138] in, represents the distance between the sth feature in the image feature and the i-th memory vector (one of the first correlation distances), Represents the distance between the sth feature in the image feature and the jth memory vector, and the value of j is 1-K. express Importance weights of all first correlation distances relative to the sth feature; represents the distance between the t-th feature in the text feature and the i-th memory vector (one of the second related distances), Represents the distance between the tth feature in the text feature and the jth memory vector, and the value of j is 1-K. express Importance weights of all second correlation distances relative to the t-th feature.

[0139] Calculating the importance weight of each of the K first related distances of the feature vector in the image feature is equivalent to calculating the importance weight of each first related memory vector of this feature relative to this feature. Calculating the importance weight of each of the K second related distances of the feature vector in the text feature is equivalent to calculating the importance weight of each second related memory vector of this feature relative to this feature.

[0140] Then, the response process is executed, which is the stage of processing and outputting the query results.

[0141] Perform a linear transformation on each first related memory vector, perform a linear transformation on each second related memory vector,

[0142]

[0143] in, Represents the i-th first related memory vector of the s-th feature in the image feature, express The learnable parameters of express Representation after linear transformation; represents the i-th second related memory vector of the t-th feature in the text feature, express The learnable parameters of express The representation after linear transformation.

[0144] Then, each first relevant memory vector after linear transformation and its importance weight are weighted and summed to obtain the cross-modal alignment feature of each feature in the image feature after knowledge enhancement. Each second relevant memory vector after linear transformation and its importance weight are weighted and summed to obtain the cross-modal alignment feature of each feature in the text feature, as shown in the following formula:

[0145]

[0146] in, The representation of the jth first related memory vector of the sth feature of the image feature after linear transformation, represents the importance weight of the jth first relevant memory vector for the sth feature. There are K first relevant memory vectors in total. represents the memory response of the sth feature;

[0147] The j-th second related memory vector of the t-th feature representing the text feature is linearly transformed. represents the importance weight of the jth second relevant memory vector for the tth feature. There are K second relevant memory vectors in total. represents the memory response of the t-th feature.

[0148] is the final cross-modal alignment feature of the sth feature in the image feature, is the final cross-modal alignment feature of the tth feature in the text feature. and Both incorporate memory vectors, which are comprehensive representations of image and text information, and contain the correlation and alignment information between the two. Each feature in the image feature becomes a cross-modal alignment feature, and each feature in the text feature becomes a cross-modal alignment feature.

[0149] S4: Based on the cross-modal alignment features of knowledge-enhanced image features and cross-modal alignment features of text features, the ultrasound report text is output through the encoder and decoder. The ultrasound report generation model is completed.

[0150] The cross-modal alignment features of the knowledge-enhanced image features are input into the encoder, and the output of the encoder and the cross-modal alignment features of the text features are input into the decoder together. The decoder sequentially cyclically inputs the output of the encoder and (t-1) cross-modal alignment features of the text features. The decoder predicts and outputs each predicted word in turn, and all the predicted words constitute the ultrasound report text.

[0151] Each cross-modal alignment feature in the image feature forms a sequence and is input into the Transformer encoder. The main task of the encoder is to convert the input sequence into a series of intermediate state vectors, as shown in the following formula:

[0152]

[0153] where f e (·) represents the encoder, Represents the output of the encoder, that is, the intermediate state vector. The output of the encoder and the sequence formed by the (t-1) cross-modal alignment features of the text features are input into the decoder together. The number of features in this sequence is one less than the total number of features. The decoder predicts and outputs a predicted word. In this way, the decoder predicts and outputs each predicted word in a loop, thereby completing the output of the predicted sequence, as shown in the following formula:

[0154]

[0155] Among them, f d (·) represents the decoder, y t Represents the predicted word, are the (t-1) cross-modal alignment features of the text features.

[0156] The decoder loops in sequence, outputting each predicted word in sequence according to the cross-modal alignment features of text features and the cross-modal alignment features of knowledge-enhanced image features, to form a cross-modal aligned ultrasound report text.

[0157] This step combines the working mechanisms of the encoder and decoder to achieve cross-modal feature processing and target output generation.

[0158] S5: Input the ophthalmic examination ultrasound image into the ultrasound report generation model to generate a corresponding ophthalmic ultrasound report.

[0159] In actual applications, ultrasound doctors input ophthalmic ultrasound images into the ultrasound report generation model of this embodiment, which can automatically generate more accurate diagnosis reports. The effect is better than other automatic medical report generation algorithms and has a good generation effect.

[0160] In addition, in order to solve the long-tail distribution problem in the medical report generation model, in this embodiment, after step S4, the term weighted loss is used to train the model.

[0161] The terms in medical reports usually show a long-tail distribution, that is, some words (such as common medical terms, disease names, symptoms, etc.) appear very frequently, while a large number of professional terms and vocabulary appear less frequently. Although these low-frequency terms appear infrequently, their number is very large, forming the long-tail part of the term distribution.

[0162] During the model training process, they may be masked by high-frequency terms, resulting in poor recognition and generation of these low-frequency terms by the model. In order to effectively handle these low-frequency terms, a weighted loss function is used, in which a higher weight is given to low-frequency terms, so that the model pays more attention to these low-frequency terms during training.

[0163] The word weight of each term in the diagnosis report set is calculated by word frequency and inverse document frequency, and each word weight is integrated into the cross entropy loss function to form the term weighted loss function, and the term weighted loss function is minimized.

[0164] Define the collection of diagnostic reports as Y k Represents the kth diagnostic report in the set, and counts all the terms that appear in the diagnostic report set to form the corresponding term list: y t Denotes the tth term in the term list, using n tk Indicates that the term yt is in the diagnostic report Y k The frequency of occurrence in the word, then the mathematical definitions of term frequency (TF) and inverse document frequency (IDF) are as follows. The inverse document frequency is used to reduce the impact of high-frequency terms on model training, thereby enhancing the weight of low-frequency terms.

[0165]

[0166] Among them, TF tk Indicates that the term yt is in the diagnostic report Y k The word frequency in T t represents the total number of terms in the diagnostic report set; {k: y t ∈Y k} means that condition y is satisfied t ∈Y k The number of reports, T k Indicates the total number of diagnostic reports, IDF t Indicates that it contains the term y t The inverse document frequency of the number of diagnostic reports, then the term y t In the diagnostic report Y k The word weight in is as shown in the following formula:

[0167] yw tk =TF tk IDF t

[0168] The word weight of each term in the diagnosis report can be pre-calculated by the above formula and used represents, and T represents the total number of terms in the diagnosis report.

[0169] These word weights are then integrated into the cross entropy loss to adjust the contribution of each term in the cross entropy loss to form a term-weighted loss function:

[0170]

[0171] Where P(y i |y1,y2,...,y i-1 ,UI) indicates that the model predicts the probability of the i-th term based on the features of the ultrasound image UI corresponding to this diagnostic report and the information of the first i-1 terms. The loss is calculated based on the difference between the predicted i-th term and the true term.

[0172] Finally, by minimizing the term-weighted loss function to train the model, the model is able to better learn and generate these terms, improving the accuracy and comprehensiveness of the model when generating medical reports.

[0173] This knowledge graph-based ophthalmic ultrasound report generation method was trained on a large ophthalmic dataset. The test results showed that the accuracy of ophthalmic ultrasound report generation can be effectively improved by using knowledge graph and cross-modal alignment methods.

[0174] This invention fills the gap in the automatic generation algorithm of medical reports in the research of eye diseases, lays a good foundation for the development of eye medical automation, and helps promote the research and development of deep learning algorithms in auxiliary eye medical diagnosis.

[0175] The present invention is implemented using the Pytorch framework, and the Adam optimizer is used to optimize the network, with the initial learning rate set to 1e-4. The encoder-decoder architecture uses a Transformer structure with 3 layers and 8 attention heads. When executing queries, the number of threads and the hyperparameter K are set to 8 and 32, respectively, for executing the query and response processes. The dimensions of the memory matrix and the number of memory vectors are set to 512 and 2048, respectively, and are randomly initialized. We use a 2-layer 8-attention-head structure to implement knowledge graph attention. The dimension of BERT is 768.

[0176] Example 2

[0177] Figure 3 It is a structural schematic diagram of an ophthalmic ultrasound report generation system based on a knowledge graph according to Embodiment 2 of the present invention;

[0178] like Figure 3 As shown, the knowledge graph-based ophthalmic ultrasound report generation system provided in this embodiment corresponds one-to-one to the knowledge graph-based ophthalmic ultrasound report generation method in Example 1.

[0179] This knowledge graph-based ophthalmic ultrasound report generation system includes a feature extraction module, a knowledge graph construction module, a knowledge-enhanced image feature acquisition module, a cross-modal alignment feature acquisition module, a training output report text module, and a report generation module.

[0180] The feature extraction module is used to extract features from the ultrasound image of the sample and its corresponding diagnosis report respectively to obtain image features and text features. The feature extraction module includes an image feature extraction unit and a text feature extraction unit.

[0181] The image feature extraction unit is used to extract features of ultrasound images using a convolutional neural network based on the ResNet101 network architecture pre-trained with the ImageNet dataset. After the ultrasound image is input into the convolutional neural network, it is decomposed into regions of equal size. The last convolutional layer of the convolutional neural network extracts the regional features of each region, and each regional feature is connected in series and expanded into a sequence. The sequence represents the image features of the ultrasound image.

[0182] The text feature extraction unit is used to convert the diagnostic report into a word vector using the word embedding layer of Transformer and extract the text features of the diagnostic report.

[0183] Knowledge graph construction module: used to construct a knowledge graph based on the diagnostic reports in the sample set, and use the knowledge graph attention mechanism to update the node features of the knowledge graph. The knowledge graph construction module includes a graph building unit and a node updating unit.

[0184] The graph building unit is used to use the Jieba word segmentation tool to perform word segmentation on the text of the diagnosis report in the sample set, and perform word frequency analysis, and use all the words about eye structure that appear in the top X positions and all the words about pathological description that appear in the top Y positions as nodes of the knowledge graph; and associate the nodes according to the medical rules of the diagnosis report to construct a knowledge graph. The nodes are associated according to the medical rules of the diagnosis report, including associating the node of the eye structure with the node of its corresponding pathological description, and associating the node of the corresponding pathological description with the nodes of other pathological descriptions triggered by it.

[0185] The node update unit is used to take the initial feature representation of the node and its neighbor nodes as the input of the knowledge graph attention mechanism, calculate the attention coefficient of each neighbor node relative to the node, normalize each attention coefficient using the Softmax function, and weightedly sum the initial feature representation of each neighbor node according to the normalized attention coefficient to update the node's features.

[0186] Knowledge-enhanced image feature acquisition module: used to fuse the updated node features and image features using the knowledge visual attention mechanism to obtain knowledge-enhanced image features.

[0187] This module uses the knowledge visual attention mechanism to calculate the attention representation of the image features about the node sequence formed by the updated node features. Based on the attention representation, knowledge-enhanced image features are generated through two fully connected layers; there is a ReLU activation function between the two fully connected layers.

[0188] The cross-modal alignment feature acquisition module is used to respectively acquire cross-modal alignment features of knowledge-enhanced image features and text features based on a memory matrix.

[0189] This module obtains the distance between the features in the knowledge-enhanced image features and each memory vector in the memory matrix, and extracts the K closest distances as the first relevant distances, and the memory vector formed by the first relevant distance is the first relevant memory vector; obtains the distance between the features in the text features and each memory vector in the memory matrix, and extracts the K closest distances as the second relevant distances, and the memory vector formed by the second relevant distance is the second relevant memory vector;

[0190] Normalizing the first correlation distance to obtain the importance weight of each first correlation distance, thereby obtaining the importance weight of each first correlation memory vector; normalizing the second correlation distance to obtain the importance weight of each second correlation distance, thereby obtaining the importance weight of each second correlation memory vector;

[0191] A weighted sum is taken for each first relevant memory vector and its importance weight to obtain the cross-modal alignment feature of the knowledge-enhanced image feature, and a weighted sum is taken for each second relevant memory vector and its importance weight to obtain the cross-modal alignment feature of the text feature.

[0192] The module for training and outputting report text is used to train and output ultrasound report text through encoder and decoder based on cross-modal alignment features of image features and text features enhanced by knowledge. The ultrasound report generation model is constructed.

[0193] This module inputs the cross-modal alignment features of knowledge-enhanced image features into the encoder; the decoder sequentially cyclically inputs the output of the encoder and (t-1) cross-modal alignment features of text features, and the decoder predicts and outputs each predicted word in turn, and all predicted words constitute the ultrasound report text.

[0194] The report generation module is used to input the ophthalmic ultrasound image into the ultrasound report generation model to generate the corresponding ophthalmic ultrasound report.

[0195] After training the output report text module, a term weighted loss function module can also be included, which is used to add a term weighted loss function to the model training, calculate the word weight of each term in the diagnostic report set by word frequency and inverse document frequency, integrate each word weight into the cross entropy loss function to form a term weighted loss function, and minimize the term weighted loss function to train the model.

[0196] As described above with reference to the accompanying drawings, the method and system for generating an ophthalmic ultrasound report based on a knowledge graph according to the present invention are described by way of example. However, those skilled in the art should understand that various improvements can be made to the method and system for generating an ophthalmic ultrasound report based on a knowledge graph proposed in the present invention without departing from the content of the present invention. Therefore, the scope of protection of the present invention should be determined by the content of the attached claims.

Claims

1. A method for generating ophthalmic ultrasound reports based on knowledge graph, characterized in that: The following steps are involved: S1: Extract features from the ultrasound image of the sample and its corresponding diagnostic report to obtain image features and text features; S2: construct a knowledge graph according to the diagnosis reports in the sample set, use the knowledge graph attention mechanism to update the node features of the knowledge graph, and use the knowledge visual attention mechanism to fuse the updated node features with the image features to obtain knowledge-enhanced image features; S3: Obtaining cross-modal alignment features of the knowledge-enhanced image features and the text features based on a memory matrix; S4: Based on the cross-modal alignment features of the knowledge-enhanced image features and the cross-modal alignment features of the text features, output the ultrasound report text through an encoder and a decoder; and complete the construction of the ultrasound report generation model; S5: Inputting the ophthalmic examination ultrasound image into the ultrasound report generation model to generate a corresponding ophthalmic ultrasound report.

2. The method for generating an ophthalmic ultrasound report based on a knowledge graph according to claim 1, characterized in that: In step S1, feature extraction is performed on the ultrasound image of the sample and its corresponding diagnosis report respectively, including: A convolutional neural network based on a ResNet101 network architecture pre-trained with an ImageNet dataset is used to extract features of the ultrasound image. After the ultrasound image is input into the convolutional neural network, it is decomposed into regions of equal size. The last convolutional layer of the convolutional neural network extracts regional features of each region, and each of the regional features is connected in series and expanded into a sequence, wherein the sequence represents image features of the ultrasound image. The word embedding layer of Transformer is used to convert the diagnostic report into word vectors to extract the text features of the diagnostic report.

3. The method for generating an ophthalmic ultrasound report based on a knowledge graph according to claim 1, characterized in that: In step S2, a knowledge graph is constructed according to the diagnostic reports in the sample set, including: Use Jieba word segmentation tool to segment the text of the diagnosis report in the sample set, and perform word frequency analysis, and use the words with the top X frequencies among all words related to eye structure and the top Y frequencies among all words related to pathological description as nodes of the knowledge graph; The nodes are associated with each other according to the medical rules of the diagnosis report to construct the knowledge graph.

4. The method for generating an ophthalmic ultrasound report based on a knowledge graph according to claim 3, characterized in that: The nodes are associated according to the medical rules of the diagnosis report, including: The node of the eye structure is associated with the node of the corresponding pathological description, and the node of the corresponding pathological description is associated with the nodes of other pathological descriptions triggered by it.

5. The method for generating an ophthalmic ultrasound report based on a knowledge graph according to claim 1, wherein: In step S2, the node features of the knowledge graph are updated using a knowledge graph attention mechanism, including: The initial feature representation of the node and its neighboring nodes is used as the input of the knowledge graph attention mechanism, the attention coefficient of each neighboring node relative to the node is calculated, each attention coefficient is normalized using the Softmax function, and the initial feature representation of each neighboring node is weighted and summed according to the normalized attention coefficient to update the feature of the node.

6. The method for generating an ophthalmic ultrasound report based on a knowledge graph according to claim 5, characterized in that: In the step S2, the updated node features and the image features are fused using a knowledge visual attention mechanism, including: A knowledge visual attention mechanism is used to calculate the attention representation of the image feature with respect to the node sequence formed by the updated node feature, and based on the attention representation, the knowledge-enhanced image feature is generated through two fully connected layers; wherein a ReLU activation function is provided between the two fully connected layers.

7. The method for generating an ophthalmic ultrasound report based on a knowledge graph according to claim 1, wherein: In the step S3, the cross-modal alignment features of the knowledge-enhanced image features and the text features are respectively obtained based on the memory matrix, including: Obtain the distances between the features in the image features after knowledge enhancement and each memory vector in the memory matrix, and extract the nearest K of the distances as the first relevant distances, and form the memory vector of the first relevant distance as the first relevant memory vector; Obtain the distances between the features in the text features and each memory vector in the memory matrix, and extract the nearest K of the distances as the second relevant distances, and form the memory vector of the second relevant distance as the second relevant memory vector; Normalizing the first correlation distance to obtain an importance weight of each first correlation distance, thereby obtaining an importance weight of each first correlation memory vector, and normalizing the second correlation distance to obtain an importance weight of each second correlation distance, thereby obtaining an importance weight of each second correlation memory vector; A weighted sum is performed on each first relevant memory vector and its importance weight to obtain the cross-modal alignment feature of the knowledge-enhanced image feature, and a weighted sum is performed on each second relevant memory vector and its importance weight to obtain the cross-modal alignment feature of the text feature.

8. The method for generating an ophthalmic ultrasound report based on a knowledge graph according to claim 1, wherein: In the step S4, based on the cross-modal alignment features of the knowledge-enhanced image features and the cross-modal alignment features of the text features, an encoder and a decoder are used to output an ultrasound report text, including: Inputting the cross-modal alignment features of the knowledge-enhanced image features into the encoder; The decoder sequentially and cyclically inputs the output of the encoder and (t-1) cross-modal alignment features of the text features, and the decoder sequentially predicts and outputs each predicted word, and all the predicted words constitute the ultrasound report text.

9. The method for generating an ophthalmic ultrasound report based on a knowledge graph according to claim 1, wherein: After step S4, the method further includes adding a term weighted loss function to the ultrasound report generation model training. The word weight of each term in the diagnostic report set is calculated by word frequency and inverse document frequency, and each word weight is integrated into the cross entropy loss function to form the term weighted loss function, and the term weighted loss function is minimized.

10. An ophthalmic ultrasound report generation system based on knowledge graph, characterized in that: include: Feature extraction module: used to extract features from the ultrasound image of the sample and its corresponding diagnostic report, respectively, to obtain image features and text features; Knowledge graph construction module: used to construct a knowledge graph based on the diagnostic reports in the sample set, and update the node features of the knowledge graph using the knowledge graph attention mechanism; A knowledge-enhanced image feature acquisition module is used to fuse the updated node features with the image features using a knowledge visual attention mechanism to obtain knowledge-enhanced image features; A cross-modal alignment feature acquisition module: used to respectively acquire the cross-modal alignment features of the knowledge-enhanced image features and the text features based on a memory matrix; Training and outputting report text module: used for outputting ultrasound report text through encoder and decoder based on the cross-modal alignment features of the image features enhanced by the knowledge and the cross-modal alignment features of the text features; completing the construction of ultrasound report generation model; Report generation module: used for inputting ophthalmic ultrasound images into the ultrasound report generation model to generate corresponding ophthalmic ultrasound reports.

Citation Information

Cited By

  • Medical report generation method and system based on cross-modal interactive memory network

    CN119626440A

  • Radiology report generation method based on comparative learning and adaptive knowledge integration

    CN120809049A

  • Radiology report generation method based on contrast learning and adaptive knowledge integration

    CN120809049B

  • Postoperative symptom prediction system and device, and storage medium

    CN121306422A