Antiepileptic drug efficacy prediction management method and system based on deep learning
Patent Information
- Application Number
- CN202611159242.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-01
- Publication Date
- 2026-10-20
AI Technical Summary
[0005]本申请的目的在于提供基于深度学习的抗癫痫药物疗效预测管理方法及系统,旨在克服现有技术中因忽略真实复诊时间间隔的非线性衰减特征而导致长间隔预测精度发生系统性偏差的缺陷,提升抗癫痫药物疗效预测的准确性与稳健性
[0020]本申请突破了现有时序预测网络对各离散时序节点等步长传递隐藏状态的刚性假设,提升了长间隔复诊场景下疗效预测的稳健性;无需引入复杂的数据插值处理,直接在网络运算机理层隔离物理时间跨度导致的系统误差,简化了非均匀时序数据的工程实现;通过结构化执行指令实现预测结果与医疗业务系统的自动化对接,提升了临床决策辅助的时效性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure QLYQS_4
Abstract
Description
Technical Field
[0001] This application relates to the fields of medical assistance and deep learning prediction technology, specifically a deep learning-based method and system for predicting and managing the efficacy of antiepileptic drugs. Background Technology
[0002] Existing methods for predicting drug efficacy typically rely on sequence models such as LSTN or Transformer to process the electronic medical record sequence of a patient's previous visits. Each visit record is extracted as a discrete time-series node and input into the network in a fixed step order. The core implicit assumption that allows these methods to function properly is that each discrete time-series node has an equivalent information step weight during feature transmission. In other words, the network transmits the hidden state based on discrete sequence steps rather than the actual physical time span.
[0003] However, the intervals between follow-up visits for epilepsy patients exhibit significant non-uniformity in clinical practice, and the accumulation and metabolism of antiepileptic drugs in the patient's blood follow an objective first-order elimination kinetic nonlinear decay law. Existing technologies force the non-uniform follow-up visit time intervals to be discretized, creating an inherent mismatch between the assumption of a uniform step length sequence and the physical reality of continuous drug efficacy decay. This results in the network being unable to perceive the attenuation modulation effect of the real time span on historical features when transmitting hidden states.
[0004] Due to the aforementioned mismatch, the model is prone to erroneous concentration accumulation or excessive forgetting when processing long-interval follow-up data, resulting in directional bias in the probability output of long-term probabilistic efficacy predictions and a significant reduction in prediction robustness. How to overcome the rigid assumption of equal step size transmission of hidden states at each discrete time-series node in existing technologies, and embed the physical decay law of drugs in the patient's body as a computable constraint in deep networks, thereby improving the accuracy of antiepileptic drug efficacy prediction in long-interval follow-up scenarios, has become an urgent technical problem to be solved. Summary of the Invention
[0005] The purpose of this application is to provide a deep learning-based method and system for predicting and managing the efficacy of antiepileptic drugs, aiming to overcome the shortcomings of existing technologies that cause systematic deviations in long-interval prediction accuracy due to ignoring the nonlinear decay characteristics of the actual follow-up time interval, and to improve the accuracy and robustness of antiepileptic drug efficacy prediction.
[0006] The objective of this application can be achieved through the following technical solution: Firstly, a deep learning-based method for predicting and managing the efficacy of antiepileptic drugs, comprising the following steps:
[0007] The medical record sequence of the target object is obtained and divided into multiple discrete time-series nodes. The decay attribute vector representing the metabolic rate of drug components in each discrete time-series node is extracted respectively.
[0008] Obtain the actual time interval between the first and second adjacent time nodes in the medical record sequence, and generate a continuous decay feature vector based on the actual time interval and the decay attribute vector of the first time node;
[0009] Based on the continuous decay feature vector mapping, a dimension-aligned decay constraint mask is obtained. Based on the decay constraint mask, the original forgetting feature vector generated by the preset temporal prediction network at the second temporal node is reconstructed, and the reconstructed forgetting feature vector is obtained.
[0010] Based on the reconstructed forgetting feature vector, the preset temporal prediction network performs a historical memory truncation operation on the hidden cell memory state generated at the first temporal node to generate the hidden cell memory state at the second temporal node.
[0011] The historical memory truncation operation is performed sequentially on each of the discrete time-series nodes in the medical record sequence, and the resulting hidden cell memory state is mapped to the target object's achievement probability value. The achievement probability value is compared with a preset intervention threshold, and the corresponding structured execution instruction is output based on the comparison result.
[0012] Secondly, the deep learning-based antiepileptic drug efficacy prediction and management system includes the following modules:
[0013] The acquisition module is used to acquire the medical record sequence of the target object and divide it into multiple discrete time-series nodes, and extract the decay attribute vector representing the metabolic rate of drug components in each of the discrete time-series nodes.
[0014] The vector generation module is used to obtain the actual time interval between the first and second time nodes that are adjacent to each other in the medical record sequence, and to generate a continuous decay feature vector based on the actual time interval and the decay attribute vector of the first time node.
[0015] The reconstruction module is used to obtain a dimension-aligned decay constraint mask based on the continuous decay feature vector mapping, and to reconstruct the original forgotten feature vector generated by the preset temporal prediction network at the second temporal node based on the decay constraint mask, and obtain the reconstructed forgotten feature vector.
[0016] The vector processing module is used to perform a historical memory truncation operation on the hidden cell memory state generated by the preset temporal prediction network at the first temporal node based on the reconstructed forgetting feature vector, and generate the hidden cell memory state of the second temporal node.
[0017] The instruction output module is used to sequentially perform historical memory truncation operations on each of the discrete time-series nodes in the medical record sequence, map the final generated hidden cell memory state to the target object's achievement probability value, compare the achievement probability value with a preset intervention threshold, and output the corresponding structured execution instruction based on the comparison result.
[0018] Thirdly, a computer storage medium stores computer-executable instructions, which, when executed, implement the deep learning-based antiepileptic drug efficacy prediction and management method described in the first aspect.
[0019] Compared with the prior art, the beneficial effects of this application are:
[0020] This application breaks through the rigid assumption of existing time series prediction networks that the hidden state is passed to each discrete time series node with equal step size, thus improving the robustness of efficacy prediction in long-interval follow-up visits. It eliminates the need for complex data interpolation processing and directly isolates the system error caused by the physical time span at the network operation mechanism layer, simplifying the engineering implementation of non-uniform time series data. It also achieves automated docking of prediction results with medical business systems through structured execution instructions, thereby improving the timeliness of clinical decision support. Attached Figure Description
[0021] Figure 1 This is a schematic diagram illustrating the steps of the deep learning-based antiepileptic drug efficacy prediction and management method of this application;
[0022] Figure 2 This is a schematic diagram of the modules of the deep learning-based antiepileptic drug efficacy prediction and management system of this application. Detailed Implementation
[0023] The technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but only to illustrate selected embodiments of this application.
[0024] Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item has been defined in one figure, it does not need to be further defined and explained in subsequent figures. The terms "first", "second", etc. are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0025] Existing deep learning-based methods for predicting the efficacy of antiepileptic drugs generally employ sequence models such as Long Short-Term Memory (LSTM) networks or Transformers when processing patients' past medical records. Each outpatient record is extracted as a discrete temporal node and input into the network sequentially according to a fixed step order. These sequence models implicitly assume that the information step weights between discrete temporal nodes are equivalent; that is, the network only transmits and updates the hidden state based on the relative order of nodes in the sequence, without considering the actual physical time span between nodes.
[0026] However, in real-world clinical settings, the frequency of follow-up appointments for epilepsy patients exhibits significant non-uniformity: some patients may have appointments every two weeks, while others may not have them for several months or even half a year due to stable condition, transportation difficulties, or other individual factors. For example, after their condition stabilizes, some patients may gradually extend their follow-up appointments from the usual two weeks to once every few months. When faced with this gradually increasing interval, existing models, because they consistently treat each appointment as an equally weighted sequential step, often fail to adjust their level of trust in historical medication characteristics in a timely manner, thus creating a potential for long-term predictive bias.
[0027] Meanwhile, the accumulation and metabolism of antiepileptic drugs in the patient's blood follow objective first-order elimination kinetics, exhibiting a nonlinear characteristic of continuous decay over real time. Existing techniques forcibly discretize the aforementioned non-uniform follow-up intervals into equally weighted sequential steps, completely ignoring the decay modulation effect of the real physical time span on historical characteristics, representing a typical defect in discretization processing.
[0028] In scenarios with long intervals between follow-up visits, the network cannot perceive the decay effect of real-time spans on historical drug efficacy characteristics. This can lead to erroneous concentration accumulation effects, misjudging long-metabolized historical drug characteristics as still effective, thus causing directional biases in long-term efficacy predictions. Conversely, in scenarios with short intervals where historical drug efficacy should still have significant residual effects, the model may suffer from excessive forgetting due to the lack of a physical time scale, similarly affecting prediction accuracy. This deficiency has long constrained the robust deployment of deep learning-based longitudinal medical time-series prediction systems in real-world clinical environments.
[0029] Therefore, such as Figure 1 As shown, this application provides a deep learning-based method for predicting and managing the efficacy of antiepileptic drugs, including the following steps:
[0030] The medical record sequence of the target object is obtained and divided into multiple discrete time-series nodes. The decay attribute vector representing the metabolic rate of drug components in each discrete time-series node is extracted respectively.
[0031] Obtain the actual time interval between the first and second adjacent time nodes in the medical record sequence, and generate a continuous decay feature vector based on the actual time interval and the decay attribute vector of the first time node;
[0032] Based on the continuous decay feature vector mapping, a dimension-aligned decay constraint mask is obtained. Based on the decay constraint mask, the original forgetting feature vector generated by the preset temporal prediction network at the second temporal node is reconstructed, and the reconstructed forgetting feature vector is obtained.
[0033] Based on the reconstructed forgetting feature vector, the preset temporal prediction network performs a historical memory truncation operation on the hidden cell memory state generated at the first temporal node to generate the hidden cell memory state at the second temporal node.
[0034] The historical memory truncation operation is performed sequentially on each of the discrete time-series nodes in the medical record sequence, and the resulting hidden cell memory state is mapped to the target object's achievement probability value. The achievement probability value is compared with a preset intervention threshold, and the corresponding structured execution instruction is output based on the comparison result.
[0035] In another implementation, such as Figure 2 As shown, this application also provides a deep learning-based antiepileptic drug efficacy prediction and management system, including the following modules:
[0036] The acquisition module is used to acquire the medical record sequence of the target object and divide it into multiple discrete time-series nodes, and extract the decay attribute vector representing the metabolic rate of drug components in each of the discrete time-series nodes.
[0037] The vector generation module is used to obtain the actual time interval between the first and second time nodes that are adjacent to each other in the medical record sequence, and to generate a continuous decay feature vector based on the actual time interval and the decay attribute vector of the first time node.
[0038] The reconstruction module is used to obtain a dimension-aligned decay constraint mask based on the continuous decay feature vector mapping, and to reconstruct the original forgotten feature vector generated by the preset temporal prediction network at the second temporal node based on the decay constraint mask, and obtain the reconstructed forgotten feature vector.
[0039] The vector processing module is used to perform a historical memory truncation operation on the hidden cell memory state generated by the preset temporal prediction network at the first temporal node based on the reconstructed forgetting feature vector, and generate the hidden cell memory state of the second temporal node.
[0040] The instruction output module is used to sequentially perform historical memory truncation operations on each of the discrete time-series nodes in the medical record sequence, map the final generated hidden cell memory state to the target object's achievement probability value, compare the achievement probability value with a preset intervention threshold, and output the corresponding structured execution instruction based on the comparison result.
[0041] I. Discrete time-series node partitioning and attenuation attribute vector extraction;
[0042] The input for this step is the original electronic medical record sequence of the target object's entire lifecycle extracted from the hospital information system and the standard pharmacopoeia configuration table. The output is a discrete time-series node sequence arranged in chronological order and the decay attribute vector corresponding to each node.
[0043] By converting the standard pharmacokinetic half-life parameter of the antiepileptic drug component in the prescription into an elimination rate constant, this invention enables each discrete time-series node to naturally carry a physical efficacy decay scale that can be computed by a deep network, laying an objective foundation for the coupling of physical laws with the hidden space of the neural network in subsequent steps.
[0044] Before extracting the above information, the present invention first performs node cleaning and time-series sorting processing on the medical record sequence: according to the actual time sequence of the patient's visits, the original electronic medical record records are deduplicated and rearranged to ensure that each discrete time-series node is strictly arranged in a unidirectional ascending order according to the actual treatment time, so as to avoid introducing false time-series logic due to abnormal data entry order.
[0045] This invention uses the target object's previous medical visits as discrete time-series nodes. , The visit timestamps and prescription data corresponding to each discrete time-series node are extracted respectively; further, the anti-epileptic drug components contained in the prescription data are extracted, and multi-heat encoding processing is performed on the drug components according to the preset drug dictionary to generate an intervention feature vector of preset dimensions.
[0046] Assuming the drug dictionary has a preset dimension of 50, and the second dimension corresponds to levetiracetam; when a prescription for a discrete time node contains only levetiracetam, the corresponding intervention feature vector takes a value of 1 in the second dimension and 0 in all other dimensions.
[0047] For each drug component with a non-zero eigenvalue in the intervention feature vector, the corresponding standard half-life constant is looked up based on a preset standard pharmacopoeia configuration table. This configuration table stores the unique identifiers of various antiepileptic drugs and their human standard half-life constants as recorded in standard medical pharmacopoeias in a key-value pair data structure.
[0048] Based on the first-order elimination kinetics of a one-compartment model, this invention converts the standard half-life constant into the drug elimination rate, and the calculation relationship is as follows:
[0049] ;
[0050] In the formula, The drug elimination rate is expressed as the reciprocal of time; T1 / 2 is the standard half-life constant of the drug, with units consistent with the actual time interval; ln2 is the logarithm of 2, approximately 0.693. In a specific embodiment, the standard half-life of levetiracetam is... The drug elimination rate is approximately 7.0 hours, calculated using the above formula. It is approximately a countdown of 0.099 hours.
[0051] The standard pharmacopoeia configuration table is pre-stored in a database or configuration file, using the drug's unique identifier as the index key and the corresponding standard half-life value as the index value. This facilitates rapid table lookup and batch calculation when the system processes different drug components. When the prescription of the target object contains multiple antiepileptic drug components, the present invention repeats the above table lookup and rate conversion process for each activated drug component, and fills the drug elimination rate corresponding to each drug into the corresponding coordinate position of the decay attribute vector one by one according to the preset dimension order, thereby supporting parallel decay modeling in multi-drug combination scenarios.
[0052] This invention, based on the dimensional order of the intervention feature vector, fills the drug elimination rate corresponding to each activated drug component into the corresponding dimensional coordinate position; for drug dimensions that are not activated in the intervention feature vector, the corresponding drug elimination rate is set to a preset zero value. This invention combines all the filled dimensions into a decay attribute vector K that is consistent with the dimensions of the intervention feature vector. The decay attribute vector represents the set of metabolic elimination rates of the drug components in the patient's body at the corresponding discrete time nodes, serving as a physical decay scale for measuring the impact of physical time passage on residual efficacy in subsequent steps.
[0053] II. Generation of the actual time interval and the continuously decaying feature vector;
[0054] The input to this step is the visit timestamps corresponding to the adjacent first and second time-series nodes, and the decay attribute vector of the first time-series node. The output is a continuously decaying feature vector.
[0055] This invention breaks through the conventional approach of treating time difference merely as an additional feature input and letting the network learn its influence on its own. Instead, it uses the analytical solution of the first-order elimination dynamics ordinary differential equation to forcibly transform the real physical time span into an objective feature residual ratio, thereby preventing the network from making overconfident predictions about long-interval data from the source.
[0056] This invention obtains the absolute value of the difference between the corresponding medical visit timestamps of the first time-series node and the second time-series node, and converts it into a preset physical time measurement unit as the actual time interval between the two. ;
[0057] Extracting the absolute value of the difference is used to eliminate time reversal errors caused by abnormal data entry order, ensuring the objective unidirectionality of the physical time flow. In a specific embodiment, if the first time-series node corresponds to a consultation time of 08:00 on a certain day, and the second time-series node corresponds to a consultation time of 08:00 on the next day, then the actual time interval... It is 24 hours.
[0058] The present invention will use the actual time interval The decay attribute vector of the first time-series node Substituting into the preset feature extraction equation: In the underlying tensor operation, first, the element-wise multiplication of the actual time interval and the decay attribute vector under the broadcast mechanism is performed to obtain the intermediate cumulative vector representing the theoretical elimination integral of each drug within the time interval; then, the negative of each element of the intermediate cumulative vector is taken, and exponential mapping processing is performed with the natural constant as the base to finally obtain the continuous decay feature vector, the calculation relationship of which is as follows:
[0059] .
[0060] In the formula, It is a continuously decaying feature vector, with values ranging from (0,1]. The decay attribute vector of the first time-series node; This is the actual time interval between the first time sequence node and the second time sequence node; This represents an exponential function with the natural constant e as its base.
[0061] At the engineering implementation level, the actual time interval As a scalar, with the attenuation attribute vector When performing element-wise multiplication, the broadcast mechanism in the computer's tensor operation framework is actually invoked:
[0062] The scalar value is automatically expanded to the same dimension as the decay attribute vector before being multiplied by each element of that vector. This mechanism ensures the validity and consistency of operations between the scalar and the high-dimensional vector. Each element in the vector directly represents the percentage of the effective concentration of the corresponding drug prescribed in the previous prescription that remains in the patient's body after actual decay over time.
[0063] In a specific embodiment, the drug elimination rate constant for levetiracetam in the corresponding dimension is approximately the reciprocal of 0.099 hours. The actual time interval is 24 hours. The result of multiplying each element is 2.376. After taking the negative number and applying an exponential mapping, we get approximately 0.093. That is, the theoretical residual concentration ratio of levetiracetam after 24 hours is approximately 9.3%.
[0064] The value of the dimension corresponding to the inactive drug in the decay attribute vector is 0, and the result after exponential mapping is 1, which indicates that there is no decay action in this dimension under the baseline state. This cleverly realizes the self-consistent logic of performing decay truncation only on the actual prescribed drugs.
[0065] III. Dimensional alignment generation of decay constraint masks and reconstruction of native forgotten feature vectors;
[0066] The input to this step is the continuously decaying feature vector and the original forgotten feature vector generated by the preset temporal prediction network at the second time node. The output is the reconstructed forgotten feature vector.
[0067] In this embodiment, the temporal prediction network preferably employs a variant architecture of a Long Short-Term Memory (LSTM) network. This network is configured to process medical record sequences of the target object, and its latent space dimension is preset to 256.
[0068] At any discrete time node The network receives the comprehensive input features of the current node. (Including the patient's physiological signs and the intervention feature vector of the medication prescribed at that time), and combined with the hidden cellular memory state of the previous node. Through internal linear fully connected layers and nonlinear activation functions, it generates three native network parameters in parallel for use during downstream physical memory truncation. The specific native gating computation equations at the computer's underlying layer are as follows:
[0069] Native forget gate calculation: , used to output the native forgotten feature vector ;
[0070] Native input gate calculation: , used to output the original input feature vector ;
[0071] Candidate memory state calculation: Used to output the candidate updated state vector .
[0072] In the formula, , , These are the weight matrices trained within the network. , , These are the bias vectors, It is the Sigmoid activation function. It is the hyperbolic tangent activation function.
[0073] This invention projects low-dimensional decay features with only physical pharmacokinetics significance onto a high-dimensional manifold space consistent with the dimension of the hidden layer of the neural network by using a preset alignment mapping weight matrix and bias vector. Then, the objective physical decay law is applied as a rigid constraint to the network's native forgetting mechanism by using the Hadamard product, so that the proportion of historical memory retained by the network is no longer determined solely by the data-driven black box forgetting gate, but must also be subject to the real physical decay boundary.
[0074] Since the objective boundary of the physical attenuation ratio must be within the (0,1) interval, this invention, after performing a dimension-aligned linear transformation, further introduces a nonlinear activation mapping for correction. Specifically, this invention transforms the continuous attenuation feature vector... Input a preset alignment mapping equation, and apply it through a preset alignment mapping weight matrix. Perform a linear spatial transformation on the continuously decaying feature vector, and then compare the transformation result with a preset alignment bias vector. Perform a summation operation to obtain the feature-aligned variables;
[0075] Subsequently, through the preset first activation function The feature alignment variable is subjected to nonlinear mapping processing to forcibly compress its value range to the (0,1) interval, thereby generating a decay constraint mask with the same dimension as the hidden cell memory state corresponding to the first time-series node. The calculation relationship is as follows:
[0076] .
[0077] In the formula, For the attenuation constraint mask; The alignment mapping weight matrix is a preset matrix whose dimensions are determined by the dimensions of the hidden layers of the temporal prediction network and the dimensions of the decay attribute vector. The alignment bias vector is a preset value, with the same dimension as the hidden layer dimension of the temporal prediction network. The first activation function is preset, preferably the Sigmoid function.
[0078] The alignment mapping weight matrix With the alignment bias vector As a learnable parameter, it is optimized synchronously with the backpropagation process of the overall loss function during the model training stage, so that the projection method of physical features into the high-dimensional latent space can be adaptively adjusted according to real historical data, ensuring the rigidity of physical constraints while taking into account the model's fitting ability.
[0079] In selecting the activation function, this invention preferably uses the Sigmoid function instead of other common activation functions such as ReLU or Tanh. The ReLU function has an unbounded range of values greater than or equal to zero. If used to generate a decay constraint mask, it will lead to an over-amplification of historical memory or even numerical inflation. The Tanh function has a range of values from negative one to positive one, which may cause the reconstructed forgotten feature vector to show unreasonable results of reverse memory. Only the Sigmoid function has a range of values that strictly falls within the open range of zero to one, which perfectly matches the physical retention ratio boundary represented by the decay constraint mask—at most, complete retention, and at least complete forgetting, thus ensuring the physical rationality of the mask generation process.
[0080] In a specific embodiment, the decay attribute vector dimension is 50, and the hidden cell memory state dimension of the temporal prediction network is 256, then the alignment mapping weight matrix... The dimensions are 256×50, and the alignment offset vector is... The dimension is 256; the feature alignment variable obtained after matrix dot product and bias summation has a dimension of 256×1, and after Sigmoid function mapping, the output decay constraint mask is... Hidden cellular memory state of the first time node Both are 256-dimensional, and their dimensions are strictly consistent, thus meeting the dimensional requirements of subsequent operations.
[0081] After obtaining the dimension-aligned decay constraint mask, the decay constraint mask is compared with the native forgotten feature vector generated by the preset temporal prediction network at the second temporal node. Perform the Hadamard product operation to generate the reconstructed forgotten feature vector.
[0082] The physical essence of this reconstruction action is the physical limit capping: regardless of the original forgotten feature vector The value of tends to retain a certain amount of historical information. The reconstructed forgotten feature vectors are numerically constrained to the real physical decay limit represented by the decay constraint mask, and the network is not allowed to subjectively retain historical features that exceed the objective pharmacokinetic residue ratio.
[0083] When the value of the attenuation constraint mask approaches 1, it indicates that the historical efficacy of the corresponding dimension has not undergone significant metabolism and should be fully preserved; when the value of the attenuation constraint mask approaches 0, it indicates that the historical efficacy of the corresponding dimension has been basically metabolized and should be forcibly forgotten. The continuous values between the two correspond to different degrees of partial retention.
[0084] IV. Historical memory truncation operation and generation of hidden cellular memory state;
[0085] The inputs to this step are the reconstructed forgotten feature vector, the hidden cell memory state corresponding to the first time-series node, and the native input feature vector and candidate update state vector generated by the preset time-series prediction network at the second time-series node. The output is the hidden cell memory state of the second time-series node.
[0086] This invention applies physical decay constraints directly to the core long-term memory channel of the neural network, rigidly limiting the upper limit of the retention of historical pharmacodynamic features within the physical metabolic boundary. This prevents the network from over-remembering historical data due to ignoring the physical time span.
[0087] This invention compares the reconstructed forgetting feature vector with the hidden cellular memory state corresponding to the first temporal node. Perform the Hadamard product operation to obtain the historical memory truncation state vector; this truncation action will forcibly reduce the historical efficacy features that have become invalid due to the long actual time span according to the physical proportion represented by the decay constraint mask. This is equivalent to installing a physical valve on the data transmission path from the first time node to the second time node. The longer the time is between the two nodes, the tighter the physical valve is closed, and the less historical memory is allowed to be transmitted.
[0088] Meanwhile, the present invention applies the native input feature vector generated by the time-series prediction network at the second time-series node. Update the candidate state vector Perform the Hadamard product operation to obtain the new feature vector of the current node. This operation filters out redundant noise in the current prescription and extracts the effective new intervention features that can actually enter the patient's body.
[0089] At the dimensional level, both the truncated historical memory state vector and the newly added feature vector of the current node exist in the same dimensional space as the hidden cellular memory state before the addition operation, thus ensuring the mathematical self-consistency of the state synthesis process. Subsequently, a vector addition operation is performed on the truncated historical memory state vector and the newly added feature vector of the current node to simulate the superimposed and mixed effect of the residual old drug effect and the newly ingested drug effect, generating the hidden cellular memory state of the second time-series node. The calculation relationship is as follows:
[0090] .
[0091] In the formula, This represents the hidden cellular memory state of the second time-series node; The original forgotten feature vector generated by the preset temporal prediction network at the second temporal node; For the attenuation constraint mask; This represents the hidden cell memory state of the first time-series node; The original input feature vector generated by the preset temporal prediction network at the second temporal node; For candidate update state vectors; This represents the Hadama product.
[0092] The present invention performs the above-mentioned historical memory truncation operation on each discrete time-series node in the medical record sequence in sequence: the hidden cell memory state output by the previous node is used as the historical basis for the calculation of the next node, and the process is rolled forward step by step along the order of the real timestamps.
[0093] When the internal step pointer of the time-series prediction network increments to the boundary node that matches the number of effective medical visits of the target object, the loop control flow is triggered to terminate. At this time, the generated hidden cell memory state is determined as the final generated hidden cell memory state, which is used to characterize the sum of historical drug efficacy characteristics of the target object after going through all medical visit nodes and after being corrected by real physical time decay.
[0094] Since the number of visits to different target objects varies, the present invention pre-sets a uniform maximum sequence length in engineering implementation. For target objects whose number of visits is less than this length, the sequence is padded with a preset padding value at the end of their medical record sequence, and a corresponding effective length indicator is generated simultaneously to mark the total number of real and effective discrete time-series nodes of the target object.
[0095] When the internal step pointer reaches the boundary marked by the effective length indicator, the loop control flow is triggered to terminate. Subsequent filling nodes no longer participate in the updating and transmission of the hidden cell memory state, thus ensuring that the final generated hidden cell memory state completely corresponds to the real medical data and is not affected by the filling data.
[0096] V. Obtaining the probability value of achieving the target and outputting structured execution instructions;
[0097] The input for this step is the final generated hidden cell memory state, and the output is the structured execution instruction after comparison with the preset intervention threshold.
[0098] This invention uses a multi-layer regression network to collapse the high-dimensional abstract cellular memory state into a single scalar confidence score, and then corrects the confidence score by combining the global fluctuation variance of sequence decay evolution. Finally, it realizes automated docking with downstream medical business systems in the form of structured instructions, so that the prediction results have executable and traceable engineering implementation capabilities.
[0099] The multilayer regression network is specifically a multilayer perceptron (MLP), which is configured at the end of the temporal prediction network. Its network topology is a multi-layered cascaded feedforward fully connected neural network. Specifically, this MLP includes an input layer, at least one hidden layer, and an output layer. Its specific network layer configuration and dimensionality collapse path are as follows:
[0100] Input layer: Receives the hidden cell memory state generated at the last temporal node of the entire sequence. Its input dimension is 256.
[0101] Hidden layers: consisting of a first hidden layer and a second hidden layer. The first hidden layer reduces the dimensionality of the 256-dimensional features to 128-dimensional features using a weight matrix, and preferably connects a batch normalization layer and a ReLU activation function; the second hidden layer further reduces the dimensionality of the 128-dimensional features to 64-dimensional features, and connects a Dropout layer to prevent regression overfitting.
[0102] Output layer: through a dimension of size The linear fully connected layer directly collapses and maps the aforementioned 64-dimensional hidden features to a 1-dimensional space, and calculates an unbounded single scalar output value.
[0103] This invention will ultimately generate hidden cell memory states The input multilayer regression network undergoes nonlinear dimensionality reduction through at least one fully connected hidden layer with ReLU activation. The output layer then further collapses this network into a single scalar output value, with the following computational relationships:
[0104] ;
[0105] In the formula, It is a single scalar output value with no limit on its range, representing the absolute confidence score of the target object's tendency to meet the standard in the high-dimensional manifold space of the model; , These are the weight matrix and bias vector of the hidden layer of a pre-defined multi-layer regression network; , These are the weight matrix and bias scalar of the output layer, respectively. The dimension size is set to ensure that the output strictly collapses into a single scalar; It is a linear rectified activation function used to filter out negative noise in the hidden layer features, enabling the dimensionality reduction process to have nonlinear expressive capabilities.
[0106] It should be noted that the aforementioned single scalar output value y is usually referred to as confidence score or log odds in the field of deep learning, and it is not directly equivalent to probability. Only after being constrained and mapped by a preset activation function is it transformed into a value with standardized probability significance. This distinction ensures the rigor of the mathematical expression of this invention.
[0107] Due to a single scalar output value Since the value of is unbounded, it cannot be directly used as a standardized probability index. Therefore, this invention further inputs it into a preset second activation function for constraint mapping, and the calculation relationship is as follows:
[0108] ;
[0109] In the formula, The base probability value is obtained by mapping a single scalar output value through the second activation function, and its value range is (0,1).
[0110] Furthermore, in some embodiments, to improve the model's robustness in predicting patient follow-up visit rhythms and medication adherence fluctuations, the present invention performs a correction on the baseline probability value before determining it as the target achievement probability value:
[0111] This invention obtains the continuous decay feature vectors corresponding to all consecutive discrete time nodes in the medical record sequence, concatenates them in time sequence to obtain the sequence decay evolution matrix, and performs a second-order difference operation on the sequence decay evolution matrix along the time axis to filter out the conventional linear decay trend, thereby obtaining a set of fluctuating gradient vectors characterizing the abrupt acceleration of adjacent visit intervals. The calculation relationship is as follows:
[0112] ;
[0113] In the formula, For nodes in the set of wave gradient vectors The second-order difference result, and They are respectively The preceding and following continuously decaying eigenvectors;
[0114] This invention extracts the statistical variance of the set of fluctuation gradient vectors on the global time axis to obtain the global variance value. The physical meaning of this variance value is to characterize the overall fluctuation intensity of the continuous decay feature vector corresponding to the target object on the time axis. The larger the variance value, the less regular the follow-up visit rhythm and medication habits of the target object are, and the more likely the basic probability value obtained by the model based on a single scalar output value is to be artificially high due to data noise.
[0115] When the global variance value is less than or equal to a preset steady-state benchmark threshold, the present invention determines that the target object is in a compliance steady-state range and directly determines the basic probability value as the achievement probability value; when the global variance value is greater than the preset steady-state benchmark threshold, the present invention determines that the target object is in a highly volatile state. Based on the deviation of the global variance value from the preset steady-state benchmark threshold, a preset negative correlation mapping function is input to generate a confidence penalty coefficient, the calculation relationship of which is as follows:
[0116] ;
[0117] In the formula, is the confidence penalty coefficient, with a value range of (0,1); This is a preset penalty sensitivity hyperparameter; This represents the deviation when the global variance exceeds a preset steady-state baseline threshold. Deviation The larger the value, the greater the penalty coefficient generated. The probability of a target value rapidly approaches zero in a non-linear manner. This invention determines the success probability value by multiplying the base probability value by the confidence penalty coefficient. This operation objectively discounts and corrects the initial prediction probability, which might have been too high due to network fitting, based on the degree of irregularity in the target object's behavior.
[0118] Finally, the present invention compares the target achievement probability value with the preset intervention threshold and outputs the corresponding structured execution instruction based on the comparison result: the preset intervention threshold can be preset by clinicians according to specific diagnosis and treatment guidelines, and is used to characterize the minimum level of certainty that is acceptable in clinical practice. The present invention does not limit the specific value of the threshold.
[0119] The structured execution instructions include a first structured execution instruction and a second structured execution instruction. When the success probability value is greater than or equal to a preset intervention threshold, the present invention generates a first structured execution instruction containing a state maintenance identifier to indicate maintaining the current drug composition of the target object. When the success probability value is less than the preset intervention threshold, the present invention generates a second structured execution instruction containing a warning interception identifier to indicate changing the current drug composition of the target object.
[0120] Specifically, the structured execution instructions are predefined with a unified field structure according to a preset protocol, including fields such as instruction timestamp, action identifier, unique identifier of target object, execution priority, and remarks description information;
[0121] Once the probability value of achieving the target is compared with the preset intervention threshold, the present invention serializes the comparison result into a preset data encapsulation format and pushes the encapsulated instruction to the designated medical business system node through a preset network transmission protocol. The system node parses the instruction field based on its internal parser and executes the corresponding prescription circulation status update or clinical early warning trigger according to the instruction identifier, thereby realizing the automated closed-loop connection between the prediction result and the clinical business process.
[0122] It should be noted that the temporal prediction network described in this invention is not limited to long short-term memory networks. For other temporal prediction network architectures such as Transformer that adopt self-attention mechanism, the decay constraint mask can also be applied as a strong constraint to the corresponding historical information retention weights inside, so as to achieve the same physical time decay truncation effect as this invention.
[0123] Through the above technical solution, the present invention can achieve the following technical effects:
[0124] 1. To address the shortcomings of existing technologies that transmit hidden states at equal step sizes for each discrete time-series node and completely ignore the modulation effect of the real physical time span on historical features, this invention transforms the real time interval into a continuously decaying feature vector based on the first-order elimination dynamics equation. It then generates a decay constraint mask through dimension alignment mapping and forces it onto the network's native forgetting mechanism. This ensures that the retention rate of historical memory is always constrained by the objective physical decay boundary, significantly improving the robustness of efficacy prediction in long-interval follow-up scenarios and effectively reducing false positive predictions caused by model overconfidence. This mechanism is universally applicable to various antiepileptic drugs with different elimination rates, eliminating the need for separate parameter tuning for a single drug type.
[0125] 2. In view of the shortcomings of existing technologies that rely on complex data interpolation methods to process non-uniform time series data and are prone to introducing additional noise, this invention does not require interpolation to complete missing or irregular follow-up visit intervals. Instead, it directly completes the forced injection of physical time decay at the network operation mechanism layer, thereby simplifying the engineering processing flow of non-uniform time series data and improving the deployment efficiency of the model in real clinical data scenarios.
[0126] 3. To address the shortcomings of existing technologies that fail to consider fluctuations in patient follow-up visits and medication adherence, and are prone to generating artificially high confidence levels in scenarios of adherence disorder, this invention applies a confidence penalty correction to the target probability value by performing second-order difference and global variance determination on the sequence decay evolution matrix. This ensures that the prediction results maintain an objective and prudent probability output even in scenarios where patient behavior is highly irregular, thereby improving the reliability of clinical decision support.
[0127] 4. In view of the shortcomings of existing technologies, such as difficulty in directly connecting the output results with medical business systems and the need for manual secondary translation, this invention serializes the comparison results of the compliance probability values into structured execution instructions and pushes them to downstream medical business system nodes, thereby realizing automated closed-loop management of prediction results and prescription circulation business, and improving the timeliness of clinical decision support.
[0128] 5. To address the shortcomings of existing technologies that rely purely on data-driven, black-box forgetting mechanisms and lack physical interpretability, this invention embeds the physical decay law of pharmacokinetics into the network gating operator in the form of an explicit formula, so that the truncation process of historical memory has clear physical interpretability, which facilitates the traceability and verification of prediction results in clinical deployment.
[0129] In another embodiment, this application also provides a computer storage medium storing computer-executable instructions, which, when executed, implement the deep learning-based antiepileptic drug efficacy prediction and management method.
[0130] The above embodiments are only used to illustrate the technical methods of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of this application without departing from the spirit and scope of the technical methods of this application.
Claims
1. A deep learning-based method for predicting and managing the efficacy of antiepileptic drugs, characterized in that, Includes the following steps: The medical record sequence of the target object is obtained and divided into multiple discrete time-series nodes. The decay attribute vector representing the metabolic rate of drug components in each discrete time-series node is extracted respectively. Obtain the actual time interval between the first and second adjacent time nodes in the medical record sequence, and generate a continuous decay feature vector based on the actual time interval and the decay attribute vector of the first time node; Based on the continuous decay feature vector mapping, a dimension-aligned decay constraint mask is obtained. Based on the decay constraint mask, the original forgetting feature vector generated by the preset temporal prediction network at the second temporal node is reconstructed, and the reconstructed forgetting feature vector is obtained. Based on the reconstructed forgetting feature vector, the preset temporal prediction network performs a historical memory truncation operation on the hidden cell memory state generated at the first temporal node to generate the hidden cell memory state at the second temporal node. The historical memory truncation operation is performed sequentially on each of the discrete time-series nodes in the medical record sequence, and the resulting hidden cell memory state is mapped to the target object's achievement probability value. The achievement probability value is compared with a preset intervention threshold, and the corresponding structured execution instruction is output based on the comparison result.
2. The method for predicting and managing the efficacy of antiepileptic drugs based on deep learning according to claim 1, characterized in that, The process of extracting the decay attribute vector includes: The visit timestamps and prescription data corresponding to each discrete time-series node are obtained respectively, the drug components contained in the prescription data are extracted, and an intervention feature vector of a preset dimension is generated based on the drug components. For each drug component with a non-zero feature value in the intervention feature vector, the standard half-life constant of each drug component is queried based on the preset standard pharmacopoeia configuration table, and the corresponding drug elimination rate is obtained according to the standard half-life constant. The drug elimination rates of each drug component are combined in the order of the dimensions of the intervention feature vector to generate a decay attribute vector.
3. The method for predicting and managing the efficacy of antiepileptic drugs based on deep learning according to claim 2, characterized in that, The process of generating the continuously decaying feature vector includes: Obtain the absolute value of the difference between the visit timestamps corresponding to the second time series node and the first time series node, and use it as the actual time interval between the two. ; The actual time interval The decay attribute vector of the first time-series node Substituting the values into the preset feature extraction equation, the element-wise multiplication result of the two is calculated, and the negative of the element-wise multiplication result is subjected to exponential mapping with the natural constant as the base to obtain a continuously decaying feature vector. ; 。 4. The deep learning-based method for predicting and managing the efficacy of antiepileptic drugs according to claim 1, characterized in that, The process of obtaining the attenuation constraint mask includes: The continuously decaying feature vector is input into a preset alignment mapping equation, and then processed by a preset alignment mapping weight matrix. A linear spatial transformation is performed on the continuously decaying feature vector, and the transformation result is compared with a preset alignment bias vector. Perform a summation operation to obtain the feature-aligned variables; Through the preset first activation function The feature alignment variables are mapped to generate a decay constraint mask that is in the same dimension as the hidden cell memory state corresponding to the first time-series node. ; 。 5. The method for predicting and managing the efficacy of antiepileptic drugs based on deep learning according to claim 1, characterized in that, The process of generating the reconstructed forgetting feature vector and the hidden cell memory state of the second time node includes: The decay constraint mask and the native forgetting feature vector Perform the Hadamard product operation to generate the reconstructed forgetting feature vector, and compare the reconstructed forgetting feature vector with the hidden cell memory state corresponding to the first time node. Perform the Hadamard product operation to obtain the truncated state vector of historical memory; The original input feature vector generated by the temporal prediction network at the second temporal node Update the candidate state vector Perform the Hadamard product operation to obtain the new feature vector for the current node; Perform vector addition on the truncated historical memory state vector and the newly added feature vector of the current node to generate the hidden cell memory state of the second time-series node. ; 。 6. The method for predicting and managing the efficacy of antiepileptic drugs based on deep learning according to claim 1, characterized in that, The process of obtaining the probability value of meeting the standard includes: The final generated hidden cell memory state is input into a preset multilayer regression network, and dimensionality reduction is performed to obtain a single scalar output value. The single scalar output value is then input into a preset second activation function and constrained to the range of (0,1) as the target probability value.
7. The deep learning-based method for predicting and managing the efficacy of antiepileptic drugs according to claim 6, characterized in that, Before determining the single scalar output value as the probability of achieving the target, the following is also included: Obtain the continuous decay feature vectors corresponding to all consecutive discrete time nodes in the medical record sequence, and concatenate them in time sequence to obtain the sequence decay evolution matrix. Perform second-order difference operation on the sequence decay evolution matrix to obtain the set of fluctuation gradient vectors. Extract the global variance value corresponding to the set of fluctuation gradient vectors. When the global variance value is less than or equal to the preset steady-state benchmark threshold, directly use the single scalar output value as the probability value of meeting the target. When the global variance value is greater than the preset steady-state benchmark threshold, a confidence penalty coefficient is generated based on the deviation of the global variance value from the preset steady-state benchmark threshold, and the product of the single scalar output value and the confidence penalty coefficient is used as the success probability value.
8. The method for predicting and managing the efficacy of antiepileptic drugs based on deep learning according to claim 1, characterized in that, The process of outputting the structured execution instructions includes: When the probability of achieving the target is greater than or equal to a preset intervention threshold, a first structured execution instruction containing a state maintenance identifier is generated to instruct the target object to maintain its current drug composition. When the probability of achieving the target is less than the preset intervention threshold, a second structured execution instruction containing a warning interception identifier is generated to indicate a change in the current drug composition of the target object.
9. A deep learning-based antiepileptic drug efficacy prediction and management system, characterized in that, Includes the following modules: The acquisition module is used to acquire the medical record sequence of the target object and divide it into multiple discrete time-series nodes, and extract the decay attribute vector representing the metabolic rate of drug components in each of the discrete time-series nodes. The vector generation module is used to obtain the actual time interval between the first and second time nodes that are adjacent to each other in the medical record sequence, and to generate a continuous decay feature vector based on the actual time interval and the decay attribute vector of the first time node. The reconstruction module is used to obtain a dimension-aligned decay constraint mask based on the continuous decay feature vector mapping, and to reconstruct the original forgotten feature vector generated by the preset temporal prediction network at the second temporal node based on the decay constraint mask, and obtain the reconstructed forgotten feature vector. The vector processing module is used to perform a historical memory truncation operation on the hidden cell memory state generated by the preset temporal prediction network at the first temporal node based on the reconstructed forgetting feature vector, and generate the hidden cell memory state of the second temporal node. The instruction output module is used to sequentially perform historical memory truncation operations on each of the discrete time-series nodes in the medical record sequence, map the final generated hidden cell memory state to the target object's achievement probability value, compare the achievement probability value with a preset intervention threshold, and output the corresponding structured execution instruction based on the comparison result.
10. A computer storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed, they implement the deep learning-based antiepileptic drug efficacy prediction and management method as described in any one of claims 1-8.