Medical time series data anti-fact prediction method and device based on causal decoupling

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

CN119742083AActive Publication Date: 2025-04-01HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)

Patent Information

Application Number
CN202510260033.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-04-01
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, and the generalization ability and adaptability are limited.

Method used

The medical timing data counterfactual prediction method based on causal decoupling is adopted. A network is built 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 used for training, and confounding factors are dynamically adjusted to improve prediction accuracy.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119742083A_ABST
    Figure CN119742083A_ABST
Patent Text Reader

Abstract

The invention provides a medical time series data anti-fact prediction method and device based on causal decoupling, and relates to the technical field of artificial intelligence. The method comprises the following steps: acquiring a medical time sequence data set; cleaning the medical time sequence data set to obtain a cleaned data set; constructing an initial time sequence anti-fact prediction network based on causal decoupling; training the initial causal decoupling-based anti-fact prediction network by adopting the cleaned data set to obtain a trained causal decoupling-based anti-fact prediction network; obtaining to-be-predicted medical time sequence data; and inputting to-be-predicted medical time sequence data into the trained prediction network for processing to obtain an anti-fact prediction result of the medical time sequence data. According to the invention, the accuracy of medical time sequence data causal inference 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 in particular to a medical time series data counterfactual prediction method and device 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, and performs diagnosis, prevention and treatment based on individual genome, biomarkers and clinical data, so as to achieve more accurate, efficient and safe medical results. Medical time series data analysis is one of the important research directions of precision medicine. With the popularization of electronic health records, genetic data and medical big data of medical records, mining 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 time series counterfactual outcomes, including: the main challenge in predicting counterfactual outcomes is that potential outcomes have never been observed, which makes it impossible to apply traditional supervised learning frameworks, making the task more difficult; in addition, in the observational dataset, there are only a few samples in each treatment, resulting in poor generalization performance, which will reduce the performance of processing counterfactual predictions; due to time-related confounding factors, it is more serious in the field of time series. Specifically, input covariates may be affected by past treatments and affect future treatments and outcomes, thereby generating time-related confounding biases. Currently, the methods for predicting counterfactual outcomes of time series include: (1) Traditional methods based on covariate balance, which reduce bias by adjusting confounding factors, but face the following limitations in time series data: inability to model time dependence; linear assumption restrictions, making it difficult to handle complex nonlinear relationships in medical time series data; as the number of covariates increases, the computational complexity increases significantly, leading to inefficient feature selection; (2) Recurrent neural network methods, which enhance the ability to model long-term dependencies through the attention mechanism, but this method has large error accumulation in causal inference tasks, resulting in unstable prediction results; In summary, the main problem with existing methods for predicting counterfactual outcomes of time series is that the confounding factors in the time series may change over time, and existing methods are difficult to adjust dynamically, resulting in large causal inference bias; current models are difficult to guarantee stability and accuracy in long-term prediction tasks, and existing methods have limited use of unlabeled data, which affects the generalization ability and adaptability of the model. Summary of the invention

[0004] In order to solve the technical problems that the confounding factors in the time series in the prior art may change over time, the existing methods are difficult to adjust dynamically, resulting in large deviations in causal inference; the current model is difficult to ensure stability and accuracy in long-term prediction tasks, and the existing methods have limited use of unlabeled data, which affects the generalization ability and adaptability of the model, the embodiment of the present invention provides a medical time series data counterfactual prediction method and device based on causal decoupling. The technical solution is as follows:

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

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

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

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

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

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

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

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

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

[0014] The time series counterfactual decoder is used to extract features of time series data during the prediction process.

[0015] Optionally, the step S4 inputs the high-quality decoupled covariate features into a time series feature encoder, performs multi-step counterfactual predictions through a time series counterfactual decoder, and obtains an initial counterfactual prediction result, including:

[0016] The high-quality decoupled covariate features are input into the time series feature encoder, and the high-quality decoupled covariate features are converted into deep feature representations; the deep feature representations are input into the time series data decoder, and the initial counterfactual prediction results are generated through the autoregressive prediction mechanism.

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

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

[0019] (1)

[0020] in, 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;

[0021] The prediction error loss function is expressed by the following formula (2)-formula (3):

[0022] (2)

[0023] (3)

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

[0025] The predicted treatment plan minimization loss function is expressed by the following formula (4):

[0026] (4)

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

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

[0029] (5)

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

[0031] Optionally, the regularized loss function is expressed by the following formula (6) to formula (8):

[0032] (6)

[0033] (7)

[0034] (8)

[0035] 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 p(y|x); is mutual information An estimated upper bound of .

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

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

[0038] A second acquisition unit is used to clean the medical time series data set to obtain a cleaned data set;

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

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

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

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

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

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

[0045] The time series counterfactual decoder is used to extract features of time series data during the prediction process.

[0046] Optionally, the step S4 inputs the high-quality decoupled covariate features into a time series feature encoder, performs multi-step counterfactual predictions through a time series counterfactual decoder, and obtains an initial counterfactual prediction result, including:

[0047] The high-quality decoupled covariate features are input into the time series feature encoder, and the high-quality decoupled covariate features are converted into deep feature representations; the deep feature representations are input into the time series data decoder, and the initial counterfactual prediction results are generated 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 expressed by the following formula (1):

[0050] (1)

[0051] in, 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;

[0052] The prediction error loss function is expressed by the following formula (2)-formula (3):

[0053] (2)

[0054] (3)

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

[0056] The predicted treatment plan minimization loss function is expressed by the following formula (4):

[0057] (4)

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

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

[0060] (5)

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

[0062] Optionally, the regularized loss function is expressed by the following formula (6) to formula (8):

[0063] (6)

[0064] (7)

[0065] (8)

[0066] 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 p(y|x); is mutual information An estimated upper bound of .

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

[0068] On the other hand, a computer-readable storage medium is provided, wherein 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 above-mentioned counterfactual prediction methods for medical time series data based on causal decoupling.

[0069] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0070] The embodiment of the present invention first obtains a medical time series data set; the medical time series data set includes: the patient's physiological indicators, treatment records and drug usage; the medical time series data set is cleaned to obtain a cleaned data set; secondly, an initial causal decoupling-based counterfactual prediction network is constructed; 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; the cleaned data set is input into the initial causal decoupling-based counterfactual prediction network, and the covariates of the cleaned data are decoupled by the feature causal decoupling module to obtain decoupled covariates 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 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; obtain the patient's medical time series data to be predicted; finally, 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 patient's health status and condition changes.

[0071] The present invention effectively handles dynamic confounding factors in medical time series data through the decoupling method of covariates, and improves the accuracy of counterfactual inference; the causal decoupling-based 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 to solve the problems of error accumulation and insufficient long-term dependency modeling capabilities in traditional methods, and enables the network to provide more stable and reliable prediction results in complex medical time series scenarios; the use of the present invention can improve the accuracy of causal inference of medical time series data. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

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

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

[0075] Figure 3 It is a structural schematic 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 decoupled counterfactual prediction network provided by an embodiment of the present invention;

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

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

[0079] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0080] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either 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 the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.

[0082] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.

[0083] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0084] The embodiment of the present invention provides a medical time series data counterfactual prediction method based on causal decoupling, which can be implemented by a medical time series data counterfactual prediction device based on causal decoupling, and the medical time series data counterfactual prediction device based on causal decoupling can be a terminal or a server. Figure 1 The flowchart of the medical time series data counterfactual prediction method based on causal decoupling is shown. The processing flow of the method may include the following steps:

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

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

[0087] in, Figure 2 is a counterfactual prediction process provided by an embodiment of the present invention; in a feasible implementation mode, when a tuple is observed ,in On behalf of the patient, is the time step. Indicates patient-related dimensional time-varying observed feature vector; represents a given therapeutic intervention; Indicates clinical results. Among them, the causal decoupling-based counterfactual prediction network constructed in this application can be used to predict the future treatment For input, output The potential clinical outcomes after the first step; Among them, the patient history covariate is composed of three variables, including instrument factors, adjustment factors and confounding factors, among which the instrument factor Affects only treatment selection, adjustment factor Only affects the results, confounding factors It also affects treatment options and outcomes.

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

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

[0090] Among them, the missing parts can be filled by using one of the mean / median filling method, the forward filling method and the backward filling method, which is not limited in this application.

[0091] Among them, the outlier detection can select the threshold method or 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 based on predetermined rules 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) Setting thresholds: Set upper and lower thresholds based on medical knowledge or historical data; for example, the normal heart rate range is 60-100 beats / minute, and the normal range of blood pressure is 120 / 80 mmHg. Comparison with thresholds: Compare each data point with the predetermined threshold. If the data point exceeds the threshold range, it is considered an outlier; (2) Marking anomalies: When the measured value at a certain moment exceeds the normal range, that is, the upper and lower thresholds, 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 range of outliers: when a data point exceeds the range of μ±3σ, it is judged as an outlier.

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

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

[0096] S3. 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.

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

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

[0099] Among them, decoupling the covariates in the medical time series data through the causal decoupling module can enable the causal decoupling-based counterfactual prediction network to accurately capture the causal relationship between intervention and outcome, remove the influence of confounding factors, and provide reliable counterfactual predictions.

[0100] The mutual information estimator is used to reduce the relationship between potential factors by using mutual information minimization constraints; the potential factors include instrumental factors, adjustment factors and confounding factors; instrumental factors only affect treatment selection; adjustment factors only affect results; confounding factors affect both treatment selection and results;

[0101] In a feasible implementation, the present application performs mutual information minimization constraints through a mutual information estimator; wherein, the mutual information minimization constraint is used to ensure the independence between potential factors, wherein the potential factors include: instrumental factors, adjustment factors, and confounding factors; by minimizing the mutual information between factors, the dependency between potential 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 temporal feature encoder is used to convert the decoupled covariate features into deep feature representation;

[0103] The time series counterfactual decoder is used to extract features of time series data during the prediction process.

[0104] In a feasible implementation, the decoupled covariate features are input into a time series feature encoder to convert the decoupled covariate features into deep feature representations; the time series counterfactual data decoder gradually predicts potential results for multiple future time steps based on the deep feature representations and intervention information.

[0105] The intervention information is a sequence of treatment plans.

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

[0107] Among them, the prediction error loss function is used to predict the real results;

[0108] The prediction error loss function ensures that the network can accurately predict future medical outcomes by minimizing the difference between the actual observation results and the predicted results. Future medical outcomes include: patient health status, the effect of drug treatment, the effect of surgical treatment, and changes in the disease.

[0109] Among them, because the adjustment factor only affects the treatment outcome and is independent of the treatment plan, the constrained decoupling factor can be minimized by predicting the probability difference between the two groups of treatment plans by minimizing the loss function.

[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 model overfitting by constraining the independence between latent factors.

[0112] Among them, because both treatment factors and confounding factors have an impact on the treatment plan, the treatment factor and the confounding factor can be separated by maximizing the loss function that predicts the difference between the two groups of treatment plans.

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

[0114] (1)

[0115] in, 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;

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

[0117] (2)

[0118] (3)

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

[0120] The loss function for minimizing the predicted treatment plan is expressed by the following formula (4):

[0121] (4)

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

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

[0124] (5)

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

[0126] (6)

[0127] (7)

[0128] (8)

[0129] 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 p(y|x); is mutual information An estimated upper bound of .

[0130] Among them, each partial loss function in the comprehensive loss function is weighted and summed, and the optimization goal is to minimize the impact of prediction error and confounding factors at the same time.

[0131] in, Figure 3 It is a structural schematic diagram of a causal decoupled 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, the data is standardized and cleaned to obtain cleaned data; the cleaned data is subjected to covariate decoupling to obtain decoupled covariate features; the decoupled covariate features are processed using mutual information minimization to obtain processed features; the processed features are input into an encoder for feature extraction to obtain feature representation; based on the feature representation, prediction is performed using an autoregressive prediction mechanism to obtain preliminary prediction results; error correction is performed based on the preliminary prediction results, and training is performed using a comprehensive loss function to obtain a trained counterfactual prediction network based on causal decoupling.

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

[0133] Among them, the decoupled covariate characteristics include: blood pressure, blood sugar, body temperature, heart rate, blood oxygen, blood lipids, pH value and liver function.

[0134] Optionally, 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 initial counterfactual prediction results, including:

[0135] The high-quality decoupled covariate features are input into the time series feature encoder, and the high-quality decoupled covariate features are converted into deep feature representations; the deep feature representations are input into the time series data decoder, and the initial counterfactual prediction results are generated through the autoregressive prediction mechanism.

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

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

[0138] In one feasible implementation, the process of generating prediction results by using 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 results generated at one time step to predict the counterfactual prediction results 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 predictions are made based on historically generated information;

[0142] (4) The time series counterfactual data decoder outputs a probability distribution, where the probability distribution represents the likelihood of generating a prediction result at the current time step. The prediction result with the highest probability is selected as the prediction result for the current time step, and the prediction result of the current time step is used as the input for the next time step.

[0143] A large-scale medical time series dataset is used for training. During the training process, the optimal model parameters and architecture are selected through cross-validation and hyperparameter optimization. The training goal of the model is to ensure that the counterfactual results can be accurately predicted at different time steps, while having strong generalization ability and stability.

[0144] S5. Obtain the medical time series data to be predicted; input the medical time series data to be predicted into the trained causal decoupling-based counterfactual prediction network for processing to obtain the counterfactual prediction results of the medical time series data.

[0145] Among them, counterfactuals play a vital role in the decision-making process in accurately predicting potential outcomes under "what-if" scenarios.

[0146] in, 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, the network For a sequence model, a recurrent neural network or a transformer model can be used. When the patient covariate historical information Three historical covariates can be obtained from the input encoder, namely Among them, the tool factor Affects only treatment selection, adjustment factor Only affects the results, confounding factors It also affects treatment selection and outcomes. , both Can be used to predict treatment And the next step results Specifically, this application will The splicing is fed into classifier D to predict the treatment variable ;Will Splicing combined treatment variables Input outcome network prediction result variable ; To ensure decoupling, this application uses and Minimization of mutual information between three variables is used as a constraint. The encoder can only predict one step ahead because it needs input at each time step. Therefore, to predict multi-step outcomes, this application trains a decoder to take the encoder’s latent representation and treat the sequence As input, the sequence of outcome variables is predicted autoregressively. Using the encoder to measure multi-step trajectories requires predicting the entire trajectory of the patient covariates, which is not feasible because the dimensions of the time series covariates are too large. The latent representation of the encoder is As input, it learns to directly autoregressively predict the latent representation. During training, this is ensured by optimizing the good fit of the same three output heads of the encoder. At test time, the result is replaced with the prediction of the previous time step.

[0147] Among them, the present invention is applicable to a variety of 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, the embodiment of the present invention can be used to assist in the treatment of cardiovascular diseases. Doctors can use counterfactual prediction results to evaluate the potential therapeutic effect of a certain drug after one week of continuous use, thereby optimizing the treatment plan. The embodiment of the present invention is suitable for scenarios with strong time correlation and where the intervention effect accumulates or decays over time.

[0149] Among them, the embodiments of the present invention can also be used for blood sugar control in chronic disease management; in a feasible implementation method, the patient's historical blood sugar data and intervention variables are obtained, wherein the intervention variables include: daily recorded medication data, including: drug type and dosage; the obtained historical blood sugar data and intervention variables are input into a trained causal decoupling-based counterfactual prediction network, and the input data is decoupled through the causal decoupling module to obtain decoupled covariate features; the decoupled covariate features are input into the mutual information estimator to perform mutual information minimization constraints 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 blood sugar changes in the next few days are obtained through prediction through the extracted historical features and intervention variables.

[0150] The embodiment of the present invention first obtains a medical time series data set; the medical time series data set includes: the patient's physiological indicators, treatment records and drug usage; the medical time series data set is cleaned to obtain a cleaned data set; secondly, an initial causal decoupling-based counterfactual prediction network is constructed; 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; the cleaned data set is input into the initial causal decoupling-based counterfactual prediction network, and the covariates of the cleaned data are decoupled by the feature causal decoupling module to obtain decoupled covariates 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 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; obtain the patient's medical time series data to be predicted; finally, 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 patient's health status and condition changes.

[0151] The present invention effectively handles dynamic confounding factors in medical time series data through the decoupling method of covariates, and improves the accuracy of counterfactual inference; the causal decoupling-based 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 to solve the problems of error accumulation and insufficient long-term dependency modeling capabilities in traditional methods, and enables the network to provide more stable and reliable prediction results in complex medical time series scenarios; the use of the present invention can improve the accuracy of causal inference of medical time series data.

[0152] Figure 5 1 is a block diagram of a medical time series data counterfactual prediction device based on causal decoupling according to an exemplary embodiment, wherein the device is used for a medical time series data counterfactual prediction method based on causal decoupling. Figure 5 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. Wherein:

[0153] The first acquisition unit 510 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;

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

[0155] A construction unit 530 is 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;

[0156] The training unit 540 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 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 prediction through the time series counterfactual decoder to 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;

[0157] The prediction unit 550 is used to 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.

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

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

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

[0161] The time series counterfactual decoder is used to extract features of time series data during the prediction process.

[0162] Optionally, the step S4 inputs the high-quality decoupled covariate features into a time series feature encoder, performs multi-step counterfactual predictions through a time series counterfactual decoder, and obtains an initial counterfactual prediction result, including:

[0163] The high-quality decoupled covariate features are input into the time series feature encoder, and the high-quality decoupled covariate features are converted into deep feature representations; the deep feature representations are input into the time series data decoder, and the initial counterfactual prediction results are generated through the autoregressive prediction mechanism.

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

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

[0166] (1)

[0167] in, 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;

[0168] The prediction error loss function is expressed by the following formula (2)-formula (3):

[0169] (2)

[0170] (3)

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

[0172] The predicted treatment plan minimization loss function is expressed by the following formula (4):

[0173] (4)

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

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

[0176] (5)

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

[0178] Optionally, the regularized loss function is expressed by the following formula (6) to formula (8):

[0179] (6)

[0180] (7)

[0181] (8)

[0182] 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 p(y|x); is mutual information An estimated upper bound of .

[0183] The embodiment of the present invention first obtains a medical time series data set; the medical time series data set includes: the patient's physiological indicators, treatment records and drug usage; the medical time series data set is cleaned to obtain a cleaned data set; secondly, an initial causal decoupling-based counterfactual prediction network is constructed; 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; the cleaned data set is input into the initial causal decoupling-based counterfactual prediction network, and the covariates of the cleaned data are decoupled by the feature causal decoupling module to obtain decoupled covariates 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 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; obtain the patient's medical time series data to be predicted; finally, 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 patient's health status and condition changes.

[0184] The present invention effectively handles dynamic confounding factors in medical time series data through the decoupling method of covariates, and improves the accuracy of counterfactual inference; the causal decoupling-based 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 to solve the problems of error accumulation and insufficient long-term dependency modeling capabilities in traditional methods, and enables the network to provide more stable and reliable prediction results in complex medical time series scenarios; the use of the present invention can improve the accuracy of causal inference of medical time series data.

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

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

[0187] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.

[0188] Combine the following Figure 6 The components of the medical time series data counterfactual prediction device 610 based on causal decoupling are specifically introduced:

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

[0190] Optionally, the first processor 2001 can perform various functions of the medical time series data counterfactual prediction device 610 based on causal decoupling by running or executing a software program 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 may include one or more CPUs, such as Figure 6 CPU0 and CPU1 are shown in FIG.

[0192] In a specific implementation, as an embodiment, the medical time series data counterfactual prediction device 610 based on causal decoupling may also include multiple processors, such as Figure 6 The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0193] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled to be executed by the first processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.

[0194] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or 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 compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, 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 may be connected to the computer through the interface circuit ( Figure 6 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

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

[0196] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 6 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.

[0197] Optionally, the transceiver 2003 may be integrated with the first processor 2001, or may exist independently, and may be connected to the first processor 2001 through the interface circuit ( Figure 6 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0198] It should be noted that Figure 6 The structure of the medical time series data counterfactual prediction device 610 based on causal decoupling shown in the figure 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 arrange the components differently.

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

[0200] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A 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 read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (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 and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link 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 other combination. When implemented by 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 process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. 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.). 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 data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0203] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0204] In the present invention, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions 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 mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0205] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0206] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond 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 above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0208] In the 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 only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

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

[0211] If the 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, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0212] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on 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. Clean 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; 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; 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 characteristic causal decoupling module includes: a structural causal model for determining the causal relationship between intervention and results; 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; The time series counterfactual decoder is used to extract features of time series data during the prediction process.

3. The medical time series data counterfactual prediction method based on causal decoupling according to claim 1 is characterized in that: The 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: The high-quality decoupled covariate features are input into the time series feature encoder, and the high-quality decoupled covariate features are converted into deep feature representations; the deep feature representations are input into the time series data decoder, and the initial counterfactual prediction results are generated through the autoregressive prediction mechanism.

4. 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.

5. The medical time series data counterfactual prediction method based on causal decoupling according to claim 4 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; 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.

6. The medical time series data counterfactual prediction method based on causal decoupling according to claim 4 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.

7. The medical time series data counterfactual prediction method based on causal decoupling according to claim 4 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 p(y|x); is mutual information An estimated upper bound of .

8. 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 7, 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.

9. 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 7 is implemented.

10. 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 7.

Citation Information

Patent Citations

  • Dynamic system event catastrophe causal inference method and system based on big data

    CN113255920A

  • Fault diagnosis method and device for model and data combined driving hot continuous rolling process

    CN118068788A

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

    CN118711225A

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

    CN118983108A

  • Modelling causation in machine learning

    US20240104370A1

Cited By

  • PPG signal noise reduction and reconstruction method based on causal decoupling network

    CN120030289A

  • A PPG Signal Denoising and Reconstruction Method Based on Causal Disentanglement Network

    CN120030289B

  • Embolism and hemorrhage risk prediction method and system based on causal Transform model

    CN120183709A

  • Intelligent low-voltage flexible direct current-environment self-adaptive multi-element energy consumption control method

    CN121150069A

  • Intelligent low-voltage flexible direct current environment self-adapting multi-element energy utilization control method

    CN121150069B