Similar case query method based on causal-dynamic multi-granularity
By employing a causal-dynamic multi-granularity similar case query method, combined with a dynamic time-warped kernel autoencoder and a causal attention network, the problem of class imbalance in medical big data is solved, enabling accurate querying of multimodal data and interpretable similar case matching, thus assisting doctors in decision-making.
Patent Information
- Application Number
- CN202511600532.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-11-04
AI Technical Summary
In medical big data, similar case queries for specific diseases face the problem of category imbalance. Existing methods are unable to effectively integrate multimodal data, resulting in low recall or high no-match rates and a lack of interpretability, which affects doctors' decision-making.
A causal-dynamic multi-granularity similar case query method is adopted. Through dynamic time-warped kernel autoencoder and causal attention network, the similarity between the query data and typical disease process template is calculated, and causal perception similarity matching is performed to provide transparent and reliable similar case query.
It enables accurate querying and assisted prediction in multimodal medical data, provides interpretable similar case query services, and enhances the transparency and credibility of clinical decision-making.
Smart Images

Figure CN121075690A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of similar case query, in particular to a similar case query method based on causal-dynamic multi-granularity. BACKGROUND
[0002] In the application of medical big data, the similar case query of specific diseases (such as chronic diseases) is facing challenges. The core problem is that the categories of medical data are highly unbalanced, and the ratio of positive examples to negative examples is disproportionate, which makes it difficult for traditional similarity measurement methods to find similar items on the minority class samples. The recall rate is low or the matching rate is high when the similarity model identifies rare cases, which affects the doctor's auxiliary decision-making. The existing methods to alleviate the class imbalance mostly mechanically replicate or simply weight in the feature space, ignoring the complex correlation, multi-modal information and dynamic time sequence characteristics of medical data, which may generate meaningless samples or lead to overfitting, affecting the generalization ability of the model.
[0003] Secondly, the problem of a small number of samples is prominent in rare diseases or specific sub-population medical data, making it difficult to build a rich and representative case library to support accurate query and model training generalization. In addition, medical data has multi-modal and complex time sequence characteristics, such as dynamic changes in physical data, high-dimensional images of medical images, and unstructured text such as medical history. Efficient fusion of heterogeneous, multi-modal, and dynamic data and feature extraction are key challenges for accurate query and auxiliary prediction. Existing deep learning models are difficult to efficiently fuse and deeply understand heterogeneous multi-modal data, and the "black box" characteristics lack explainability, limiting their application in clinical decision support. Traditional explainability methods are mostly post-explanation, without incorporating causal relationships, and the explanation results may not be the underlying mechanism. SUMMARY
[0004] Therefore, it is necessary to provide a similar case query method based on causal-dynamic multi-granularity, comprising: S1: obtaining the data to be queried, preprocessing the data to be queried to obtain the features to be queried; S2: inputting the features to be queried into the encoder of the trained dynamic time warping kernel autoencoder, performing dynamic time warping similarity calculation on the time sequence features in the features to be queried and each preset typical disease progression template respectively, obtaining the corresponding similarity, mapping each similarity to the corresponding multi-granularity dynamic feature vector; aggregating all multi-granularity dynamic feature vectors to obtain a feature vector set, and expanding the feature vector set into a single high-dimensional vector; S3: obtaining causal attention weights by passing the high-dimensional vector through a causal attention network, performing causal attention weighting on the high-dimensional vector based on the causal attention weights to obtain causal weighted features; calculating the causal perception similarity between the causal weighted features corresponding to the data to be queried and the causal weighted features corresponding to the known cases in the database, and taking the known case with the highest causal perception similarity as the similar case of the data to be queried.
[0005] Preferably, in S1, the preprocessing of the data to be queried includes: The data to be queried includes numerical time-series vital signs data of the patient to be queried, or structured numerical data, or unstructured text-based medical history data, or medical imaging data; The features to be queried may include time-series vital signs features, numerical features, medical history text features, or image features; The preprocessing of numerical time series vital signs data is as follows: after data cleaning, the numerical time series vital signs data is subjected to Min-Max standardization to obtain standardized time series vital signs data. The standardized time series vital signs data is then encoded using a gated cyclic unit to obtain fixed-length time series vital signs features. The preprocessing of structured numerical data is as follows: after cleaning the structured numerical data, Min-Max standardization is performed to obtain numerical features; The preprocessing of unstructured text-based medical history data involves using a pre-trained word embedding model to transform the unstructured text-based medical history data into medical history text features. The preprocessing of medical image data involves using a pre-trained deep convolutional neural network to extract features from the medical image data, thereby obtaining image features.
[0006] Preferably, in S2, the formula for calculating the dynamic time warp similarity is: ; in, Indicates dynamic time warp similarity; Indicates the first The temporal characteristics of the patient to be queried; Indicates the first A pre-set template for typical disease progression; Indicates the scaling parameter; This represents the multidimensional dynamic time-warped distance.
[0007] Preferably, each similarity is mapped to a corresponding multi-granularity dynamic feature vector, and the mapping formula is: ; in, Indicates the first The patient to be queried corresponds to the first... Multi-granular dynamic feature vectors under a pre-set typical disease process template; Indicates the activation function; Indicates the first The weights of a pre-defined typical disease progression template; Indicates the first The bias of a pre-defined typical disease progression template.
[0008] Preferably, the causal attention network includes a feature causal relationship graph for calculating causal attention weights. The feature causal relationship graph includes cause nodes, effect nodes, and corresponding causal influence weights. Cause nodes or effect nodes include high-dimensional vectors of any dimension corresponding to the data to be queried. The causal influence weight of cause nodes or effect nodes is the global influence of cause nodes or effect nodes calculated by the Peter-Clark algorithm.
[0009] Preferably, the calculation process for the causal weighted features corresponding to the data to be queried includes: The causal attention weights are obtained by passing the high-dimensional vector through a causal attention network, and the calculation formula is as follows: ; in, This indicates the causal attention weight corresponding to the data to be queried; This represents the softmax function; This represents the weight matrix corresponding to the data to be queried; Indicates the bias corresponding to the data to be queried; This represents the high-dimensional vector corresponding to the data to be queried; It represents the Hadamardi (or Hadama) stack; This represents the weight of each causal influence extracted from the feature causal relationship graph; Based on the causal attention weights corresponding to the data to be queried, a causal attention weighting is applied to the high-dimensional vector to obtain the causal weighted features corresponding to the data to be queried. The calculation formula is as follows: ; in, This represents the causal weighted feature corresponding to the data to be queried.
[0010] Preferably, in S3, the formula for calculating causal perception similarity is: ; in, Indicates the similarity of causal perception; This indicates the patient to be queried; Indicates the first in the database One known case; This represents the causal weighted feature corresponding to the data to be queried; Indicates the first in the database Causal weighted features corresponding to 1 known case; Represents the L2 norm; This represents the dot product of vectors.
[0011] Preferably, in S2, the training process of the dynamic time-warped kernel autoencoder includes: Obtain the original medical dataset containing multiple samples. The samples are the original multimodal data of existing patients and their corresponding labels. The labels indicate whether the existing patients have developed the target chronic disease complication, with values of 0 or 1, where 0 indicates no complication and 1 indicates complication. The samples include minority class samples and majority class samples. The multimodal raw data includes numerical time-series vital signs data of existing patients, structured numerical data, unstructured textual medical history data, and medical image data. The data of each modality in the multimodal raw data are preprocessed to obtain the time-series vital signs features, numerical features, medical history text features, and image features of existing patients. By splicing together the temporal signs, numerical features, medical history text features, and image features of existing patients, a unified initial feature vector corresponding to the sample is obtained; The unified initial feature vectors corresponding to each sample are input into the encoder of the dynamic time warp kernel autoencoder to obtain the feature vector set corresponding to each sample. The feature vector set corresponding to each sample is then passed through the decoder of the dynamic time warp kernel autoencoder to output the corresponding reconstructed features. Based on each unified initial feature vector and its corresponding reconstructed features, the reconstruction loss is calculated using the following formula: ; in, Indicates the reconstruction loss; Indicates the number of samples; Indicates the first The reconstructed features corresponding to each sample; Indicates decoder; Indicates the first The set of feature vectors corresponding to each sample; Let L2 norm be denoted; minimize the reconstruction loss to train the dynamic temporally warped kernel autoencoder.
[0012] Preferably, in S3, the process of obtaining the causal weighted features corresponding to known cases in the database includes: Context-aware sample reconstruction is performed based on minority class samples, majority class samples, and their corresponding high-dimensional vectors to obtain a balanced training set; a deep learning classifier is then trained based on the balanced training set. The high-dimensional vectors corresponding to each sample in the balanced training set are passed through a trained deep learning classifier, and the hidden layer in the deep learning classifier outputs the corresponding intermediate feature representation. Each intermediate feature representation is passed through a causal attention network to obtain a corresponding causal attention weight. Based on each causal attention weight, the corresponding intermediate feature representation is weighted by causal attention to obtain the causal weighted features corresponding to each sample. The causal weighted features corresponding to each sample are the causal weighted features corresponding to each known case.
[0013] Preferably, the process of obtaining a balanced training set includes: A semantic association graph is constructed using each sample as a node and the cosine similarity between the high-dimensional vectors corresponding to each sample as the edge weight. For any minority class sample, select the samples with the highest similarity to the cosine as potential seeds; The causal propensity gain between minority class samples and each potential seed is calculated using the following formula: ; in, Indicates causal bias gain; Indicates the first A minority class of samples; Indicates sample The A potential seed; Indicates the first High-dimensional vectors corresponding to all potential seeds of a minority class sample; Represents multi-granularity dynamic feature vectors Importance weights; Indicates the strength of causal relationship; Indicates the first Labels in a minority class of samples; Indicates an indicator function, when The value is 1 if the condition is met, and 0 otherwise. Potential seeds with causal tendency gain higher than the first threshold are selected, the high-dimensional vectors corresponding to each selected potential seed are fine-tuned, and combined with the causal chain reverse generation strategy to synthesize positive sample. The causal isolation degree between minority class samples and each majority class sample is calculated using the following formula: ; in, Indicates the degree of causal isolation; Indicates the first A majority class sample; Represents the set of minority class samples; This represents the graph distance based on causal tendency chains on the semantic association graph, where the graph distance is the sum of the edge weights on the path connecting two samples; The majority class samples with causal isolation higher than the second threshold are selected and synthesized into negative samples; By combining the positive and negative samples corresponding to each minority class sample, a balanced training set is obtained.
[0014] Beneficial effects: the method obtains the to-be-queried features of the to-be-queried data, inputs the to-be-queried features into the encoder of the trained dynamic time warping kernel autoencoder, calculates the similarity between the time sequence feature in the to-be-queried features and each preset typical disease progression template, and then maps each similarity into a corresponding multi-granularity dynamic feature vector; aggregates all the multi-granularity dynamic feature vectors to obtain a feature vector set, and expands the feature vector set into a single high-dimensional vector; the high-dimensional vector is subjected to causal attention weighting through a causal attention network to obtain a causal weighted feature; the causal perception similarity between the causal weighted feature corresponding to the to-be-queried data and the causal weighted feature corresponding to the known case in the database is calculated, and the known case with the highest causal perception similarity is taken as the similar case of the to-be-queried data, thereby providing a transparent and reliable similar case query service. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, below will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, without creative labor, can also obtain other drawings according to these drawings.
[0016] Figure 1 The flowchart of the similar case query method based on causal-dynamic multi-granularity in the embodiments of the present application. DETAILED DESCRIPTION
[0017] In order to make the above objects, features and advantages of the present application more apparent, below will make a detailed description of the specific embodiments of the present application in conjunction with the drawings. In the following description, a lot of specific details are set forth in order to fully understand the present application. However, the present application can be implemented in many other ways different from the description herein, and those skilled in the art can make similar improvements without departing from the connotation of the present application, therefore the present application is not limited by the specific embodiments disclosed below.
[0018] In addition, the terms "first", "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise explicitly specified.
[0019] As shown in Figure 1 The present embodiment provides a similar case query method based on causal-dynamic multi-granularity, comprising: S1: obtaining to-be-queried data, preprocessing the to-be-queried data, and obtaining to-be-queried features.
[0020] In this embodiment, preprocessing the data to be queried includes: The data to be queried includes numerical time-series vital signs data of the patient to be queried, or structured numerical data, or unstructured text-based medical history data, or medical imaging data; The features to be queried may include time-series vital signs features, numerical features, medical history text features, or image features; The preprocessing of numerical time series vital signs data is as follows: after data cleaning (such as missing value filling and outlier handling), the numerical time series vital signs data is subjected to Min-Max standardization to obtain standardized time series vital signs data. The standardized time series vital signs data is then encoded using a gated cyclic unit to obtain fixed-length time series vital signs features. The preprocessing of structured numerical data is as follows: after cleaning the structured numerical data, Min-Max standardization is performed to obtain numerical features; The preprocessing of unstructured text-based medical history data involves using pre-trained word embedding models (such as Word2Vec, BERT, etc.) to transform the unstructured text-based medical history data into fixed-dimensional medical history text features. The preprocessing of medical image data involves using a pre-trained deep convolutional neural network to extract features from the medical image data, resulting in fixed-dimensional image features.
[0021] S2: Input the query feature into the encoder of the trained dynamic time warp kernel autoencoder, calculate the dynamic time warp similarity between the temporal signs in the query feature and each preset typical disease process template, obtain the corresponding similarity, map each similarity to the corresponding multi-granularity dynamic feature vector; aggregate all multi-granularity dynamic feature vectors to obtain a feature vector set, and expand the feature vector set into a single high-dimensional vector.
[0022] Specifically, the encoder includes a dynamic pattern matching layer and a granular aggregation layer; In the dynamic pattern matching layer, the dynamic time warp similarity between the temporal vital signs in the query features and each preset typical disease process template is calculated. The formula for calculating the dynamic time warp similarity is: ; in, Indicates dynamic time warp similarity; Indicates the first The temporal characteristics of the patient to be queried; Indicates the first A pre-set template for typical disease progression; Indicates the scaling parameter; This represents the multidimensional dynamic time-warped distance.
[0023] In the granular aggregation layer, each similarity is mapped to a corresponding multi-granularity dynamic feature vector. All multi-granularity dynamic feature vectors are aggregated to obtain a feature vector set. The mapping formula is as follows: ; in, Indicates the first The patient to be queried corresponds to the first... Multi-granular dynamic feature vectors under a pre-set typical disease process template; Indicates the activation function; Indicates the first The weights of a pre-defined typical disease progression template; Indicates the first The bias of a preset typical disease process template; the number of preset typical disease process templates is K, that is, the bias of the Kth template. For each patient to be queried, K multi-granularity dynamic feature vectors will be generated.
[0024] In this embodiment, the typical disease progression template is a time-series data predefined by domain experts that represents a specific stage or pattern of disease development. For example, in the context of diabetic nephropathy, the typical disease progression template can be defined as follows: "Stable Blood Glucose Control Template," which contains sequence data showing a long-term HbA1c level below 7.0% and a stable estimated glomerular filtration rate (eGFR); "Rapid Deterioration of Renal Function Template," which contains sequence data showing a significant decrease in eGFR exceeding a specific percentage within a short period (e.g., within 6 months), accompanied by a sharp increase in the urinary microalbumin / creatinine ratio (UACR); and "Acute Complication Template," which contains sequence data showing drastic and irregular fluctuations in key physiological indicators such as blood glucose and blood pressure within a short period. By matching with these templates, the similarity between the patient's current state and different typical disease progressions can be quantified.
[0025] This embodiment provides the training process for a dynamic time-warped kernel autoencoder, including: Obtain the original medical dataset containing multiple samples. The samples are the original multimodal data of existing patients and their corresponding labels. The labels indicate whether the existing patients have developed the target chronic disease complication, with values of 0 or 1, where 0 indicates no complication and 1 indicates complication. The samples include minority class samples (samples with label 1) and majority class samples (samples with label 0). The raw multimodal data includes: Numerical time-series vital signs data of existing patients are denoted as ,in, Indicates the first Numerical time-series vital signs data of existing patients. Indicates the first One existing patient Vital signs data at any given time , Indicates the quantity of vital signs data. , Indicates the first The time series length corresponding to each existing patient; The structured values of existing patients are denoted as follows: ,in, Indicates the first Structured data of existing patients , This indicates the number of structured values, which include static data that is independent of time, such as gender, age, and BMI. The existing unstructured text-based medical history data of patients is denoted as , Indicates the first Unstructured text-based medical history data of existing patients, including text descriptions of chief complaints, present illness, and medication records; The existing patient's medical imaging data is denoted as , Indicates the first Medical imaging data of existing patients, including retinal color photography, ultrasound images, CT / MRI scans, etc. Preprocessing is performed on each modality of the original multimodal data (the preprocessing process is the same as step S1) to obtain the temporal signs, numerical features, medical history text features, and image features of the existing patients. By splicing together the temporal signs, numerical features, medical history text features, and image features of existing patients, a unified initial feature vector corresponding to the sample is obtained; The unified initial feature vectors corresponding to each sample are input into the encoder of the dynamic time warp kernel autoencoder to obtain the feature vector set corresponding to each sample. The feature vector set corresponding to each sample is then passed through the decoder of the dynamic time warp kernel autoencoder to output the corresponding reconstructed features. Based on each unified initial feature vector and its corresponding reconstructed features, the reconstruction loss is calculated using the following formula: ; in, Indicates the reconstruction loss; Indicates the number of samples; Indicates the first The reconstructed features corresponding to each sample; Indicates decoder; Indicates the first The set of feature vectors corresponding to each sample; denotes L2 norm; the reconstruction loss is minimized to train the dynamic time warping kernel autoencoder.
[0026] S3: passing the high-dimensional vector through the causal attention network to obtain a causal attention weight, performing causal attention weighting on the high-dimensional vector based on the causal attention weight to obtain a causal weighted feature; calculating a causal perception similarity between the causal weighted feature corresponding to the to-be-queried data and the causal weighted features corresponding to the known cases in the database, and taking the known case with the highest causal perception similarity as the similar case of the to-be-queried data.
[0027] Specifically, the causal attention network is provided with a feature causal relationship graph for calculating the causal attention weight; the feature causal relationship graph includes cause nodes, effect nodes and corresponding causal influence weight; the cause node or the effect node includes a high-dimensional vector corresponding to any one dimension of the to-be-queried data, and the causal influence weight of the cause node or the effect node is the global influence of the cause node or the effect node calculated by the Peter-Clark algorithm.
[0028] Further, the calculation process of the causal weighted feature corresponding to the to-be-queried data includes: passing the high-dimensional vector through the causal attention network to obtain a causal attention weight, and the calculation formula is: ; wherein, denotes the causal attention weight corresponding to the to-be-queried data; denotes a softmax function; denotes a weight matrix corresponding to the to-be-queried data; denotes a bias corresponding to the to-be-queried data; denotes a high-dimensional vector corresponding to the to-be-queried data; denotes a Hadamard product; denotes each causal influence weight extracted from the feature causal relationship graph; performing causal attention weighting on the high-dimensional vector based on the causal attention weight corresponding to the to-be-queried data to obtain a causal weighted feature corresponding to the to-be-queried data, and the calculation formula is: ; wherein, denotes the causal weighted feature corresponding to the to-be-queried data.
[0029] In this embodiment, the calculation formula of the causal perception similarity is: ; wherein, denotes the causal perception similarity; denotes a to-be-queried patient; denotes a known case in the database. a known case; denotes the causal attention weighted features of the query data; denotes the causal attention weighted features of the i-th known case in the database; denotes the causal attention weighted features of the i-th known case in the database; denotes the L2 norm; denotes the vector dot product.
[0030] To provide richer explanations of the similarity, the present embodiment also supports explaining the causes of the similarity according to the causal attention weights. When two cases are judged to be similar, the model can highlight the features with high causal correlation strength (such as persistent hyperglycemia and abnormal renal function indicators) on which the two cases show similar patterns, thus giving a causal explanation of “why similar”. For example, if two patients both develop similar patterns of renal function decline due to “poor long-term glycemic control” and “genetic predisposition”, the model can clearly point out the key features on these causal chains as the main basis for the similarity. This allows doctors to find the diagnosis and treatment process and prognosis of similar historical cases to assist in diagnosis and treatment decisions, enhancing the clinical practicality, transparency and credibility of the system.
[0031] Further, the process of obtaining the causal attention weighted features of the known cases in the database includes: context-aware sample reconstruction based on the minority class samples, the majority class samples, and the corresponding high-dimensional vectors to obtain a balanced training set; training a deep learning classifier (such as a multilayer perceptron) based on the balanced training set; the high-dimensional vectors corresponding to each sample in the balanced training set pass through the trained deep learning classifier, and the hidden layer output in the deep learning classifier corresponds to the intermediate feature representation; each intermediate feature representation passes through a causal attention network respectively to obtain a corresponding causal attention weight, and the corresponding intermediate feature representation is weighted based on the causal attention weight to obtain a causal attention weighted feature corresponding to each sample, and the causal attention weighted feature corresponding to each sample is the causal attention weighted feature corresponding to each known case.
[0032] The training process of the deep learning classifier includes: the causal attention weight corresponding to each sample passes through a sigmoid function to output a corresponding prediction probability; based on the prediction probability corresponding to each sample and the label, a binary cross-entropy loss is calculated, and the binary cross-entropy loss is minimized to optimize the deep learning classifier.
[0033] The training of the deep learning classifier aims to learn a feature space that can effectively distinguish between the occurrence of complications (positive samples) and the non-occurrence of complications (negative samples). After training, the deep learning classifier has a dual role: first, for all known cases in the database, the "intermediate feature representation" with high discriminability extracted through the hidden layer in the middle is used for subsequent causal weighting; second, it can be directly applied to new data to be queried, outputting an auxiliary disease risk prediction probability to provide a preliminary risk level judgment for doctors.
[0034] Furthermore, the process of obtaining a balanced training set includes: To improve the recall rate and accuracy of similarity queries on rare cases, a semantic correlation graph is constructed with each sample as a node and the cosine similarity between the high-dimensional vectors corresponding to each sample as the edge weight. For any minority class sample, select multiple samples with the largest cosine similarity as potential seeds. A causal inference mechanism is introduced to evaluate the "correlation transmission" of feature detection. This mechanism focuses on the causal contribution of local feature subsets to the disease outcome. The Peter-Clark algorithm is used to infer the causal correlation strength between features. For any minority class sample, the causal propensity gain between it and each potential seed is calculated to measure the increase in the likelihood of the potential seed becoming a positive example (minority class sample) under the existing causal correlation. The calculation formula is: ; Where, represents the causal propensity gain; represents the th minority class sample; represents the th potential seed of sample ; represents the th minority class sample; represents the high-dimensional vector corresponding to all potential seeds of the th minority class sample; represents the importance weight of the multi-granularity dynamic feature vector ; represents the causal correlation strength; represents the label in the th minority class sample; represents the indicator function, which is 1 when , otherwise 0; ; wherein, represents the causal isolation degree; represents the i-th majority class sample; represents the i-th majority class sample; represents the minority class sample set; represents the graph distance based on the causal tendency chain on the semantic correlation graph, the graph distance being the sum of the edge weights on the path connecting the two samples; the causal isolation degree is used to measure the distance of the multi-granularity dynamic feature vector of the negative example (majority class sample) from the multi-granularity dynamic feature vector of the nearest positive example along the causal path on the semantic correlation graph, so as to identify those "safe" negative example samples that are "difficult" to be converted into positive example samples through the causal tendency chain; The majority class samples with a causal isolation degree higher than a second threshold value are screened out and combined into negative example samples; The positive example samples and the negative example samples corresponding to each minority class sample are combined to obtain a balanced training set.
[0035] In the embodiment, the fine-tuning process includes: performing small-step displacement on the high-dimensional vector corresponding to the latent seed in the direction of the high-dimensional vector pointing to the corresponding minority class sample, the displacement step being proportional to the causal tendency gain; and combining the fine-tuned latent seed high-dimensional vector into a positive example sample in combination with the causal chain reverse generation strategy, the specific generation process of the positive example sample being: identifying key features with high causal correlation strength in the original minority class sample, fusing the key features with the fine-tuned latent seed high-dimensional vector, and generating a positive example sample that retains the context information of the latent seed and has the core causal features of the minority class sample.
[0036] The database stores "known cases". These known cases come from the original medical data set, and they have complete historical data and a determined label (whether complications occur). The role of the database is to serve as a "reference system" for the new "query data" to find similar cases.
[0037] The query data is new patient data with unknown results. In this embodiment, the purpose of the method is not only to find the most similar known cases for this new data, but also to provide an auxiliary risk prediction for the query data through the trained deep learning classifier, causal attention network and sigmoid function.
[0038] Through the causal attention network, not only can the disease risk be accurately predicted, but also the causal attention weight inside can be used as a feature contribution map to directly indicate which features contribute most to the final prediction probability, and this contribution is based on the position and causal correlation strength of the feature on the causal chain in the semantic correlation graph, which provides an intuitive and interpretable decision basis for clinical analysis.
[0039] The similarity case query method based on the cause-effect-dynamic multi-granularity provided by the embodiment has the following beneficial effects: The method proposes a new comprehensive analysis and processing method to solve the similarity case query problem in unbalanced medical data sets and assist in precise disease risk prediction. By introducing multi-granularity dynamic feature extraction, context-aware sample reconstruction, and cause-effect-explanation fusion mechanism, the limitations of the prior art are broken through, the similarity matching is more accurate, the query result is more clinically meaningful and provides reliable explanation, and the doctor is assisted in early risk assessment and clinical decision-making of chronic diseases. The core is to construct a feature representation that deeply understands the dynamic physiological changes and disease development patterns of patients, to enhance sample representation and similarity evaluation through causal correlation, and to provide transparent and reliable similarity case query services.
[0040] The technical features of the above-described embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described, but it should be considered that any combination of the technical features is within the scope of the present disclosure as long as the combination does not contradict.
[0041] The above-described embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the patent scope of the application. It should be noted that for ordinary skilled persons in the art, some modifications and improvements can be made without departing from the concept of the present application, and these are within the protection scope of the present application. Therefore, the patent protection scope of the present application should be subject to the appended claims.
Claims
1. A method for similarity case query based on causal-dynamic multi-granularity, characterized in that, Comprise: S1: obtain the data to be queried, pre-process the data to be queried, and obtain the features to be queried; S2: input the features to be queried into the encoder of the trained dynamic time warping kernel autoencoder, calculate the dynamic time warping similarity of the time series sign feature in the features to be queried and each preset typical disease process template respectively, obtain the corresponding similarity, map each similarity to the corresponding multi-granularity dynamic feature vector; aggregate all multi-granularity dynamic feature vectors to obtain a feature vector set, and expand the feature vector set into a single high-dimensional vector; S3: obtain the causal attention weight of the high-dimensional vector through the causal attention network, weight the high-dimensional vector based on the causal attention weight, and obtain the causal weighted feature; calculate the causal perception similarity between the causal weighted feature corresponding to the data to be queried and the causal weighted feature corresponding to the known cases in the database, and take the known case with the highest causal perception similarity as the similar case of the data to be queried. 2.The causal-dynamic multi-granularity based similar case query method according to claim 1, characterized in that, In S1, the pre-processing of the data to be queried comprises: The data to be queried includes numerical time series sign data of the patient to be queried, or structured numerical value, or unstructured text type medical history data, or medical image data; The features to be queried correspond to time series sign features, numerical value features, medical history text features, or image features; The pre-processing of the numerical time series sign data is: after data cleaning of the numerical time series sign data, Min-Max standardization processing is performed to obtain standardized time series sign data, and a gating recurrent unit is used to encode the standardized time series sign data to obtain a fixed-length time series sign feature; The pre-processing of the structured numerical value is: after data cleaning of the structured numerical value, Min-Max standardization processing is performed to obtain a numerical value feature; The pre-processing of the unstructured text type medical history data is: a pre-trained word embedding model is used to convert the unstructured text type medical history data into medical history text features; The pre-processing of the medical image data is: a pre-trained deep convolutional neural network is used to extract features from the medical image data to obtain image features. 3.The causal-dynamic multi-granularity based similar case query method according to claim 1, characterized in that, In S2, the calculation formula of the dynamic time warping similarity is: ; in, Indicates dynamic time warp similarity; Indicates the first The temporal characteristics of the patient to be queried; Indicates the first A pre-set template for typical disease progression; Indicates the scaling parameter; This represents the multidimensional dynamic time-warped distance. 4.The causal-dynamic multi-granularity based similar case query method according to claim 3, characterized in that, Each similarity is mapped to the corresponding multi-granularity dynamic feature vector, and the mapping formula is: ; wherein, represents the first preset typical disease progression template under which the first patient to be queried corresponds to a multi-granularity dynamic feature vector; represents an activation function; represents a weight of the first preset typical disease progression template; represents a bias of the first preset typical disease progression template. 5.The causal-dynamic multi-granularity based similar case query method according to claim 1, characterized in that, A feature causal relationship graph is set in the causal attention network for calculating the causal attention weight; The feature causal relationship graph includes cause nodes, effect nodes and corresponding causal influence weight; the cause node or the effect node includes any one-dimensional high-dimensional vector corresponding to the data to be queried, and the causal influence weight of the cause node or the effect node is the global influence of the cause node or the effect node calculated by the Peter-Clark algorithm. 6.The causal-dynamic multi-granularity based similar case query method according to claim 5, characterized in that, The calculation process of the causal weighted feature corresponding to the data to be queried comprises: The high-dimensional vector is input into the causal attention network to obtain the causal attention weight, and the calculation formula is: ; wherein, denotes the causal attention weight corresponding to the data to be queried; denotes a softmax function; denotes the weight matrix corresponding to the data to be queried; denotes the bias corresponding to the data to be queried; denotes the high-dimensional vector corresponding to the data to be queried; denotes a Hadamard product; denotes each causal influence weight extracted from the feature causal relationship graph. The high-dimensional vector is weighted based on the causal attention weight corresponding to the data to be queried to obtain the causal weighted feature corresponding to the data to be queried, and the calculation formula is: ; wherein, represents the causal weighted features corresponding to the data to be queried.
7. The causal-dynamic multi-granularity based similar case query method according to claim 1, characterized in that, In S3, the calculation formula of the causal perception similarity is: ; wherein, denotes the causal-aware similarity; denotes the patient to be queried; denotes the i-th known case in the database; denotes the i-th known case in the database; denotes the causal-weighted feature corresponding to the data to be queried; denotes the causal-weighted feature corresponding to the i-th known case in the database; denotes the causal-weighted feature corresponding to the i-th known case in the database; denotes the L2 norm; denotes the vector dot product. 8.The causal-dynamic multi-granularity based similar case query method according to claim 1, wherein, In S2, the training process of the dynamic time warping kernel autoencoder comprises: An original medical data set containing a plurality of samples is obtained, the samples being multi-modal original data of existing patients and corresponding labels; the labels represent whether the existing patients have a target chronic disease complication, and take values of 0 or 1, 0 indicating no occurrence and 1 indicating occurrence; the samples include minority class samples and majority class samples; The multi-modal original data includes numerical time series sign data, structured numerical data, unstructured text medical history data and medical image data of the existing patients, and each modality data in the multi-modal original data is preprocessed to obtain time series sign features, numerical features, medical history text features and image features of the existing patients, respectively; The time series sign features, the numerical features, the medical history text features and the image features of the existing patients are spliced to obtain a unified initial feature vector corresponding to each sample; The unified initial feature vector corresponding to each sample is input into an encoder of a dynamic time warping kernel autoencoder, respectively, to obtain a feature vector set corresponding to each sample, and the feature vector set corresponding to each sample is input into a decoder of the dynamic time warping kernel autoencoder, respectively, to output corresponding reconstructed features; Based on each unified initial feature vector and the corresponding reconstructed feature, a reconstruction loss is calculated, and the calculation formula is: ; wherein, denotes a reconstruction loss; denotes a number of samples; denotes a reconstruction feature corresponding to the th sample; denotes a decoder; denotes a feature vector set corresponding to the th sample; denotes an L2 norm; minimizing the reconstruction loss to train the dynamic time warping kernel autoencoder. 9.The causal-dynamic multi-granularity based similar case query method according to claim 8, characterized in that, In S3, the process of obtaining the causal weighted features corresponding to the known cases in the database includes: Based on the minority class samples, the majority class samples and the corresponding high-dimensional vectors, context-aware sample reconstruction is performed to obtain a balanced training set; and a deep learning classifier is trained based on the balanced training set; The high-dimensional vector corresponding to each sample in the balanced training set is input into the trained deep learning classifier, and the hidden layer output of the deep learning classifier outputs a corresponding intermediate feature representation; Each intermediate feature representation is input into a causal attention network, respectively, to obtain a corresponding causal attention weight, and the causal attention weight is used for causal attention weighting on the corresponding intermediate feature representation to obtain a causal weighted feature corresponding to each sample, and the causal weighted feature corresponding to each sample is the causal weighted feature corresponding to each known case.
10. The causal-dynamic multi-granularity based similar case query method according to claim 9, characterized in that, The process of obtaining the balanced training set includes: A semantic association graph is constructed by taking each sample as a node and taking the cosine similarity between the high-dimensional vectors corresponding to the samples as an edge weight; For any minority class sample, a plurality of samples with the largest cosine similarity are selected as potential seeds; The causal propensity gain between the minority class sample and each potential seed is calculated, and the calculation formula is: ; in, Indicates causal bias gain; Indicates the first A minority class of samples; Indicates sample The A potential seed; Indicates the first High-dimensional vectors corresponding to all potential seeds of a minority class sample; Represents multi-granularity dynamic feature vectors Importance weights; Indicates the strength of causal relationship; Indicates the first Labels in a minority class of samples; Indicates an indicator function, when The value is 1 if the condition is met, and 0 otherwise. Potential seeds with a causal propensity gain higher than a first threshold value are selected, the high-dimensional vectors corresponding to the selected potential seeds are fine-tuned, and a positive example sample is synthesized by combining the causal chain reverse generation strategy; The causal isolation degree between the minority class sample and each majority class sample is calculated, and the calculation formula is: ; wherein, represents a causal isolation degree; represents a first majority class sample; represents a minority class sample set; represents a graph distance based on causal propensity chains on a semantic association graph, the graph distance being a sum of edge weights on a path connecting two samples; Majority class samples with a causal isolation degree higher than a second threshold value are selected and synthesized into negative example samples; The positive example samples and the negative example samples corresponding to each minority class sample are combined to obtain the balanced training set.
Citation Information
Patent Citations
Similar pathology retrieval method, device and equipment based on multiple modes and storage medium
CN118245626A
Big data-based regulation applicability monitoring method and system
CN120974217A
Configuring a generative machine learning model using a syntactic interface
US12211598B1
System and Method for Similarity Search in Process Data
US20150178286A1
Similar case search apparatus, method for operating similar case search apparatus, and similar case search system
US20190295724A1