Case recommendation method and system based on Mangbar model
Through the Mamba model, the problem of low accuracy of case recommendation in the existing case recommendation system is solved, and the accurate calculation of similarity between patients and capture complex relationships is achieved, and the accuracy and comprehensiveness of case recommendations are improved.
Patent Information
- Application Number
- CN202510552045.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-12
AI Technical Summary
When the existing case recommendation system handles complex clinical cases, it is unable to fully explore the complex relationship between patients, resulting in low accuracy of recommended cases.
The Mamba model is used to fuse multi-source information, and the patient embedded representation is generated through patient feature vector training. The graph network model is constructed for encoding processing, and the recommended cases are calculated using cosine similarity, and structured reports are output in combination with large language models.
It improves the accuracy and comprehensiveness of case recommendations, realizes accurate calculation of similarity between patients and captures complex relationships, and enhances the precision of data processing and the accuracy of case recommendations.
Smart Images

Figure CN120473178A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image segmentation technology, and specifically to a case recommendation method and system based on the Mamba model. Background Art
[0002] With the continuous advancement of medical technology, similar case recommendation systems have been widely used in the medical field. Doctors can use these systems to access a large amount of historical case information to assist in the diagnosis and treatment of new cases.
[0003] Diagnosis based on historical case information relies on multi-source imaging data (such as CT and MRI) and other clinical information (such as pathology reports and laboratory test results). However, current recommendation systems only use a single type of feature (such as text or image information) for similarity calculations and recommend a single type of case. When dealing with complex clinical cases, they often fail to fully explore the complex relationships between patients and cannot fully describe their characteristics, resulting in low accuracy in the final recommended cases.
[0004] Therefore, there is an urgent need for a case recommendation system to improve the accuracy of case recommendations. Summary of the Invention
[0005] In view of this, the embodiments of the present application provide a case recommendation method and system based on the Mamba model, which can effectively integrate multi-source information, accurately calculate the similarity between patients, and use graph network modeling to improve the accuracy of recommendations.
[0006] To achieve the above objectives, in a first aspect, embodiments of the present application provide a case recommendation method based on the Mamba model, comprising:
[0007] Preprocessing is performed based on the cases of multiple patients to obtain a patient embedding representation, where the patient embedding representation corresponds one-to-one with the patient, and the patient embedding representation is generated by training a patient feature vector, where the patient feature vector includes a text feature vector and an image feature vector;
[0008] For data of the same type, similarity is calculated based on the patient embedding representations corresponding to any two patients to generate an initial similarity dataset;
[0009] Constructing a graph network model based on the initial similarity dataset, wherein the graph network model includes a plurality of nodes and a plurality of connecting edges, wherein the node is any patient, and the weight of the connecting edge is the similarity between any two patients;
[0010] The Mamba model is used to encode the graph network model and output the global feature representation of multiple nodes;
[0011] The cosine similarity is calculated based on the global feature representation of multiple nodes to obtain a similarity matrix, and the similarity matrix is used to recommend cases that meet preset conditions, where the preset condition is that the case similarity is not less than a preset value.
[0012] Optionally, the Mamba model is used to encode the graph network model and output global feature representations of multiple nodes, including:
[0013] For any node in the graph network model, multiple subgraphs are generated;
[0014] Add position encoding and structure encoding to node features in multiple subgraphs;
[0015] The node features after position coding and structure coding are spliced together to obtain a spliced coding graph;
[0016] The concatenated encoded graph is vectorized using a message passing neural network to obtain a subgraph vector.
[0017] Sort all nodes and subgraph vectors in the graph network model and input them into the bidirectional selective state space model;
[0018] The Mamba model encodes subgraph sequences and generates global feature representations.
[0019] Optionally, sort all nodes and subgraph vectors in the graph network model, including:
[0020] When the maximum walk length is 0, sort the nodes according to their importance;
[0021] When the maximum walk length is greater than 0, the nodes are sorted according to the hierarchical structure formed by the proximity relationship between the nodes during the subgraph generation process.
[0022] Optionally, the Mamba model encodes the subgraph sequence to generate a global feature representation by comprehensively encoding the subgraph sequence using a bidirectional selective state space model to generate a global feature representation.
[0023] Optionally, preprocessing is performed based on multiple patient cases to obtain patient embedding representations, including:
[0024] Acquiring basic data information of multiple patients, wherein the basic data information includes text information and image information;
[0025] Extract text features from the text information in the basic data information to form a text feature vector, where one feature vector corresponds to one patient;
[0026] Perform image feature extraction on the image information in the basic data information to form an image feature vector;
[0027] splicing the text feature vector and the image feature vector as a patient feature vector, wherein the patient feature vector includes the text feature vector and the image feature vector;
[0028] Patient feature vectors are trained to generate patient embedding representations.
[0029] Optionally, initial similarity calculation is performed on data of the same type represented by the patient embedding. Generating an initial similarity dataset includes:
[0030] Identifying the patient embedding representation using a fully convolutional neural network, where the fully convolutional neural network is trained based on target patient training samples, where the target patient training samples include patient-specific feature information, positive samples corresponding to the specific feature information, and negative samples corresponding to the specific feature information;
[0031] The similarity of the same class information represented by any two patient embeddings is compared to generate an initial similarity dataset.
[0032] Optionally, the fully convolutional neural network is generated in combination with triplet loss.
[0033] Optionally, also include:
[0034] A large language model is used to output a case format that meets a similarity threshold. The large language model receives feedback from doctors, adjusts cyclically, and outputs the results.
[0035] In a second aspect, an embodiment of the present application provides a case recommendation system based on the Mamba model, comprising:
[0036] A preprocessing module is used to perform preprocessing based on the case data of multiple patients to obtain a patient embedding representation, where the patient embedding representation corresponds one-to-one with the patient and is generated by training a patient feature vector, where the patient feature vector includes a text feature vector and an image feature vector;
[0037] An initial similarity determination module is used to calculate the similarity of data of the same type based on the patient embedding representations corresponding to any two patients to generate an initial similarity dataset;
[0038] A graph network model is constructed based on the initial similarity dataset, wherein the graph network model includes a plurality of nodes and a plurality of connecting edges, wherein the nodes are any patients, and the weights of the connecting edges are the similarities between any two patients;
[0039] The Mamba model is used to encode graph network models and output global feature representations of multiple nodes;
[0040] The cosine similarity determination module is used to calculate the cosine similarity based on the global feature representation of multiple nodes to obtain a similarity matrix, and use the similarity matrix to recommend cases that meet preset conditions, where the preset condition is that the case similarity is not less than a preset value.
[0041] Optionally, also include:
[0042] A large language model is used to output a case format that meets a similarity threshold. The large language model receives feedback from doctors, cyclically adjusts, and outputs the results.
[0043] It can be seen that the case recommendation method based on the Mamba model in the present application performs preprocessing on the cases of multiple patients to obtain a patient embedding representation, which is generated through patient feature vector training, and the patient feature vector includes a text feature vector and an image feature vector; for the same type of data, based on the patient embedding representation corresponding to any two patients, similarity calculation is performed to generate an initial similarity data set; based on the initial similarity data set, a graph network model is constructed, and the graph network model includes multiple nodes and multiple connecting edges, the node is any patient, and the connecting edge is the similarity between any two patients; the graph network model is encoded using the Mamba model to output the global feature representation of multiple nodes; the cosine similarity is calculated based on the global feature representation of multiple nodes to obtain a similarity matrix, and the similarity matrix is used to recommend cases that meet the preset conditions, and the preset condition is that the similarity of the case is not less than the preset value.
[0044] The patient embedding representation in this application can be considered to contain both text and image information. It realizes the comprehensive extraction of image and text information in the data acquisition stage, integrates data information from multiple sources, and improves the comprehensiveness of recommended cases. In addition, this application first performs a first similarity calculation to roughly screen the correlation of the data, inputs the data after the first similarity calculation into the bidirectional selective state space model, and compares the cosine similarity of the data processed by the Mamba model again, that is, performs a second similarity calculation. The two data similarity comparisons can effectively screen the data comprehensively, improve the precision of data processing in the case recommendation process, and improve the accuracy of case recommendation. The Mamba model in this application can realize the accurate calculation of the similarity between patients and the capture of complex relationships, further improving the accuracy of similar case recommendations.
[0045] A large language model is used to output a case format that meets the similarity threshold. The large language model accepts feedback from doctors, adjusts and outputs it in a loop. It can be seen that this application also uses a large language model (LLM) to organize case information into a structured and easy-to-understand report format to help doctors quickly obtain key information. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0047] Figure 1 Schematic diagram of the steps of the case recommendation method based on the Mamba model provided in an embodiment of the present application.
[0048] Figure 2 This is a schematic process diagram of another step of the case recommendation method based on the Mamba model provided in an embodiment of the present application.
[0049] Figure 3 This is a module diagram of the case recommendation system based on the Mamba model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0051] refer to Figure 1 , which is a schematic diagram of the steps of the case recommendation method based on the Mamba model in an embodiment of the present application.
[0052] Step S11: Preprocessing is performed based on the cases of multiple patients to obtain a patient embedding representation, where the patient embedding representation corresponds one-to-one with the patient, and the patient embedding representation is generated by training a patient feature vector, where the patient feature vector includes a text feature vector and an image feature vector;
[0053] Step S12: For data of the same type, similarity calculation is performed based on the patient embedding representations corresponding to any two patients to generate an initial similarity dataset;
[0054] Step S13: constructing a graph network model based on the initial similarity dataset, wherein the graph network model includes a plurality of nodes and a plurality of connecting edges, wherein the node is any patient, and the connecting edge is the similarity between any two patients;
[0055] Step S14: Encode the graph network model using the Mamba model and output global feature representations of multiple nodes;
[0056] Step S15: Calculate the cosine similarity based on the global feature representation of multiple nodes to obtain a similarity matrix, and use the similarity matrix to recommend cases that meet a preset condition, where the preset condition is that the case has a similarity not less than a preset value.
[0057] The patient embedding representation in this application can be considered to contain both text and image information. It realizes the comprehensive extraction of image and text information in the data acquisition stage, integrates data information from multiple sources, and improves the comprehensiveness of recommended cases. In addition, this application first performs a first similarity calculation to roughly screen the correlation of the data, inputs the data after the first similarity calculation into the bidirectional selective state space model, and compares the cosine similarity of the data processed by the Mamba model again, that is, performs a second similarity calculation. The two data similarity comparisons can effectively screen the data comprehensively, improve the precision of data processing in the case recommendation process, and improve the accuracy of case recommendation. The Mamba model in this application can realize the accurate calculation of the similarity between patients and the capture of complex relationships, further improving the accuracy of similar case recommendations.
[0058] In order to obtain more accurate relevant cases, Figure 2 As shown, the present application can extract image information or text information from the images and basic information of patient cases, avoiding the situation where cases from that source are excluded when the patient case only has image references or only text references, resulting in insufficient case references. The multi-source data integration process in the present application can provide a good data foundation for the case recommendation process.
[0059] Specifically, the process of extracting the patient's image information or text information in this application can be:
[0060] Step S111: acquiring basic data information of multiple patients, wherein the basic data information includes text information and image information;
[0061] Optionally, pre-process the patient's electronic medical records, examination reports and other text materials, including text extraction, text cleaning, and information integration, to obtain text information such as the patient's name, age, clinical diagnosis, and image information such as imaging manifestations, and jointly determine the text information and image information as basic data information.
[0062] Step S112: extract text features from the text information in the basic data information to form a text feature vector, where one feature vector corresponds to one patient;
[0063] In an optional embodiment, a BERT model (Bidirectional Encoder Representations from Transformers) is used to extract features from the preprocessed patient text data to generate context-aware text feature vectors that can reflect information such as patient symptoms and diagnosis.
[0064] Specifically, the basic data information is converted into word embeddings, position embeddings, and sentence embeddings of the same dimension, and the vectors of the same dimension are superimposed element by element to obtain the input embedding of the basic data information; the input embedding of the basic data information is trained with the BERT model to generate a context-aware word vector representation; the word vectors are aggregated into a vector of fixed dimension using the average pooling method to form a text feature vector for the entire text.
[0065] It’s important to note that the BERT model not only considers the meaning of individual words but also improves its understanding of medical terms and expressions through contextual relationships. Ultimately, the BERT model outputs a feature vector for each piece of text.
[0066] In other optional embodiments, the BERT model can adopt other natural language processing models, such as Transformer or Long Short-Term Memory (LSTM). The above language processing models can be selected according to actual conditions, and this application does not limit this.
[0067] Step S113: extracting image features from the image information in the basic data information to form an image feature vector;
[0068] In an optional embodiment, a ResNet50 model (Residual Network with 50 layers) is used to extract features from the patient's image to form an image feature vector. The vector ResNet50 model has multiple convolutional layers and pooling layers, and also uses residual connections, which can effectively capture the spatial features and detail information in the image while reducing the difficulty of training the deep network; the image feature vector can reflect information such as the location, shape, and texture of the lesion;
[0069] Optionally, the patient's image may be an MRI image or a CT image, and the lesion may include a tumor, a polyp, and the like.
[0070] Step S114: concatenate the text feature vector and the image feature vector to form a patient feature vector, where the patient feature vector includes the text feature vector and the image feature vector;
[0071] Step S115: Train the patient feature vector to generate a patient embedding representation.
[0072] After obtaining the patient embedding representation, we will compare the similarities and exclude some cases with low correlation. Specifically, we will perform initial similarity calculation on the same type of data represented by the patient embedding representation. The generated initial similarity dataset includes:
[0073] Step S121: using a fully convolutional neural network (FCNN) to identify the patient embedding representation, wherein the fully convolutional neural network is trained based on target patient training samples, wherein the target patient training samples include specific feature information of the patient, positive samples corresponding to the specific feature information, and negative samples corresponding to the specific feature information;
[0074] The target patient training samples can be considered as a set of triplets. In this embodiment, a specific feature vector of a patient is randomly selected as an anchor point. According to the clinical diagnosis information in each patient information, the patient feature vector belonging to the same class as the anchor point is selected as a positive sample, and the patient feature vector of a different class from the anchor point is selected as a negative sample. The target patient training samples (anchor point a, positive sample p, negative sample n) are generated according to the above selection process.
[0075] The initial fully convolutional neural network is trained using the target patient training samples obtained above, thereby obtaining a fully convolutional neural network with the ability to recognize specific features. The fully convolutional neural network has multiple fully connected layers, which can more effectively capture the feature differences and similarities between patients.
[0076] In a further optional embodiment, the fully convolutional neural network is generated in combination with triplet loss (Triplet Loss), and the FCNN model is optimized by Triplet Loss so that the distance between the anchor point and the positive sample is as small as possible, and the distance between the anchor point and the negative sample is as large as possible, so that the network can better understand the similarities and differences between different regions in the image, thereby improving the segmentation performance.
[0077] The triplet loss calculation formula is as follows:
[0078] Triplet Loss=L=max(0,d(a,p)-d(a,n)+α) Formula 1
[0079] Among them, d(a,p) is the Euclidean distance between the anchor point and the positive sample, d(a,n) is the Euclidean distance between the anchor point and the negative sample, α is the minimum margin, and L is the triplet loss.
[0080] After obtaining the triplet loss, the full convolutional neural network is optimized and trained. The specific process can be:
[0081] Forward propagation calculates the triplet loss of the current batch, and then backpropagates to adjust the network weights to minimize the loss and update the parameters of the fully convolutional neural network to improve the embedding vector's ability to judge patient similarity.
[0082] The specific steps of back propagation can be: calculating the partial derivatives of the loss with respect to the anchor point, positive sample and negative sample embedding vectors Use the chain rule to propagate backward from the embedding layer and calculate the gradient of each weight in the fully convolutional neural network for each embedding vector to calculate the total gradient After obtaining the total gradient, the stochastic gradient descent algorithm is used to update the network weights of the fully convolutional neural network to obtain a new fully convolutional neural network.
[0083] Among them, the network weight W' of the fully convolutional neural network is updated as follows:
[0084]
[0085] Among them, W represents the network weight and η represents the learning rate.
[0086] After training, all patient feature vectors are fed into the trained FCNN network to generate a valid embedding representation for each patient. After processing through multiple fully connected layers, the resulting valid embedding is a vector that fully captures the patient's characteristics.
[0087] Step S122: perform similarity comparison on the same category information represented by any two patient embeddings to generate an initial similarity dataset.
[0088] In an optional embodiment, the cosine similarity algorithm is used to calculate the similarity between the effective embedding representations of two patients. The cosine similarity can quantify the angle between different feature vectors, thereby reflecting their similarity.
[0089] The calculation formula is:
[0090]
[0091] Among them, A and B are two patient embedding representations. Through the calculation of dot product and norm, a similarity ratio between -1 and 1 is obtained. When it is in [-1, 0], it can be considered irrelevant, and when it is in [0, 1], it can be considered relevant. The patient data in [0, 1] is determined as the data in the initial similarity dataset.
[0092] Build a graph network model based on the initial similarity dataset, combined with Figure 2As shown, the graph network model includes multiple nodes and multiple connection edges, the node is any patient, and the weight of the connection edge is the similarity between any two patients.
[0093] The Mamba model is used to encode the graph network model and output global feature representations for multiple nodes. Specifically, the graph network model is input into the Graphmamba model, which effectively calculates the similarity between nodes by introducing a bidirectional selective SSM encoding model. The Graphmamba model utilizes a state space mechanism to dynamically capture long-range dependencies between nodes and their neighbors in the graph, thereby providing more accurate feature representations.
[0094] The Mamba model is used to encode the graph network model and output global feature representations of multiple nodes, including:
[0095] Step S141: For any node in the graph network model, generate multiple subgraphs;
[0096] For the nodes in the graph network model, M random walks are performed, and the walk length is m is the maximum walk length of any random walk, which controls the sampling range. Combined with the number of random walks M, multiple subgraphs are generated.
[0097] The value of M is directly proportional to the complexity of the graph network model. The more complex the graph network model is, the larger the value of M is.
[0098] The multiple subgraphs in this application can simplify a complex graph network model into the form of multiple subgraphs, providing a basis for subsequent encoding; and each subgraph contains several groups of node features, any of which contains similarity information between the node and the adjacent nodes. The local and global structural information of the node can be captured using the subgraph form.
[0099] Step S142: adding position codes and structure codes to node features in multiple subgraphs;
[0100] Step S143: splicing the node features after position coding and structure coding to obtain a spliced coding graph;
[0101] In an embodiment of the present application, structural coding and position coding are added to node features to enhance the Mamba model's understanding of the graph structure model.
[0102] In an optional implementation, adding structural encoding to node features can be done by calculating the random walk matrix P corresponding to each subgraph and using the sum of the off-diagonal elements of the random walk matrix P as the structural encoding of the node feature. Specifically, the calculation formula for each element of the random walk matrix P is:
[0103]
[0104] Among them, P ij Represents the random walk matrix corresponding to node i and node j, A ij Indicates whether there is an edge between node i and node j. If there is an edge between node i and node j, then A ij = 1. If there is no edge between node i and node j, then A ij =0.d i Indicates the number of directly connected edges of node i.
[0105] In an alternative implementation, adding position encoding to node features can be done as follows:
[0106] Calculate the Laplacian matrix L of the subgraph, L=DA, where D is the degree matrix of the subgraph and A is the adjacency matrix of the subgraph.
[0107] Calculate the eigenvectors of the Laplacian matrix L as the positional encoding.
[0108] Step S144: vectorize the concatenated coded graph using a message passing neural network to obtain a subgraph vector;
[0109] Message-Passing Neural Networks (MPNN) is a neural network framework for processing graph-structured data. It uses a message passing mechanism to enable nodes to dynamically update their own representations based on the structure and characteristics of the graph.
[0110] In an embodiment of the present application, a message passing neural network is used to vectorize each subgraph, and the local structure and context are captured by iteratively aggregating the feature information of each node and its neighbors, thereby generating a comprehensive vector representation for each subgraph that can reflect its internal complex relationships and patterns. This vector representation is called a subgraph vector, and the subgraph vector can integrate local information.
[0111] It should be noted that the training process of the MPNN network includes the message passing stage and the reading stage.
[0112] When in the message passing stage, the MPNN network generates information based on the node’s own characteristics, transmits the information according to the network’s topology, and records the node v’s own characteristics as x v , the information generated by node v at time step t is recorded as The time step is the data point corresponding to each moment in the sequence, and the hidden state of node v at time step t is recorded as The calculation formula for updating the hidden state of a node is as follows:
[0113]
[0114] Among them, M t is a message function, which is used to generate information based on nodes and edges. N(v) represents the neighbors of all nodes v. is the hidden state of node v at time step t, is the hidden state of node w at time step t, e vw is the edge feature between node v and node w.
[0115] The calculation formula for node information update is as follows:
[0116]
[0117] in, is the hidden state of node v at time step t+1, U t It is an aggregation function, which is used to aggregate the information passed to the node and the node's own features to generate new node features. is the hidden state of node v at time step t, is the information generated by node v at time step t+1.
[0118] When in the reading phase, the MPNN network maps the features of the entire graph into a feature vector that describes the features of the entire graph. The formula for calculating the subgraph vector is as follows:
[0119]
[0120] in, is the final subgraph vector, R is the reading function, which takes the weighted average of the feature vectors of all nodes in the entire graph as the vector representation of the entire graph. is the final hidden state of node v after T rounds of message passing; v∈G represents all nodes in the graph.
[0121] Step S145: sort all nodes and subgraph vectors in the graph network model and input them into the bidirectional selective state space model;
[0122] Optionally, when the maximum walk length is 0, the nodes are sorted according to their importance; when the maximum walk length is greater than 0, the nodes are sorted according to the hierarchical structure formed by the proximity relationship between the nodes during the subgraph generation process.
[0123] Specifically, all nodes in the graph network model and the resulting locally encoded subgraph vectors are sorted to ensure that the model can effectively utilize contextual information. When the maximum walk length m = 0, the nodes are sorted according to their importance. When the maximum walk length m > 0, the subgraphs have an implicit order, typically based on the hierarchical structure formed by the proximity relationships between nodes.
[0124] Step S146: The bidirectional selective state space model encodes the subgraph sequence to generate a global feature representation.
[0125] The bidirectional selective state space model is a key encoding component of the Mamba model, specifically the Graphmamba model. The Graphmamba model uses a bidirectional selective state space model (SSM) to comprehensively encode subgraph sequences, thereby capturing a wider range of contextual information. This encoding process ensures that the feature representation of each node depends not only on its immediate neighbors but also incorporates information from more distant regions of the graph. Through multiple iterations, the Graphmamba model aggregates global features in each pass, ensuring that each node's representation is imbued with sufficient contextual information. This feature aggregation and updating process comprehensively improves node representation capabilities from multiple levels and perspectives.
[0126] Ultimately, the Graphmamba model outputs a global feature representation of all nodes. This representation, after multiple training iterations, enables the model to achieve a higher level of semantic understanding. Through these steps, Graphmamba effectively enhances its ability to perceive similarities between nodes.
[0127] This application also calculates cosine similarity based on the global feature representation of the nodes to obtain a similarity matrix between nodes. Each item in the matrix represents the similarity between two nodes, and the higher the value, the more similar the two nodes are. For the target patient, the relevant similarity information can be extracted and sorted in the final similarity matrix. The similarity of similar patients can be sorted. Based on the sorted similar patient index, the case reports of the top few patients with high similarity are recommended, and the case and treatment plans of the corresponding patients can be extracted.
[0128] Finally, this application also discloses a case update and recommendation function. That is, the case recommendation method in this application also includes:
[0129] Step S16: Utilize a large language model to output a case format that meets a similarity threshold, wherein the large language model receives feedback from doctors, makes circular adjustments, and outputs the results.
[0130] In an optional example, a similarity threshold (eg, 0.7) may be set, and similar cases exceeding this threshold may be screened out based on the similarity matrix. The resulting case pairs may be used for subsequent analysis and report generation.
[0131] Furthermore, case information and report templates are combined into prompt content to ensure that the generated content meets the expected template and content requirements. Case information includes age, gender, diagnosis, treatment plan, etc., and the report template includes a comparison of basic patient information, as well as similarities and differences.
[0132] The constructed prompt content is input into the Large Language Model (LLM) for processing, the generated text is obtained, and the output is a PDF file.
[0133] Large language models can output reports that meet similarity thresholds to doctors. Doctors can review the generated report content to confirm its necessity and accuracy. Based on feedback, large language models continuously optimize the output content, thereby improving the quality of future reports generated.
[0134] The patient embedding representation in this application can be considered to contain both text and image information. It realizes the comprehensive extraction of image and text information in the data acquisition stage, integrates data information from multiple sources, and improves the comprehensiveness of recommended cases. In addition, this application first performs a first similarity calculation to roughly screen the correlation of the data, inputs the data after the first similarity calculation into the bidirectional selective state space model, and compares the cosine similarity of the data processed by the Mamba model again, that is, performs a second similarity calculation. The two data similarity comparisons can effectively screen the data comprehensively, improve the precision of data processing in the case recommendation process, and improve the accuracy of case recommendation. The Mamba model in this application can realize the accurate calculation of the similarity between patients and the capture of complex relationships, further improving the accuracy of similar case recommendations.
[0135] A large language model is used to output a case format that meets the similarity threshold. The large language model accepts feedback from doctors, adjusts and outputs it in a loop. It can be seen that this application also uses a large language model (LLM) to organize case information into a structured and easy-to-understand report format to help doctors quickly obtain key information.
[0136] As an optional implementation of the disclosure of the embodiment of the present invention, refer to Figure 3 , an embodiment of the present invention further provides a case recommendation system based on the Mamba model, which may specifically include:
[0137] A preprocessing module 31 is configured to perform preprocessing based on the case data of multiple patients to obtain a patient embedding representation, wherein the patient embedding representation corresponds one-to-one with each patient and is generated by training a patient feature vector, wherein the patient feature vector includes a text feature vector and an image feature vector;
[0138] An initial similarity determination module 32 is configured to calculate similarity for data of the same type based on the patient embedding representations corresponding to any two patients to generate an initial similarity dataset;
[0139] A graph network model 33 is constructed based on the initial similarity dataset, wherein the graph network model includes a plurality of nodes and a plurality of connecting edges, wherein the nodes are any patients, and the weights of the connecting edges are the similarities between any two patients;
[0140] Mamba model 34, used to encode the graph network model and output global feature representations of multiple nodes;
[0141] The cosine similarity determination module 35 is used to calculate the cosine similarity based on the global feature representation of multiple nodes to obtain a similarity matrix, and use the similarity matrix to recommend cases that meet a preset condition, wherein the preset condition is that the case has a similarity not less than a preset value.
[0142] In the case recommendation system based on the Mamba model provided in the embodiment of the present application, the Mamba model 34 is used to encode the graph network model and output global feature representations of multiple nodes, including:
[0143] For any node in the graph network model, multiple subgraphs are generated;
[0144] Add position encoding and structure encoding to node features in multiple subgraphs;
[0145] The node features after position coding and structure coding are spliced together to obtain a spliced coding graph;
[0146] The concatenated encoded graph is vectorized using a message passing neural network to obtain a subgraph vector.
[0147] Sort all nodes and subgraph vectors in the graph network model and input them into the bidirectional selective state space model;
[0148] The Mamba model encodes subgraph sequences and generates global feature representations.
[0149] In the case recommendation system based on the Mamba model provided in the embodiment of the present application, the Mamba model 34 is used to sort all nodes and subgraph vectors in the graph network model, including:
[0150] When the maximum walk length is 0, sort the nodes according to their importance;
[0151] When the maximum walk length is greater than 0, the nodes are sorted according to the hierarchical structure formed by the proximity relationship between the nodes during the subgraph generation process.
[0152] In the case recommendation system based on the Mamba model provided in an embodiment of the present application, the Mamba model 34 is used to encode the subgraph sequence and generate a global feature representation by comprehensively encoding the subgraph sequence using a bidirectional selective state space model to generate a global feature representation.
[0153] In the case recommendation system based on the Mamba model provided in the embodiment of the present application, the preprocessing module 31 is used to preprocess the cases of multiple patients to obtain patient embedding representations, including:
[0154] Acquiring basic data information of multiple patients, wherein the basic data information includes text information and image information;
[0155] Extract text features from the text information in the basic data information to form a text feature vector, where one feature vector corresponds to one patient;
[0156] Perform image feature extraction on the image information in the basic data information to form an image feature vector;
[0157] splicing the text feature vector and the image feature vector as a patient feature vector, wherein the patient feature vector includes the text feature vector and the image feature vector;
[0158] Patient feature vectors are trained to generate patient embedding representations.
[0159] In the case recommendation system based on the Mamba model provided in the embodiment of the present application, the initial similarity determination module 32 is used to perform initial similarity calculation on the same type of data represented by the patient embedding, and the generation of the initial similarity dataset includes:
[0160] Identifying the patient embedding representation using a fully convolutional neural network, where the fully convolutional neural network is trained based on target patient training samples, where the target patient training samples include patient-specific feature information, positive samples corresponding to the specific feature information, and negative samples corresponding to the specific feature information;
[0161] The similarity of the same class information represented by any two patient embeddings is compared to generate an initial similarity dataset.
[0162] In the case recommendation system based on the Mamba model provided in an embodiment of the present application, the fully convolutional neural network is generated in combination with triplet loss.
[0163] The case recommendation system based on the Mamba model provided in the embodiment of the present application also includes:
[0164] The large language model 36 is used to output the case format that meets the similarity threshold. The large language model receives feedback from doctors, cyclically adjusts and outputs.
[0165] The above describes multiple embodiment schemes provided by the embodiments of the present application. The various optional methods introduced in each embodiment scheme can be combined and cross-referenced with each other without conflict, thereby extending a variety of possible embodiment schemes, which can all be considered as embodiment schemes disclosed and open in the embodiments of the present application.
[0166] Although the embodiments of the present application are disclosed above, the present application is not limited thereto. Any person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims.
Claims
1. A case recommendation method based on the Mamba model, characterized in that: include: Preprocessing is performed based on the cases of multiple patients to obtain a patient embedding representation, where the patient embedding representation corresponds one-to-one with the patient, and the patient embedding representation is generated by training a patient feature vector, where the patient feature vector includes a text feature vector and an image feature vector; For data of the same type, similarity is calculated based on the patient embedding representations corresponding to any two patients to generate an initial similarity dataset; Constructing a graph network model based on the initial similarity dataset, wherein the graph network model includes a plurality of nodes and a plurality of connecting edges, wherein the node is any patient, and the weight of the connecting edge is the similarity between any two patients; The Mamba model is used to encode the graph network model and output the global feature representation of multiple nodes; The cosine similarity is calculated based on the global feature representation of multiple nodes to obtain a similarity matrix, and the similarity matrix is used to recommend cases that meet preset conditions, where the preset condition is that the case similarity is not less than a preset value.
2. The case recommendation method based on the Mamba model according to claim 1, characterized in that: The Mamba model is used to encode the graph network model and output global feature representations of multiple nodes, including: For any node in the graph network model, multiple subgraphs are generated; Add position encoding and structure encoding to node features in multiple subgraphs; The node features after position coding and structure coding are spliced together to obtain a spliced coding graph; The concatenated encoded graph is vectorized using a message passing neural network to obtain a subgraph vector. Sort all nodes and subgraph vectors in the graph network model and input them into the bidirectional selective state space model; The Mamba model encodes subgraph sequences and generates global feature representations.
3. The case recommendation method based on the Mamba model according to claim 2, characterized in that: Sort all nodes and subgraph vectors in the graph network model, including: When the maximum walk length is 0, sort the nodes according to their importance; When the maximum walk length is greater than 0, the nodes are sorted according to the hierarchical structure formed by the proximity relationship between the nodes during the subgraph generation process.
4. The case recommendation method based on the Mamba model according to claim 2, characterized in that: The Mamba model encodes the subgraph sequence to generate a global feature representation, and uses a bidirectional selective state space model to comprehensively encode the subgraph sequence to generate a global feature representation.
5. The case recommendation method based on the Mamba model according to claim 1, characterized in that: Preprocessing is performed based on multiple patient cases to obtain patient embedding representations, including: Acquiring basic data information of multiple patients, wherein the basic data information includes text information and image information; Extract text features from the text information in the basic data information to form a text feature vector, where one feature vector corresponds to one patient; Perform image feature extraction on the image information in the basic data information to form an image feature vector; splicing the text feature vector and the image feature vector as a patient feature vector, wherein the patient feature vector includes the text feature vector and the image feature vector; Patient feature vectors are trained to generate patient embedding representations.
6. The case recommendation method based on the Mamba model according to claim 5, characterized in that: Perform initial similarity calculation on the same type of data represented by patient embeddings to generate an initial similarity dataset including: Identifying the patient embedding representation using a fully convolutional neural network, where the fully convolutional neural network is trained based on target patient training samples, where the target patient training samples include patient-specific feature information, positive samples corresponding to the specific feature information, and negative samples corresponding to the specific feature information; The similarity of the same class information represented by any two patient embeddings is compared to generate an initial similarity dataset.
7. The case recommendation method based on the Mamba model according to claim 6, characterized in that: The fully convolutional neural network is generated in combination with triplet loss.
8. The case recommendation method based on the Mamba model according to claim 6, characterized in that: Also includes: A large language model is used to output a case format that meets a similarity threshold. The large language model receives feedback from doctors, adjusts cyclically, and outputs the results.
9. A case recommendation system based on the Mamba model, characterized in that: A preprocessing module is used to perform preprocessing based on the case data of multiple patients to obtain a patient embedding representation, where the patient embedding representation corresponds one-to-one with the patient and is generated by training a patient feature vector, where the patient feature vector includes a text feature vector and an image feature vector; An initial similarity determination module is used to calculate the similarity of data of the same type based on the patient embedding representations corresponding to any two patients to generate an initial similarity dataset; A graph network model is constructed based on the initial similarity dataset, wherein the graph network model includes a plurality of nodes and a plurality of connecting edges, wherein the nodes are any patients, and the weights of the connecting edges are the similarities between any two patients; The Mamba model is used to encode graph network models and output global feature representations of multiple nodes; The cosine similarity determination module is used to calculate the cosine similarity based on the global feature representation of multiple nodes to obtain a similarity matrix, and use the similarity matrix to recommend cases that meet preset conditions, where the preset condition is that the case similarity is not less than a preset value.
10. The case recommendation system based on the Mamba model according to claim 9, characterized in that: Also includes: A large language model is used to output a case format that meets a similarity threshold. The large language model receives feedback from doctors, cyclically adjusts, and outputs the results.