A Counterfactual Prediction Method and Device for Medical Time-Series Data Based on Causal Disentanglement

By adopting a causal decoupling method in medical timing data prediction and dynamically adjusting confounding factors, the problems of causal inference deviation and long-term prediction stability in the prior art are solved, and higher counterfactual inference accuracy and personalized medical decision support are achieved.

CN119742083BActive Publication Date: 2025-06-13HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510260033.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-13
Estimated Expiration
2045-03-06

AI Technical Summary

Technical Problem

The prior art is difficult to dynamically adjust the confounding factors in causal inference when predicting counterfactual results of time series, resulting in large deviations in causal inference, and it is difficult to ensure stability and accuracy in long-term prediction tasks. The use of labelless data is limited, which affects the generalization ability and adaptability of the model.

Method used

The medical timing data counterfactual prediction method based on causal decoupling is adopted to build a network through the characteristic causal decoupling module, mutual information estimator, timing feature encoder and timing counterfactual decoder, covariate decoupling and multi-step counterfactual prediction are carried out, and the comprehensive loss function is combined for training, dynamically adjust confounding factors and improve prediction accuracy.

Benefits of technology

Effectively dealing with dynamic confounding factors in medical timing data improves the accuracy of counterfactual inference, can accurately evaluate the long-term effects of interventions, provide support for personalized medical decisions, and improve the stability and reliability of the model in complex medical timing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119742083B_ABST
    Figure CN119742083B_ABST
Patent Text Reader

Abstract

The present invention provides a counterfactual prediction method and device for medical time series data based on causal decoupling, which relates to the field of artificial intelligence technology. The method includes: obtaining a medical time series data set; performing cleaning processing on the medical time series data set to obtain a cleaned data set; constructing an initial causal decoupling time series counterfactual prediction network; using the cleaned data set to train the initial causal decoupling counterfactual prediction network to obtain a trained causal decoupling counterfactual prediction network; obtaining the medical time series data to be predicted; inputting the medical time series data to be predicted into the trained prediction network for processing to obtain a counterfactual prediction result of the medical time series data. By using the present invention, the accuracy of causal inference of medical time series data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and particularly to a counterfactual prediction method and device for medical time series data based on causal decoupling. Background Art

[0002] Precision medicine plays an important role in people's livelihood. It provides medical services in a personalized way, based on an individual's genome, biomarkers and clinical data for diagnosis, prevention and treatment, so as to achieve more accurate, efficient and safe medical outcomes. The analysis of medical time series data is one of the important research directions of precision medicine. With the popularization of medical big data such as electronic health records, gene data and medical records, mining the implicit information in medical data through causal inference methods can effectively assist personalized treatment and decision-making.

[0003] Currently, there are the following challenges in predicting counterfactual results of time series, including: The main challenge in counterfactual result prediction is that the potential results have never been observed, resulting in the inability to apply traditional supervised learning frameworks and making the task more difficult; in addition, in the observed dataset, there are only a few samples in each process, resulting in poor generalization performance and reducing the performance of handling counterfactual predictions; due to time-related confounding factors, it is more serious in the time series field. Specifically, the input covariates may be affected by past treatments and at the same time affect future treatments and results, thus generating time-related confounding biases. Currently, the methods for predicting counterfactual results of time series include: (1) Traditional methods based on covariate balance, which reduce biases by adjusting confounding factors, but face the following limitations in time series data: unable to model time dependence; linear hypothesis limitation, making it difficult to handle complex non-linear relationships in medical time series data; as the number of covariates increases, the computational complexity increases significantly, resulting in inefficient feature selection; (2) Methods based on recurrent neural networks, which strengthen the long-term dependence modeling ability through attention mechanisms, but this method has large error accumulation in causal inference tasks, resulting in unstable prediction results; In summary, the main problems of existing methods for predicting counterfactual results of time series are that the confounding factors in time series may change over time, and existing methods are difficult to dynamically adjust, resulting in large causal inference biases; current models are difficult to ensure stability and accuracy in long-term prediction tasks, and the utilization of unlabeled data by existing methods is limited, affecting the generalization ability and adaptability of the models. Summary of the Invention

[0004] To solve the technical problems existing in the prior art that the confounding factors in the time series may change over time and it is difficult for existing methods to dynamically adjust, resulting in large causal inference biases; current models are difficult to ensure stability and accuracy in long-term prediction tasks; and existing methods have limited utilization of unlabeled data, affecting the generalization ability and adaptability of the models, the embodiments of the present invention provide a counterfactual prediction method and device for medical time series data based on causal decoupling. The technical solutions are as follows:

[0005] On the one hand, a counterfactual prediction method for medical time series data based on causal decoupling is provided. This method is implemented by a counterfactual prediction device for medical time series data based on causal decoupling, and the method includes:

[0006] S1. Obtain a medical time series data set; the medical time series data set includes: physiological indicators of patients, treatment records, and drug usage conditions;

[0007] S2. Clean the medical time series data set to obtain a cleaned data set;

[0008] S3. Construct an initial counterfactual prediction network based on causal decoupling; among them, the initial counterfactual prediction network based on causal decoupling includes: a feature causal decoupling module, a mutual information estimator, a time series feature encoder, a time series counterfactual decoder, and a comprehensive loss function;

[0009] S4. Input the cleaned data set into the initial counterfactual prediction network based on causal decoupling. The feature causal decoupling module decouples the covariates of the cleaned data to obtain decoupled covariate features; input the decoupled covariate features into the mutual information estimator for mutual information minimization constraint to obtain high-quality decoupled covariate features; input the high-quality decoupled covariate features into the time series feature encoder, and perform multi-step counterfactual prediction through the time series counterfactual decoder to obtain an initial counterfactual prediction result; use the initial counterfactual prediction result to train through the comprehensive loss function to obtain a trained counterfactual prediction network based on causal decoupling;

[0010] S5. Obtain the medical time series data of the patient to be predicted; input the medical time series data of the patient to be predicted into the trained counterfactual prediction network based on causal decoupling for processing to obtain the prediction results of the patient's health status and disease changes.

[0011] Optionally, the feature causal decoupling module includes: a structural causal model for determining the causal relationship between interventions and outcomes;

[0012] Among them, the mutual information estimator is used to reduce the relationship between latent factors by minimizing mutual information; among them, the latent factors include: instrumental factor, adjustment factor, and confounding factor; the instrumental factor only affects treatment selection; the adjustment factor only affects the outcome; the confounding factor affects both treatment selection and the outcome;

[0013] Among them, the temporal feature encoder is used to convert the decoupled covariate features into deep feature representations;

[0014] Among them, the temporal counterfactual decoder is used to extract the features of temporal data during the prediction process.

[0015] Optionally, the step S4 of inputting the high-quality decoupled covariate features into the temporal feature encoder and performing multi-step counterfactual prediction through the temporal counterfactual decoder to obtain the initial counterfactual prediction result includes:

[0016] Input the high-quality decoupled covariate features into the temporal feature encoder, and convert the high-quality decoupled covariate features into deep feature representations; input the deep feature representations into the temporal data decoder, and generate the initial counterfactual prediction result through the autoregressive prediction mechanism.

[0017] Optionally, the comprehensive loss function includes: prediction error loss function, prediction treatment plan minimization loss function, prediction treatment plan maximization loss function, and regularization loss function.

[0018] Optionally, the comprehensive loss function is represented by the following formula (1):

[0019] (1)

[0020] Among them, represents the comprehensive loss; represents the prediction error loss; represents the prediction treatment plan minimization loss; represents the prediction treatment plan maximization loss; represents the regularization loss;

[0021] Among them, the prediction error loss function is represented by the following formula (2) - formula (3):

[0022] (2)

[0023] (3)

[0024] Among them, represents the prediction error loss; represents the selection probability of the treatment plan based on the confounding factor ; N represents the number of patients; Denote the treatment plan at time t; Denote the treatment effect at time t+1; Denote the predicted effect at time t+1; Denote the adjustment factor; Denote the probability of the treatment plan occurring; Denote the historical sum before the treatment result at time t+1; Denote the historical sum before the treatment plan at time t+1;

[0025] Among them, the predicted treatment plan that minimizes the loss function is represented by the following formula (4):

[0026] (4)

[0027] Among them, Denote the minimum loss of the predicted treatment plan; Denote a hyperparameter; A metric used to measure the distribution difference between the treatment group and the control group.

[0028] Optionally, the predicted treatment plan that maximizes the loss is represented by the following formula (5):

[0029] (5)

[0030] Among them,[[]] is a hyperparameter,[[]] Denote the treatment selection probability based on the treatment factor plus the confounding factor; Denote the treatment selection probability based on the confounding factor.

[0031] Optionally, the regularization loss function is represented by the following formula (6) - formula (8):

[0032] (6)

[0033] (7)

[0034] (8)

[0035] Among them, Denote the hyperparameter; Denote the approximate mutual information between the treatment factor and the confounding factor; Denote the approximate mutual information between the adjustment factor and the confounding factor; Denote the function The expectation with respect to the distribution P (x, y); Denote the function First, take the expectation with respect to the distribution p(y) to get the result, and then take the expectation with respect to p(x); Denotes the log function value of the probability function q(y|x); is the mutual information an upper bound estimate of.

[0036] On the other hand, a medical time series data counterfactual prediction device based on causal decoupling is provided. The device is applied to a medical time series data counterfactual prediction method based on causal decoupling. The device includes:

[0037] A first acquisition unit for acquiring a medical time series data set; the medical time series data set includes: physiological indicators of patients, treatment records, and drug usage;

[0038] A second acquisition unit for cleaning the medical time series data set to obtain a cleaned data set;

[0039] A construction unit for constructing an initial causal decoupling-based counterfactual prediction network; wherein, the initial causal decoupling-based counterfactual prediction network includes: a feature causal decoupling module, a mutual information estimator, a time series feature encoder, a time series counterfactual decoder, and a comprehensive loss function;

[0040] A training unit for inputting the cleaned data set into the initial causal decoupling-based counterfactual prediction network, decoupling the covariates of the cleaned data through the feature causal decoupling module to obtain decoupled covariate features; inputting the decoupled covariate features into the mutual information estimator for mutual information minimization constraint to obtain high-quality decoupled covariate features; inputting the high-quality decoupled covariate features into the time series feature encoder, and performing multi-step counterfactual prediction through the time series counterfactual decoder to obtain an initial counterfactual prediction result; using the initial counterfactual prediction result to perform training through the comprehensive loss function to obtain a trained causal decoupling-based counterfactual prediction network;

[0041] A prediction unit for acquiring the medical time series data of the patient to be predicted; inputting the medical time series data of the patient to be predicted into the trained causal decoupling-based counterfactual prediction network for processing to obtain the prediction results of the patient's health status and disease condition changes.

[0042] Optionally, the feature causal decoupling module includes: a structural causal model for determining the causal relationship between interventions and outcomes;

[0043] Among them, the mutual information estimator is used to reduce the relationship between latent factors by mutual information minimization constraint; among them, the latent factors include: instrumental factors, adjustment factors, and confounding factors; instrumental factors only affect treatment selection; adjustment factors only affect outcomes; confounding factors affect both treatment selection and outcomes;

[0044] Among them, the temporal feature encoder is used to convert the decoupled covariate features into deep feature representations;

[0045] Among them, the temporal counterfactual decoder is used to extract the features of temporal data during the prediction process.

[0046] Optionally, S4 inputs the high-quality decoupled covariate features into the temporal feature encoder, and performs multi-step counterfactual prediction through the temporal counterfactual decoder to obtain the initial counterfactual prediction result, including:

[0047] Input the high-quality decoupled covariate features into the temporal feature encoder, and convert the high-quality decoupled covariate features into deep feature representations; input the deep feature representations into the temporal data decoder, and generate the initial counterfactual prediction result through the autoregressive prediction mechanism.

[0048] Optionally, the comprehensive loss function includes: a prediction error loss function, a prediction treatment plan minimization loss function, a prediction treatment plan maximization loss function, and a regularization loss function.

[0049] Optionally, the comprehensive loss function is represented by the following formula (1):

[0050] (1)

[0051] Among them, represents the comprehensive loss; represents the prediction error loss; represents the prediction treatment plan minimization loss; represents the prediction treatment plan maximization loss; represents the regularization loss;

[0052] Among them, the prediction error loss function is represented by the following formula (2) - formula (3):

[0053] (2)

[0054] (3)

[0055] Among them, represents the prediction error loss; represents the selection probability of the treatment plan based on the confounding factor ; N represents the number of patients; represents the treatment plan at time t; represents the treatment effect at time t + 1; represents the predicted effect at time t + 1; represents the adjustment factor; represents the probability of the treatment plan occurring; Represents the historical sum before the treatment result at time t + 1; Represents the historical sum before the treatment plan at time t + 1;

[0056] Among them, the predicted treatment plan that minimizes the loss function is represented by the following formula (4):

[0057] (4)

[0058] Among them, Represents the minimum loss of the predicted treatment plan; Represents a hyperparameter; A metric used to measure the distribution difference between the treatment group and the control group.

[0059] Optionally, the predicted treatment plan that maximizes the loss is represented by the following formula (5):

[0060] (5)

[0061] Among them, Is a hyperparameter, Represents the treatment selection probability based on the treatment factor plus the confounding factor; Represents the treatment selection probability based on the confounding factor.

[0062] Optionally, the regularization loss function is represented by the following formula (6) - formula (8):

[0063] (6)

[0064] (7)

[0065] (8)

[0066] Among them, Represents a hyperparameter; Represents the approximate mutual information between the treatment factor and the confounding factor; Represents the approximate mutual information between the adjustment factor and the confounding factor; Represents the function The expectation with respect to the distribution P(x, y); Represents the function First, the expectation with respect to the distribution p(y) is obtained, and then the expectation with respect to p(x); Represents the log function value of the probability function q(y|x); Is the mutual information An upper bound estimate of.

[0067] On the other hand, a medical time-series data counterfactual prediction device based on causal decoupling is provided. The medical time-series data counterfactual prediction device based on causal decoupling includes: a processor; a memory storing computer-readable instructions thereon, and when the computer-readable instructions are executed by the processor, any one of the methods in the above-mentioned medical time-series data counterfactual prediction method based on causal decoupling is implemented.

[0068] On the other hand, a computer-readable storage medium is provided, and at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement any one of the methods in the above-mentioned medical time-series data counterfactual prediction method based on causal decoupling.

[0069] The beneficial effects brought by the technical solutions provided in the embodiments of the present invention at least include:

[0070] In the embodiments of the present invention, a medical time-series data set is first obtained; the medical time-series data set includes: physiological indicators of patients, treatment records, and drug usage conditions; the medical time-series data set is cleaned to obtain a cleaned data set; secondly, an initial counterfactual prediction network based on causal decoupling is constructed; wherein, the initial counterfactual prediction network based on causal decoupling includes: a feature causal decoupling module, a mutual information estimator, a time-series feature encoder, a time-series counterfactual decoder, and a comprehensive loss function; the cleaned data set is input into the initial counterfactual prediction network based on causal decoupling, and the covariates of the cleaned data are decoupled by the feature causal decoupling module to obtain decoupled covariate features; the decoupled covariate features are input into the mutual information estimator for mutual information minimization constraint to obtain high-quality decoupled covariate features; the high-quality decoupled covariate features are input into the time-series feature encoder, and multi-step counterfactual prediction is performed by the time-series counterfactual decoder to obtain an initial counterfactual prediction result; the initial counterfactual prediction result is used to train through the comprehensive loss function to obtain a trained counterfactual prediction network based on causal decoupling; the medical time-series data of the patient to be predicted is obtained; finally, the medical time-series data of the patient to be predicted is input into the trained counterfactual prediction network based on causal decoupling for processing to obtain the prediction results of the patient's health status and disease progression.

[0071] The present invention effectively processes the dynamic confounding factors in medical time-series data through the covariate decoupling method, improving the accuracy of counterfactual inference; the counterfactual prediction network based on causal decoupling constructed by the present invention can accurately evaluate the long-term effects of intervention measures and provide support for personalized medical decision-making. The present invention adopts a multi-step prediction structure, solves the problems of error accumulation and insufficient long-term dependence modeling ability in traditional methods, and can enable the network to provide more stable and reliable prediction results in complex medical time-series scenarios; the accuracy of causal inference of medical time-series data can be improved by adopting the present invention. Description of the Drawings

[0072] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0073] Figure 1 is a flowchart of a counterfactual prediction method for medical time-series data based on causal decoupling provided by an embodiment of the present invention;

[0074] Figure 2 is a process of counterfactual prediction provided by an embodiment of the present invention;

[0075] Figure 3 is a schematic structural diagram of a causal decoupling time-series data counterfactual prediction method provided by an embodiment of the present invention;

[0076] Figure 4 is a schematic diagram of a covariate decoupling counterfactual prediction network provided by an embodiment of the present invention;

[0077] Figure 5 is a block diagram of a counterfactual prediction device for medical time-series data based on causal decoupling provided by an embodiment of the present invention;

[0078] Figure 6 is a schematic structural diagram of a counterfactual prediction device for medical time-series data based on causal decoupling provided by an embodiment of the present invention. Specific Embodiments

[0079] The following will describe the technical solutions in the present invention with reference to the accompanying drawings.

[0080] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as an "example" in the present invention should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly, the use of the word "example" is intended to present concepts in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one of the two.

[0081] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when their differences are not emphasized, the meanings they express are the same. "(of)", "corresponding", and "corresponding" can sometimes be used interchangeably. It should be noted that when their differences are not emphasized, the meanings they express are the same.

[0082] In the embodiments of the present invention, sometimes subscripts such as W 1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meanings they express are the same.

[0083] To make the technical problems, technical solutions, and advantages to be solved by the present invention clearer, the following will be described in detail with reference to the accompanying drawings and specific embodiments.

[0084] The embodiments of the present invention provide a counterfactual prediction method for medical time-series data based on causal decoupling. This method can be implemented by a counterfactual prediction device for medical time-series data based on causal decoupling. The counterfactual prediction device for medical time-series data based on causal decoupling can be a terminal or a server. As Figure 1 shown in the flowchart of the counterfactual prediction method for medical time-series data based on causal decoupling, the processing flow of this method can include the following steps:

[0085] S1. Obtain a medical time-series data set; the medical time-series data set includes: physiological indicators of patients, treatment records, and drug usage conditions.

[0086] In a feasible implementation manner, the physiological indicators of patients include: blood pressure, blood sugar, body temperature, heart rate, blood oxygen, blood lipid, pH value, and liver function, etc.

[0087] Among them, Figure 2 is a process of counterfactual prediction provided by the embodiments of the present invention; in a feasible implementation manner, when observing a tuple where represents a patient, is the time step. represents the observed feature vector of the -dimensional time-varying related to the patient; represents the given treatment intervention; represents the clinical outcome. Among them, the counterfactual prediction network based on causal decoupling constructed in this application can use future treatment as the input and output steps of the potential clinical outcome; among them, the patient historical covariates are composed of three variables including an instrumental factor, an adjustment factor, and a confounding factor. Among them, the instrumental factor only affects the treatment selection, the adjustment factor only affects the outcome, and the confounding factor affects both the treatment selection and the outcome.

[0088] S2. Clean the medical time-series data set to obtain the cleaned data set.

[0089] In a feasible implementation, the cleaning process may include: filling in missing values, detecting outliers, removing invalid data, duplicate data, and inconsistent data.

[0090] Among them, filling in missing values can adopt one of the methods of mean / median filling method, forward filling method, and backward filling method, which is not limited in this application.

[0091] Among them, outlier detection can select the threshold method, the standard deviation method, or the autoregressive model to process the data. Among them, the threshold method is a method for detecting outliers based on a fixed range calculated by a predetermined rule or historical data, and is often used to monitor physiological data such as heart rate, blood pressure, and body temperature in medical data. In a feasible implementation, the implementation process of the threshold method includes:

[0092] (1) Set the threshold: Set the upper and lower threshold values according to medical knowledge or historical data; for example, the normal heart rate range is 60 - 100 beats per minute, and the normal blood pressure range is 120 / 80 mmHg. Compare with the threshold: Compare each data point with the predetermined threshold. If the data point exceeds the threshold range, it is regarded as an outlier; (2) Mark the outlier: When the measured value at a certain moment exceeds the normal range, that is, the upper and lower threshold values, it is marked as an outlier.

[0093] Among them, the implementation process of the standard deviation method: Calculate the mean μ and standard deviation σ of the data; Define the outlier range: When a certain data point exceeds the range of μ ± 3σ, it is determined as an outlier.

[0094] Among them, the autoregressive model includes: AR, ARMA, and ARIMA; the autoregressive model can predict future data points based on historical data points and calculate the error. When the difference between the actual value and the predicted value at a certain moment exceeds the predetermined range, it is abnormal.

[0095] Among them, the normalization processing technology is adopted to normalize the characteristics of the physiological index data of different patients to ensure that data in different dimensions can be analyzed on the same scale.

[0096] S3. Construct an initial causal decoupling counterfactual prediction network; among them, the initial causal decoupling counterfactual prediction network includes: a feature causal decoupling module, a mutual information estimator, a time series feature encoder, a time series counterfactual decoder, and a comprehensive loss function.

[0097] Optionally, the feature causal decoupling module includes: a structural causal model for determining the causal relationship between intervention and outcome;

[0098] Among them, this application uses a structural causal model to decouple the covariates in medical time series data, separating intervention factors, outcome factors, and confounding factors.

[0099] Among them, by decoupling the covariates in the medical time-series data through the causal decoupling module, the causal relationship between the intervention and the outcome can be accurately captured by the causal decoupling counterfactual prediction network, the influence of confounding factors can be removed, and reliable counterfactual predictions can be provided.

[0100] Among them, the mutual information estimator is used to reduce the relationship between latent factors by minimizing the mutual information; among them, the latent factors include: instrumental factors, adjustment factors, and confounding factors; instrumental factors only affect treatment selection; adjustment factors only affect the outcome; confounding factors affect both treatment selection and the outcome;

[0101] In a feasible implementation manner, the present application performs mutual information minimization constraint through the mutual information estimator; among them, the mutual information minimization constraint is used to ensure the independence between latent factors, where the latent factors include: instrumental factors, adjustment factors, and confounding factors; by minimizing the mutual information between factors, the dependence relationship between latent factors is reduced, the interference factors in causal inference are removed, and the adaptability of the causal decoupling counterfactual prediction network to complex medical time-series data is improved.

[0102] Among them, the time-series feature encoder is used to transform the decoupled covariate features into deep feature representations;

[0103] Among them, the time-series counterfactual decoder is used to extract the features of the time-series data during the prediction process.

[0104] In a feasible implementation manner, the decoupled covariate features are input into the time-series feature encoder to transform the decoupled covariate features into deep feature representations; the time-series counterfactual data decoder predicts the potential outcomes at multiple future time steps step by step according to the deep feature representations and the intervention information.

[0105] Among them, the intervention information is the treatment plan sequence.

[0106] Optionally, the comprehensive loss function includes: prediction error loss function, prediction treatment plan minimization loss function, prediction treatment plan maximization loss function, and regularization loss function;

[0107] Among them, the prediction error loss function is used for the prediction of the true outcome;

[0108] Among them, the prediction error loss function ensures that the network can accurately predict future medical outcomes by minimizing the difference between the true observed outcome and the predicted outcome; among them, the future medical outcomes include: patient health status, the effect of drug treatment, the effect of surgical treatment, and the change of the condition.

[0109] Among them, since the adjustment factor only affects the treatment outcome and has nothing to do with the treatment plan, the constraint decoupling factor can be minimized by predicting the probability difference between the two treatment plans by minimizing the loss function of the treatment plan prediction.

[0110] Among them, the regularization loss function is used to ensure that there is no intersection of information between different factors;

[0111] Among them, the regularization loss avoids overfitting of the model by constraining the independence between latent factors.

[0112] Among them, since both the treatment factor and the confounding factor affect the treatment plan, the treatment factor and the confounding factor can be separated by predicting the difference between the two treatment plans by maximizing the loss function of the treatment plan prediction.

[0113] Optionally, the comprehensive loss function is represented by the following formula (1):

[0114] (1)

[0115] Among them, represents the comprehensive loss; represents the prediction error loss; represents minimizing the loss of the predicted treatment plan; represents maximizing the loss of the predicted treatment plan; represents the regularization loss;

[0116] Among them, the prediction error loss function is represented by the following formula (2) - formula (3):

[0117] (2)

[0118] (3)

[0119] Among them, represents the prediction error loss; represents the selection probability of the treatment plan based on the confounding factor ; N represents the number of patients; represents the treatment plan at time t; represents the treatment effect at time t + 1; represents the predicted effect at time t + 1; represents the adjustment factor; represents the probability of the treatment plan occurring; represents the historical sum before the treatment outcome at time t + 1; represents the historical sum before the treatment plan at time t + 1;

[0120] Among them, the prediction treatment plan minimization loss function is represented by the following formula (4):

[0121] (4)

[0122] Among them, represents minimizing the loss of the predicted treatment plan; represents a hyperparameter; a metric for measuring the distribution difference between the treatment group and the control group.

[0123] Optionally, maximizing the loss of the predicted treatment plan is represented by the following formula (5):

[0124] (5)

[0125] Optionally, the regularization loss function is represented by the following formula (6) - formula (8):

[0126] (6)

[0127] (7)

[0128] (8)

[0129] Among them, represents a hyperparameter; represents the approximate mutual information between the treatment factor and the confounding factor; represents the approximate mutual information between the adjustment factor and the confounding factor; represents the function the expectation with respect to the distribution P(x, y); represents the function first obtain the result by taking the expectation with respect to the distribution p(y) and then take the expectation with respect to p(x); represents the log function value of the probability function q(y|x); is the mutual information an upper bound estimate of.

[0130] Among them, each partial loss function in the comprehensive loss function is weighted and summed, and the optimization objective is to simultaneously minimize the prediction error and the influence of confounding factors.

[0131] Among them, Figure 3It is a schematic structural diagram of a causal decoupling time-series data counterfactual prediction method provided by an embodiment of the present invention; in a feasible implementation manner, medical time-series data is obtained, and the data is standardized and cleaned to obtain the cleaned data; the cleaned data is subjected to covariate decoupling to obtain decoupled covariate features; the decoupled covariate features are processed by minimizing mutual information to obtain processed features; the processed features are input into an encoder for feature extraction to obtain feature representations; according to the feature representations, an autoregressive prediction mechanism is used for prediction to obtain a preliminary prediction result; error correction is performed according to the preliminary prediction result, and training is performed through a comprehensive loss function to obtain a trained causal decoupling counterfactual prediction network.

[0132] S4. Input the cleaned data set into the initial causal decoupling counterfactual prediction network, and perform decoupling processing on the covariates of the cleaned data through the feature causal decoupling module to obtain decoupled covariate features; input the decoupled covariate features into the mutual information estimator for mutual information minimization constraint to obtain high-quality decoupled covariate features; input the high-quality decoupled covariate features into the time-series feature encoder, and perform multi-step counterfactual prediction through the time-series counterfactual decoder to obtain an initial counterfactual prediction result; use the initial counterfactual prediction result to perform training through a comprehensive loss function to obtain a trained causal decoupling counterfactual prediction network;

[0133] Among them, the decoupled covariate features include: blood pressure, blood sugar, body temperature, heart rate, blood oxygen, blood lipid, PH value, liver function, etc.

[0134] Optionally, in S4, inputting the high-quality decoupled covariate features into the time-series feature encoder and performing multi-step counterfactual prediction through the time-series counterfactual decoder to obtain an initial counterfactual prediction result includes:

[0135] Input the high-quality decoupled covariate features into the time-series feature encoder, and convert the high-quality decoupled covariate features into deep feature representations; input the deep feature representations into the time-series data decoder, and generate an initial counterfactual prediction result through an autoregressive prediction mechanism.

[0136] Among them, the future prediction results are gradually generated through the autoregressive prediction mechanism; the prediction at each time step depends not only on the intervention information and features at the current moment, but also combines the results of historical predictions to correct the prediction output at the next moment; the above method helps to reduce the accumulation of errors in the prediction process, enabling the causal decoupling counterfactual prediction network to maintain a high prediction accuracy over a long time span.

[0137] In a feasible implementation manner, the autoregressive prediction mechanism is a method for predicting future values based on historical information.

[0138] In a feasible implementation manner, the process of generating a prediction result through a temporal counterfactual data decoder and an autoregressive prediction mechanism may include:

[0139] (1) Initialize the temporal counterfactual data decoder; at each time step, the temporal counterfactual data decoder receives the deep feature representation of the temporal feature encoder;

[0140] (2) At each subsequent time step, the temporal counterfactual data decoder combines the counterfactual prediction result generated at one time step to predict the counterfactual prediction result at the current time step;

[0141] (3) The self-attention layer inside the temporal counterfactual data decoder masks the time steps after the current position to ensure that the prediction is made based on the information generated historically;

[0142] (4) The temporal counterfactual data decoder outputs a probability distribution; wherein, the probability distribution represents the possibility of generating a prediction result at the current time step; select the one with the highest probability as the prediction result at the current time step, and use the prediction result at the current time step as the input for the next time step.

[0143] Among them, a large-scale medical temporal data set is used for training. During the training process, the best model parameters and architecture are selected through cross-validation and hyperparameter optimization; wherein, the training objective of the model is to ensure accurate prediction of counterfactual results at different time steps, while having strong generalization ability and stability.

[0144] S5. Obtain the medical temporal data to be predicted; input the medical temporal data to be predicted into the trained causal decoupled counterfactual prediction network for processing to obtain the counterfactual prediction result of the medical temporal data.

[0145] Among them, counterfactual plays a crucial role in accurately predicting the potential results in the "hypothesis - then" scenario during the decision-making process.

[0146] Among them, Figure 4 is a schematic diagram of a covariate decoupled counterfactual prediction network provided by an embodiment of the present invention; in a feasible implementation manner, wherein, the network is a sequence model, and a recurrent neural network or a transformer model can be used. When the historical information of patient covariates is input into the encoder, three historical covariates can be obtained, namely . Among them, the instrumental factor only affects the treatment selection, the adjustment factor only affects the result, and the confounding factor affects both the treatment selection and the result. Among them, at each time step , there is Can be used to predict treatment and the next result . Specifically, this application will concatenate and send it into classifier D to predict the treatment variable ; will concatenate and combine with the treatment variable input into the outcome network to predict the result variable ; to ensure decoupling, this application takes and the minimization of the mutual information among the three variables as the constraint condition. Among them, the network encoder can only predict one step because it requires the input at each time step . Therefore, to predict multi-step results, this application trains a decoder, which takes the latent representation of the encoder and the treatment sequence as inputs and autoregressively predicts the sequence of result variables. Using the encoder to measure multi-step trajectories requires predicting the entire trajectory of patient covariates, which is not feasible due to the overly large dimension of time-series covariates. The latent representation of the encoder is used as the input, and it learns to directly autoregressively predict the latent representation. During training, it is guaranteed by optimizing the good fit of the same three output heads of the encoder. During testing, the result is replaced with the predicted result of the previous time step.

[0147] Among them, the present invention is applicable to multiple tasks in medical time-series data, including: personalized treatment plan formulation, disease prediction, and drug effect evaluation, and has broad application potential.

[0148] In a feasible implementation manner, the embodiment of the present invention can be used to assist in the treatment of cardiovascular diseases. Doctors can evaluate the potential treatment effect after a certain drug is continuously used for one week by counterfactual prediction results, so as to optimize the treatment plan. The embodiment of the present invention is applicable to scenarios with strong time correlation and intervention effects that accumulate or decay over time.

[0149] Among them, the embodiment of the present invention can also be used for blood glucose control in chronic disease management; in a feasible implementation manner, historical blood glucose data and intervention variables of patients are obtained, where the intervention variables include: data on medication conditions recorded every day, including: drug types and dosages; the obtained historical blood glucose data and intervention variables are input into a trained causal decoupling counterfactual prediction network, and the data is decoupled through the causal decoupling module to obtain decoupled covariate features; the decoupled covariate features are input into the mutual information estimator for mutual information minimization constraint to obtain high-quality decoupled covariate features; the high-quality decoupled covariate features are input into the multi-step counterfactual module for prediction, and the future blood glucose changes are obtained by predicting based on the extracted historical features and intervention variables.

[0150] In an embodiment of the present invention, a medical time-series dataset is first obtained; the medical time-series dataset includes: physiological indicators of patients, treatment records, and drug usage; the medical time-series dataset is cleaned to obtain a cleaned dataset; secondly, an initial causal decoupled counterfactual prediction network is constructed; wherein, the initial causal decoupled counterfactual prediction network includes: a feature causal decoupling module, a mutual information estimator, a time-series feature encoder, a time-series counterfactual decoder, and a comprehensive loss function; the cleaned dataset is input into the initial causal decoupled counterfactual prediction network, and the covariates of the cleaned data are decoupled by the feature causal decoupling module to obtain decoupled covariate features; the decoupled covariate features are input into the mutual information estimator for mutual information minimization constraint to obtain high-quality decoupled covariate features; the high-quality decoupled covariate features are input into the time-series feature encoder, and multi-step counterfactual prediction is performed by the time-series counterfactual decoder to obtain an initial counterfactual prediction result; the initial counterfactual prediction result is used to train through the comprehensive loss function to obtain a trained causal decoupled counterfactual prediction network; the medical time-series data of the patient to be predicted is obtained; finally, the medical time-series data of the patient to be predicted is input into the trained causal decoupled counterfactual prediction network for processing to obtain the prediction results of the patient's health status and disease progression.

[0151] The present invention effectively processes the dynamic confounding factors in medical time-series data through a covariate decoupling method, improving the accuracy of counterfactual inference; the causal decoupled counterfactual prediction network constructed by the present invention can accurately evaluate the long-term effects of intervention measures and provide support for personalized medical decision-making. The present invention adopts a multi-step prediction structure, solves the problems of error accumulation and insufficient long-term dependence modeling ability in traditional methods, and enables the network to provide more stable and reliable prediction results in complex medical time-series scenarios; the adoption of the present invention can improve the accuracy of causal inference of medical time-series data.

[0152] Figure 5 is a block diagram of a counterfactual prediction device for medical time-series data based on causal decoupling shown according to an exemplary embodiment, and the device is used for the counterfactual prediction method of medical time-series data based on causal decoupling. Refer to Figure 5 and the device includes a first acquisition unit 510, a second acquisition unit 520, a construction unit 530, a training unit 540, and a prediction unit 550. Among them:

[0153] The first acquisition unit 510 is used to acquire a medical time-series dataset; the medical time-series dataset includes: physiological indicators of patients, treatment records, and drug usage;

[0154] The second acquisition unit 520 is used to clean the medical time-series dataset to obtain a cleaned dataset;

[0155] A building unit 530 for building an initial causal decoupled counterfactual prediction network; wherein, the initial causal decoupled counterfactual prediction network includes: a feature causal decoupling module, a mutual information estimator, a temporal feature encoder, a temporal counterfactual decoder, and a comprehensive loss function;

[0156] A training unit 540 for inputting the cleaned data set into the initial causal decoupled counterfactual prediction network, decoupling the covariates of the cleaned data through the feature causal decoupling module to obtain decoupled covariate features; inputting the decoupled covariate features into the mutual information estimator for mutual information minimization constraint to obtain high-quality decoupled covariate features; inputting the high-quality decoupled covariate features into the temporal feature encoder, and performing multi-step counterfactual prediction through the temporal counterfactual decoder to obtain an initial counterfactual prediction result; using the initial counterfactual prediction result to perform training through the comprehensive loss function to obtain a trained causal decoupled counterfactual prediction network;

[0157] A prediction unit 550 for obtaining the medical temporal data of the patient to be predicted; inputting the medical temporal data of the patient to be predicted into the trained causal decoupled counterfactual prediction network for processing to obtain the prediction results of the patient's health status and disease condition changes.

[0158] Optionally, the feature causal decoupling module includes: a structural causal model for determining the causal relationship between interventions and outcomes;

[0159] Wherein, the mutual information estimator is used to reduce the relationship between latent factors by mutual information minimization constraint; wherein, the latent factors include: an instrumental factor, an adjustment factor, and a confounding factor; the instrumental factor only affects the treatment selection; the adjustment factor only affects the outcome; the confounding factor affects both the treatment selection and the outcome;

[0160] Wherein, the temporal feature encoder is used to convert the decoupled covariate features into a deep feature representation;

[0161] Wherein, the temporal counterfactual decoder is used to extract the features of the temporal data during the prediction process.

[0162] Optionally, the step of inputting the high-quality decoupled covariate features into the temporal feature encoder in S4 and performing multi-step counterfactual prediction through the temporal counterfactual decoder to obtain an initial counterfactual prediction result includes:

[0163] Inputting the high-quality decoupled covariate features into the temporal feature encoder, and converting the high-quality decoupled covariate features into a deep feature representation; inputting the deep feature representation into the temporal data decoder, and generating an initial counterfactual prediction result through an autoregressive prediction mechanism.

[0164] Optionally, the comprehensive loss function includes: a prediction error loss function, a predicted treatment plan minimization loss function, a predicted treatment plan maximization loss function, and a regularization loss function.

[0165] Optionally, the comprehensive loss function is represented by the following formula (1):

[0166] (1)

[0167] where, denotes the comprehensive loss; denotes the prediction error loss; denotes the predicted treatment plan minimization loss; denotes the predicted treatment plan maximization loss; denotes the regularization loss;

[0168] where, the prediction error loss function is represented by the following formula (2) - formula (3):

[0169] (2)

[0170] (3)

[0171] where, denotes the prediction error loss; denotes the selection probability of the treatment plan based on the confounding factor ; N denotes the number of patients; denotes the treatment plan at time t; denotes the treatment effect at time t + 1; denotes the predicted effect at time t + 1; denotes the adjustment factor; denotes the probability of the treatment plan occurring; denotes the historical sum before the treatment result at time t + 1; denotes the historical sum before the treatment plan at time t + 1;

[0172] where, the predicted treatment plan minimization loss function is represented by the following formula (4):

[0173] (4)

[0174] where, denotes the predicted treatment plan minimization loss; denotes a hyperparameter; a metric used to measure the distribution difference between the treatment group and the control group.

[0175] Optionally, the predicted treatment plan maximization loss is represented by the following formula (5):

[0176] (5)

[0177] Among them, is a hyperparameter, indicating the treatment selection probability based on the treatment factor plus the confounding factor; indicating the treatment selection probability based on the confounding factor.

[0178] Optionally, the regularization loss function is represented by the following formulas (6)-(8):

[0179] (6)

[0180] (7)

[0181] (8)

[0182] Among them, represents a hyperparameter; represents the approximate mutual information between the treatment factor and the confounding factor; represents the approximate mutual information between the adjustment factor and the confounding factor; represents the function with respect to the expectation of the distribution P(x, y); represents the function first with respect to the expectation of the distribution p(y) to obtain a result and then with respect to the expectation of p(x); represents the log function value of the probability function q(y|x); is the mutual information with an upper bound estimate.

[0183] In the embodiment of the present invention, a medical time series dataset is first obtained; the medical time series dataset includes: physiological indicators of patients, treatment records, and drug usage; the medical time series dataset is cleaned to obtain a cleaned dataset; secondly, an initial causal decoupled counterfactual prediction network is constructed; wherein, the initial causal decoupled counterfactual prediction network includes: a feature causal decoupling module, a mutual information estimator, a time series feature encoder, a time series counterfactual decoder, and a comprehensive loss function; the cleaned dataset is input into the initial causal decoupled counterfactual prediction network, and the covariates of the cleaned data are decoupled by the feature causal decoupling module to obtain decoupled covariate features; the decoupled covariate features are input into the mutual information estimator for mutual information minimization constraint to obtain high-quality decoupled covariate features; the high-quality decoupled covariate features are input into the time series feature encoder, and multi-step counterfactual prediction is performed through the time series counterfactual decoder to obtain an initial counterfactual prediction result; the initial counterfactual prediction result is used for training through the comprehensive loss function to obtain a trained causal decoupled counterfactual prediction network; the medical time series data of the patient to be predicted is obtained; finally, the medical time series data of the patient to be predicted is input into the trained causal decoupled counterfactual prediction network for processing to obtain the prediction results of the patient's health status and disease progression.

[0184] The present invention effectively processes the dynamic confounding factors in medical time series data through the covariate decoupling method, improving the accuracy of counterfactual inference; the causal decoupled counterfactual prediction network constructed by the present invention can accurately evaluate the long-term effects of intervention measures and provide support for personalized medical decision-making. The present invention adopts a multi-step prediction structure, solves the problems of error accumulation and insufficient long-term dependence modeling ability in traditional methods, and enables the network to provide more stable and reliable prediction results in complex medical time series scenarios; the adoption of the present invention can improve the accuracy of causal inference of medical time series data.

[0185] Figure 6 FIG. is a schematic structural diagram of a counterfactual prediction device for medical time series data based on causal decoupling provided by an embodiment of the present invention, as Figure 6 shown, the counterfactual prediction device for medical time series data based on causal decoupling may include the above-mentioned Figure 5 shown counterfactual prediction device for medical time series data based on causal decoupling. Optionally, the counterfactual prediction device 610 for medical time series data based on causal decoupling may include a first processor 2001.

[0186] Optionally, the counterfactual prediction device 610 for medical time series data based on causal decoupling may further include a memory 2002 and a transceiver 2003.

[0187] Wherein, the first processor 2001 is connected to the memory 2002 and the transceiver 2003, such as through a communication bus.

[0188] The following combines Figure 6 to specifically introduce each component of the counterfactual prediction device 610 for medical time-series data based on causal decoupling:

[0189] Among them, the first processor 2001 is the control center of the counterfactual prediction device 610 for medical time-series data based on causal decoupling, which can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPUs), or can be an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as: one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs).

[0190] Optionally, the first processor 2001 can execute various functions of the counterfactual prediction device 610 for medical time-series data based on causal decoupling by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.

[0191] In a specific implementation, as an embodiment, the first processor 2001 can include one or more CPUs, such as Figure 6 the CPU0 and CPU1 shown in

[0192] In a specific implementation, as an embodiment, the counterfactual prediction device 610 for medical time-series data based on causal decoupling can also include multiple processors, such as Figure 6 the first processor 2001 and the second processor 2004 shown in

[0193] Among them, the memory 2002 is used to store the software program for implementing the solution of the present invention and is controlled by the first processor 2001 for execution. The specific implementation manner can refer to the above method embodiments and will not be elaborated here.

[0194] Optionally, the memory 2002 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or may also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001 or may exist independently and is coupled to the first processor 2001 through an interface circuit ( Figure 6 not shown) of the counterfactual prediction device 610 for medical time-series data based on causal decoupling. The embodiments of the present invention do not make specific limitations thereto.

[0195] The transceiver 2003 is used to communicate with a network device or with a terminal device.

[0196] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 6 not separately shown). Among them, the receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.

[0197] Optionally, the transceiver 2003 may be integrated with the first processor 2001 or may exist independently and is coupled to the first processor 2001 through an interface circuit ( Figure 6 not shown) of the counterfactual prediction device 610 for medical time-series data based on causal decoupling. The embodiments of the present invention do not make specific limitations thereto.

[0198] It should be noted that Figure 6 the structure of the counterfactual prediction device 610 for medical time-series data based on causal decoupling shown in does not constitute a limitation on the router. The actual knowledge structure recognition device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0199] In addition, the technical effects of the counterfactual prediction device 610 for medical time-series data based on causal decoupling may refer to the technical effects of the counterfactual prediction method for medical time-series data based on causal decoupling described in the above method embodiments, and will not be elaborated here.

[0200] It should be understood that the first processor 2001 in the embodiments of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0201] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0202] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware, or any combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that contains one or more collections of available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0203] It should be understood that the term "and / or" in this document is merely a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Here, A and B can be singular or plural. In addition, the character " / " in this document generally represents an "or" relationship between the associated objects before and after, but it may also represent an "and / or" relationship, which can be specifically understood with reference to the context.

[0204] In the present invention, "at least one" means one or more, and "a plurality" means two or more. "At least one of the following" or a similar expression refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.

[0205] It should be understood that in various embodiments of the present invention, the magnitudes of the sequence numbers of the above processes do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0206] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0207] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the devices, apparatuses, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0208] In several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

[0209] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0210] In addition, the functional units in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0211] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0212] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A counterfactual prediction method for medical time series data based on causal decoupling, characterized in that: The method comprises: S1. Obtain a medical time series data set; the medical time series data set includes: patients' physiological indicators, treatment records, and drug usage; S2, cleaning the medical time series data set to obtain a cleaned data set; S3, constructing an initial causal decoupling-based counterfactual prediction network; wherein the initial causal decoupling-based counterfactual prediction network includes: a feature causal decoupling module, a mutual information estimator, a temporal feature encoder, a temporal counterfactual decoder, and a comprehensive loss function; The characteristic causal decoupling module includes: a structural causal model for determining the causal relationship between intervention and outcome; The mutual information estimator is used to reduce the relationship between potential factors by using mutual information minimization constraints; the potential factors include: instrument factors, adjustment factors and confounding factors; instrument factors only affect treatment selection; adjustment factors only affect results; confounding factors affect both treatment selection and results; Wherein, the temporal feature encoder is used to convert the decoupled covariate feature into a deep feature representation; Wherein, the time series counterfactual decoder is used to extract features of time series data during the prediction process; S4. Input the cleaned data set into the initial causal decoupling-based counterfactual prediction network, decouple the covariates of the cleaned data through the feature causal decoupling module to obtain decoupled covariate features; input the decoupled covariate features into the mutual information estimator to perform mutual information minimization constraints to obtain high-quality decoupled covariate features; input the high-quality decoupled covariate features into the time series feature encoder, perform multi-step counterfactual predictions through the time series counterfactual decoder to obtain the initial counterfactual prediction results; use the initial counterfactual prediction results to train through the comprehensive loss function to obtain a trained causal decoupling-based counterfactual prediction network; The step S4 inputs the high-quality decoupled covariate features into the time series feature encoder, performs multi-step counterfactual predictions through the time series counterfactual decoder, and obtains the initial counterfactual prediction results, including: Input high-quality decoupled covariate features into the time series feature encoder, and convert the high-quality decoupled covariate features into deep feature representations; input the deep feature representations into the time series data decoder, and generate initial counterfactual prediction results through the autoregressive prediction mechanism; S5. Obtain the patient's medical time series data to be predicted; input the patient's medical time series data to be predicted into the trained causal decoupling-based counterfactual prediction network for processing to obtain the prediction results of the patient's health status and disease change.

2. The medical time series data counterfactual prediction method based on causal decoupling according to claim 1 is characterized in that: The comprehensive loss function includes: a prediction error loss function, a prediction treatment plan minimization loss function, a prediction treatment plan maximization loss function and a regularization loss function.

3. The medical time series data counterfactual prediction method based on causal decoupling according to claim 2 is characterized in that: The comprehensive loss function is expressed by the following formula (1): (1) in, It represents comprehensive loss; represents the prediction error loss; represents the predicted treatment plan that minimizes the loss; represents the predicted treatment plan that maximizes the loss; represents the regularization loss; The prediction error loss function is expressed by the following formula (2)-formula (3): (2) (3) in, represents the prediction error loss; Based on the confounding factors The probability of selecting the treatment plan; N represents the number of patients; represents the treatment plan at time t; represents the treatment effect at time t+1; Indicates the prediction effect at time t+1; represents the adjustment factor; Indicates the probability of the treatment option occurring; represents the historical sum of treatment results before time t+1; represents the historical sum before the treatment plan at time t+1; The predicted treatment plan minimization loss function is expressed by the following formula (4): (4) in, represents the predicted treatment plan that minimizes the loss; represents a hyperparameter; A measure of the difference in distribution between treatment and control groups.

4. The medical time series data counterfactual prediction method based on causal decoupling according to claim 2 is characterized in that: The predicted treatment plan maximization loss is expressed by the following formula (5): (5) in, is a hyperparameter, represents the probability of treatment selection based on the treatment factor plus the confounder; represents the probability of treatment selection based on the confounder.

5. The medical time series data counterfactual prediction method based on causal decoupling according to claim 2 is characterized in that: The regularized loss function is expressed by the following formula (6)-formula (8): (6) (7) (8) in, represents a hyperparameter; represents the approximate mutual information between the treatment factor and the confounding factor; represents the approximate mutual information between the adjustment factor and the confounding factor; Representation function The expectation of the distribution P(x,y); Representation function First get the result about the expectation of distribution p(y) and then get the expectation about p(x); Represents the log function value of the probability function q(y|x); is mutual information An estimated upper bound of .

6. A medical time series data counterfactual prediction device based on causal decoupling, the medical time series data counterfactual prediction device based on causal decoupling is used to implement the medical time series data counterfactual prediction method based on causal decoupling as claimed in any one of claims 1 to 5, characterized in that: The device comprises: The first acquisition unit is used to acquire a medical time series data set; the medical time series data set includes: a patient's physiological indicators, treatment records, and drug usage; A second acquisition unit is used to clean the medical time series data set to obtain a cleaned data set; A construction unit, used to construct an initial causal decoupling-based counterfactual prediction network; wherein the initial causal decoupling-based counterfactual prediction network includes: a feature causal decoupling module, a mutual information estimator, a temporal feature encoder, a temporal counterfactual decoder, and a comprehensive loss function; A training unit is used to input the cleaned data set into the initial causal decoupling-based counterfactual prediction network, decouple the covariates of the cleaned data through the feature causal decoupling module, and obtain decoupled covariate features; input the decoupled covariate features into the mutual information estimator to perform mutual information minimization constraints to obtain high-quality decoupled covariate features; input the high-quality decoupled covariate features into the time series feature encoder, perform multi-step counterfactual predictions through the time series counterfactual decoder, and obtain initial counterfactual prediction results; use the initial counterfactual prediction results to train through a comprehensive loss function to obtain a trained causal decoupling-based counterfactual prediction network; The prediction unit is used to obtain the patient's medical time series data to be predicted; the patient's medical time series data to be predicted is input into the trained causal decoupling-based counterfactual prediction network for processing to obtain the prediction results of the patient's health status and disease changes.

7. A medical time series data counterfactual prediction device based on causal decoupling, characterized in that: The medical time series data counterfactual prediction device based on causal decoupling includes: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Causal decoupling representation learning method based on variational auto-encoder

    CN118711225A

  • Device for analyzing causes of sepsis based on matrix causal deentanglement

    CN118983108A