A causal-dynamic multi-granularity based similar case query method

By employing a causal-dynamic multi-granularity similar case query method, which utilizes a dynamic time-warped kernel autoencoder and a causal attention network, the problem of class imbalance in medical big data is solved. This enables accurate querying of multimodal data and interpretable similar case queries, thereby enhancing the transparency and credibility of clinical decision-making.

CN121075690BActive Publication Date: 2026-02-03湖南工商大学
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511600532.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-02-03
Estimated Expiration
2045-11-04

AI Technical Summary

Technical Problem

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 and provide interpretable causal relationships, resulting in low recall rates or high no-match rates, which affects doctors' decision-making.

Method used

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 templates is calculated. Combined with causal perception similarity, a transparent similar case query is provided.

Benefits of technology

It enables accurate querying and assisted prediction in multimodal medical data, provides a reliable similar case query service, and enhances the transparency and interpretability of clinical decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121075690B_ABST
    Figure CN121075690B_ABST
Patent Text Reader

Abstract

The application relates to a similar case query method based on a cause-effect-dynamic multi-granularity, which comprises the following steps: acquiring a to-be-queried feature of to-be-queried data, inputting the to-be-queried feature into an encoder of a trained dynamic time warping kernel autoencoder, calculating the similarity between a time sequence sign feature in the to-be-queried feature and each preset typical disease process template, then mapping each similarity into a corresponding multi-granularity dynamic feature vector, aggregating all the multi-granularity dynamic feature vectors to obtain a feature vector set, and expanding the feature vector set into a single high-dimensional vector, performing cause-effect attention weighting on the high-dimensional vector through a cause-effect attention network to obtain a cause-effect weighted feature, calculating the cause-effect perception similarity between the cause-effect weighted feature corresponding to the to-be-queried data and the cause-effect weighted feature corresponding to a known case in a database, and taking the known case with the highest cause-effect perception similarity as the similar case of the to-be-queried data, so that a transparent and credible similar case query service is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of similar case query technology, and in particular to a similar case query method based on causal-dynamic multi-granularity. Background Technology

[0002] In the application of big data in healthcare, finding similar cases for specific diseases (such as chronic diseases) faces challenges. The core issue is the high imbalance between categories in medical data, with a significant disparity between positive and negative examples. This makes it difficult for traditional similarity measurement methods to find similar items in minority class samples. When similarity models identify rare cases, the recall rate is low or the no-match rate is high, affecting doctors' decision-making. Existing methods to alleviate class imbalance often involve mechanically replicating or simply weighting features in the feature space, ignoring the complex relationships, multimodal information, and dynamic temporal characteristics of medical data. This may generate meaningless samples or lead to overfitting, affecting the model's generalization ability.

[0003] Secondly, the limited sample size is particularly prominent in rare disease or specific subgroup medical data, making it difficult to build a rich and representative case database to support accurate queries and model training generalization. Furthermore, medical data possesses multimodal and complex temporal characteristics, such as dynamic changes in vital signs, high-dimensional medical images, and unstructured text like medical history. Efficiently fusing heterogeneous, multimodal, and dynamic data and extracting features is a key challenge for accurate queries and assisted prediction. Existing deep learning models struggle to efficiently fuse and deeply understand heterogeneous multimodal data, and their "black box" nature lacks interpretability, limiting their application in clinical decision support. Traditional interpretability methods are mostly ex post facto explanations, failing to incorporate causal relationships, and the explanations may not reflect the fundamental mechanisms. Summary of the Invention

[0004] Therefore, it is necessary to provide a similar case query method based on causal-dynamic multi-granularity, including:

[0005] S1: Obtain the data to be queried, preprocess the data to be queried, and obtain the features to be queried;

[0006] 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.

[0007] S3: Pass the high-dimensional vector through a causal attention network to obtain causal attention weights. Apply causal attention weights to the high-dimensional vector to obtain causal weighted features. Calculate the causal perception similarity between the causal weighted features corresponding to the query data and the causal weighted features corresponding to known cases in the database, and take the known case with the highest causal perception similarity as the similar case of the query data.

[0008] Preferably, in S1, the preprocessing of the data to be queried includes:

[0009] 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;

[0010] The features to be queried may include time-series vital signs features, numerical features, medical history text features, or image features;

[0011] 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.

[0012] The preprocessing of structured numerical data is as follows: after cleaning the structured numerical data, Min-Max standardization is performed to obtain numerical features;

[0013] 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.

[0014] 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.

[0015] Preferably, in S2, the formula for calculating the dynamic time warp similarity is:

[0016] ;

[0017] 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.

[0018] Preferably, each similarity is mapped to a corresponding multi-granularity dynamic feature vector, and the mapping formula is:

[0019] ;

[0020] 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.

[0021] 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.

[0022] Preferably, the calculation process for the causal weighted features corresponding to the data to be queried includes:

[0023] The causal attention weights are obtained by passing the high-dimensional vector through a causal attention network, and the calculation formula is as follows:

[0024] ;

[0025] 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;

[0026] 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:

[0027] ;

[0028] in, This represents the causal weighted feature corresponding to the data to be queried.

[0029] Preferably, in S3, the formula for calculating causal perception similarity is:

[0030] ;

[0031] 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 each known case; Represents the L2 norm; This represents the dot product of vectors.

[0032] Preferably, in S2, the training process of the dynamic time-warped kernel autoencoder includes:

[0033] 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.

[0034] 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.

[0035] 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;

[0036] 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.

[0037] Based on each unified initial feature vector and its corresponding reconstructed features, the reconstruction loss is calculated using the following formula:

[0038] ;

[0039] 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.

[0040] Preferably, in S3, the process of obtaining the causal weighted features corresponding to known cases in the database includes:

[0041] 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.

[0042] 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.

[0043] 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.

[0044] Preferably, the process of obtaining a balanced training set includes:

[0045] 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.

[0046] For any minority class sample, select the samples with the highest similarity to the cosine as potential seeds;

[0047] The causal propensity gain between minority class samples and each potential seed is calculated using the following formula:

[0048] ;

[0049] 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.

[0050] 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.

[0051] The causal isolation degree between minority class samples and each majority class sample is calculated using the following formula:

[0052] ;

[0053] 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;

[0054] The majority class samples with causal isolation higher than the second threshold are selected and synthesized into negative samples;

[0055] By combining the positive and negative samples corresponding to each minority class sample, a balanced training set is obtained.

[0056] Beneficial effects: This method acquires the query features of the data to be queried, inputs these features into the encoder of a trained dynamic temporal warp kernel autoencoder, calculates the similarity between the temporal vital signs in the query features and each preset typical disease process template, and then maps each similarity to a corresponding multi-granularity dynamic feature vector; aggregates all multi-granularity dynamic feature vectors to obtain a feature vector set, and expands the feature vector set into a single high-dimensional vector; passes the high-dimensional vector through a causal attention network for causal attention weighting to obtain causal weighted features; calculates the causal perceived similarity between the causal weighted features corresponding to the query data and the causal weighted features corresponding to known cases in the database, and uses the known cases with the highest causal perceived similarity as similar cases to the query data, providing a transparent and reliable similar case query service. Attached Figure Description

[0057] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0058] Figure 1 This is a flowchart of the similar case query method based on causal-dynamic multi-granularity in the embodiments of this application. Detailed Implementation

[0059] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.

[0060] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0061] like Figure 1 As shown, this embodiment provides a similar case query method based on causal-dynamic multi-granularity, including:

[0062] S1: Obtain the data to be queried, preprocess the data to be queried, and obtain the features to be queried.

[0063] In this embodiment, preprocessing the data to be queried includes:

[0064] 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;

[0065] The features to be queried may include time-series vital signs features, numerical features, medical history text features, or image features;

[0066] 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.

[0067] The preprocessing of structured numerical data is as follows: after cleaning the structured numerical data, Min-Max standardization is performed to obtain numerical features;

[0068] 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.

[0069] 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.

[0070] 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.

[0071] Specifically, the encoder includes a dynamic pattern matching layer and a granular aggregation layer;

[0072] 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:

[0073] ;

[0074] 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.

[0075] 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:

[0076] ;

[0077] 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.

[0078] 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.

[0079] This embodiment provides the training process of a dynamic time-warped kernel autoencoder, including:

[0080] 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).

[0081] The raw multimodal data includes:

[0082] 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;

[0083] 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.

[0084] 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;

[0085] 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.

[0086] 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.

[0087] 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;

[0088] 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.

[0089] Based on each unified initial feature vector and its corresponding reconstructed features, the reconstruction loss is calculated using the following formula:

[0090] ;

[0091] 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.

[0092] S3: Pass the high-dimensional vector through a causal attention network to obtain causal attention weights. Apply causal attention weights to the high-dimensional vector to obtain causal weighted features. Calculate the causal perception similarity between the causal weighted features corresponding to the query data and the causal weighted features corresponding to known cases in the database, and take the known case with the highest causal perception similarity as the similar case of the query data.

[0093] Specifically, 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 their corresponding causal influence weights. Cause nodes or effect nodes include a high-dimensional vector 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.

[0094] Furthermore, the calculation process for the causal weighted features corresponding to the data to be queried includes:

[0095] The causal attention weights are obtained by passing the high-dimensional vector through a causal attention network, and the calculation formula is as follows:

[0096] ;

[0097] 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;

[0098] 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:

[0099] ;

[0100] in, This represents the causal weighted feature corresponding to the data to be queried.

[0101] In this embodiment, the formula for calculating causal perception similarity is:

[0102] ;

[0103] 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 each known case; Represents the L2 norm; This represents the dot product of vectors.

[0104] To provide richer explanations for similarity, this embodiment also supports interpreting the causes of similarity based on causal attention weights. When two cases are judged to be similar, the model can highlight the similar patterns exhibited by the two in features with high causal correlation (such as persistent hyperglycemia and abnormal renal function indicators), thus providing a causal explanation for "why they are similar." For example, if two patients develop similar patterns of renal function decline due to "long-term poor glycemic control" and "genetic susceptibility," the model can clearly identify key features in these causal chains as the main basis for similarity. This allows physicians to assist in diagnosis and treatment decisions by reviewing the treatment processes and prognoses of similar historical cases, enhancing the system's clinical usability, transparency, and credibility.

[0105] Furthermore, the process of obtaining the causal weighted features corresponding to known cases in the database includes:

[0106] 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 (such as a multilayer perceptron) is trained based on the balanced training set.

[0107] 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.

[0108] 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.

[0109] The training process of a deep learning classifier includes:

[0110] The causal attention weights corresponding to each sample are passed through the sigmoid function to output the corresponding prediction probabilities;

[0111] Based on the predicted probability and label of each sample, the binary cross-entropy loss is calculated, and the binary cross-entropy loss is minimized to optimize the deep learning classifier.

[0112] The purpose of training a deep learning classifier is to learn a feature space that can effectively distinguish between cases where complications occur (positive examples) and cases where they do not occur (negative examples). After training, the deep learning classifier has a dual function: first, it extracts highly discriminative "intermediate feature representations" from its hidden layers for all known cases in the database, which are then used for subsequent causal weighting; second, it can be directly applied to new query data to output an auxiliary disease risk prediction probability, providing doctors with a preliminary risk level assessment.

[0113] Furthermore, the process of obtaining a balanced training set includes:

[0114] To improve the recall and accuracy of similarity queries in rare cases, 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.

[0115] For any minority class sample, select the samples with the highest similarity to the cosine as potential seeds;

[0116] A causal inference mechanism is introduced to evaluate the "association transmission" of feature detection. This mechanism focuses on the causal contribution of local feature subsets to disease outcomes. The Peter-Clark algorithm is used to infer the strength of causal associations 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 probability that a potential seed will become a positive example (minority class sample) under the existing causal associations. The calculation formula is as follows:

[0117] ;

[0118] 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.

[0119] 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.

[0120] The causal isolation degree between minority class samples and each majority class sample is calculated using the following formula:

[0121] ;

[0122] in, Indicates the degree of causal isolation; Indicates the first A majority class sample; Represents the set of minority class samples; The graph distance is represented by the causal tendency chain on the semantic association graph, where the graph distance is the sum of the edge weights on the path connecting the two samples; the causal isolation is used to measure the distance between the multi-granularity dynamic feature vector of a negative example (majority class sample) and the multi-granularity dynamic feature vector of its nearest positive example along the causal path on the semantic association graph, in order to identify "safe" negative examples that are "difficult" to be transformed into positive examples through the causal tendency chain.

[0123] The majority class samples with causal isolation higher than the second threshold are selected and synthesized into negative samples;

[0124] By combining the positive and negative samples corresponding to each minority class sample, a balanced training set is obtained.

[0125] In this embodiment, the fine-tuning process includes: shifting the high-dimensional vector corresponding to the latent seed along the direction pointing to the high-dimensional vector of the corresponding minority class sample with a small step size, the shift step size being proportional to the causal tendency gain; and combining it with the causal chain reverse generation strategy to synthesize a positive example sample. The specific generation process of the positive example sample is as follows: identifying key features with high causal correlation strength in the original minority class sample, fusing these key features with the fine-tuned high-dimensional vector of the latent seed, and generating a positive example sample that retains the contextual information of the latent seed and has the core causal features of the minority class sample.

[0126] The database stores "known cases." These known cases come from original medical datasets and have complete historical data and defined labels (whether complications occurred). The database serves as a "reference point," allowing new "query data" to find similar cases within it.

[0127] The data to be queried is newly arrived patient data with unknown outcomes. In this embodiment, the purpose of this method, in addition to finding the most similar known cases for this new data, is to provide an auxiliary risk prediction for the data to be queried using a trained deep learning classifier, causal attention network, and sigmoid function.

[0128] Causal attention networks can not only accurately assist in the prediction of disease risk, but their internal causal attention weights can also serve as a feature contribution map, directly indicating which features contribute the most to the final predicted probability. Moreover, this contribution is based on their position on the causal chain in the semantic association graph and the strength of the causal association, which provides an intuitive and interpretable basis for decision-making in clinical analysis.

[0129] The causal-dynamic multi-granularity similar case query method provided in this embodiment has the following beneficial effects:

[0130] This method proposes a novel comprehensive analysis and processing approach to solve the challenge of similar case queries in imbalanced medical datasets, assisting in accurate disease risk prediction. By introducing multi-granular dynamic feature extraction, context-aware sample reconstruction, and a causal-interpretive fusion mechanism, it overcomes the limitations of existing technologies, making similarity matching more accurate, query results more clinically meaningful, and providing reliable interpretations to assist doctors in early risk assessment and clinical decision-making for chronic diseases. The core is to construct feature representations that deeply understand patients' dynamic physiological changes and disease development patterns, enhance sample representation and similarity assessment through causal association, and provide a transparent and reliable similar case query service.

[0131] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0132] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for querying similar cases based on causal-dynamic multi-granularity, characterized in that, include: S1: Obtain the data to be queried, preprocess the data to be queried, and obtain the features to be queried; 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. S3: The causal attention network includes a feature causal relationship graph used to calculate causal attention weights. The feature causal relationship graph includes cause nodes, effect nodes, and their corresponding causal influence weights. Each cause node or effect node consists of a high-dimensional vector of any dimension corresponding to the data being queried. The causal influence weight of each cause node or effect node is the global influence calculated using the Peter-Clark algorithm. The causal attention weights are obtained by passing the high-dimensional vector through the causal attention network, calculated 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; Causal attention weights are applied to high-dimensional vectors to obtain causal weighted features, calculated using the following formula: ; in, This represents the causal weighted feature corresponding to the data to be queried; Calculate the causal perceived similarity between the causal weighted features corresponding to the data to be queried and the causal weighted features corresponding to known cases in the database. The formula for calculating the causal perceived 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; Indicates the first in the database Causal weighted features corresponding to each known case; Represents the L2 norm; This represents the vector dot product; and the known cases with the highest causal perception similarity are taken as similar cases in the query data.

2. The similar case query method based on causal-dynamic multi-granularity according to claim 1, characterized in that, 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.

3. The similar case query method based on causal-dynamic multi-granularity according to claim 1, characterized in that, In S2, the formula for calculating 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.

4. The similar case query method based on causal-dynamic multi-granularity according to claim 3, characterized in that, Each similarity is mapped to a corresponding multi-granularity dynamic feature vector, and 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 Bias of a pre-defined typical disease progression template.

5. The method for querying similar cases based on causality-dynamic multi-granularity according to claim 1, characterized in that, 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.

6. The method for querying similar cases based on causality-dynamic multi-granularity according to claim 5, characterized in that, 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.

7. The method for querying similar cases based on causality-dynamic multi-granularity according to claim 6, characterized in that, 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.

Citation Information

Patent Citations

  • Big data-based regulation applicability monitoring method and system

    CN120974217A