CN117909658B - Interpolation method and system based on cyclic neural network - Google Patents

Interpolation method and system based on cyclic neural network Download PDF

Info

Publication number
CN117909658B
CN117909658B CN202410308801.8A CN202410308801A CN117909658B CN 117909658 B CN117909658 B CN 117909658B CN 202410308801 A CN202410308801 A CN 202410308801A CN 117909658 B CN117909658 B CN 117909658B
Authority
CN
China
Prior art keywords
data
time
vector
current
moment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410308801.8A
Other languages
Chinese (zh)
Other versions
CN117909658A (en
Inventor
叶俊辰
冒玉浩
杜博文
程克
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN202410308801.8A priority Critical patent/CN117909658B/en
Publication of CN117909658A publication Critical patent/CN117909658A/en
Application granted granted Critical
Publication of CN117909658B publication Critical patent/CN117909658B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

The invention discloses an interpolation method and system based on a cyclic neural network, which relate to the technical field of data interpolation, wherein data to be interpolated is taken as input, the cyclic neural network is utilized for carrying out missing value reconstruction to obtain time sequence prediction data, then the time sequence prediction data is utilized for carrying out missing value filling to the data to be interpolated to obtain time sequence interpolation data, the time sequence interpolation data is taken as input, a space interpolation model is utilized for carrying out missing value reconstruction to obtain space prediction data, finally the time sequence prediction data and the space prediction data are fused to obtain space-time prediction data, the time-time prediction data is utilized for carrying out missing value filling to the data to be interpolated to obtain interpolation completion data, and the invention respectively carries out reconstruction to the data from the time sequence direction and the space direction so as to achieve the aim of accurately interpolating the missing value of the data.

Description

Interpolation method and system based on cyclic neural network
Technical Field
The invention relates to the technical field of data interpolation, in particular to an interpolation method and system based on a cyclic neural network.
Background
In the face of the loss of the monitoring data, the traditional method for interpolating the loss value aims at filling the loss part quickly and laborsaving, and the idea is that the traditional interpolation method cannot correlate the whole sequence, so that the deviation of the interpolation value of the monitoring data and the trend of the original monitoring data is caused.
Since the last 80 s, artificial neural networks have been actively developed in the field of artificial intelligence, and are an operational model formed by interconnecting a large number of nodes (or neurons), each node representing a specific output function, called an excitation function, and each connection between two nodes representing a weighted value, called a weight, through the connection signal, which corresponds to the memory of the artificial neural network, and the output of the artificial neural network varies depending on the connection mode, the weight and the excitation function of the network. The artificial neural network is usually an approximation to a certain algorithm or function in nature, and may also be a logic strategy expression, which attempts to perform information processing by simulating the brain neural network processing and memorizing information, so as to overcome the defect of linear learning of the traditional method, and in the subsequent development, the artificial neural network gradually derives a plurality of versions when facing different aspects of problems, such as a convolutional neural network, a cyclic neural network and the like.
The cyclic neural network is a recursive neural network which takes sequence data as input, carries out recursion in the evolution direction of the sequence and all nodes are connected in a chained mode, the network focuses on the time sequence relation in the input sequence, and the association of contexts is researched to better understand the association of contexts. For example, for a sentence, an isolated understanding word often cannot accurately obtain the accurate meaning of the sentence, and the word needs to be orderly connected and understood to well understand the accurate meaning of the sentence. For better training and improving the effect, the commonly adopted cyclic neural network comprises a bidirectional cyclic neural network and a long-term and short-term memory network. In recent years, a cyclic neural network is also used for performing interpolation of missing values of monitoring data, the missing monitoring data is input into the network according to a certain sequence length, the monitoring data is reconstructed through the network, then the missing values are filled, and compared with a traditional interpolation method, the interpolation method can greatly improve the accuracy.
However, the conventional recurrent neural network for interpolation often ignores the relation of the spatial directions, that is, the relation between the monitoring data of different sensors at the same time step, resulting in an increased interpolation error. Therefore, in the case of excessive sequence deletion, the filling effect is very limited to be improved, and sometimes, a plurality of unreasonable filling conditions can even occur.
Disclosure of Invention
The invention aims to provide an interpolation method and system based on a cyclic neural network, and provides a space-time combined interpolation model consisting of the traditional cyclic neural network and a space interpolation model aiming at the problem that the traditional cyclic neural network ignores the data space relation, wherein the interpolation model can reconstruct data from a time sequence direction and a space direction respectively, so that the aim of accurately interpolating the data missing value is fulfilled.
In order to achieve the above object, the present invention provides the following.
An interpolation method based on a cyclic neural network comprises the following steps.
Obtaining data to be interpolated; the data to be interpolated comprises a monitoring data vector corresponding to each moment in a plurality of moments; the monitoring data vector comprises monitoring values acquired by each sensor at the current moment.
Taking the data to be interpolated as input, and reconstructing a missing value by using a cyclic neural network to obtain time sequence prediction data; the time sequence prediction data comprises time sequence prediction vectors corresponding to each moment; the timing prediction vector includes a timing prediction value for each sensor at a current time.
Filling the missing value of the data to be interpolated by using the time sequence prediction data to obtain time sequence interpolated data; taking the time sequence interpolation data as input, and reconstructing a missing value by using a space interpolation model to obtain space prediction data; the time sequence interpolation data comprises time sequence interpolation vectors corresponding to each time moment; the time sequence interpolation vector comprises time sequence interpolation values of each sensor at the current moment; the spatial prediction data comprises spatial prediction vectors corresponding to each moment; the spatial prediction vector includes a spatial prediction value of each sensor at a current time.
Fusing the time sequence prediction data and the space prediction data to obtain space-time prediction data; filling the missing value of the data to be interpolated by using the space-time prediction data to obtain interpolation completion data; the space-time prediction data comprises a space-time prediction vector corresponding to each moment; the spatiotemporal predictive vector includes a spatiotemporal predictive value for each sensor at a current time.
A computer system, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor executing the computer program to perform the steps of a cyclic neural network based interpolation method as described above.
According to the specific embodiments provided by the invention, the following technical effects are disclosed.
The invention provides an interpolation method and system based on a cyclic neural network, which are used for firstly taking data to be interpolated as input, reconstructing missing values by using the cyclic neural network to obtain time sequence prediction data, then carrying out missing value filling on the data to be interpolated by using the time sequence prediction data to obtain time sequence interpolation data, carrying out missing value reconstruction by using a space interpolation model by taking the time sequence interpolation data as input to obtain space prediction data, finally fusing the time sequence prediction data and the space prediction data to obtain space-time prediction data, carrying out missing value filling on the data to be interpolated by using the space-time prediction data to obtain interpolation completion data, and aiming at the problem that the space relation of the data is ignored by the traditional cyclic neural network, providing a space-time combined interpolation model consisting of the traditional cyclic neural network and the space interpolation model, wherein the interpolation model can reconstruct the data from the time sequence direction and the space direction respectively so as to achieve the aim of accurately interpolating the missing values of the data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an interpolation method according to embodiment 1 of the present invention.
Fig. 2 is a general flowchart of an interpolation method according to embodiment 1 of the present invention.
Fig. 3 is a flow chart of timing direction reconstruction according to embodiment 1 of the present invention.
Fig. 4 is a flow chart of the reconstruction of the spatial direction according to embodiment 1 of the present invention.
Fig. 5 is a training flowchart provided in embodiment 1 of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The invention aims to provide an interpolation method and system based on a cyclic neural network, and provides a space-time combined interpolation model consisting of the traditional cyclic neural network and a space interpolation model aiming at the problem that the traditional cyclic neural network ignores the data space relation, wherein the interpolation model can reconstruct data from a time sequence direction and a space direction respectively, so that the aim of accurately interpolating the data missing value is fulfilled.
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Example 1: the present embodiment is used to provide an interpolation method based on a recurrent neural network, as shown in fig. 1, 2, 3 and 4, including the following steps.
S1: obtaining data to be interpolated; the data to be interpolated comprises a monitoring data vector corresponding to each moment in a plurality of moments; the monitoring data vector comprises monitoring values acquired by each sensor at the current moment.
The data to be interpolated refers to data containing a missing value, and the purpose of the interpolation method of the present embodiment is to accurately determine the missing value, so as to perform data interpolation on the data to be interpolated, and obtain interpolation completion data.
In practical application, all sensors acquire monitoring values in real time, the monitoring values acquired by all sensors form a monitoring sequence, in this embodiment, monitoring sequence information is read first, continuous data of a fixed window is selected from the monitoring sequence information, so that data to be interpolated can be obtained, the data to be interpolated comprises monitoring data vectors corresponding to each moment in a plurality of moments, the monitoring data vectors comprise monitoring values acquired by each sensor at the current moment, n sensors are assumed to be shared, the monitoring data vectors comprise n element values, each element value represents the monitoring value acquired by one sensor at the current moment, and the monitoring data vector corresponding to the current moment t can be marked as X t.
The embodiment can further perform data normalization on the monitoring data vector corresponding to each moment to achieve monitoring data normalization, and perform subsequent steps by taking the normalized monitoring data vector as a new monitoring data vector.
S2: taking the data to be interpolated as input, and reconstructing a missing value by using a cyclic neural network to obtain time sequence prediction data; the time sequence prediction data comprises time sequence prediction vectors corresponding to each moment; the timing prediction vector includes a timing prediction value for each sensor at a current time.
The cyclic neural network used in the embodiment may be a conventional cyclic neural network, where the conventional cyclic neural network refers to the most primitive cyclic neural network, and is capable of learning information in a time sequence direction and reconstructing a sequence, and is often used in aspects of natural language learning and the like. In particular, the recurrent neural network may be a recurrent neural network employing a bi-directional LSTM kernel function, including a hidden layer.
Taking data to be interpolated as input, and reconstructing missing values by using a cyclic neural network to obtain time sequence prediction data, wherein the method comprises the following steps.
(1) Generating a current missing vector and a historical missing vector corresponding to each moment based on the data missing condition of the data to be interpolated, wherein the current missing vector comprises a mask value used for representing whether a monitoring value acquired by each sensor at the current moment is missing or not, and the historical missing vector comprises a count value used for representing the missing times of the monitoring value acquired by each sensor before the current moment.
And identifying the missing position of the monitored data vector corresponding to each moment, if the monitored value of the d-th sensor in the monitored data vector is missing, the mask value of the d-th sensor is 0, if the monitored value of the d-th sensor in the monitored data vector is not missing, the mask value of the d-th sensor is 1, the mask values of n sensors form the current missing vector, the current missing vector corresponding to the current moment t can be recorded as M t, the current missing vector comprises n mask values representing whether the missing exists or not, the mask values are represented by 0 and 1, wherein 0 represents the missing, and 1 represents the fact that the missing exists, namely, the current missing vector is monitored.
For each moment, the history missing vector corresponding to the current moment comprises n element values, wherein each element value represents a count value of the history sequence missing condition of one sensor, and the count value is described as the history missing step number of the monitoring value of the sensor at the current position. The embodiment usesThe count value of the d-th sensor at time t is represented by h t, and the last time the d-th sensor has a monitored value at and before time t is represented by/>Mask value indicating whether or not the monitored value of the d-th sensor is missing at time t, and if so,/>0, Otherwise, then/>Is 1,/>Specifically described is the following formula (1).
(1)。
In the formula (1), h t-1 represents the time when the d-th sensor has a monitoring value last time before the time t-1 and the time t-1; a count value of the d-th sensor at time t-1; /(I) Mask value indicating whether or not the monitored value of the d-th sensor is missing at time t-1, and if so,/>0, Otherwise, then/>1.
The count value of each sensor can be calculated through the formula (1), the count values of all the sensors form a history missing vector corresponding to the current moment, and the history missing vector corresponding to the current moment t can be recorded as
Based on the time sequence information, the time sequence information corresponding to each moment can be obtained, wherein the time sequence information comprises a monitoring data vector, a current missing vector and a historical missing vector corresponding to the current moment.
(2) For each moment, taking a monitoring data vector, a current missing vector and a historical missing vector corresponding to the current moment and a forward hidden layer vector corresponding to the moment above the current moment as inputs, and calculating the forward hidden layer vector corresponding to the current moment by using a hidden layer of the cyclic neural network; and taking the monitoring data vector, the current missing vector and the historical missing vector corresponding to the current moment and the reverse hidden layer vector corresponding to the next moment of the current moment as inputs, and calculating the reverse hidden layer vector corresponding to the current moment by using the hidden layer of the cyclic neural network.
The method for calculating the forward hidden layer vector corresponding to the current moment by using the hidden layer of the cyclic neural network by taking the monitoring data vector, the current missing vector and the historical missing vector corresponding to the current moment and the forward hidden layer vector corresponding to the last moment of the current moment as inputs can comprise the following steps: the forward hidden layer vector corresponding to the last time of the current time is attenuated by using the historical missing vector corresponding to the current time, so that a forward attenuation vector corresponding to the current time is obtained; carrying out bit-wise multiplication on the forward attenuation vector corresponding to the current moment and the forward hidden layer vector corresponding to the moment above the current moment to obtain a forward attenuation post-vector corresponding to the current moment; and calculating a forward hidden layer vector corresponding to the current moment based on the monitoring data vector, the current missing vector and the forward attenuated vector corresponding to the current moment.
The method for calculating the reverse hidden layer vector corresponding to the current moment by using the hidden layer of the cyclic neural network by taking the monitored data vector, the current missing vector and the historical missing vector corresponding to the current moment and the reverse hidden layer vector corresponding to the next moment of the current moment as inputs can comprise the following steps: attenuating the reverse hidden layer vector corresponding to the next time of the current time by using the historical missing vector corresponding to the current time to obtain a reverse attenuation vector corresponding to the current time; carrying out bit-wise multiplication on the reverse attenuation vector corresponding to the current moment and the reverse hidden layer vector corresponding to the next moment of the current moment to obtain a reverse attenuation vector corresponding to the current moment; and calculating the reverse hidden layer vector corresponding to the current moment based on the monitoring data vector corresponding to the current moment, the current missing vector and the reverse attenuated vector.
Taking forward transmission as an example, a forward hidden layer vector H t-1 which is generated by a cyclic neural network at the previous moment and has time sequence information of all previous moments is firstly obtained, for the initial moment, the forward hidden layer vector at the previous moment is a random vector, the cyclic neural network is used for transmitting information backwards, specifically, an LSTM (least squares) core structure is adopted, the forward hidden layer vector H t-1 at the previous moment and an original sequence value (namely a monitoring data vector) X t at the current moment are used for transmitting information backwards, and in order to embody a sequence missing mode, a history missing vector at the current moment is usedAnd attenuating the forward hidden layer vector H t-1 at the previous moment to obtain an attenuation vector. Use/>Representing the attenuation vector, W and b represent the parameter matrix and the bias vector, respectively, the attenuation vector can be described as the following equation (2).
(2)。
The forward hidden layer vector H t-1 and the attenuation vector at the previous momentMultiplying by bit to obtain a new attenuated vector/>
When information is transmitted backwards, the LSTM kernel function is used for calculating a forward hidden layer vector H t transmitted to the current moment of the next moment, and the attenuated vector is attenuatedThe current time monitor data vector X t and the current miss vector M t are used as inputsThe H t calculation can be described as the following equation (3) representing the connector of the vector.
(3)。
And executing the forward transfer step along the forward circulation to obtain the forward hidden layer vector at each moment.
The reverse transfer step is the same as the forward transfer step, and only the forward hidden layer vector H t-1 at the previous time is replaced by the reverse hidden layer vector at the next timeThe reverse hidden layer vector at the current moment can be obtained. And executing the reverse transfer step along the reverse circulation to obtain the reverse hidden layer vector at each moment.
The embodiment adopts a bidirectional cyclic neural network, and based on the process, the forward hidden layer vector and the reverse hidden layer vector at each moment can be obtained.
(3) For each moment, taking a forward hidden layer vector corresponding to the last moment of the current moment and a reverse hidden layer vector corresponding to the next moment of the current moment as inputs, calculating to obtain a time sequence prediction vector corresponding to the current moment, and forming time sequence prediction data by the time sequence prediction vectors corresponding to all the moments.
Using the forward hidden layer vector H t-1 and the reverse hidden layer vectorTo estimate all timing predictions at the current time instant, W and/>, usingRespectively representing a forward parameter matrix and a reverse parameter matrix, b representing a bias vector,/>Time-series prediction vector representing estimated current time, then/>Specifically described is the following formula (4).
(4)。
S3: filling the missing value of the data to be interpolated by using the time sequence prediction data to obtain time sequence interpolated data; taking the time sequence interpolation data as input, and reconstructing a missing value by using a space interpolation model to obtain space prediction data; the time sequence interpolation data comprises time sequence interpolation vectors corresponding to each time moment; the time sequence interpolation vector comprises time sequence interpolation values of each sensor at the current moment; the spatial prediction data comprises spatial prediction vectors corresponding to each moment; the spatial prediction vector includes a spatial prediction value of each sensor at a current time.
For each moment, filling the defect of the original monitoring data vector by using the estimated time sequence prediction vector of the current moment, namely for each defect value of the monitoring data vector, taking the time sequence prediction value of the corresponding position of the time sequence prediction vector to interpolate the monitoring data vector to obtain a time sequence interpolation vectorThe time sequence interpolation vectors at all times form time sequence interpolation data.
In this embodiment, the spatial interpolation model is a fully connected network, and includes a fully connected layer, where the element value on the diagonal of the parameter matrix of the fully connected network is 0, so as to eliminate the influence of the original value on the reconstruction.
Taking the time sequence interpolation data as input, and carrying out missing value reconstruction by using a space interpolation model to obtain space prediction data, wherein the method can comprise the following steps: for each moment, taking the time sequence interpolation vector of the current moment as input, and reconstructing the missing value by using a fully connected network to obtain the spatial prediction vector of the current moment, wherein the spatial prediction vectors of all the moments form spatial prediction data.
Specifically, in this embodiment, a regression method is used to estimate the time-sequence-interpolated data of the time sequence reconstruction between the sensor data, that is, reconstructing the spatial direction, and specifically reconstructing the time-sequence-interpolated data by using a fully-connected network. In the fully connected network, the diagonal value of the parameter matrix W for reconstruction is set to 0 to eliminate the influence of the original value on the reconstruction, the parameter matrix W is used for representing the parameter matrix, and the offset vector b is used for representing the space prediction vectorCan be described as the following formula (5).
(5)。
S4: fusing the time sequence prediction data and the space prediction data to obtain space-time prediction data; filling the missing value of the data to be interpolated by using the space-time prediction data to obtain interpolation completion data; the space-time prediction data comprises a space-time prediction vector corresponding to each moment; the spatiotemporal predictive vector includes a spatiotemporal predictive value for each sensor at a current time.
The merging of the time-space prediction data and the time-space prediction data to obtain the time-space prediction data may include: for each moment, calculating a time sequence weight coefficient corresponding to the current moment based on the historical missing vector corresponding to the current moment; calculating the difference value of the time sequence weight coefficient corresponding to the 1 and the current moment to obtain a space weight coefficient corresponding to the current moment; and carrying out weighted fusion on the time sequence prediction vector and the space prediction vector corresponding to the current moment based on the time sequence weight coefficient and the space weight coefficient corresponding to the current moment to obtain the space-time prediction vector corresponding to the current moment, wherein the space-time prediction vectors at all moments form space-time prediction data.
Specifically, the combination of the time sequence direction and the space direction predicted value includes: calculating a missing vector from the historyI.e. the sequence-missing-related time-series weight coefficient/>To/>, the timing prediction vectorAnd spatial prediction vector/>Taken together, a final reconstructed sequence vector (i.e., a temporal spatial prediction vector) C t is formed, calculated as shown in equations (6) and (7).
(6)。
In the formula (6), the amino acid sequence of the compound,Is an activation function; w is a parameter matrix; b is the bias vector.
(7)。
Filling missing values of the data to be interpolated by using the space-time prediction data to obtain interpolation completion data, which may include: and for each moment, filling the defect of the original monitoring data vector by using the space-time prediction vector of the current moment obtained by estimation, namely, for each defect value of the monitoring data vector, taking the space-time prediction value of the corresponding position of the space-time prediction vector to interpolate the monitoring data vector so as to obtain a space-time interpolation vector, wherein the space-time interpolation vector of all the moments forms interpolation completion data.
The embodiment is used for providing a space-time combined multi-element time sequence vacant interpolation method based on a cyclic neural network, and further combining spatial information based on the traditional cyclic neural network to reconstruct and fill data, wherein the combined spatial information is in the vertical direction of the time sequence direction, the data reconstruction is carried out on the monitoring values of different sensors at the same time, adjacent sequences are connected, similar reconstruction is carried out, the sequence reconstructed in the time sequence direction and the sequence reconstructed in the space direction are combined in a certain proportion, a space-time reconstructed sequence is obtained, the missing part of the original sequence is filled with the space-time reconstructed sequence, and the reconstruction and filling of the data are completed.
The embodiment can be applied to the field of geotechnical analysis of civil engineering, the sensor can be a stress sensor which is arranged on a tunnel to be monitored and monitors the stress of the position of the sensor, the monitoring value at the moment is a stress value, the stress values acquired by the stress sensors form data to be interpolated, and the data to be interpolated are interpolated by using the S1-S4 to finish the reconstruction and interpolation of the stress value.
As shown in FIG. 5, the embodiment further comprises the step of training the recurrent neural network and the fully-connected network, by which network parameters (including W and b of formula (2), LSTMcell of formula (3), W of formula (4),And b, W and b of formula (5), and/>, of formula (6)The values of W and b) are obtained, during training, the monitoring sequence is decomposed into network inputs by each continuous phase synchronization number, all monitoring data are used as training sets and verification sets, all missing data are used as test sets (the actual values of the missing data are known), the model with the best interpolation effect is reserved, and the training process comprises the following steps.
(1) The method comprises the steps of obtaining a data set, wherein the data set comprises a training set and a testing set, the training set comprises a plurality of data samples to be interpolated, the testing set comprises a plurality of data samples to be interpolated and label data corresponding to each data sample to be interpolated, and the label data is a complete data sample which does not contain a missing value and corresponds to the data sample to be interpolated.
In this embodiment, a plurality of complete data samples may be pre-established, and for each complete data sample, the complete data sample is randomly deleted for the monitoring value, so as to obtain a data sample to be interpolated corresponding to the complete data sample.
(2) And taking each data sample to be interpolated in the training set as the input of the cyclic neural network and the full-connection network, and performing data interpolation on the data sample to be interpolated according to the steps of S1-S4 to obtain an interpolation completion data sample corresponding to the data sample to be interpolated. And comparing the obtained interpolation completion data sample with the monitoring value part of the data sample to be interpolated, and evaluating loss, namely taking the undelayed monitoring value of each data sample to be interpolated and the undelayed monitoring value of the corresponding position of the interpolation completion data sample corresponding to the data sample to be interpolated as inputs, and calculating by using a first loss function to obtain a training loss value, wherein the first loss function adopts an average absolute error MAE. And updating network parameters of the cyclic neural network and the full-connection network by using the training loss value to obtain the updated cyclic neural network and the updated full-connection network.
(3) And taking each data sample to be interpolated in the test set as input of the updated circulating neural network and the updated fully-connected network, and performing data interpolation on the data sample to be interpolated according to the steps of S1-S4 to obtain an interpolated data sample corresponding to the data sample to be interpolated. And taking an interpolation value at a missing position in each interpolation completion data sample and a monitoring value at a corresponding position of the tag data as inputs, respectively calculating a second loss value and a third loss value by using a second loss function and a third loss function, calculating an average value of the second loss value and the third loss value, and obtaining a test loss value, wherein the second loss function adopts an average absolute error MAE, and the third loss function adopts a root mean square error RMSE.
(4) Judging whether the test loss value does not drop continuously for many times, if so, ending the iteration, taking the updated circulating neural network and the updated fully-connected network with the minimum test loss value in all iterations as the trained circulating neural network and the trained fully-connected network, and if not, judging whether the maximum iteration times are reached; if yes, ending the iteration, taking the updated cyclic neural network and the updated full-connection network with the smallest test loss values in all the iterations as the trained cyclic neural network and the trained full-connection network, if not, continuing the iteration, taking the updated cyclic neural network and the updated full-connection network of the current iteration as the cyclic neural network and the full-connection network of the next iteration, and returning to the step (2).
In this embodiment, the maximum number of iterations may be 1000.
The present embodiment is implemented based on computer science and some machine learning algorithms, so that a certain basis of programming and machine learning is required in implementation, and can be implemented based on a plurality of programming languages. In order to verify the interpolation effect of the model, the model is selected to verify on a complete Yangtze river shield monitoring dataset, the dataset comprises a plurality of time sequences of a group of sensors at the same time step, namely the embodiment can be trained by utilizing the dataset consisting of the monitoring values of a certain underwater shield tunnel of the Yangtze river, the dataset is divided into a training set and a testing set, the model is trained and verified on the training set, and the accuracy and the effect of interpolation are evaluated by utilizing the testing set. To verify the interpolation accuracy of the model at different rates of loss, successive loss of different rates of the data set was chosen. Based on Python and its open source algorithm package, the structure of the neural network is constructed, and the method can improve the interpolation accuracy under the condition of reasonably selecting the model and parameters.
The embodiment is used for providing an interpolation method of a multi-element time sequence vacancy based on a cyclic neural network, and is mainly used for solving the problem that the traditional statistical or machine learning method is difficult to restore data under the scene that a large amount of monitored data is missing, and the accuracy of restoring the data is improved by adopting the method of combining the cyclic neural network and the space estimation. The reconstruction flow of the time sequence direction comprises the following steps: for a certain moment in a specific continuous time sequence, firstly, the historical missing vectors of the various characteristics of the moment are obtainedThe normalized monitor data vector X t and the mask vector (current missing vector) M t, then the kernel function of LSTM is used to calculate each hidden layer vector in forward and reverse direction of the sequence, and finally the two vectors are used in combination to reconstruct the data in the time sequence direction. The reconstruction process of the space direction comprises the following steps: for the reconstruction sequence obtained in the time sequence direction, filling the missing part in the original sequence, and then carrying out regression reconstruction in the space direction on the sequence by using a fully connected network. And finally, combining the sequence reconstructed in the time direction and the sequence reconstructed in the space direction by using a learnable parameter related to the mask vector and the historical deletion vector to obtain a final reconstructed sequence.
In this embodiment, based on a cyclic neural network using a bi-directional LSTM kernel function, a full-connection layer is used to reconstruct the spatial direction at each time step, and then the two are numerically combined with a learnable parameter to obtain a predicted value of the missing value.
The method and the device are suitable for solving the problems that a traditional interpolation method is inaccurate and the traditional cyclic neural network method ignores information of the spatial direction, reconstructing a missing sequence through space-time combination, and finally obtaining a more accurate interpolation result. The method for restoring the missing monitoring data can be regarded as an incomplete time sequence, specifically, the method can be divided into two steps, wherein the first step is to fill time sequence data based on time sequence data acquired by the same sensor, the step is to estimate all data by using a cyclic neural network, specifically, an autoregressive method is adopted to match the specific capability of processing the time sequence data of the cyclic neural network, and the rest monitoring values of the current sequence are used for estimating all data (the missing is regarded as a default value, generally 0) so as to form a new time sequence, and then the new time sequence is optimized according to the known monitoring data; and the second step is to estimate the space direction to form a new prediction sequence, wherein the estimation of the space direction refers to the estimation of all data by adopting a regression method for the data groups acquired by different sensors at the same time, and then the optimization is carried out according to the known monitoring data. On a real Yangtze river tunnel monitoring data set, the accuracy of the method can be improved greatly compared with that of a traditional interpolation method.
Example 2.
The present embodiment provides a computer system, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the computer program to perform the steps of a recurrent neural network-based interpolation method as described in embodiment 1.
In this specification, each embodiment is mainly described in the specification as a difference from other embodiments, and the same similar parts between the embodiments are referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to assist in understanding the methods of the present invention and the core ideas thereof; also, it is within the scope of the present invention to be modified by those of ordinary skill in the art in light of the present teachings. In view of the foregoing, this description should not be construed as limiting the invention.

Claims (7)

1. An interpolation method based on a recurrent neural network, comprising:
obtaining data to be interpolated; the data to be interpolated comprises a monitoring data vector corresponding to each moment in a plurality of moments; the monitoring data vector comprises monitoring values collected by each sensor at the current moment;
Taking the data to be interpolated as input, and reconstructing a missing value by using a cyclic neural network to obtain time sequence prediction data; the time sequence prediction data comprises time sequence prediction vectors corresponding to each moment; the time sequence prediction vector comprises a time sequence prediction value of each sensor at the current moment;
Filling the missing value of the data to be interpolated by using the time sequence prediction data to obtain time sequence interpolated data; taking the time sequence interpolation data as input, and reconstructing a missing value by using a space interpolation model to obtain space prediction data; the time sequence interpolation data comprises time sequence interpolation vectors corresponding to each time moment; the time sequence interpolation vector comprises time sequence interpolation values of each sensor at the current moment; the spatial prediction data comprises spatial prediction vectors corresponding to each moment; the spatial prediction vector comprises a spatial prediction value of each sensor at the current moment;
fusing the time sequence prediction data and the space prediction data to obtain space-time prediction data; filling the missing value of the data to be interpolated by using the space-time prediction data to obtain interpolation completion data; the space-time prediction data comprises a space-time prediction vector corresponding to each moment; the space-time prediction vector comprises a space-time prediction value of each sensor at the current moment;
taking the data to be interpolated as input, and reconstructing the missing value by using a cyclic neural network to obtain time sequence prediction data, wherein the method specifically comprises the following steps of:
generating a current missing vector and a historical missing vector corresponding to each moment based on the data missing condition of the data to be interpolated; the current missing vector comprises a mask value used for representing whether the monitoring value acquired by each sensor at the current moment is missing or not; the history missing vector comprises a count value used for representing the missing times of the monitoring value acquired by each sensor before the current moment;
For each moment, taking a monitoring data vector, a current missing vector and a historical missing vector corresponding to the current moment and a forward hidden layer vector corresponding to the moment above the current moment as inputs, and calculating the forward hidden layer vector corresponding to the current moment by using a hidden layer of the cyclic neural network; taking the monitoring data vector, the current missing vector and the history missing vector corresponding to the current moment and the reverse hidden layer vector corresponding to the next moment of the current moment as inputs, and calculating the reverse hidden layer vector corresponding to the current moment by using the hidden layer of the cyclic neural network;
for each moment, taking a forward hidden layer vector corresponding to the last moment of the current moment and a reverse hidden layer vector corresponding to the next moment of the current moment as inputs, and calculating to obtain a time sequence prediction vector corresponding to the current moment; the time sequence prediction vectors corresponding to all moments form time sequence prediction data.
2. The interpolation method based on the cyclic neural network according to claim 1, wherein the forward hidden layer vector corresponding to the current time is calculated by using the hidden layer of the cyclic neural network by taking as input the monitored data vector corresponding to the current time, the current missing vector and the historical missing vector, and the forward hidden layer vector corresponding to the previous time of the current time, and specifically comprising:
the forward hidden layer vector corresponding to the last time of the current time is attenuated by using the historical missing vector corresponding to the current time, so that a forward attenuation vector corresponding to the current time is obtained;
Carrying out bit-wise multiplication on the forward attenuation vector corresponding to the current moment and the forward hidden layer vector corresponding to the moment above the current moment to obtain a forward attenuation post-vector corresponding to the current moment;
And calculating a forward hidden layer vector corresponding to the current moment based on the monitoring data vector, the current missing vector and the forward attenuated vector corresponding to the current moment.
3. The interpolation method based on the recurrent neural network according to claim 1, wherein the reverse hidden layer vector corresponding to the current time is calculated by using the hidden layer of the recurrent neural network by taking as input the monitored data vector corresponding to the current time, the current missing vector and the history missing vector, and the reverse hidden layer vector corresponding to the next time of the current time, and specifically comprising:
attenuating the reverse hidden layer vector corresponding to the next time of the current time by using the historical missing vector corresponding to the current time to obtain a reverse attenuation vector corresponding to the current time;
Carrying out bit-wise multiplication on the reverse attenuation vector corresponding to the current moment and the reverse hidden layer vector corresponding to the next moment of the current moment to obtain a reverse attenuation vector corresponding to the current moment;
And calculating the reverse hidden layer vector corresponding to the current moment based on the monitoring data vector corresponding to the current moment, the current missing vector and the reverse attenuated vector.
4. The interpolation method based on a recurrent neural network of claim 1, wherein the spatial interpolation model is a fully connected network.
5. The interpolation method based on the cyclic neural network according to claim 4, wherein the time-series interpolated data is used as an input, and the missing value reconstruction is performed by using a spatial interpolation model to obtain spatial prediction data, and the method specifically comprises:
For each moment, taking a time sequence interpolation vector corresponding to the current moment as input, and reconstructing a missing value by using a fully connected network to obtain a spatial prediction vector corresponding to the current moment; the spatial prediction vectors corresponding to all moments form spatial prediction data.
6. The interpolation method based on the recurrent neural network as claimed in claim 1, wherein the time-series prediction data and the spatial prediction data are fused to obtain space-time prediction data, and the method specifically comprises:
for each moment, calculating a time sequence weight coefficient corresponding to the current moment based on the historical missing vector corresponding to the current moment; calculating the difference value of the time sequence weight coefficient corresponding to the 1 and the current moment to obtain a space weight coefficient corresponding to the current moment; based on the time sequence weight coefficient and the space weight coefficient corresponding to the current time, carrying out weighted fusion on the time sequence prediction vector and the space prediction vector corresponding to the current time to obtain a space-time prediction vector corresponding to the current time; the spatio-temporal prediction vectors corresponding to all moments constitute spatio-temporal prediction data.
7. A computer system, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of a recurrent neural network-based interpolation method as claimed in any one of claims 1-6.
CN202410308801.8A 2024-03-19 2024-03-19 Interpolation method and system based on cyclic neural network Active CN117909658B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410308801.8A CN117909658B (en) 2024-03-19 2024-03-19 Interpolation method and system based on cyclic neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410308801.8A CN117909658B (en) 2024-03-19 2024-03-19 Interpolation method and system based on cyclic neural network

Publications (2)

Publication Number Publication Date
CN117909658A CN117909658A (en) 2024-04-19
CN117909658B true CN117909658B (en) 2024-05-14

Family

ID=90697494

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410308801.8A Active CN117909658B (en) 2024-03-19 2024-03-19 Interpolation method and system based on cyclic neural network

Country Status (1)

Country Link
CN (1) CN117909658B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827335A (en) * 2023-02-06 2023-03-21 东南大学 Time sequence data missing interpolation system and method based on modal crossing method
CN116682557A (en) * 2023-06-05 2023-09-01 东南大学 Chronic complications early risk early warning method based on small sample deep learning
CN117390962A (en) * 2023-10-27 2024-01-12 桂林电子科技大学 Air quality prediction method based on second-order cyclic neural network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114819350A (en) * 2022-04-28 2022-07-29 天津大学 RUL prediction method under sensor fault condition based on multiple tasks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827335A (en) * 2023-02-06 2023-03-21 东南大学 Time sequence data missing interpolation system and method based on modal crossing method
CN116682557A (en) * 2023-06-05 2023-09-01 东南大学 Chronic complications early risk early warning method based on small sample deep learning
CN117390962A (en) * 2023-10-27 2024-01-12 桂林电子科技大学 Air quality prediction method based on second-order cyclic neural network

Also Published As

Publication number Publication date
CN117909658A (en) 2024-04-19

Similar Documents

Publication Publication Date Title
CN108090558B (en) Automatic filling method for missing value of time sequence based on long-term and short-term memory network
CN111191841B (en) Power load prediction method and device, computer equipment and storage medium
CN111027686B (en) Landslide displacement prediction method, device and equipment
US20200272905A1 (en) Artificial neural network compression via iterative hybrid reinforcement learning approach
CN111245673B (en) SDN time delay sensing method based on graph neural network
CN111027732B (en) Method and system for generating multi-wind power plant output scene
CN112213771A (en) Seismic wave impedance inversion method and device
CN115903741B (en) Industrial control system data anomaly detection method
CN113037577B (en) Network traffic prediction method, device and computer readable storage medium
CN111383741A (en) Method, device and equipment for establishing medical imaging model and storage medium
CN112365033B (en) Wind power interval prediction method, system and storage medium
CN114626479A (en) Time sequence anomaly detection method and device based on variational self-coding time sequence decomposition
CN114694379B (en) Traffic flow prediction method and system based on self-adaptive dynamic graph convolution
CN115660135A (en) Traffic flow prediction method and system based on Bayes method and graph convolution
CN113505924A (en) Information propagation prediction method and system based on cascade spatiotemporal features
Liseune et al. Leveraging latent representations for milk yield prediction and interpolation using deep learning
CN116775687A (en) Time sequence prediction closed-loop framework based on digital-analog symbiosis
CN115345222A (en) Fault classification method based on TimeGAN model
CN117909658B (en) Interpolation method and system based on cyclic neural network
Ibarguengoytia et al. Any time probabilistic reasoning for sensor validation
CN111930728B (en) Method and system for predicting characteristic parameters and failure rate of equipment
CN111275751B (en) Unsupervised absolute scale calculation method and system
CN117011673A (en) Electrical impedance tomography image reconstruction method and device based on noise diffusion learning
CN116166642A (en) Spatio-temporal data filling method, system, equipment and medium based on guide information
CN114399901A (en) Method and equipment for controlling traffic system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant