A Neural Tensor Ring Fusion Method for Traffic Flow Data Completion
By using technical means such as tensor ring decomposition and ConvLSTM in traffic flow data completion, the shortcomings of existing models in learning higher-order nonlinear relationships and historical time characteristics are solved, and a higher-precision data completion effect is achieved.
Patent Information
- Application Number
- CN202411776138.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-12-05
AI Technical Summary
The existing neural tensor network model is difficult to fully learn the higher-order nonlinear relationship between data features in traffic flow data completion, and ignores the impact of historical time features on the data, resulting in insufficient completion accuracy.
The tensor loop (TR) decomposition idea is used to construct a neural tensor loop fusion model, use third-order factor tensors to learn the potential features of data, and capture the multi-dimensional interaction of traffic data in time through a convolutional long short-term memory network (ConvLSTM), and use multiple historical time feature matrices to complete the missing data.
This method can more effectively capture the high-order nonlinear relationships and temporal dynamic features between data features, significantly improving the accuracy of traffic flow data completion.
Smart Images

Figure CN119249286B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of traffic data completion, and particularly relates to a neural tensor loop fusion method for traffic flow data completion. Background Art
[0002] With the continuous development of information acquisition technology, the number of Internet of Things sensors deployed in various parts of the city by the intelligent transportation system (ITS) is gradually increasing. The sensors can collect traffic flow data at all times, which can not only provide richer road network information for urban residents, but also help ITS solve problems such as urban pollution and traffic congestion caused by the large-scale growth of the city. However, due to many reasons such as weather conditions, hardware failures, and power outages, traffic data is often missing, and the conclusions and decisions drawn by researchers using these unprocessed missing traffic data may have significant biases. Therefore, how to accurately complete traffic flow data has become a hot issue of concern to researchers.
[0003] The process of traffic data completion is essentially to capture the features and their spatio-temporal correlations of known data through a model, and use the learned data features to fill in the missing data. Therefore, whether the hidden features and their relationships in the data can be fully captured is the key to the traffic completion model. As a high-order extension of the matrix decomposition method, researchers have tried to use tensor decomposition models to solve the traffic data completion problem. This type of model can effectively extract the linear features of the data and store the features in a small-scale factor matrix (tensor), improving the completion accuracy while also being interpretable. However, the tensor completion method focuses on the learning of linear features and has very limited ability to complete data with high-order and complex non-linear correlations.
[0004] To improve the above deficiencies, some researchers have extended the tensor decomposition model to the form of a neural network, that is, constructing a tensorial neural network (TNNs). TNNs not only retain the advantages of the tensor decomposition model, but also have strong expression and processing capabilities for high-dimensional data, and have excellent performance in the field of data completion. Nevertheless, the current neural tensor network model for traffic flow data completion still has the following problems: First, the existing neural tensor network model refers to the idea of tensor CP decomposition and mostly uses the form of a second-order factor matrix to learn the latent features in the data, resulting in insufficient ability of the model to capture the hidden high-order non-linear relationships between features, and the completion accuracy needs to be further improved; Second, the existing neural tensor network model only uses a single vector (matrix) containing the current time feature to complete the missing data, ignoring the influence of historical time features on the data, and cannot well represent the dynamic law of traffic flow changing with time. Summary of the Invention
[0005] To solve the above problems, the present invention proposes a neural tensor ring fusion method for traffic flow data completion. Aiming at the problem that existing methods cannot fully learn the high-order non-linear relationships between data features, the present invention constructs a new neural tensor network, namely the neural tensor ring fusion model, by using the idea of tensor ring (TR) decomposition. This model learns the latent features of data in the form of a third-order factor tensor, and can better preserve the structure and information of the original data while expressing and processing high-order data tensors. At the same time, aiming at the problem that existing models cannot well represent the dynamic law of traffic flow changing over time, the present invention uses a convolutional long short-term memory network (ConvLSTM) to capture the multi-dimensional interaction of traffic data over time, and uses multiple matrices containing historical time features to jointly complete the missing data.
[0006] The technical solution of the present invention is as follows:
[0007] A neural tensor ring fusion method for traffic flow data completion, comprising the following steps:
[0008] Step 1, obtain traffic flow data in the road network system and model the traffic flow data as a third-order tensor;
[0009] Step 2, construct the objective function of the neural tensor ring fusion model with reference to the idea of tensor ring decomposition;
[0010] Step 3, complete the traffic flow data based on the neural tensor ring fusion model.
[0011] Further, in the above step 1, the traffic flow data is modeled as a third-order tensor , where represents the number of nodes in the road network system, represents the time interval, is the total number of days in the data set; the third-order tensor consists of several elements, and one element represents a traffic flow value. Define the element to represent the traffic flow value at the th day, the th time period, and the th node in the road network system.
[0012] Further, in the above step 2, the idea of tensor ring decomposition means decomposing a high-order tensor into a linear multiplication of a series of third-order factor tensors, and these tensors are connected end to end to form a ring structure; for -order high-order tensor , tensor ring decomposition can decompose the -order high-order tensor into third-order factor tensors; is the Dimensions on the order; the tensor ring decomposition formula is:
[0013] ;
[0014] where, is a high-order tensor the element with coordinates in is the -th order element coordinate of the high-order tensor; represents the trace operation; is the order number; is the matrix determined by the element coordinates on the -th order of the high-order tensor, which is taken from the -th factor tensor at the -th slice on the second order. In the tensor, the element coordinates on the order are the ones that determine which slice to take.
[0015] Furthermore, in step 2, the objective function of the neural tensor ring fusion model is expressed as:
[0016] ;
[0017] where, , , are three different third-order factor tensors, , , are artificially specified different hyperparameters, representing the tensor ring ranks of the first factor tensor, the second factor tensor, and the third factor tensor respectively, , , are the dimensions of the high-order tensor on the first order, the second order, and the third order respectively; represents all the parameters to be trained in the network; is the element coordinate index; is the traffic flow value at the -th day and the -th time period and the -th node after completion; , , are different regularization term coefficients.
[0018] Furthermore, in step 3, the neural tensor ring fusion model includes an embedding layer and an interaction layer; the embedding layer fully learns the latent features in the original traffic data by constructing three third-order factor tensors and uses a ConvLSTM encoder to characterize the temporal interaction of traffic data; in the interaction layer, the model converts each matrix containing different features into a fused feature through vectorization and concatenation operations, and then gradually mines the complex non-linear correlations between features through a feature extraction layer.
[0019] Furthermore, the specific process of step 3 is as follows:
[0020] Step 3.1: Perform data embedding on each traffic flow value; the specific process is as follows:
[0021] Each traffic flow value contains three items: node, time period, and day. One-hot encoding is performed on these three items respectively to construct one-hot vectors for the node, time period, and day:
[0022] ;
[0023] ;
[0024] ;
[0025] Among them, is the one-hot vector of the th node; is the one-hot vector of the th time period; is the one-hot vector of the th day; represents the one-hot encoding process; is the time scale parameter;
[0026] Through the one-hot vectors, the model obtains embedding matrices of different orders. Each embedding matrix contains its own latent features. The embedding matrix of the node contains node features, the embedding matrix of the time period contains time features, and the embedding matrix of the day contains day features; the embedding matrices are as follows:
[0027] ;
[0028] ;
[0029] ;
[0030] Among them, is the embedding matrix of the th node; is the embedding matrix of the th time period; and are the embedding matrices for the rd, th day respectively; represents the mode-2 product of tensors;
[0031] Input the first embedding matrices into the ConvLSTM encoder to obtain the latent features for the th day:
[0032] ;
[0033] ;
[0034] where , , , are the initial, the first, the th, the th memory cells respectively; , , , are the initial, the first, the th, the th hidden states respectively; is the ConvLSTM encoder; is the latent feature for the th day obtained after passing through the ConvLSTM encoder; is the Sigmoid activation function; , represent the weight matrix and the bias term of the mapping layer respectively;
[0035] Step 3.2. Construct the fusion features using the embedding matrices. Specifically, vectorize the node features, time period features, and day features in the embedding matrices respectively, and then concatenate them to obtain the fusion features. The formula is as follows:
[0036] ;
[0037] ;
[0038] ;
[0039] ;
[0040] where , , are the vectorized node features, time period features, and day features respectively; represents vectorization; Indicates a splicing operation; is the fused feature, which contains all feature elements, is a set hyperparameter representing the latent feature dimension;
[0041] Step 3.3: The model uses feature extraction modules to capture the non - linear correlation between features. Each feature extraction module is composed of a fully - connected layer and a one - dimensional convolutional layer. The process is expressed as:
[0042] ;
[0043] Among them, represents the feature extraction module; and and respectively represent the output vectors of the 1st, the th, and the th feature extraction modules;
[0044] Step 3.4: The neural tensor ring fusion model inputs into the fully - connected layer to obtain the traffic flow value at the th node in the th time period on the th day after final completion: :
[0045] ;
[0046] Among them, represents the fully - connected layer; and are the weight matrix and the bias term of the fully - connected layer respectively.
[0047] The beneficial technical effects brought by the present invention: Aiming at the problems existing in the current traffic data completion neural tensor network model, the present invention proposes a new neural tensor ring fusion framework based on the TR decomposition method. This method uses the form of a third - order factor tensor to learn different hidden features in the data in the embedding layer, fuses different features in the feature interaction layer, and then uses the feature extraction module to capture the correlation of the fused vector, so as to fully mine the hidden high - order non - linear features between features. In addition, through the ConvLSTM encoder, the model can learn more comprehensively the latent dynamic time features of the data, so as to effectively utilize the dynamic correlation of the data in time. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flowchart of the neural tensor ring fusion method for traffic flow data completion of the present invention.
[0049] Figure 2This is a line graph of the root mean square error of each model in the random missing scenario in the experiments of the present invention.
[0050] Figure 3 This is a line graph of the root mean square error of each model in the non-random missing scenario in the experiments of the present invention. Detailed implementation manners
[0051] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners:
[0052] The present invention believes that there are correlations in the traffic flow tensor in the three modalities of "node", "time period", and "day". Based on the above view, the neural tensor ring fusion framework proposed by the present invention refers to the idea of third-order tensor ring decomposition. Three factor tensors are used in the embedding layer to learn different features of the data respectively, and the features are fused through the interaction layer, so as to effectively capture and utilize the high-order non-linear relationships between data features and achieve high-precision data completion.
[0053] The present invention believes that the change of traffic flow over time is smooth. Based on this view, the present invention proposes a new method for constructing a time feature matrix. This method inputs multiple matrices containing historical time features into ConvLSTM to generate a time feature matrix of corresponding elements, effectively utilizing the dynamic correlation of data in time.
[0054] As Figure 1 shown, the present invention includes the following steps:
[0055] Step 1: Obtain the traffic flow data in the road network system and model the traffic flow data as a third-order tensor , where represents the number of nodes in the road network system, represents the time interval, is the total number of days in the data set; the third-order tensor consists of several elements, and one element represents a traffic flow value. Define the element to represent the traffic flow value at the th node at the th time period on the th day.
[0056] Due to reasons such as equipment failures or communication problems, there are often certain degrees of missing traffic flow data. The goal of the present invention is: how to construct a completion model in the case of missing data to effectively infer the missing traffic flow values in.
[0057] Step 2: Construct the objective function of the neural tensor ring fusion model with reference to the idea of tensor ring decomposition;
[0058] Tensor ring decomposition can effectively reduce the dimension and represent high-order tensors. It can decompose a high-order tensor into a linear multiplication of a series of third-order factor tensors, which are connected end to end to form a ring structure. For example, for order high-order tensor , tensor ring decomposition can order high-order tensor corresponding to the decomposition into third-order factor tensors, and name the th factor tensor as , . In the above expression, and are artificially defined hyperparameters, which are called the tensor ring rank of the th factor tensor and the tensor ring rank of the th factor tensor respectively. Their sizes directly determine the number of potential features in ; is the dimension of the high-order tensor at the th order, is the dimension of the high-order tensor at the th order. Denote the element coordinates of the high-order tensor at the th order as , and denote the element with coordinates in the high-order tensor as , is the element coordinates of the high-order tensor at the th order, then through tensor ring decomposition, the following formula can be obtained:
[0059] ;
[0060] where, represents the trace operation; is a matrix determined by the element coordinates of the high-order tensor at the th order. It is taken from the rd factor tensor at the 2nd order and the th slice. In a tensor, the element coordinates at a certain order are used to determine which slice to take.
[0061] The neural tensor ring fusion model framework for traffic data completion constructed by the present invention is as shown in Figure 1As shown, the model constructs a multi-layer neural network architecture by referring to the above-mentioned tensor ring decomposition idea, which mainly consists of two main levels: the embedding layer and the interaction layer. In the embedding layer, the model fully learns the latent features in the original traffic data by constructing three third-order factor tensors, and uses the ConvLSTM encoder to characterize the temporal interaction of traffic data; in the interaction layer, the model transforms each matrix containing different features into a fused feature through vectorization and concatenation operations, and then gradually mines the complex non-linear correlations between features through the feature extraction layer.
[0062] The objective function of the neural tensor ring fusion model can be expressed as:
[0063] ;
[0064] where , , are three different third-order factor tensors, , , are artificially defined different hyperparameters, representing the tensor ring ranks of the first factor tensor, the second factor tensor, and the third factor tensor respectively, , , are the dimensions of the first order, the second order, and the third order of the high-order tensor respectively. For simplicity, it is stipulated here that the three are equal, and their sizes are set to the latent feature dimension, that is , is the set hyperparameter, representing the latent feature dimension; represents all the parameters to be trained in the network; is the element coordinate index; is the traffic flow value at the th day, the th time period, and the th node after completion; , , are different regularization term coefficients, and the regularization term is added here to prevent the model from overfitting.
[0065] Step 3. Perform traffic flow data completion based on the neural tensor ring fusion model; the specific process is as follows:
[0066] Step 3.1. Embed the data for each traffic flow value;
[0067] Referring to the idea of tensor ring decomposition, three third-order factor tensors are constructed in the embedding layer, enabling the model to fully learn the potential spatio-temporal features at each order of traffic flow data during training. Additionally, the model of the present invention uses a ConvLSTM encoder to enhance the model's ability to capture dynamic time correlations. The specific process is as follows:
[0068] Each traffic flow value contains three elements: node, time period, and day. One-hot encoding (a string consisting of 0s and 1s) is performed on the IDs of these three elements respectively to construct one-hot vectors for the node, time period, and day:
[0069] ;
[0070] ;
[0071] ;
[0072] Among them, is the one-hot vector of the th node; is the one-hot vector of the th time period; is the one-hot vector of the th day; represents the one-hot encoding process; here is a user-defined hyperparameter called the time scale parameter, which determines the number of units in the ConvLSTM encoder in the following text, that is, it is considered that the features of the th day are jointly determined by the features of the previous days.
[0073] Through the one-hot vectors, the model can obtain embedding matrices at different orders. Each embedding matrix contains its own potential features. The embedding matrix of the node contains node features, the embedding matrix of the time period contains time features, and the embedding matrix of the day contains day features; the respective embedding matrices are as follows:
[0074] ;
[0075] ;
[0076] ;
[0077] Among them, is the embedding matrix of the th node; is the embedding matrix of the th time period; , are respectively the th day, the Embedding matrix for days; Represents the mode-2 product of tensors.
[0078] It should be noted that, in order to further extract the temporal pattern of traffic flow data over days, directly using to represent the latent feature of the th day is abandoned here. Instead, the first embedding matrices are input into the ConvLSTM encoder to obtain a more accurate latent feature of the th day:
[0079] ;
[0080] ;
[0081] Among them, , , , are the initial, the first, the th, and the th memory cells respectively; , , , are the initial, the first, the th, and the th hidden states respectively; is the ConvLSTM encoder; is the latent feature of the th day obtained after passing through the ConvLSTM encoder; is the Sigmoid activation function; , represent the weight matrix and the bias term of the mapping layer respectively.
[0082] Step 3.2. Construct the fused feature using the embedding matrix. Specifically, vectorize and represent the node feature, time period feature, and day feature in the embedding matrix respectively, and then concatenate them to obtain the fused feature. The formula is as follows:
[0083] ;
[0084] ;
[0085] ;
[0086] ;
[0087] Among them, , , They are the vectorized node features, time period features, and day features respectively. Indicates vectorization; Indicates the concatenation operation; Is the fused feature, which contains all the feature elements.
[0088] Step 3.3. The model of the present invention uses feature extraction modules to capture the non-linear correlation between features. Each feature extraction module is composed of a fully connected layer and a one-dimensional convolutional layer. The process is expressed as:
[0089] ;
[0090] Among them, Indicates the feature extraction module; , , Indicate the output vectors of the 1st, the th, and the th feature extraction modules respectively.
[0091] Step 3.4. Finally, the neural tensor ring fusion model inputs into the fully connected layer to obtain the traffic flow value at the th day, the th time period, and the th node after final completion: :
[0092] ;
[0093] Among them, Indicates the fully connected layer; , Are the weight matrix and the bias term of the fully connected layer respectively.
[0094] In summary, the interaction layer function adopted by the present invention can be expressed as:
[0095] ;
[0096] Among them, Indicates continuously using feature extraction modules;
[0097] Benefiting from this structure, the interaction layer function of the neural tensor ring fusion model can learn according to different input data, fully excavate the hidden features of the data and the high-order complex correlations between features, so as to achieve better experimental accuracy.
[0098] To prove the feasibility and superiority of the present invention, the following comparative experiments are given. The PEMS04 highway traffic dataset is selected, including two missing scenarios: random missing and non-random missing. The missing rates include 20%, 40%, 60%, and 80%. The comparative models are selected as TR (tensor ring decomposition model), NTF (neural tensor network model based on the idea of tensor CP decomposition), and NTC (neural tensor network model using three-dimensional convolutional neural network to extract features). The evaluation index is selected as root mean square error. The comparison results are as Figure 2 、 Figure 3 shown. Figure 2 、 Figure 3 are respectively the line charts of the root mean square error of each model in the random missing and non-random missing scenarios in the experiments of the present invention. It can be clearly seen that the present invention achieves the minimum root mean square error in all scenarios and all missing rates, indicating that the present invention can achieve higher prediction accuracy.
[0099] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions, or substitutions made by those skilled in the art within the substantial scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A neural tensor loop fusion method for traffic flow data completion, characterized in that: The steps include: Step 1: Obtain traffic flow data in the road network system and model the traffic flow data as a third-order tensor; Step 2: Construct the objective function of the neural tensor ring fusion model based on the tensor ring decomposition idea; Step 3: Complete the traffic flow data based on the neural tensor loop fusion model; the specific process is as follows: Step 3.1: embed data for each traffic flow value; the specific process is as follows: Each traffic flow value contains three items: node, time period, and day. These three items are encoded one-hot to construct the one-hot vector of node, time period, and day: e n =one_hot(n); e t =one_hot(t); in, is the one-hot vector of the nth node; is the one-hot vector of the t-th period; is the one-hot vector of the dth day; one_hot(·) represents the one-hot encoding process; τ is the time scale parameter; Through the one-hot vector, the model obtains embedding matrices of different orders. Each embedding matrix contains its own potential features. The embedding matrix of the node contains the node features, the embedding matrix of the time period contains the time features, and the embedding matrix of the day contains the day features. Each embedding matrix is as follows: Among them, U n is the embedding matrix of the nth node; V t is the embedding matrix of the tth period; are the embedding matrices for the d-τth day and the d-1th day respectively; ×2 represents the mode-2 product of the tensor; The first τ embedding matrices are fed into the ConvLSTM encoder to obtain the latent features of the dth day: Among them, c0, c1, c τ-1 、c τ are the initial, first, τ-1th, and τth memory cells respectively; h0, h1, h τ-1 、h τ are the initial, 1st, τ-1th, and τth hidden states respectively; ConvLSTM(·) is the ConvLSTM encoder; is the potential feature of the dth day after passing through the ConvLSTM encoder; σ(·) is the Sigmoid activation function; Θ P , b P Respectively represent the weight matrix and partial rank term of the mapping layer; Step 3.2: Use the embedding matrix to construct fusion features. Specifically, the node features, time period features, and day features in the embedding matrix are vectorized and concatenated to obtain fusion features. The formula is as follows: in n =already(U n ); in t =thing(V t ); Among them, u n 、v t , They are vectorized node features, time period features, and day features respectively; vec(·) indicates vectorization; Represents a splicing operation; It is the fusion feature, including all feature elements, r is the set hyperparameter, representing the potential feature dimension; Step 3.3: The model uses ω feature extraction modules to capture the nonlinear correlation between features. Each feature extraction module consists of a fully connected layer and a one-dimensional convolutional layer. The process is expressed as: Where FE(·) represents the feature extraction module; f (1) 、f (ω-1) 、f (ω) Represent the output vectors of the 1st, ω-1th, and ωth feature extraction modules respectively; Step 3.4: Neural Tensor Ring Fusion Model (ω) Input the fully connected layer to obtain the final completed traffic flow value at the nth node in the tth period on the dth day Among them, FC(·) represents the fully connected layer; Θ a , b a are the weight matrix and partial rank term of the fully connected layer respectively.
2. The neural tensor loop fusion method for traffic flow data completion according to claim 1, characterized in that: In step 1, the traffic flow data is modeled as a third-order tensor Where N represents the number of nodes in the road network system, T represents the time interval, and D is the total number of days in the data set; the third-order tensor consists of several elements, one element represents a traffic flow value, and the element x is defined as ntd Represents the traffic flow value at the nth node in the tth period on the dth day.
3. The neural tensor loop fusion method for traffic flow data completion according to claim 2 is characterized in that: In step 2, the idea of tensor ring decomposition is to decompose a high-order tensor into a series of linear multiplications of third-order factor tensors, which are connected end to end to form a ring structure; for a high-order tensor of order M, Tensor ring decomposition can decompose a high-order tensor of order M into M third-order factor tensors; M is the dimension of the Mth order of the high-order tensor; the tensor ring decomposition formula is: in, is a high-order tensor The coordinates are (i1,i2,…,i M ), i M is the coordinate of the element on the Mth order of the high-order tensor; Tr(·) represents the trace operation; m is the order number; is the coordinate i of the element on the mth order of the high-order tensor m Determine the matrix, which is taken from the mth factor tensor The i-th m slices. In the tensor, the coordinates of the elements on the order determine which slice to take.
4. The neural tensor loop fusion method for traffic flow data completion according to claim 3 is characterized in that: In step 2, the objective function of the neural tensor loop fusion model is expressed as: in, are three different third-order factor tensors, r1, r2, and r3 are artificially defined hyperparameters, representing the tensor ring ranks of the first, second, and third factor tensors, respectively; I1, I2, and I3 are the dimensions of the first, second, and third orders of the high-order tensor, respectively; Θ represents all parameters that need to be trained in the network; Ω s is the element coordinate index; is the traffic flow value at the nth node in the tth period on the dth day after completion; α, β, and γ are different regularization coefficients.
5. The neural tensor loop fusion method for traffic flow data completion according to claim 4 is characterized in that: In step 3, the neural tensor ring fusion model includes an embedding layer and an interaction layer; the embedding layer constructs three third-order factor tensors to fully learn the potential features in the original traffic data, and uses the ConvLSTM encoder to characterize the temporal interaction of traffic data; in the interaction layer, the model converts each matrix containing different features into a fused feature through vectorization and concatenation operations, and then gradually mines the complex nonlinear correlation between features through the feature extraction layer.
Citation Information
Patent Citations
Traffic speed data filling method based on space-time regularization tensor decomposition
CN117493865A
Network traffic missing data completion method and device, electronic equipment and storage medium
CN117938762A