Postoperative risk prediction method and system based on retrieval enhancement and medium

By introducing clinical knowledge retrieval and Cross-Attention information fusion into the postoperative risk prediction framework, the problem of insufficient utilization of semantic information in traditional methods is solved, and the performance and accuracy of postoperative risk prediction are improved.

CN118942695APending Publication Date: 2024-11-12CHENGDU UNIV OF INFORMATION TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410961442.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

Traditional postoperative risk prediction methods fail to make full use of clinical semantic information, resulting in insufficient prediction performance and problems such as dimensional improvement or insufficient use of information in information fusion.

Method used

A postoperative risk prediction framework based on search enhancement was designed. By introducing a clinical knowledge search module, relevant cases are obtained from additional table instance knowledge bases, and they are integrated into the prediction process through semantic representation, and information fusion is carried out using the Cross-Attention method. , enhance postoperative risk prediction performance.

Benefits of technology

The prediction performance of the model is improved, and by effectively integrating the information of the search examples, labels and target instances, the accuracy and efficiency of postoperative risk prediction are improved, and the shortcomings of insufficient utilization of semantic information among instances in the traditional framework are made.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118942695A_ABST
    Figure CN118942695A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of clinical auxiliary decision making, discloses a postoperative risk prediction method and system based on retrieval enhancement and a medium, and aims to assist anesthetists or surgeons in making proper medical resource plans for patients and optimizing distribution of medical resources and realize postoperative risk prediction by constructing a postoperative risk prediction framework. The postoperative risk prediction framework comprises a feature extractor used for converting a table data instance into a text instance, a feature encoder used for encoding the text instance to obtain an instance vector, and a retriever used for retrieving the first k instance vectors most similar to the instance vector output by the feature encoder from an additional knowledge base, the label embedding device is used for embedding labels into vector representation with the same dimension as an instance vector; the fusion device is used for fusing the instance vector output by the retriever and a target instance according to a label embedding vector matrix; and the predictor is used for outputting a prediction result according to a retrieval enhanced target instance vector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of clinical decision support, and more specifically, relates to a postoperative risk prediction method, system and medium based on retrieval enhancement. Background Art

[0002] At present, in the medical field, the traditional postoperative risk prediction framework uses historically accumulated clinical data to build a model based on the mapping relationship between the individual patient's preoperative basic information, laboratory tests and other structured clinical data, as well as preoperative diagnosis, planned surgery and other unstructured data and the risk of postoperative complications, in order to predict whether future patients will have the risk of postoperative complications. Figure 1 As shown in the left figure, only the basic information of the target patient to be predicted, preoperative laboratory test data, preoperative diagnosis information, etc. are used to predict whether the patient will have postoperative complications. That is, the input condition instance and the output prediction result of the prediction model are a one-to-one mapping relationship, and clinical semantic information is not fully utilized.

[0003] From the perspective of clinical practice, when doctors predict postoperative complications for patients, they not only base their predictions on the patient's preoperative information, but also link previous positive and negative clinical cases with similar characteristics to the target patient to comprehensively judge whether the patient will have postoperative complications. That is, doctors will predict whether a patient will have postoperative complications based on the patient's preoperative information and similar clinical cases. The predicted conditional instances and predicted results are in a many-to-one relationship. However, the traditional postoperative risk prediction framework does not consider integrating the above-mentioned empirical knowledge in the prediction process to implement auxiliary decision-making. Summary of the invention

[0004] The present invention is provided to solve the above problems existing in the prior art. Therefore, a postoperative risk prediction method, system and medium based on retrieval enhancement are needed, and a new framework with strong generalization ability is innovatively designed, which is a postoperative risk prediction framework based on retrieval enhancement. The framework introduces a relevant clinical knowledge retrieval module on the basis of the traditional postoperative risk prediction framework, obtains relevant cases from an additional table instance knowledge base, and integrates them into the prediction process through semantic representation, thereby enhancing the postoperative risk prediction performance.

[0005] The present invention can serve as an important component of the perioperative medical system. By predicting in advance whether a patient will have postoperative complications, it can assist anesthesiologists or surgeons in formulating appropriate medical resource plans for patients and optimize the allocation of medical resources. At a deeper level, it can reduce the risk of death due to postoperative complications in patients.

[0006] In order to achieve the above object, the present invention adopts the following technical scheme:

[0007] According to a first embodiment of the present invention, a postoperative risk prediction method based on retrieval enhancement is provided, the method comprising:

[0008] Constructing a postoperative risk prediction framework, and realizing postoperative risk prediction based on the postoperative prediction framework;

[0009] The postoperative risk prediction framework includes:

[0010] A feature extractor, which converts tabular data instances into text instances;

[0011] A feature encoder, used for encoding the text instance to obtain an instance vector;

[0012] A retriever, which is used to retrieve the top k instance vectors that are most similar to the instance vector output by the feature encoder from the additional knowledge base;

[0013] The label embedder is used to embed the label into a vector representation of the same dimension as the instance vector to obtain a label embedding vector matrix;

[0014] A fuser, used to fuse the instance vector output by the retriever with the target instance according to the label embedding vector matrix to obtain a retrieval enhanced target instance vector;

[0015] A predictor is used to output a prediction result according to the retrieved enhanced target instance vector.

[0016] Further, the feature extractor includes a tabular input instance feature extractor and an additional tabular instance knowledge base feature extractor;

[0017] The table input instance feature extractor takes a structured file as input and extracts the field values ​​that are not empty. in Indicates the e-th field value and the corresponding field name in Indicates the e-th field name, concatenates the field name and the corresponding field value to form multiple texts, and concatenates the multiple texts to finally form a sentence description about the instance in Represents the i-th sentence instance;

[0018] The additional table instance knowledge base feature extractor takes the structured document as input, assigns the instances in the knowledge base to the additional positive table instance knowledge base according to the label category of the table instance, and then uses Indicates that represents the uth instance in the additional positive table instance knowledge base, or is assigned to the additional negative table instance knowledge base and then used Indicates that Represents the vth instance in the additional negative instance knowledge base. After the table text converter, the additional positive table instance knowledge base and the additional negative table instance knowledge base are converted into an additional positive sentence instance knowledge base. in represents the u-th sentence instance in the additional positive sentence instance knowledge base, and the additional negative sentence instance knowledge base in Represents the vth sentence instance in the additional negative sentence instance knowledge base.

[0019] Furthermore, encoding the text instance to obtain an instance vector specifically includes:

[0020] For each target sentence instance Additional masculine sentence instance knowledge base X PEK-sent And additional negative sentence instance knowledge base X NEK-sent After embedding, they are converted into d-dimensional semantic vectors Additional positive sentence instance vector knowledge base The size is m×d, where m is the number of positive instances, d is the dimension of the embedding, and there is an additional knowledge base of negative sentence instance vectors The size is e×d, where e is the number of negative instances.

[0021] Furthermore, the top k instance vectors that are most similar to the instance vector output by the feature encoder are retrieved from the additional knowledge base, specifically including:

[0022] The target sentence instance vector The cosine value is calculated with each sentence instance vector in the additional positive sentence instance vector knowledge base and the additional negative sentence instance vector knowledge base, and the cosine value is respectively used Indicates that represents the cosine value of the mth sentence instance vector in the additional positive sentence instance vector knowledge base and the target sentence instance vector, Represents the cosine value of the bth sentence instance vector in the additional negative sentence instance vector knowledge base and the target sentence instance vector;

[0023] According to the cosine value X P_aos , X N_aos Keep additional positive sentence instance vector knowledge base separately Additional Negative Sentence Instance Vector Knowledge Base The first k most similar sentence instance vectors in form the positive sentence instance vector matrix and the negative sentence instance vector matrix

[0024] Furthermore, the label is embedded into a vector representation of the same dimension as the instance vector to obtain a label embedding vector matrix, which specifically includes:

[0025] The positive sentence instance vector matrix and the negative sentence instance vector matrix The corresponding 0 / 1 numerical label Y is mapped to the learnable weight matrix Find the corresponding vector as the embedding vector of the label, where l is the number of label categories, Represents the label embedding vector matrix.

[0026] Further, the instance vector output by the retriever is fused with the target instance according to the label embedding vector matrix to obtain a retrieval enhanced target instance vector, specifically including:

[0027] Using positive label embedding vectors As the query vector source, As the source of the matrix of key and value vectors, and After the positive label query weight matrix W Q_P , positive instance key weight matrix W K_P and the positive instance value weight matrix W V_P Then form the corresponding query vector Q P , key vector matrix K P and the value vector matrix V P :

[0028] Q P With K P The transpose of is multiplied to generate the attention score matrix A P , divide the attention score matrix by the query vector Q P The square root of the dimension The attention score matrix is ​​scaled, and then the attention score matrix is ​​normalized by softmax to obtain the attention distribution matrix. Finally, the attention distribution matrix is ​​multiplied by the value vector matrix to generate a new retrieval instance vector Z that integrates the information of each instance with the label information as the benchmark. P :

[0029] Using target instance to enhance the cross attention fusion component With the new positive retrieval instance vector Z P and the new negative retrieval instance vector Z N Information fusion: First, vector Z P and vector Z N Splice to form a vector matrix , then the vector matrix With the target instance vector Perform Cross-Attention operation, where As the query vector source, As the source of key and value matrices, generate a retrieval-enhanced target instance vector that incorporates the positive and negative instances of each new retrieval based on the target instance information

[0030] Further, the predictor includes two decoding components and a Sigmoid function connected in sequence;

[0031] The decoding component is composed of a fully connected layer plus a layer normalization LayerNorm and a Relu activation function;

[0032] The Sigmoid function converts the final output of the decoding component into a numerical value between [0, 1] to predict whether the target instance is negative or positive.

[0033] According to a second technical solution of the present invention, a postoperative risk prediction system based on retrieval enhancement is provided, the system comprising a processor, and the processor is configured to:

[0034] Constructing a postoperative risk prediction framework, and realizing postoperative risk prediction based on the postoperative prediction framework;

[0035] The postoperative risk prediction framework includes:

[0036] A feature extractor, which converts tabular data instances into text instances;

[0037] A feature encoder, used for encoding the text instance to obtain an instance vector;

[0038] A retriever, which is used to retrieve the top k instance vectors that are most similar to the instance vector output by the feature encoder from the additional knowledge base;

[0039] The label embedder is used to embed the label into a vector representation of the same dimension as the instance vector to obtain a label embedding vector matrix;

[0040] A fuser, used to fuse the instance vector output by the retriever with the target instance according to the label embedding vector matrix to obtain a retrieval enhanced target instance vector;

[0041] A predictor is used to output a prediction result according to the retrieved enhanced target instance vector.

[0042] Further, the feature extractor includes a tabular input instance feature extractor and an additional tabular instance knowledge base feature extractor;

[0043] The table input instance feature extractor takes a structured file as input and extracts the field values ​​that are not empty. in Indicates the e-th field value and the corresponding field name in Indicates the e-th field name, concatenates the field name and the corresponding field value to form multiple texts, and concatenates the multiple texts to finally form a sentence description about the instance in Represents the i-th sentence instance;

[0044] The additional table instance knowledge base feature extractor takes the structured document as input, assigns the instances in the knowledge base to the additional positive table instance knowledge base according to the label category of the table instance, and then uses Indicates that represents the uth instance in the additional positive table instance knowledge base, or is assigned to the additional negative table instance knowledge base and then used Indicates that Represents the vth instance in the additional negative instance knowledge base. After the table text converter, the additional positive table instance knowledge base and the additional negative table instance knowledge base are converted into an additional positive sentence instance knowledge base. in represents the u-th sentence instance in the additional positive sentence instance knowledge base, and the additional negative sentence instance knowledge base in Represents the vth sentence instance in the additional negative sentence instance knowledge base.

[0045] According to a third technical solution of the present invention, a readable storage medium is provided, wherein the readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method as described above.

[0046] The present invention has at least the following beneficial effects:

[0047] (1) Traditional postoperative risk prediction methods usually only use one-to-one information, and there is a problem of insufficient utilization of clinical semantic information. This patent proposes a many-to-one postoperative risk prediction framework based on retrieval enhancement, which makes up for the defect of insufficient utilization of semantic information between instances in traditional frameworks. By retrieving positive and negative sample instances similar to the target instance and adding them to the target instance together with their label semantic information, the semantic information of the target instance can be increased and enriched, thereby improving the prediction performance of the model.

[0048] (2) Regarding the information fusion problem between the retrieved instances, labels and target instances, traditional methods often use simple concatenation or vector addition operations, but there are problems of dimensionality increase or insufficient information utilization. The patent of this invention innovatively uses the Cross-Attention method to solve this fusion problem. First, the label is used as a query vector and its corresponding instance is subjected to a Cross-Attention operation. According to the importance of each instance to the label, the information of each instance is extracted to form a new retrieval instance based on the label information. Subsequently, the target instance is used as a query vector and the new retrieval instance is subjected to a Cross-Attention operation. According to the importance of each new retrieval instance to the target instance, the information of each new retrieval instance is extracted to form a retrieval enhanced target instance based on the target instance information. This fusion method effectively fuses the information between the retrieval instance, label and target instance while ensuring that the dimension does not increase, providing effective fusion information for subsequent decoding and prediction, thereby improving the performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram comparing the traditional postoperative complication risk prediction framework and the postoperative complication risk prediction framework based on retrieval enhancement is shown.

[0050] Figure 2 A structural diagram of a postoperative risk prediction framework based on retrieval enhancement according to an embodiment of the present invention is shown.

[0051] Figure 3 A schematic diagram of a process of a feature extractor for a tabular input instance according to an embodiment of the present invention is shown.

[0052] Figure 4 A schematic diagram of an additional table instance knowledge base feature extractor processing process according to an embodiment of the present invention is shown.

[0053] Figure 5 A schematic diagram of a feature encoder processing process according to an embodiment of the present invention is shown.

[0054] Figure 6 A schematic diagram of a retriever processing process according to an embodiment of the present invention is shown.

[0055] Figure 7 A schematic diagram of a tag embedder processing process according to an embodiment of the present invention is shown.

[0056] Figure 8 A schematic diagram of a fusion device processing process according to an embodiment of the present invention is shown.

[0057] Fig. 9 A schematic diagram of a predictor processing process according to an embodiment of the present invention is shown.

[0058] Fig.10 A structural diagram of a postoperative risk prediction system based on retrieval enhancement according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0059] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and specific embodiments, but are not intended to limit the present invention. For the various steps described herein, if there is no necessity for a causal relationship between each other, the order in which they are described as examples herein should not be regarded as a limitation, and those skilled in the art should know that they can be adjusted in order, as long as the logic between them is not destroyed, resulting in the inability to implement the entire process.

[0060] The embodiment of the present invention proposes a postoperative risk prediction method based on retrieval enhancement, which realizes postoperative risk prediction based on the postoperative prediction framework by constructing a postoperative risk prediction framework. The present invention can be stored in a computer in the form of a computer program product, and specifically, the constructed postoperative risk prediction framework can be stored in a computer in the form of a computer program product, which can be used to assist anesthesiologists or surgeons, comprehensively utilizing the patient's basic information before surgery, structured clinical data such as laboratory tests, and unstructured data such as preoperative diagnosis and planned surgery, to predict whether the patient to be operated on will have a clinical scenario of postoperative complications such as pulmonary complications, cardiovascular adverse events, and acute kidney injury.

[0061] The core of the method proposed in this embodiment is to design a new postoperative risk prediction framework, which is a many-to-one retrieval enhancement framework. First, the framework retrieves k instances of positive and negative patients with similar preoperative information, and then fuses the instances of these 2k patients and their corresponding postoperative complications (i.e., label information) with the preoperative information of the target patient to further predict the occurrence of postoperative complications of the patient. Combining multiple instances and labels of similar positive and negative patients for predictive modeling increases the predictive semantic information of the target patient.

[0062] Considering the advantages of deep learning in feature representation and natural language processing, this embodiment chooses to use deep learning methods to implement the framework. On this basis, this embodiment establishes an additional table instance knowledge base and searches the knowledge base. Finally, the information in the retrieved knowledge base and the corresponding label information are fused with the target instance to enhance the semantic information of the target instance, thereby realizing the postoperative risk prediction of the target patient.

[0063] The structure of the constructed postoperative risk prediction framework is as follows Figure 2As shown in the figure, it mainly includes six types of modules: (1) feature extractor; (2) feature encoder; (3) retriever; (4) label embedder; (5) fusion; and (6) predictor.

[0064] exist Figure 2 In the framework shown, represents the i-th target sentence instance, X PEK-sent represents the additional positive sentence instance knowledge base, X NEK-sent represents the additional knowledge base of negative sentence instances, Is The d-dimensional vector generated by the feature encoding operation, where d represents the embedding length of the text, the same below. Yes X PEK-sent The additional positive sentence instance vector knowledge base generated by the feature encoding operation has a size of m×d, where m is the number of positive instances. Yes X NEK-sent The additional negative sentence instance vector knowledge base generated by the feature encoding operation has a size of b×d, where b is the number of negative sentence instances. Is exist The vector matrix consists of the top k vectors retrieved from , and its size is k×d, where k is the number of instances retrieved from the positive sentence instance vector knowledge base. Is exist The vector matrix consists of the top k vectors retrieved from , and its size is k×d, where k is the number of instances retrieved from the negative sentence instance vector knowledge base. Y is the label corresponding to the retrieved instance. Since this task is a binary classification task, the labels are only 0 and 1, so Y is a vector of length 2. It is the vector matrix formed by Y through the label embedder, and its size is 2×d. Is and The d-dimensional vector formed by the fusion operation. i is the positive probability of the target instance.

[0065] The functions and definitions of each module will be introduced in detail below.

[0066] (1) Feature extractor: In this embodiment, the feature extractor plays a role in converting tabular data instances into text instances. Patients' preoperative information is usually stored in tabular form, but directly using tabular data values ​​as input to the model will lack numerical semantic information. In order to make full use of the semantic information in tabular data and give full play to the advantages of deep learning in the field of text processing, this embodiment adopts a method for converting structured tabular data instances into unstructured text instances. Specifically, the "attribute: value" method is used to serialize tabular data instances. At the same time, this serialization method also effectively handles the problem of missing values. In preoperative examinations, because the conditions of each patient are different, the content of the preoperative examination will also be different. The missing examination items are usually the examinations that the doctor considers unimportant to the patient after the preoperative evaluation, but the final preoperative examination data usually contains all examination items, which leads to the generation of missing values.

[0067] For the missing value problem, the common practice is to use some filling methods, such as mean method, median method, KNN method, etc. However, these filling methods may introduce noise and reduce the prediction performance of the model. Therefore, in this embodiment, the missing fields are deleted and only the fields with values ​​are spliced, thereby avoiding the problems that may be caused by the filling process.

[0068] In this embodiment, the feature extractor consists of two parts: a table input instance feature extractor and an additional table instance knowledge base feature extractor. The detailed processing process is as follows: Figure 3 and Figure 4 shown.

[0069] For the feature extractor of tabular input instances, the input can be structured files such as Excel, CSV, Pickle, etc. First, extract the field values ​​that are not empty (using Represents the field value, where Indicates the e-th field value) and the corresponding field name (with Represents the field name, where Indicates the e-th field name), then use ":" to concatenate the field name and field value to form text, and then use "," to concatenate the text formed by each field name and field value, and finally form a sentence description about the instance (use Indicates that represents the i-th sentence instance).

[0070] For the additional table instance knowledge base feature extractor, the input is also a structured file such as Excel, CSV, Pickle, etc. The difference is that the feature extractor will classify the instances in the knowledge base into an additional positive table instance knowledge base (with Indicates that represents the u-th instance in the additional positive table instance knowledge base) or the additional negative table instance knowledge base (with Indicates that Finally, the additional positive table instance knowledge base and the additional negative table instance knowledge base are converted into an additional positive sentence instance knowledge base (using Indicates that represents the u-th sentence instance in the additional positive sentence instance knowledge base) and the additional negative sentence instance knowledge base (with Indicates that represents the vth sentence instance in the additional negative sentence instance knowledge base).

[0071] (2) Feature encoder: In order to make the sentence instance understandable to the model, it needs to be encoded and converted into a vector form. Common sentence encoding methods include Word2Vec, USE (Universal Sentence Encoder), and the use of pre-trained or domain-tuned BERT (Bidirectional Encoder Representations from Transformers) model. This embodiment uses the distiluse-base-multilingual-cased-v1 model to encode the sentence instance. The detailed processing process is as follows: Figure 5 As shown in the figure, the distiluse-base-multilingual-cased-v1 model is one of the SBERT series models. The SBERT model uses the twin network architecture to fine-tune the BERT model, making it more suitable for processing text semantic similarity tasks.

[0072] Specifically, the target sentence instances are Additional masculine sentence instance knowledge base X PEK-sent , and an additional knowledge base X of negative sentence instances NEK-sent Input into the SBERT model for embedding. Finally, they are converted into d-dimensional semantic vectors Additional positive sentence instance vector knowledge base (with , whose size is m×d, where m is the number of positive instances and d is the dimension of embedding), and an additional knowledge base of negative sentence instance vectors (denoted by , whose size is e×d, where e is the number of negative instances and d is the dimension of the embedding).

[0073] (3) Retrieval: The main function of the retrieval module in this embodiment is to retrieve the top k instances that are most similar to the input instance from the additional knowledge base. This embodiment uses the method of calculating the cosine value as the criterion for judging the similarity between sentence instances. The range of the cosine value is [-1, 1]. The larger the value, the more similar it is. The processing process of the retrieval is as follows: Figure 6 shown.

[0074] Specifically, the target sentence instance vector The cosine value is calculated for each sentence instance vector in the additional positive sentence instance vector knowledge base and the additional negative sentence instance vector knowledge base. The cosine value is calculated using Indicates that represents the cosine value of the mth sentence instance vector in the additional positive sentence instance vector knowledge base and the target sentence instance vector, Represents the cosine value of the bth sentence instance vector in the additional negative sentence instance vector knowledge base and the target sentence instance vector.

[0075] Further, according to the cosine value X p_cos , X N_cos Keep additional positive sentence instance vector knowledge base separately Additional Negative Sentence Instance Vector Knowledge Base The first k most similar sentence instance vectors in form the positive sentence instance vector matrix and the negative sentence instance vector matrix

[0076] (4) Label embedder: The function of the label embedder is to embed the label into a vector representation of the same dimension as the instance so as to combine the label information with the instance information.

[0077] Specifically, the processing process is as follows Figure 7 As shown, the positive sentence instance vector matrix and the negative sentence instance vector matrix The corresponding 0 / 1 numerical label Y is mapped to the learnable weight matrix (with Represents, where l is the number of label categories) to find the corresponding vector as the embedding vector of the label. Represents the label embedding vector matrix.

[0078] (5) Fusion: In order to make full use of the retrieved data and strengthen the semantic information of the target instance, it is necessary to fuse the retrieved data with the target instance. The fusion module of the present invention consists of three components, namely, the cross-attention fusion component between the positive instance and the label, the cross-attention fusion component between the negative instance and the label, and the target instance enhanced cross-attention fusion component.

[0079] First, the function of the cross-attention fusion component between positive instances and labels is to fuse the information between the retrieved positive instances and their labels. Since labels and instances belong to different types and semantics of data, a cross-attention mechanism is used to fuse the information between them. Specifically, the positive label embedding vector As the query vector source, As the source of key and value vector matrices, they are respectively passed through the positive label query weight matrix W Q_P , positive instance key weight matrix W K_P and the positive instance value weight matrix W V_P Then form the corresponding query vector Q P , key vector matrix K P and the value vector matrix V p (The specific calculation process is shown in formula (1)). Then, Q p With K P The transpose of is multiplied to generate the attention score matrix A p In order to stabilize the gradient during training and maintain the normalized characteristics of the attention distribution, the attention score matrix needs to be divided by the query vector Q p The square root of the dimension √d q , scale the attention score matrix, then perform softmax normalization on the attention score matrix to obtain the attention distribution matrix, and finally perform a product operation on the attention distribution matrix and the value vector matrix to generate a new retrieval instance vector Z that integrates the information of each instance with the label information as the benchmark p (The specific calculation process is shown in formula (2)). The function and implementation of the cross-attention fusion component between negative instances and labels are the same as those of the cross-attention fusion component between positive instances and labels.

[0080] Finally, the target instance enhanced cross attention fusion component combines the target instance With the new positive retrieval instance vector Z P and the new negative retrieval instance vector Z N To perform information fusion. Specifically, firstly transform the vector Z P and vector Z N Splice to form a vector matrix , and then compare it with the target instance vector Perform Cross-Attention operation (where, As the query vector source, As the source of the key and value matrix), generate a retrieval-enhanced target instance vector that fuses the positive and negative instances of each new retrieval with the target instance information as the benchmark The specific processing process is as follows Figure 8 shown.

[0081]

[0082]

[0083] (6) Predictor: The predictor in this embodiment can be understood as a decoder module, which consists of a decoding component and a Sigmoid function. The decoding component is used twice, consisting of a fully connected layer plus a layer normalization LayerNorm and a Relu activation function. The introduction of LayerNorm and ReLU can alleviate the problem of gradient vanishing or gradient exploding, accelerate training convergence, and improve the generalization ability of the model.

[0084] Since this task is a binary classification task, the Sigmoid function is used to convert the final output of the decoding component into a value between [0,1] to predict whether the target instance is negative or positive. The specific processing process is as follows Fig. 9 shown.

[0085] Please combine Figure 1 ,contrast Figure 1 The left figure and the right figure in FIG. 1 are different from the traditional prediction framework in the following four aspects:

[0086] ① Added an additional tabular instance knowledge base: In order to provide the model with a retrievable instance knowledge source, we added an additional tabular instance knowledge base, which consists of historical patient medical records.

[0087] ② Added a retriever: In order to retrieve positive and negative instances similar to the target instance, the present invention adds a retriever module. Specifically, the module retrieves the top k positive sentence instance vectors and negative sentence instance vectors that are most similar to the target sentence instance vector from an additional positive sentence instance vector knowledge base and an additional negative sentence instance vector knowledge base, respectively, based on the target sentence instance vector.

[0088] ③ Added label embedding processing: In order to express the semantic information of the label and make it better integrated with the corresponding instance, the label needs to be embedded. For this purpose, the present invention adds a label embedding processor.

[0089] ④ Implementation of the fusion module: The difference between the fusion module in this embodiment and the fusion module in the traditional prediction framework is that the traditional fusion module uses Self-Attention to fuse the feature information within the instance, while the fusion module in this embodiment uses Cross-Attention to fuse the information between different instances and between instances and labels, which is more in line with the requirements of the retrieval enhancement framework.

[0090] Figure 4 FIG. 1 shows a structural diagram of a postoperative risk prediction system based on retrieval enhancement according to an embodiment of the present invention. The embodiment of the present invention provides a postoperative risk prediction system based on retrieval enhancement, such as Fig.10 As shown, the postoperative risk prediction system 1000 based on retrieval enhancement includes a processor 1001, and the processor 1001 is configured to:

[0091] Constructing a postoperative risk prediction framework, and realizing postoperative risk prediction based on the postoperative prediction framework;

[0092] The postoperative risk prediction framework includes:

[0093] A feature extractor, which converts tabular data instances into text instances;

[0094] A feature encoder, used for encoding the text instance to obtain an instance vector;

[0095] A retriever, which is used to retrieve the top k instance vectors that are most similar to the instance vector output by the feature encoder from the additional knowledge base;

[0096] The label embedder is used to embed the label into a vector representation of the same dimension as the instance vector to obtain a label embedding vector matrix;

[0097] A fuser, used to fuse the instance vector output by the retriever with the target instance according to the label embedding vector matrix to obtain a retrieval enhanced target instance vector;

[0098] A predictor is used to output a prediction result according to the retrieved enhanced target instance vector.

[0099] In some embodiments, the feature extractor includes a tabular input instance feature extractor and an additional tabular instance knowledge base feature extractor;

[0100] The table input instance feature extractor takes a structured file as input and extracts the field values ​​that are not empty. in Indicates the e-th field value and the corresponding field name in Indicates the e-th field name, concatenates the field name and the corresponding field value to form multiple texts, and concatenates the multiple texts to finally form a sentence description about the instance in Represents the i-th sentence instance;

[0101] The additional table instance knowledge base feature extractor takes the structured document as input, assigns the instances in the knowledge base to the additional positive table instance knowledge base according to the label category of the table instance, and then uses Indicates that represents the uth instance in the additional positive table instance knowledge base, or is assigned to the additional negative table instance knowledge base and then used Indicates that Represents the vth instance in the additional negative instance knowledge base. After the table text converter, the additional positive table instance knowledge base and the additional negative table instance knowledge base are converted into an additional positive sentence instance knowledge base. in represents the u-th sentence instance in the additional positive sentence instance knowledge base, and the additional negative sentence instance knowledge base in Represents the vth sentence instance in the additional negative sentence instance knowledge base.

[0102] The text instance is encoded to obtain an instance vector, specifically comprising:

[0103] For each target sentence instance Additional masculine sentence instance knowledge base X PEK-sent And additional negative sentence instance knowledge base X NEK-sent After embedding, they are converted into d-dimensional semantic vectors Additional knowledge base of positive sentence instance vectors The size is m×d, where m is the number of positive instances, d is the dimension of the embedding, and there is an additional knowledge base of negative sentence instance vectors The size is e×d, where e is the number of negative instances.

[0104] In some embodiments, retrieving the top k instance vectors most similar to the instance vector output by the feature encoder from the additional knowledge base specifically includes:

[0105] The target sentence instance vector The cosine value is calculated with each sentence instance vector in the additional positive sentence instance vector knowledge base and the additional negative sentence instance vector knowledge base, and the cosine value is respectively used Indicates that represents the cosine value of the mth sentence instance vector in the additional positive sentence instance vector knowledge base and the target sentence instance vector, Represents the cosine value of the bth sentence instance vector in the additional negative sentence instance vector knowledge base and the target sentence instance vector;

[0106] According to the cosine value X P_cos , X N_cos Keep additional positive sentence instance vector knowledge base separately Additional Negative Sentence Instance Vector Knowledge Base The first k most similar sentence instance vectors in form the positive sentence instance vector matrix and the negative sentence instance vector matrix

[0107] In some embodiments, embedding the label into a vector representation of the same dimension as the instance vector to obtain a label embedding vector matrix specifically includes:

[0108] The positive sentence instance vector matrix and the negative sentence instance vector matrix The corresponding 0 / 1 numerical label Y is mapped to the learnable weight matrix Find the corresponding vector as the embedding vector of the label, where l is the number of label categories, Represents the label embedding vector matrix.

[0109] In some embodiments, the instance vector output by the retriever is fused with the target instance according to the label embedding vector matrix to obtain a retrieval enhanced target instance vector, specifically comprising:

[0110] Using positive label embedding vectors As the query vector source, As the source of the matrix of key and value vectors, and After the positive label query weight matrix W Q_P , positive instance key weight matrix W K_P and the positive instance value weight matrix W V_F Then form the corresponding query vector Q P , key vector matrix K P and the value vector matrix V P :

[0111] Q P With K P The transpose of is multiplied to generate the attention score matrix A P , divide the attention score matrix by the query vector Q P The square root of the dimension The attention score matrix is ​​scaled, and then the attention score matrix is ​​normalized by softmax to obtain the attention distribution matrix. Finally, the attention distribution matrix is ​​multiplied by the value vector matrix to generate a new retrieval instance vector Z that integrates the information of each instance with the label information as the benchmark. F :

[0112] Using target instance to enhance the cross attention fusion component With the new positive retrieval instance vector Z Pand the new negative retrieval instance vector Z N Information fusion: First, vector Z P and vector Z N Splice to form a vector matrix , then the vector matrix With the target instance vector Perform Cross-Attention operation, where As the query vector source, As the source of key and value matrices, generate a retrieval-enhanced target instance vector that incorporates the positive and negative instances of each new retrieval based on the target instance information

[0113] In some embodiments, the predictor includes two decoding components and a Sigmoid function connected in sequence;

[0114] The decoding component is composed of a fully connected layer plus a layer normalization LayerNorm and a Relu activation function;

[0115] The Sigmoid function converts the final output of the decoding component into a numerical value between [0, 1] to predict whether the target instance is negative or positive.

[0116] It should be noted that the various system structures described in this embodiment belong to the same technical concept as the previously described method, and achieve the same technical effect through the same principle, which will not be repeated here.

[0117] An embodiment of the present invention further provides a readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the methods described in the above embodiments.

[0118] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. For example, those of ordinary skill in the art can use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the present invention. This should not be interpreted as a feature of an invention that is not claimed for protection being necessary for any claim. On the contrary, the subject matter of the present invention may be less than all the features of the embodiments of a specific invention. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently used as a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present invention should be determined with reference to the full scope of the equivalent forms of the attached claims and these claims.

Claims

1. A postoperative risk prediction method based on retrieval enhancement, characterized in that: The method comprises: Constructing a postoperative risk prediction framework, and realizing postoperative risk prediction based on the postoperative prediction framework; The postoperative risk prediction framework includes: A feature extractor, which converts tabular data instances into text instances; A feature encoder, used for encoding the text instance to obtain an instance vector; A retriever, which is used to retrieve the top k instance vectors that are most similar to the instance vector output by the feature encoder from the additional knowledge base; The label embedder is used to embed the label into a vector representation of the same dimension as the instance vector to obtain a label embedding vector matrix; A fuser, used to fuse the instance vector output by the retriever with the target instance according to the label embedding vector matrix to obtain a retrieval enhanced target instance vector; A predictor is used to output a prediction result according to the retrieved enhanced target instance vector.

2. The method according to claim 1, characterized in that The feature extractor includes a tabular input instance feature extractor and an additional tabular instance knowledge base feature extractor; The table input instance feature extractor takes a structured file as input and extracts the field values ​​that are not empty. in Indicates the e-th field value and the corresponding field name in Indicates the e-th field name, concatenates the field name and the corresponding field value to form multiple texts, and concatenates the multiple texts to finally form a sentence description about the instance in Represents the i-th sentence instance; The additional table instance knowledge base feature extractor takes the structured document as input, assigns the instances in the knowledge base to the additional positive table instance knowledge base according to the label category of the table instance, and then uses Indicates that represents the uth instance in the additional positive table instance knowledge base, or is assigned to the additional negative table instance knowledge base and then used Indicates that Represents the vth instance in the additional negative instance knowledge base. After the table text converter, the additional positive table instance knowledge base and the additional negative table instance knowledge base are converted into an additional positive sentence instance knowledge base. in represents the u-th sentence instance in the additional positive sentence instance knowledge base, and the additional negative sentence instance knowledge base in Represents the vth sentence instance in the additional negative sentence instance knowledge base.

3. The method according to claim 2, characterized in that The text instance is encoded to obtain an instance vector, specifically comprising: For each target sentence instance Additional masculine sentence instance knowledge base X PEK-sent And an additional knowledge base of feminine sentence instances After embedding, they are converted into d-dimensional semantic vectors Additional positive sentence instance vector knowledge base The size is mΔd, where m is the number of positive instances, d is the dimension of the embedding, and there is an additional knowledge base of negative sentence instance vectors The size is e×d, where e is the number of negative instances.

4. The method according to claim 3, characterized in that Retrieve the top k instance vectors that are most similar to the instance vector output by the feature encoder from the additional knowledge base, including: The target sentence instance vector The cosine value is calculated with each sentence instance vector in the additional positive sentence instance vector knowledge base and the additional negative sentence instance vector knowledge base, and the cosine value is respectively used Indicates that represents the cosine value of the mth sentence instance vector in the additional positive sentence instance vector knowledge base and the target sentence instance vector, Represents the cosine value of the bth sentence instance vector in the additional negative sentence instance vector knowledge base and the target sentence instance vector; According to the cosine value X P_ccs , X N_cos Keep additional positive sentence instance vector knowledge base separately Additional Negative Sentence Instance Vector Knowledge Base The first k most similar sentence instance vectors in form the positive sentence instance vector matrix X P-sent-top_h and the negative sentence instance vector matrix 5. The method according to claim 4, characterized in that The label is embedded into a vector representation of the same dimension as the instance vector to obtain the label embedding vector matrix, which specifically includes: The positive sentence instance vector matrix and the negative sentence instance vector matrix The corresponding 0 / 1 numerical label Y is mapped to the learnable weight matrix Find the corresponding vector as the embedding vector of the label, where is the number of label categories, Represents the label embedding vector matrix.

6. The method according to claim 5, characterized in that The instance vector output by the retriever is fused with the target instance according to the label embedding vector matrix to obtain a retrieval enhanced target instance vector, specifically including: Using positive label embedding vectors As the query vector source, As the source of the matrix of key and value vectors, and After the positive label query weight matrix W Q_P , positive instance key weight matrix W K_P and the positive instance value weight matrix W V_F Then form the corresponding query vector Q P , key vector matrix K P and the value vector matrix V P : Q P With K P The transpose of is multiplied to generate the attention score matrix A P , divide the attention score matrix by the query vector Q P The square root of the dimension The attention score matrix is ​​scaled, and then the attention score matrix is ​​normalized by softmax to obtain the attention distribution matrix. Finally, the attention distribution matrix is ​​multiplied by the value vector matrix to generate a new retrieval instance vector Z that integrates the information of each instance with the label information as the benchmark. P : Using target instance to enhance the cross attention fusion component With the new positive retrieval instance vector Z P and the new negative retrieval instance vector Z N Information fusion: First, vector Z P and vector Z N Splice to form a vector matrix Then the vector matrix With the target instance vector Perform Cross-Attention operation, where As the query vector source, As the source of key and value matrices, generate a retrieval-enhanced target instance vector that incorporates the positive and negative instances of each new retrieval based on the target instance information 7. The method according to claim 6, characterized in that The predictor includes two decoding components and a Sigmoid function connected in sequence; The decoding component is composed of a fully connected layer plus a layer normalization LayerNorm and a Relu activation function; The Sigmoid function converts the final output of the decoding component into a numerical value between [0, 1] to predict whether the target instance is negative or positive.

8. A postoperative risk prediction system based on retrieval enhancement, characterized in that: The system includes a processor configured to: Constructing a postoperative risk prediction framework, and realizing postoperative risk prediction based on the postoperative prediction framework; The postoperative risk prediction framework includes: A feature extractor, which converts tabular data instances into text instances; A feature encoder, used for encoding the text instance to obtain an instance vector; A retriever, which is used to retrieve the top k instance vectors that are most similar to the instance vector output by the feature encoder from the additional knowledge base; The label embedder is used to embed the label into a vector representation of the same dimension as the instance vector to obtain a label embedding vector matrix; A fuser, used to fuse the instance vector output by the retriever with the target instance according to the label embedding vector matrix to obtain a retrieval enhanced target instance vector; A predictor is used to output a prediction result according to the retrieved enhanced target instance vector.

9. The system according to claim 8, characterized in that The feature extractor includes a tabular input instance feature extractor and an additional tabular instance knowledge base feature extractor; The table input instance feature extractor takes a structured file as input and extracts the field values ​​that are not empty. in Indicates the e-th field value and the corresponding field name in Indicates the e-th field name, concatenates the field name and the corresponding field value to form multiple texts, and concatenates the multiple texts to finally form a sentence description about the instance in Represents the i-th sentence instance; The additional table instance knowledge base feature extractor takes the structured document as input, assigns the instances in the knowledge base to the additional positive table instance knowledge base according to the label category of the table instance, and then uses Indicates that represents the uth instance in the additional positive table instance knowledge base, or is assigned to the additional negative table instance knowledge base and then used Indicates that Represents the vth instance in the additional negative instance knowledge base. After the table text converter, the additional positive table instance knowledge base and the additional negative table instance knowledge base are converted into an additional positive sentence instance knowledge base. in represents the u-th sentence instance in the additional positive sentence instance knowledge base, and the additional negative sentence instance knowledge base in Represents the vth sentence instance in the additional negative sentence instance knowledge base.

10. A readable storage medium, characterized in that: The readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method according to any one of claims 1 to 7.