A method and device for solving the problem of irregular medical time series data
Two-stage filling of medical time series data through the graph neural network model solves the problem of data irregularity, improves prediction accuracy and interpolation quality, and provides more comprehensive clinical decision support.
Patent Information
- Application Number
- CN202410639597.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-22
AI Technical Summary
Medical time series data has irregularities due to factors such as equipment failures, changes in medical intervention, and patient status fluctuations. It is difficult for existing technologies to effectively capture and utilize the relationship structure of time series models, resulting in low quality interpolation data.
The graph neural network model is used to encode, feature identify and extract the input spatio-temporal data, and MPNN and MPGRU models are used to analyze continuous missing nodes, calculate the real-time missing rate and weight, and perform two-stage filling to ensure that the temporal and spatial structure of the data is Fully captured and optimized.
It improves the prediction accuracy of medical time series data, reveals the deep clinical significance behind missing data, provides more accurate and comprehensive clinical decision support, and ensures the efficiency and accuracy of data interpolation.
Smart Images

Figure CN118245474B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical data processing, and in particular to a method and device for solving the problem of irregular medical time series data. Background Art
[0002] With the development of medical technology, medical time series data plays an increasingly important role in clinical decision-making and patient monitoring; however, in actual medical environments, the collection process of medical device detection data is often affected by various factors, such as equipment failure, changes in medical intervention, fluctuations in patient status, etc.; these factors may lead to missing data or inconsistent observation intervals, forming irregular time series data. This irregularity poses a significant challenge in data processing and analysis, especially in time series prediction models that rely on continuous and complete data input.
[0003] The challenge of irregular time series data lies not only in missing observations, but also in time misalignment. For example, an electrocardiogram (ECG) may be sampled dozens of times per second, while blood test results may be obtained only once a day. The medical data of the same patient at different time points may come from different devices, and the number of detection values and detection intervals of these devices are different, resulting in a very uneven distribution of data on the time axis.
[0004] To address these challenges, early processing methods included the use of interpolation, kernel methods, and probabilistic methods to fill in missing data in an attempt to restore the continuity and regularity of the data; these methods have alleviated the problems caused by irregular data to a certain extent, but they often ignore the clinical information that may be contained in the missing data; in modern technology, especially models based on recurrent neural network architectures (such as RNN, LSTM, GRU) and Transformer have made progress in processing time series data, but most still assume that the data is regularly sampled or requires aligned cross-modal measurements; existing methods mostly adopt a two-stage processing strategy, that is, first estimate the missing values to generate a regularized data set, and then optimize the selected model to improve the performance of the model on downstream tasks; although this method is simple, it does not fully utilize the information implied by the missing data, nor does it effectively deal with the irregularity of data sampling.
[0005] Chinese Patent Publication No.: CN113672607A, discloses a method for processing missing values of medical time series data, the technical point of which is to fill the missing values through various clinical data patterns, including the following steps: data input, inputting multivariate original time series data containing missing values, interpolation switch matrix and input data timestamp matrix in the input layer, and adding supplementary input at the same time; it can be seen that the existing methods for solving the problem of irregular medical time series data have the following problems: the existing methods for studying how to effectively capture and utilize the relationship structure of time series models are relatively few, and it is difficult to ensure the rationality of interpolation data, resulting in low quality of interpolation data. Summary of the invention
[0006] To this end, the present invention provides a method and device for solving the problem of irregular medical time series data, so as to overcome the problem in the prior art of low quality of interpolated data due to the lack of time information and feature information of fused missing data to construct a graph neural network model that can capture and express sample changes and time-varying structures in complex time series.
[0007] To achieve the above object, the present invention provides a method for solving the problem of irregular medical time series data, comprising:
[0008] Encode the input spatiotemporal data to obtain an input sequence;
[0009] Performing feature recognition and feature extraction on the input sequence to obtain a node feature vector;
[0010] By introducing the MPNN model and the MPGRU model, the node feature vector is analyzed to generate a real-time feature sequence, the continuous missing nodes in the real-time feature sequence are obtained, the corresponding continuous time intervals are obtained according to the continuous missing nodes, the real-time missing rate is calculated according to the continuous time intervals, and the weight is calculated according to the real-time missing rate, so as to generate the first step prediction value according to the MPGRU model and generate the preliminary filling result according to the MPNN model;
[0011] Based on the preliminary filling result, obtaining a secondary continuous missing node, obtaining a data point according to the continuous missing node and the secondary continuous missing node, and modifying the weight corresponding to the data point to generate a secondary filling result according to the MPNN model;
[0012] The format of the padded spatiotemporal data is converted into an initial time series.
[0013] Furthermore, the input sequence is intercepted in real time to obtain sets of two adjacent nodes, obtain the real-time time interval between each set, and determine each real-time time interval according to the standard time interval in turn.
[0014] If the real-time time interval is less than or equal to the standard time interval, it is determined that the input spatiotemporal data corresponding to the node is not missing;
[0015] If the real-time time interval is greater than the standard time interval, it is determined that the input spatiotemporal data corresponding to the node is missing, the two nodes are marked as nodes to be interpolated, and the input spatiotemporal data corresponding to the nodes to be interpolated are extracted as the node feature vector.
[0016] Furthermore, the positions of two consecutive nodes to be interpolated are obtained according to the time series for determination. If the two nodes to be interpolated are adjacent, they are determined to be consecutively missing, and the two nodes to be interpolated are marked as consecutively missing nodes.
[0017] Furthermore, the real-time time interval between consecutive missing nodes is obtained, recorded as the continuous time interval, and the allowed cumulative time interval is compared with the continuous time interval.
[0018] If the continuous time interval is less than or equal to the allowed accumulation time interval, calculating the first missing rate;
[0019] If the continuous time interval is greater than the allowed accumulation time interval, a second missing rate is calculated.
[0020] Furthermore, the calculation formula for generating the first step prediction based on the weight is:
[0021]
[0022] in, is the weight of the h-th layer, is the bias vector of the hth layer, is the first step prediction value corresponding to the missing node at t, is the node feature vector value at t-1.
[0023] Further, each secondary consecutive missing node in the preliminary filling result sequence is obtained, and the sequence position corresponding to any secondary consecutive missing node is determined.
[0024] If there is a repetition in the position corresponding to a continuous missing node, the data corresponding to the repeated node is obtained as a data point, and the time interval corresponding to the repeated position is obtained and recorded as the historical missing time, and the weight is corrected.
[0025] Furthermore, the calculation formula for generating the real-time feature sequence according to the MPNN model is:
[0026]
[0027] in, is the initial filling result generated for node i at time t, is the data represented by the vector corresponding to node i at time t-1, is the output result of the first step prediction value corresponding to the input sequence at t, is the set of two adjacent nodes corresponding to node i at time t and time t-1, is the predicted value corresponding to the mask at time t, is the read function corresponding to the i-node.
[0028] Furthermore, the process of encoding the data and analyzing the node feature vector according to the MPNN model includes:
[0029]
[0030] Among them, MPNNk( ) represents the forward pass of a k-1 layer message passing neural network, represents the node feature vector corresponding to the k-1th layer of node i at time t, represents the weight matrix, represents the update function corresponding to layer k, is the message function corresponding to layer k, represents the sum function or mean function, Represents the node feature vector of node i in layer k at time t.
[0031] Further, generating a real-time feature sequence according to the MPNN model includes:
[0032]
[0033] in, represents the reset gate corresponding to the i node at t, represents the update gate corresponding to the i node at t, is the hidden representation of node i at time t-1, It is the output result of the processing module of the previous time step.
[0034] Encode the input spatiotemporal data to obtain an input sequence;
[0035] Performing feature recognition and feature extraction on the input sequence to obtain a node feature vector;
[0036] By introducing the MPNN model and the MPGRU model, the node feature vector is analyzed to generate a real-time feature sequence, the continuous missing nodes in the real-time feature sequence are obtained, the corresponding continuous time intervals are obtained according to the continuous missing nodes, the real-time missing rate is calculated according to the continuous time interval, and the weight is calculated according to the real-time missing rate to generate a preliminary filling result according to the MPNN model;
[0037] Based on the preliminary filling result, obtaining a secondary continuous missing node, obtaining a data point according to the continuous missing node and the secondary continuous missing node, and modifying the weight corresponding to the data point to generate a secondary filling result according to the MPNN model;
[0038] The format of the padded spatiotemporal data is converted into an initial time series.
[0039] Furthermore, the input sequence is intercepted in real time to obtain sets of two adjacent nodes, obtain the real-time time interval between each set, and determine each real-time time interval according to the standard time interval in turn.
[0040] If the real-time time interval is less than or equal to the standard time interval, it is determined that the input spatiotemporal data corresponding to the node is not missing;
[0041] If the real-time time interval is greater than the standard time interval, it is determined that the input spatiotemporal data corresponding to the node is missing, the two nodes are marked as nodes to be interpolated, and the input spatiotemporal data corresponding to the nodes to be interpolated are extracted as the node feature vector.
[0042] Furthermore, the positions of two consecutive nodes to be interpolated are determined. If the two nodes to be interpolated are adjacent, they are determined to be consecutively missing, and the two nodes to be interpolated are marked as consecutively missing nodes.
[0043] Furthermore, the real-time time interval between consecutive missing nodes is obtained, recorded as the continuous time interval, and the allowed cumulative time interval is compared with the continuous time interval.
[0044] If the continuous time interval is less than or equal to the allowed accumulation time interval, obtain the number of missing data and the total number of data in the current sequence, and calculate the first missing rate;
[0045] If the continuous time interval is greater than the allowed cumulative time interval, the corresponding continuous missing nodes are marked as cumulative missing node sets until all continuous missing nodes are determined, and the number of cumulative missing node sets and the total number of data in the input sequence are obtained to calculate the second missing rate;
[0046] The real-time miss rate is calculated according to the first miss rate and the second miss rate.
[0047] Furthermore, the calculation formula for generating the first step prediction based on the MPGRU model and the weights is:
[0048]
[0049] in, is the weight, is the bias vector, is the predicted value corresponding to the missing node at time t, is the node feature vector value at t-1.
[0050] Further, each secondary consecutive missing node in the preliminary filling result sequence is obtained, and the sequence position corresponding to any secondary consecutive missing node is determined.
[0051] If there is a repetition at the position corresponding to a continuous missing node, obtain the data corresponding to the repeated node as the data point, obtain the time interval corresponding to the repeated position, record it as the historical missing time, calculate the repetition missing rate based on the historical missing time, and correct the weight based on the repetition missing rate.
[0052] Furthermore, the calculation formula for generating the preliminary filling result according to the MPNN model is:
[0053]
[0054] in, is the initial filling result generated by node i at time t, is the node feature vector of node i at time t-1, is the predicted value corresponding to time t, is the set of two adjacent nodes, is the predicted value corresponding to the mask at time t, is the read function corresponding to the i-node.
[0055] Furthermore, the process of encoding the data and analyzing the node feature vector according to the MPNN model includes:
[0056]
[0057] Among them, MPNNk( ) represents the forward pass of a k-1 layer message passing neural network, represents the node feature vector corresponding to the k-1th layer of node i at time t, represents the weight matrix, represents the update function corresponding to layer k, is the message function corresponding to layer k, represents the sum function or mean function, Represents the node feature vector of node i in layer k at time t.
[0058] Further, generating a real-time feature sequence according to the MPGRU model includes:
[0059]
[0060] in, represents the reset gate corresponding to node i at time t, represents the update gate corresponding to node i at time t, represents the candidate hidden state corresponding to node i at t, is the hidden representation of node i at time t, is the second-step prediction result of the output of the previous time step processing module corresponding to node i at time t, is the predicted value corresponding to the mask at time t.
[0061] On the other hand, a device for solving the problem of irregular medical time series data is based on any of the above methods for solving the problem of irregular medical time series data, comprising:
[0062] A space-time encoder is used to encode the input space-time data to obtain an input sequence;
[0063] A modeling module, used to construct a recursive neural network model and a message passing neural network MPNN, wherein the message passing neural network is used to perform feature recognition and feature extraction on the input sequence to obtain a node feature vector;
[0064] The processing module includes a transmission unit, a gated circulation unit and an interpolation unit.
[0065] A gated recurrent unit, which is used to implement gating. For each time node, a reset gate and an update gate are calculated by an MPNN function, and a hidden state is controlled by a gating mechanism and a Hadamard product operation. The message passing model includes an MPNN function, a gating mechanism and a Hadamard product operation.
[0066] The transmission unit is used to analyze the node feature vector and generate a real-time feature sequence;
[0067] The interpolation unit is used to obtain the continuous missing nodes in the real-time feature sequence, obtain the corresponding continuous time intervals according to the continuous missing nodes, calculate the real-time missing rate according to the continuous time intervals, calculate the weight according to the real-time missing rate, and generate a preliminary filling result according to the MPNN model;
[0068] Based on the preliminary filling result, obtaining a secondary continuous missing node, obtaining a data point according to the continuous missing node and the secondary continuous missing node, and modifying the weight corresponding to the data point to generate a secondary filling result according to the MPNN model;
[0069] The space-time decoder is used to convert the format of the padded space-time data into an initial time series.
[0070] Compared with the prior art, the beneficial effect of the present invention lies in that computer technology and deep learning methods are used to solve the problem of irregularity of medical time series data in the construction of neural network models, and the missing data is effectively supplemented by utilizing the existing information in the time series data to improve the prediction accuracy of the model for irregular medical time series data. When performing data interpolation, the use of neural network technology not only achieves efficient and accurate data recovery, but also reveals the deep clinical significance behind the missing data, providing more accurate and comprehensive support for clinical decision-making. By introducing a machine learning model that can effectively utilize the inherent correlation of time series data, this model not only encodes and decodes data in the time dimension, but also performs the same operation in the spatial dimension. In the first stage of filling, the model uses spatiotemporal coding technology to capture the intrinsic time and space structure of the data, and then generates preliminary data filling results through spatial decoding; the second stage of filling is further optimized based on this result to improve the accuracy of the filled data.
[0071] Furthermore, by fusing the time information and feature information of the missing data, that is, determining the continuous missing nodes and analyzing their corresponding continuous time intervals, if the continuous time interval is less than or equal to the allowed cumulative time interval, indicating that there are more continuous missing data, the proportion of the number of missing data in the current sequence to the cumulative missing data is calculated as the first missing rate. If the continuous time interval is greater than the allowed cumulative time interval, indicating that the characteristic of the missing data is intermittent missing, the number of interruptions is counted to calculate the weight according to the number of interruptions to improve the accuracy of the calculation.
[0072] Furthermore, the data interpolation in this embodiment utilizes statistical methods to deduce and fill in the missing data, that is, to predict the missing values through a recursive neural network to obtain complete data, and to fully extract the features of the missing data and fuse the time information and feature information of the missing data, that is, to determine the continuous missing nodes and analyze their corresponding continuous time intervals, and at the same time, to adjust the calculation model based on the feedback of the preliminary filling results to perform more accurate interpolation and ensure the quality of the interpolated data.
[0073] Furthermore, the missing value problem is handled by replacing the missing values with certain values using auxiliary information, and a bidirectional graph interpolation network is introduced. This network cleverly solves the irregularity problem of time series data through the joint application of graph neural network and multi-layer perceptron; this structural design enables the model to fully understand and utilize the intrinsic connections in time series data, effectively improving the quality and accuracy of the data filling process; compared with the traditional single-stage filling method, the two-stage filling strategy adopted by the present invention is more refined and can handle the missing data problem more accurately; after the collected data is initially filled, it is further optimized for the second time to ensure that the filling results can better reflect the actual medical data, and is particularly suitable for processing data in complex scenarios such as intermittent failure of sensors and changes in medical interventions; because it can flexibly respond to different types of irregular time series data problems, this method has strong adaptability and is applied to data missing encountered in clinical environments and incomplete data records in the research process; to obtain more comprehensive and accurate time series data analysis results and obtain complete data. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 A flow chart of a method for solving the problem of irregular medical time series data according to an embodiment of the present invention;
[0075] Figure 2 A schematic diagram of the problem of irregular medical time series data according to an embodiment of the present invention;
[0076] Figure 3 A logical diagram of the architecture for processing irregular medical time series data according to an embodiment of the present invention;
[0077] Figure 4 A schematic diagram of the connection structure of a device for solving the problem of irregular medical time series data according to an embodiment of the present invention. DETAILED DESCRIPTION
[0078] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0079] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0080] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.
[0081] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0082] See also Figure 1 , Figure 2 as well as Figure 3 As shown, Figure 1 The flowchart of the method for solving the problem of irregular medical time series data according to an embodiment of the present invention is as follows: Figure 2 This is a schematic diagram of the problem of irregular medical time series data according to an embodiment of the present invention. Figure 3 The present invention provides a method for solving the problem of irregular medical time series data, including:
[0083] Step S1, using a polymorphic neural network to encode input spatiotemporal data to obtain an input sequence;
[0084] Step S2, performing feature recognition and feature extraction on the input sequence to obtain a node feature vector;
[0085] Step S3, by introducing the MPNN model and the MPGRU model, analyzing the node feature vector, generating a real-time feature sequence, obtaining continuous missing nodes in the real-time feature sequence, obtaining corresponding continuous time intervals according to the continuous missing nodes, calculating the real-time missing rate according to the continuous time intervals, calculating the weight according to the real-time missing rate, and generating a preliminary filling result according to the MPNN model;
[0086] Step S4, based on the preliminary filling result, obtaining a secondary continuous missing node, obtaining a data point according to the continuous missing node and the secondary continuous missing node, and modifying the weight corresponding to the data point to generate a secondary filling result according to the MPNN model;
[0087] Step S5, converting the format of the padded spatiotemporal data into an initial time series.
[0088] The node feature vector is the data represented by a vector;
[0089] In step S1, the association between the current state and the previous state of the data is first determined. This process is implemented through the computational model of the message passing neural network (MPNN), which comprehensively considers the dependencies between data points at each moment. Through this step, the dynamic changes in time series data can be grasped, laying the foundation for subsequent data filling and feature extraction. On this basis, the improved gated recurrent unit (MPGRU) is used to process the feature extraction of spatiotemporal data. This structure effectively captures the spatial relationship and dynamic changes in the data by integrating the advantages of polymorphic neural networks and gated recurrent units, thereby extracting more representative feature vectors, that is, spatiotemporal features. Preliminary data filling is performed on the extracted spatiotemporal features. This process involves estimating the missing data points through the learned spatiotemporal relationships. The preliminary filled data will serve as the basis for subsequent processing. This step introduces the deep information learned from the MPNN and MPGRU models. Improve the accuracy and reliability of filling. Based on the results of the preliminary filling in step S3, further refine and optimize the data filling in the second stage. In this step, the model applies the MPNN structure again, focusing on those data points that are more difficult to predict, and further optimizes the prediction results of these points in order to achieve a higher filling accuracy. After the two-stage filling in step S3 and step S4, the model uses the decoding process to convert the extracted feature vectors back to the original time series format. This step ensures the consistency and continuity of the data, so that the filled data can provide support for medical decision-making. On the basis of step S5, the model performs self-optimization through error feedback during the training process, ensuring that the model can adapt to the changing medical time series data scenarios and improve its generalization ability. Finally, by comparing with known medical time series data, the accuracy and reliability of the model filling results are verified to ensure that the data output by the model can be effectively used for clinical decision support.
[0090] In this embodiment, computer technology and deep learning methods are used to solve the problem of irregularity of medical time series data in the construction of neural network models. The missing data is effectively supplemented by utilizing the existing information in the time series data to improve the prediction accuracy of the model for irregular medical time series data. When performing data interpolation, the use of neural network technology not only achieves efficient and accurate data recovery, but also reveals the deep clinical significance behind the missing data, providing more accurate and comprehensive support for clinical decision-making. By introducing a machine learning model that can effectively utilize the inherent correlation of time series data, this model not only encodes and decodes data in the time dimension, but also performs the same operation in the spatial dimension. In the first stage of filling, the model uses spatiotemporal coding technology to capture the intrinsic time and space structure of the data, and then generates preliminary data filling results through spatial decoding; the second stage of filling is further optimized based on this result to improve the accuracy of the filled data.
[0091] Specifically, the interpolation unit processes the input spatiotemporal data according to the recursive neural network model to obtain the input sequence X[t, t+T′] and the mask, intercepts the input sequence in real time, and obtains the set of two adjacent nodes , obtain the real-time time interval between each set, and determine each real-time time interval according to the standard time interval in turn,
[0092] If the real-time time interval is less than or equal to the standard time interval, it is determined that the data corresponding to the two adjacent nodes are not missing;
[0093] If the real-time time interval is greater than the standard time interval, it is determined that the data corresponding to the two adjacent nodes are missing, the two nodes are marked as nodes to be interpolated, and the input spatiotemporal data corresponding to the nodes to be interpolated are extracted as node feature vectors;
[0094] Continue to perform calculation operations on the next two adjacent nodes.
[0095] Specifically, the positions of two consecutive nodes to be interpolated are determined.
[0096] If the two nodes to be interpolated are adjacent, the missing mode of the two nodes to be interpolated is determined to be continuous missing, and the two nodes to be interpolated are marked as continuous missing nodes;
[0097] If two nodes to be interpolated are not adjacent, the two nodes to be interpolated are not marked as consecutive missing nodes.
[0098] In this embodiment, two consecutive nodes to be interpolated are obtained in time sequence, and their positions in the input sequence are determined. If they are determined to be in adjacent positions, they are represented as consecutive missing data.
[0099] Specifically, an allowed accumulation time interval is set, the real-time time interval between consecutive missing nodes is obtained, recorded as the continuous time interval, and the allowed accumulation time interval is compared with the continuous time interval.
[0100] If the continuous time interval is less than or equal to the allowed accumulation time interval, obtain the number of missing data and the total number of data in the current sequence to calculate the first missing rate V1=Xq / Xz, and output V2=0 at the same time;
[0101] If the continuous time interval is greater than the allowed cumulative time interval, the corresponding continuous missing nodes are marked as cumulative missing node sets until all continuous missing nodes are determined, the number of cumulative missing node sets and the total number of data in the input sequence are obtained, and the second missing rate V2=Xs / Xj is calculated;
[0102] Calculate the real-time missing rate Vs=max{V1, V2} according to the first missing rate and the second missing rate;
[0103] Among them, Xq is the number of missing data in the current sequence, Xz is the number of total data in the current sequence, Xj is the number of total data in the input sequence, and Xs is the number of cumulative missing node sets; the first missing rate represents the proportion of the number of missing data in the current sequence to the cumulative missing data, and the current sequence consists of nodes between consecutive missing nodes;
[0104] Calculating weights =Vs;
[0105] In this embodiment, the input model is used to calculate the predicted value according to the weight , perform preliminary data filling, generate the first step prediction, insert the predicted value into the original data through the filling operator, obtain the preliminary filling result Xt, and calculate the interpolation representation , the interpolation representation With hidden representation Connect them and then linearly predict to get the second stage interpolation. Copy the architecture described above, process the sequence in the forward and backward directions respectively, connect the interpolation representation and hidden state in the two directions, and get the final interpolation result through MLP aggregation.
[0106] The allowed cumulative time interval set in this embodiment represents a threshold value for a long time interval of accumulated missing data in the sequence, indicating that there is a lot of accumulated missing data. Generally, it is set to 3 to 4 times of the standard time interval, and is adjusted according to the actual total number of data.
[0107] By fusing the time information and feature information of the missing data, that is, determining the continuous missing nodes and analyzing their corresponding continuous time intervals, if the continuous time interval is less than or equal to the allowed cumulative time interval, it means that there are more continuous missing data. In this way, the ratio of the number of missing data in the current sequence to the cumulative missing data is calculated as the first missing rate. If the continuous time interval is greater than the allowed cumulative time interval, it means that the characteristic of the missing data is intermittent missing. In this way, the number of interruptions is counted to calculate the weight according to the number of interruptions to improve the accuracy of the calculation.
[0108] According to the above method, each secondary continuous missing node in the preliminary filling result sequence is obtained, and the sequence position corresponding to any secondary continuous missing node is determined.
[0109] If there is a repetition at the position corresponding to a continuous missing node, obtain the data corresponding to the repeated node as the data point, obtain the time interval corresponding to the repeated position, record it as the historical missing time, calculate the repetition missing rate according to the historical missing time, and modify the weight according to the repetition missing rate to be '=Vs'=Tc / Tz;
[0110] If there is no duplicate position, it is determined that there is no need to optimize the secondary consecutive missing nodes;
[0111] Among them, Tc is the historical missing time, Tz is the continuous time interval, and Vs' is the repeated missing rate;
[0112] The data points in the preliminary filling result are obtained according to the MPNN function, and the data points are optimized to generate a secondary filling result.
[0113] The data interpolation in this embodiment utilizes statistical methods to deduce and fill in the missing data, that is, to predict the missing values through a recursive neural network to obtain complete data, and to fully extract the features of the missing data, integrate the time information and feature information of the missing data, that is, to determine the continuous missing nodes, and analyze their corresponding continuous time intervals. At the same time, the calculation model is adjusted according to the feedback of the preliminary filling results to perform more accurate interpolation and ensure the quality of the interpolated data.
[0114] See also Figure 4 As shown, it is a connection diagram of a device for solving the problem of irregular medical time series data according to an embodiment of the present invention;
[0115] The present invention also provides a device for solving the problem of irregular medical time series data, comprising:
[0116] A spatiotemporal encoder is used to encode the input spatiotemporal data to obtain an input sequence and a mask;
[0117] A modeling module, used to construct a recursive neural network model and a message passing neural network MPNN, wherein the message passing neural network is used to perform feature recognition on the input sequence to obtain a node feature vector z;
[0118] A processing module, including a transmission unit, a gated circulation unit, and an interpolation unit;
[0119] A gated recurrent unit, which is used to implement gating. For each time node, a reset gate and an update gate are calculated by an MPNN function, and a hidden state is controlled by a gating mechanism and a Hadamard product operation. The message passing model includes an MPNN function, a gating mechanism and a Hadamard product operation.
[0120] A transmission unit, used for analyzing the node feature vector and generating a real-time feature sequence;
[0121] Interpolation unit, obtain real-time feature sequence H t-T , according to the message passing model, the real-time feature sequence H t-T Perform preliminary data filling, generate the first step prediction, obtain the preliminary filling result Xt, obtain the data points in the preliminary filling result according to the MPNN function, optimize the data points, and generate the secondary filling result;
[0122] Wherein, by obtaining the continuous missing nodes in the real-time feature sequence, obtaining the corresponding continuous time intervals according to the continuous missing nodes, calculating the real-time missing rate according to the continuous time intervals, and calculating the weight according to the real-time missing rate, so as to generate a preliminary filling result according to the MPNN model;
[0123] Based on the preliminary filling result, obtaining a secondary continuous missing node, obtaining a data point according to the continuous missing node and the secondary continuous missing node, and modifying the weight corresponding to the data point to generate a secondary filling result according to the MPNN model;
[0124] The space-time decoder is used to convert the format of the extracted space-time data into an initial format.
[0125] Spatiotemporal data refers to temporal data that includes the time dimension and geometric data that includes the space dimension. Temporal data, also known as time series data, refers to data collected at different timestamps or time periods for the same phenomenon and arranged in chronological order. It is usually used to describe the situation or state of the phenomenon changing over time. Spatial data, also known as geometric data, is used to represent the geographical location, individual form, size distribution and other information of an object in the real world. It is a quantitative description of things or objects that have positioning significance in reality.
[0126] In this embodiment, the missing value problem is handled by replacing the missing value with certain values using auxiliary information. A bidirectional graph interpolation network is introduced, which cleverly solves the irregularity problem of time series data through the joint application of graph neural network and multi-layer perceptron. This structural design enables the model to fully understand and utilize the intrinsic connection in the time series data, effectively improving the quality and accuracy of the data filling process. Compared with the traditional single-stage filling method, the two-stage filling strategy adopted by the present invention is more refined and can handle the missing data problem more accurately. After the collected data is initially filled, it is optimized twice to ensure that the filling result can better reflect the actual medical situation, especially suitable for processing data in complex scenarios such as intermittent failure of sensors and changes in medical interventions. Because it can flexibly deal with different types of irregular time series data problems, this method has strong adaptability and is applied to data missing encountered in clinical environments and incomplete data records in the research process. Medical professionals and researchers can obtain more comprehensive and accurate time series data analysis results, which is of substantial significance for formulating or adjusting patients' treatment plans, improving the efficiency of clinical diagnosis and treatment, and promoting the in-depth medical research.
[0127] Example 1, taking a real public data set as an example, the overall training process of the present invention is explained; this data set contains 11988 samples, 36 variable features, 215 timestamps, and a missing ratio of 88.4%.
[0128] First, the data is encoded. In the spatiotemporal encoder, the input sequence X[t, t+T′] and the mask M[t, t+T′] are processed step by step by a recursive neural network, which implements the gating mechanism through the message passing layer. Given the node feature vector z of the k-1th layer, the present invention represents the general class of MPNNs as:
[0129]
[0130] in, is the neighbor set of the i-th node in the graph Gt, and is a differentiable update and message function (e.g., a multilayer perceptron), and ∑ is a permutation-invariant, differentiable aggregation function (e.g., sum or mean);
[0131] For simplicity, the present invention uses MPNN ( ) represents the forward pass of a k-layer message passing neural network; in the following, MPNNs are used as the cornerstone for building a spatiotemporal encoder; in order to dynamically learn and update information, the present invention uses gated recurrent units (GRUs) as the basis, and innovates the GRU gate to adapt it to the defined message passing layer; the operation details of the message passing GRU (MPGRU) mechanism used in the embodiment of the present invention are as follows:
[0132]
[0133] in, and denote the reset and update gates respectively, Determines whether to discard the hidden state of the previous time step, Determines whether to update the hidden state of the previous time step, is the hidden representation of node i at time t, where the hidden representation refers to the feature vector or feature vector value, is the output of the decoder module at the previous time step; represents the weight matrix, symbol and Respectively represent the Hadamard product and the vector connection operation; the initial state can be initialized to a constant or a learnable embedding vector; for the missing time steps in the input data, the encoder will receive the predicted value from the decoder block as input; by performing the above calculation operations on each time point and node, the encoded sequence H within a time sequence can be obtained t-T .
[0134] As the first step of decoding, we first generate the first step prediction value linearly from the MPGRU hidden representation:
[0135] ,
[0136] in, represents the weight of the hth layer, is a learnable h-th layer bias vector; the filling operator used in the present invention is defined as:
[0137]
[0138] Fill operator Replace the value at the same position in the input The missing values in ; by Feed it to the filling operator to get the first stage interpolation , so that the output is Xt, that is, the output result of the first step prediction value, and the missing value is predicted one step ahead Replace; then the obtained node-level prediction is combined with Mt and the hidden representation corresponding to the previous moment connected and processed by a final layer of MPNN that computes the interpolated representation for each node , as shown below:
[0139]
[0140] in, Represents the readout function, which acts on all node states to ensure the order of node states;
[0141] As mentioned before, the interpolated representation depends only on the messages received from neighboring nodes and the representation of the previous step. In fact, by aggregating only messages from one neighborhood, the interpolated representation Independent of the input features of the i-th node itself ; This constraint forces the model to learn how to reconstruct the target input by taking into account spatial dependencies: this has a regularizing effect because the model is constrained to focus on local information; then, the interpolated representation With hidden representation Concatenate and generate the second stage interpolation by using a second linear readout and applying the fill operator:
[0142]
[0143] Finally, the interpolated information is fed as input to MPGR to update the hidden representation and continue processing the next input graph Gt+1.
[0144] The bidirectional interpolation network is implemented by replicating the architecture described above. It is divided into two modules. The first module will process the sequence in the forward direction (from the beginning to the end of the sequence), while the second module will proceed in the reverse direction. The representations extracted by the two modules are aggregated by MLP to obtain the final interpolation result:
[0145]
[0146] Where fwd and bwd represent the forward and backward modules respectively; the final output can be easily obtained by Note that, by construction, the model of the present invention can exploit all available relevant spatiotemporal information, since the only explicitly masked value is the .
[0147] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
[0148] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for solving the problem of irregular medical time series data, characterized in that: include, Encode the input spatiotemporal data to obtain an input sequence; Performing feature recognition and feature extraction on the input sequence to obtain a node feature vector; By introducing the message passing neural network MPNN model and the MPGRU model, the node feature vector is analyzed to generate a real-time feature sequence, the continuous missing nodes in the real-time feature sequence are obtained, the corresponding continuous time intervals are obtained according to the continuous missing nodes, the real-time missing rate is calculated according to the continuous time interval, and the weight is calculated according to the real-time missing rate to generate the first step prediction value according to the MPGRU model and generate the preliminary filling result according to the MPNN model; The MPGRU model is a message passing GRU; Based on the preliminary filling result, obtaining a secondary continuous missing node, obtaining a data point according to the continuous missing node and the secondary continuous missing node, and modifying the weight corresponding to the data point to generate a secondary filling result according to the MPNN model; The positions of two consecutive nodes to be interpolated are determined. If the two nodes to be interpolated are adjacent, they are determined to be consecutive missing nodes, and the two nodes to be interpolated are marked as consecutive missing nodes. Get the real-time time interval between consecutive missing nodes, record it as the continuous time interval, and compare the allowed cumulative time interval with the continuous time interval. If the continuous time interval is less than or equal to the allowed accumulation time interval, obtain the number of missing data and the total number of data in the current sequence, and calculate the first missing rate V1=Xq / Xz, and output V2=0 at the same time; If the continuous time interval is greater than the allowed cumulative time interval, the corresponding continuous missing nodes are marked as cumulative missing node sets until all continuous missing nodes are determined, and the number of cumulative missing node sets and the total number of data in the input sequence are obtained to calculate the second missing rate V2=Xs / Xj; Calculate the real-time missing rate Vs=max{V1, V2} according to the first missing rate and the second missing rate; Among them, Xq is the number of missing data in the current sequence, Xz is the number of total data in the current sequence, Xj is the number of total data in the input sequence, and Xs is the number of cumulative missing node sets; the first missing rate represents the proportion of the number of missing data in the current sequence to the cumulative missing data, and the current sequence consists of nodes between consecutive missing nodes; Calculating weights =Vs; Obtain each secondary consecutive missing node in the preliminary filling result sequence, and determine the sequence position corresponding to any secondary consecutive missing node. If there is a repetition at the position corresponding to a continuous missing node, obtain the data corresponding to the repeated node as the data point, obtain the time interval corresponding to the repeated position, record it as the historical missing time, calculate the repetition missing rate according to the historical missing time, and modify the weight according to the repetition missing rate to be '=Vs'=Tc / Tz; If there is no duplicate position, it is determined that there is no need to optimize the secondary consecutive missing nodes; Among them, Tc is the historical missing time, Tz is the continuous time interval, and Vs' is the repeated missing rate; The format of the padded spatiotemporal data is converted into an initial time series.
2. The method for solving the problem of irregular medical time series data according to claim 1, characterized in that: The input sequence is intercepted in real time to obtain the set of two adjacent nodes, the real-time time interval between each set is obtained, and each real-time time interval is determined according to the standard time interval. If the real-time time interval is less than or equal to the standard time interval, it is determined that the input spatiotemporal data corresponding to the node is not missing; If the real-time time interval is greater than the standard time interval, it is determined that the input spatiotemporal data corresponding to the node is missing, the two nodes are marked as nodes to be interpolated, and the input spatiotemporal data corresponding to the nodes to be interpolated are extracted as the node feature vector.
3. The method for solving the problem of irregular medical time series data according to claim 1, characterized in that: The calculation formula for generating the first step prediction based on the MPGRU model and the weights is: , in, is the weight of the h-th layer, is the bias vector of the hth layer, is the first step prediction value corresponding to the missing node at time t, is the node feature vector value at time t-1.
4. The method for solving the problem of irregular medical time series data according to claim 1, characterized in that: The calculation formula for generating the preliminary filling result according to the MPNN model is: , in, is the initial filling result generated for node i at time t, is the node feature vector corresponding to node i at time t-1, is the output result of the first step prediction value corresponding to the input sequence at t, is the predicted value corresponding to the mask at time t, is the read function corresponding to the i-node, represents the filling operator, Represents a vector concatenation operation.
5. The method for solving the problem of irregular medical time series data according to claim 1, characterized in that: The process of encoding the data and analyzing the node feature vector according to the MPNN model includes: , in, represents the forward pass of a k-1 layer message passing neural network, represents the node feature vector corresponding to the k-1th layer of node i at time t, represents the weight matrix, represents the update function corresponding to layer k, is the message function corresponding to the k-th layer, ∑ represents the sum function or mean function, represents the node feature vector of node i in layer k at time t, Represents the set of neighbor nodes of node i.
6. The method for solving the problem of irregular medical time series data according to claim 1, characterized in that: Generating a real-time feature sequence according to the MPGRU model includes: , in, represents the reset gate corresponding to node i at time t, represents the update gate corresponding to node i at time t, represents the candidate hidden state corresponding to node i at t, is the hidden representation of node i at time t, is the second-step prediction result of the output of the previous time step processing module corresponding to node i at time t, is the predicted value corresponding to the mask at time t, is the hidden representation of node i at time t-1, represents the weight matrix, represents the Hadamard product, Represents a vector concatenation operation.
7. A device for solving the problem of irregular medical time series data, based on the method for solving the problem of irregular medical time series data according to any one of claims 1 to 6, characterized in that: include, A space-time encoder is used to encode the input space-time data to obtain an input sequence; A modeling module, used to construct a recursive neural network model and a message passing neural network MPNN, wherein the message passing neural network is used to perform feature recognition and feature extraction on the input sequence to obtain a node feature vector; Processing module, including transmission unit, gated loop unit and interpolation unit, A gated recurrent unit is used to implement gate control. For each time node, the reset gate and the update gate are calculated by the MPNN function. The hidden state is controlled by the gating mechanism and the Hadamard product operation. The message passing model includes the MPNN function, the gating mechanism and the Hadamard product operation. The transmission unit is used to analyze the node feature vector and generate a real-time feature sequence; The interpolation unit is used to obtain the continuous missing nodes in the real-time feature sequence, obtain the corresponding continuous time intervals according to the continuous missing nodes, calculate the real-time missing rate according to the continuous time intervals, calculate the weight according to the real-time missing rate, and generate a preliminary filling result according to the MPNN model; Based on the preliminary filling result, obtaining a secondary continuous missing node, obtaining a data point according to the continuous missing node and the secondary continuous missing node, and modifying the weight corresponding to the data point to generate a secondary filling result according to the MPNN model; The space-time decoder is used to convert the format of the padded space-time data into an initial time series.
Citation Information
Cited By
Prediction method for irregular time series data in process industry
CN120409796A
A prediction method for irregular time series data in process industry
CN120409796B
