A traffic flow interpolation method based on video restoration technology

The skip-gram model and t-SNE algorithm are used to extract bayonet features, combined with periodic subnetworks and spatial subnetworks, to solve the problems of data conversion and feature extraction in traffic flow interpolation, and achieve high accuracy and robustness of traffic flow. Traffic interpolation effect.

CN113971373BActive Publication Date: 2024-10-25CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111311305.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-08
Publication Date
2024-10-25
Estimated Expiration
2041-11-08

AI Technical Summary

Technical Problem

The existing technology is difficult to convert from structured traffic trajectory data to unstructured road network pixel images, it is difficult to use convolution to extract features from the sparse road network pixel matrix, and it is difficult to model and capture complex spatiotemporal characteristics to achieve high accuracy. Rate traffic interpolation.

Method used

The Skip-gram model is used to extract the checkpoint feature vector, and the t-SNE algorithm is used for dimensionality reduction to generate the checkpoint matrix and road network flow image, which are input into the traffic flow interpolation model, including periodic subnetworks, spatial subnetworks and fusion network to perform traffic flow interpolation.

Benefits of technology

It achieves more accurate road network pixel image generation and traffic flow interpolation, improves the real-time and accuracy of traffic flow data, and is suitable for traffic data interpolation with high missing rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113971373B_ABST
    Figure CN113971373B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of intelligent transportation, and specifically relates to a traffic flow interpolation method based on video restoration technology, the method comprising: acquiring vehicle data, constructing a vehicle trajectory according to the acquired vehicle data; inputting the vehicle trajectory into a Skip‑gram model, extracting a checkpoint feature vector; using a t‑SNE algorithm to perform dimensionality reduction processing on the checkpoint feature vector, and obtaining a checkpoint two-dimensional feature distribution; diffusing the checkpoint two-dimensional feature distribution, generating a checkpoint matrix, and filling the checkpoint flow to generate a road network flow image; inputting the road network flow image into a traffic flow interpolation model, and obtaining data of restored flow; the traffic flow interpolation model comprises a periodic subnetwork, a spatial subnetwork and a fusion network; the present invention provides a high-quality data foundation for the construction of an intelligent transportation system, and can also be applied to the interpolation or prediction of the same type of spatiotemporal data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of intelligent transportation, and in particular relates to a traffic flow interpolation method based on video restoration technology. Background Art

[0002] With the development of information technology, a huge amount of traffic data is generated in the road network every day. Complete and reliable traffic data is the basis for building an intelligent transportation system. ANPR System (Automatic number-plate recognition System) is the main source of traffic data in cities at present, but in urban planning and construction, due to cost constraints, some equipment is of poor quality. Data loss is inevitable in the process of data collection, processing and storage. The lack of data not only reduces the validity of the data, but also brings troubles to subsequent work. Incomplete traffic data interpolation is an effective processing of massive traffic data, which is of great significance to the subsequent analysis of traffic management systems (TMS) and intelligent transportation systems (ITS). Traffic data has obvious timeliness, that is, the reference value of data gradually decreases with the passage of time. Therefore, the real-time and accuracy of traffic flow data are two necessary indicators for traffic data interpolation.

[0003] In recent years, as intelligent transportation systems have attracted attention in academia and industry, many scholars have conducted research on traffic data interpolation. At present, traffic data interpolation methods can be roughly divided into the following three categories: traditional methods, such as tensor decomposition, interpolation, etc. Statistical learning methods, which interpolate traffic data by establishing a probability distribution model of traffic data. Deep learning methods, which extract spatiotemporal features from historical traffic data by establishing a deep neural network, thereby realizing traffic data interpolation.

[0004] In terms of temporal correlation, there are many filtering interpolation methods that have some applications in outlier interpolation. Filtering methods include single value decomposition, wavelet analysis, immune algorithm, spectral subtraction, etc. The filtering method regards traffic information as time series data and interpolates outliers through spectral analysis, feature extraction and smoothing data, so the filtering method is difficult to handle long-term missing data. In terms of spatial correlation, denoising autoencoders are used to obtain the spatial characteristics of traffic data to achieve the purpose of interpolation.

[0005] Problems existing in existing technologies include: how to convert structured traffic trajectory data into unstructured road network pixel images; how to use convolution to extract features from sparse road network pixel matrices; and how to model and capture complex spatiotemporal characteristics to achieve high-accuracy traffic flow interpolation. Summary of the invention

[0006] In order to solve the problems existing in the above prior art, the present invention proposes a traffic flow interpolation method based on video restoration technology, which includes: acquiring vehicle data, and constructing vehicle trajectories according to the acquired vehicle data; inputting the vehicle trajectory into the Skip-gram model to extract the checkpoint feature vector; using the t-SNE algorithm to perform dimensionality reduction processing on the checkpoint feature vector to obtain the checkpoint two-dimensional feature distribution; diffusing the checkpoint two-dimensional feature distribution to generate a checkpoint matrix, and filling the checkpoint flow to generate a road network flow image; inputting the road network flow image into the traffic flow interpolation model to obtain the data of the restored flow; the traffic flow interpolation model includes a periodic subnetwork, a spatial subnetwork and a fusion network.

[0007] Preferably, the process of constructing a vehicle trajectory according to the acquired vehicle data includes: the acquired vehicle data includes the vehicle license plate number, driving speed, driving direction and timestamp; constructing a driving path of the vehicle in the road network according to the driving speed, driving direction and timestamp of the vehicle, and the constructed driving path is the trajectory of the vehicle; the expression of the driving path is V i ={m i1 ,m i2 ,…,m in}, where m i1 represents the first checkpoint that vehicle i passes when entering the road network, m in Indicates the last checkpoint that vehicle i passes when leaving the road network.

[0008] Preferably, the equation for extracting the bayonet feature vector of the vehicle trajectory using the Skip-gram model includes:

[0009]

[0010]

[0011]

[0012] Among them, g(m) represents the Skip-gram model maximization function, m represents the checkpoint, represents the port existing in the context of port m, Context(m) represents the context of port m, u represents the port taken from the union of port m and the negative sample subset, Indicates the processing port The negative sample subset generated when represents the probability of the occurrence of the checkpoint m and the negative sample subset under the premise of the context checkpoint, σ(.) represents the sigmoid function, represents, T represents transpose, θ u represents the learning parameter, L m (u) represents the condition for judging whether the bayonet u is equal to the bayonet m. If they are equal, Lm The value of (u) is set to 1, otherwise it is set to 0; L represents the optimization target, and C represents the vehicle trajectory set.

[0013] Preferably, the process of using the t-SNE algorithm to reduce the dimension of the bayonet feature vector includes:

[0014] Step 1: Calculate each bayonet x according to the bayonet feature vector i Distributed in bayonet x j The probability of surrounding j|i , according to the probability p j|i Calculate bayonet x i and bayonet x j The similarity p ij ;

[0015] Step 2: Map the high-dimensional bayonet feature vector to the low-dimensional space to obtain the corresponding two-dimensional bayonet feature y i With y j , calculate the two-dimensional bayonet feature y i With y j The similarity q ij ;

[0016] Step 3: According to the high-dimensional card slot x i With bayonet x j The similarity p ij and the two-dimensional bayonet feature y i With y j The similarity q ij Gradient descent is used to optimize the KL divergence of Q distribution and P distribution to obtain the mapping y1,…,y of the bayonet in two-dimensional space. N ;

[0017] Step 4: Cut the mapping of the bayonet in the two-dimensional space to obtain grid units;

[0018] Step 5: Check the number of checkpoints in the grid unit. If the number of checkpoints in the grid unit is 1, no operation is performed; otherwise, a diffusion algorithm is used to generate a checkpoint matrix and a road network flow image for the grids with checkpoints greater than 1, so that the number of checkpoints in each grid unit is at most 1.

[0019] Furthermore, the process of using the diffusion algorithm to generate a checkpoint matrix and a road network flow image for the grid includes:

[0020] Step 1: Take the checkpoint with the largest historical flow in the current grid unit as the reference checkpoint, and divide the outer layer of the reference checkpoint into four areas according to the angle;

[0021] Step 2: Calculate the azimuth angle between the bayonet and the reference bayonet;

[0022] Step 3: Place the bayonet at the position of the corresponding angle in the outer layer. If the position is occupied, allocate it to other positions in the corresponding area;

[0023] Step 4: If the corresponding area is completely occupied, expand outward one layer and return to step 1 until a position that can be expanded is found to obtain a bayonet matrix; the cells with bayonet in the matrix are set to 1, and the cells without bayonet are set to 0;

[0024] Step 5: Set the time interval, divide the checkpoint traffic according to the set time interval, and obtain the divided checkpoint traffic slices;

[0025] Step 6: Fill the road network flow slices into the corresponding positions of the checkpoint matrix to generate a road network flow image sliced ​​by time.

[0026] Preferably, the process of processing the road network flow image using the traffic flow interpolation model includes:

[0027] Step 1: Perform partial convolution on the two-dimensional feature distribution vector of the bayonet to obtain the time slice to be repaired;

[0028] Step 2: Input the time slice to be repaired into the periodic subnetwork to obtain the periodic characteristics of traffic flow;

[0029] Step 3: Input the time slice to be repaired into the spatial subnetwork to obtain the spatial characteristics of traffic flow;

[0030] Step 4: Input the periodic characteristics of traffic flow and the spatial characteristics of traffic flow into the fusion network to obtain the interpolation results of traffic flow.

[0031] Furthermore, the process of performing partial convolution on the road network flow image includes: inputting the road network flow image and the corresponding initial mask, the initial mask size is the same as the road network flow image size; setting the data in the position corresponding to the checkpoint in the initial mask to 1, and setting other positions to 0; using the mask to block the invalid area where the checkpoint does not exist in the flow image, and convolving the valid area; updating the mask after the convolution process is completed; obtaining the feature map of traffic flow and the updated mask.

[0032] Furthermore, the process of using the periodic subnetwork to process the time slice to be repaired includes: the periodic subnetwork adopts a codec structure; and BiConvLSTM is used as a component unit in the network; the road network flow images are arranged in chronological order.

[0033] {X t-1d ,X t-10min ,X t-5min ,X,X t+5min ,X t+10min ,X t+1d}, where X is the road network flow image containing missing data, and the other data are the complete road network flow images within the period, where min represents minutes and d represents days; the arranged road network flow image is input into BiConvLSTM, and the hidden state H and unit output Y are output; before each layer of BiConvLSTM in the encoder, the PConvLSTM network is used to downsample the input time slice to be repaired, and the hidden states H1, H2, …, H t ; The hidden state of each layer in the decoder comes from the copy in the encoder, and deconvolution is used for upsampling before each layer of ConvLSTM; The input of the first layer of the decoder comes from the randomly initialized features, and then the input of each layer of the decoder is the output of the previous layer, and finally the periodic characteristics of traffic flow are obtained.

[0034] Furthermore, the process of using the spatial subnetwork to process the time slice to be repaired includes: the spatial subnetwork adopts an encoding and decoding structure; the road network traffic image X containing missing data is input into the spatial subnetwork to obtain a traffic flow spatial feature map; the encoder Encoder in the spatial subnetwork uses Partial Convolution for downsampling; the decoder Decoder uses deconvolution for upsampling to make the output size of the spatial features of the traffic flow the same as the input size.

[0035] Furthermore, the process of fusing the periodic features of traffic flow and the spatial features of traffic flow using a fusion network includes: stacking the periodic features and the spatial features, fusing the two features using a 1×1 convolution, and outputting a fused feature matrix.

[0036] Beneficial effects of the present invention:

[0037] 1. The present invention proposes a road network pixel image generation method TrafficNet2Matrix, which improves the traditional road network matrix method, uses a representation learning method to mine the relationship between road network nodes from vehicle trajectories, fully considers the spatial and flow correlation between checkpoints, and generates road network pixel images, making the final result more accurate.

[0038] 2. The present invention applies Partial Convolutions and LSTM to the interpolation of traffic flow images, and proposes a network unit PConvLSTM suitable for traffic flow interpolation. A mask is added to the convolution to improve the performance of convolution in sparse road network images, and the model is enabled to capture time series features by integrating LSTM.

[0039] 3. The present invention designs a traffic flow interpolation model TrafficImputationNet, which uses two sub-networks to extract the periodic and spatiotemporal characteristics of traffic flow respectively; this model can not only perform high-quality traffic flow interpolation, but also has strong robustness for traffic data with high missing rates. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is the overall structure diagram of the traffic flow interpolation based on deep learning of the present invention;

[0041] Figure 2 The Traffic2Matrix algorithm schematic diagram of the road network matrix of the present invention;

[0042] Figure 3 It is a schematic diagram of partial convolution of the present invention;

[0043] Figure 4 It is a schematic diagram of the BiConvLSTM structure of the present invention;

[0044] Figure 5 It is a schematic diagram of the periodic network structure of the present invention;

[0045] Figure 6 Schematic diagram of the spatial subnetwork structure of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] A traffic flow interpolation method based on video restoration technology, such as Figure 1 As shown, the method includes: acquiring vehicle data, constructing vehicle trajectories according to the acquired vehicle data; inputting the vehicle trajectories into the Skip-gram model to extract the checkpoint feature vector; using the t-SNE algorithm to perform dimensionality reduction processing on the checkpoint feature vector to obtain the checkpoint two-dimensional feature distribution; inputting the checkpoint two-dimensional feature distribution into the traffic flow interpolation model to obtain the data of restored traffic flow; the traffic flow interpolation model includes a periodic subnetwork, a spatial subnetwork and a fusion network.

[0048] The process of constructing a vehicle trajectory based on the acquired vehicle data includes: using the automatic license plate recognition (ANPR) data of the traffic checkpoints in the road network as the data source, and recording the license plate number, driving speed, driving direction, timestamp and other data when the vehicle passes through the checkpoint. The vehicle trajectory represents the driving path of the vehicle in the road network, and is constructed based on the license plate number and timestamp data captured by the automatic license plate recognition device. The driving path of the vehicle in the road network is recorded using V i ={m i1 ,m i2 ,…,m in} means, where m i1 represents the first checkpoint that vehicle i passes when entering the road network, m in Indicates the last checkpoint that vehicle i passes when leaving the road network.

[0049] A specific implementation of a traffic flow interpolation method based on video restoration technology, the method comprising:

[0050] S1: Pixelation of traffic data. Word embedding technology learns the distributed representation of words by mining the association between contexts in the corpus, thereby achieving the purpose of reducing the dimensionality of the word space. Word embedding technology is based on the distribution hypothesis (DistributionHypothesis), that is, words that appear in the same context have similar semantics. Due to the similarity between vehicle trajectories and sentence structures, the checkpoint association hypothesis is proposed, that is, the checkpoints adjacent to a checkpoint in the trajectory are more closely associated than other checkpoints. Based on the above assumption, the present invention uses the Skip-gram model to mine the feature representation of checkpoints from the trajectory. The t-SNE algorithm is used to reduce the dimension of the high-dimensional checkpoint feature vector and map it to a two-dimensional pixel space. If the checkpoints in the two-dimensional space are divided using an equidistant grid, the checkpoints that are closer will be divided into the same pixel unit. In order to solve this problem, the present invention proposes a pixel diffusion algorithm. Taking the checkpoint with the largest flow in the same unit as the benchmark, diffusion is performed according to the azimuth. Finally, each grid contains at most one pixel.

[0051] S2: Establish a traffic flow interpolation model. TrafficImputationNet consists of three networks: a periodic sub-network, a spatial sub-network, and a fusion network. The periodic sub-network attempts to learn the periodic characteristics of road network traffic, the spatial sub-network attempts to learn the spatial characteristics of a single moment in the road network, and the fusion network merges the characteristics of the two sub-networks.

[0052] In the process of pixelating traffic data, the specific process includes:

[0053] S11: Bayonet mount and context checkpoints in the predicted path The Skip-gram model is trained to obtain a trained Skip-gram model; that is, for a given sample (m, Context(m)), the maximization function of the sample is:

[0054]

[0055] Among them, g(m) represents the Skip-gram model maximization function, m represents the checkpoint, represents the port existing in the context of port m, Context(m) represents the context of port m, u represents the port taken from the union of port m and the negative sample subset, Indicates the processing port The negative sample subset generated when It represents the probability of the occurrence of checkpoint m and negative sample subset under the premise of the presence of context checkpoint.

[0056] The calculation formula is:

[0057]

[0058] Among them, σ represents the sigmoid function, Indicates the bayonet vector, T represents transpose, θ u represents the parameters to be learned, L m (u) is:

[0059]

[0060] For a given vehicle trajectory set C, the overall optimization goal of Skip-gram is:

[0061]

[0062] Where C represents the given set of vehicle trajectories.

[0063] S12: The process of using the t-SNE algorithm to reduce the dimension of the bayonet feature vector includes:

[0064] Step 1: Calculate each bayonet x according to the bayonet feature vector i Distributed in bayonet x j The probability of surrounding j|i , according to the probability p j|i Calculate bayonet x i and bayonet x j The similarity p ij ;

[0065] Calculate x for each bayonet i Distributed in bayonet x jThe probability of surrounding j|i The formula is:

[0066]

[0067] Among them, σ i Represents the data point x i The Gaussian variance centered at , k represents the number of selected neighborhood points, x k represents the context slot k.

[0068] Calculate bayonet x i and bayonet x j The similarity p ij The formula is:

[0069]

[0070] Where N represents the number of bayonet feature vectors input to the t-SNE algorithm.

[0071] Step 2: Map the high-dimensional bayonet feature vector to the low-dimensional space to obtain the corresponding two-dimensional bayonet feature y i With y j , calculate the two-dimensional bayonet feature y i With y j The similarity q ij ;

[0072] Calculate the two-dimensional bayonet feature y i With y j The similarity q ij The formula is:

[0073]

[0074] Among them, y k Represents the feature representation of the upper and lower bayonet k.

[0075] Step 3: According to the high-dimensional card slot x i With bayonet x j The similarity p ij and the two-dimensional bayonet feature y i With y j The similarity q ij Gradient descent is used to optimize the KL divergence of Q distribution and P distribution to obtain the mapping y1,…,y of the bayonet in two-dimensional space. N ; The KL divergence formula is:

[0076]

[0077] Among them, P represents the probability distribution of high dimension, and Q represents the probability distribution of low dimension.

[0078] Step 4: Cut the mapping of the bayonet in the two-dimensional space to obtain the grid unit. The specific process includes: first, the two-dimensional space mapped to the bayonet needs to be cut. If the number of bayonet is k, the matrix size is m rows and n columns, and m×n≥k; the cutting span of a single grid is:

[0079]

[0080] Among them, x span Represents the span of each unit x-axis, x max represents the maximum value of x, x min represents the minimum value of x, n represents the number of columns to be divided, and y span Represents the span of each unit y axis, y max Indicates the maximum value of y, y min Represents the minimum value of y, and m represents the number of columns to be divided.

[0081] If the index of each cell in the matrix M is (i, j), then M ij The areas covered are:

[0082] x∈(x min +j×x span ,x min +(j+1)×x span ]

[0083] y∈(y max -(i+1)×y span ,y max -i×y span ]

[0084] Among them, j represents the y-axis index in the matrix M, and i represents the x-axis index in the matrix M.

[0085] Step 5: Check the number of checkpoints in the grid unit. If the number of checkpoints in the grid unit is 1, no operation is performed; otherwise, a diffusion algorithm is used to generate a checkpoint matrix and a road network flow image for the grids with checkpoints greater than 1, so that the number of checkpoints in each grid unit is at least 1. Since the number of checkpoints in each grid unit after cutting is greater than or equal to 0, in order to make each unit contain at most one checkpoint, the grids with checkpoints greater than or equal to 2 in the grid need to be diffused.

[0086] like Figure 2 As shown in Figure 1, the process of using the diffusion algorithm to generate a checkpoint matrix and a road network flow image for a grid includes:

[0087] Step 1: Take the checkpoint with the largest historical flow in the current grid unit as the reference checkpoint, and divide the outer layer of the reference checkpoint into four areas according to the angle;

[0088] Step 2: Calculate the azimuth angle between the bayonet and the reference bayonet; the calculation formula is:

[0089]

[0090] Among them, α represents the azimuth angle between the bayonet to be diffused and the reference bayonet, g represents, Δy represents the distance between the bayonet to be diffused and the reference bayonet on the y-axis, Δx represents the distance between the bayonet to be diffused and the reference bayonet on the x-axis, y2 represents the y-axis coordinate of the bayonet to be diffused, y1 represents the y-axis coordinate of the reference bayonet, x2 represents the x-axis coordinate of the bayonet to be diffused, and x1 represents the x-axis coordinate of the reference bayonet.

[0091] Step 3: Place the bayonet at the position of the corresponding angle in the outer layer. If the position is occupied, allocate it to other positions in the corresponding area;

[0092] Step 4: If the corresponding area is completely occupied, expand outward one layer and return to step 1 until a position that can be expanded is found to obtain a bayonet matrix; the cells with bayonet in the matrix are set to 1, and the cells without bayonet are set to 0;

[0093] Step 5: Set the time interval, divide the checkpoint traffic according to the set time interval, and obtain the divided checkpoint traffic slices;

[0094] Step 6: Fill the road network flow slices into the corresponding positions of the checkpoint matrix to generate a road network flow image sliced ​​by time.

[0095] The traffic flow interpolation model consists of three parts: the periodic subnetwork, the spatial subnetwork, and the fusion network. The periodic subnetwork and the spatial subnetwork are parallel, and they output the periodic characteristics and spatial characteristics of the traffic flow respectively. The fusion network receives the output of the two subnetworks as input, and outputs the interpolated traffic flow results. The network structure of the periodic subnetwork is shown in Figure 2. Figure 5 As shown in Figure 2, the structure of the spatial subnetwork is as follows: Figure 6 shown.

[0096] The process of processing the two-dimensional feature distribution of the checkpoint using the traffic flow interpolation model includes:

[0097] Step 1: Perform partial convolution on the bayonet two-dimensional feature distribution vector to obtain the time slice to be repaired; the specific process includes:

[0098] The road network flow image contains a large number of invalid pixels. The standard convolution operation will treat valid pixels and invalid pixels in the same way, which will interfere with the results. Partial Convolutions uses a mask to mask the invalid area so that the convolution is only for the valid area, which effectively improves the feature extraction effect of the sparse matrix. Figure 3 shown.

[0099] The mask is responsible for distinguishing which pixels are valid in the convolution operation, 1 indicates valid pixels, and 0 indicates invalid pixels. The road network pixel matrix represents the distribution of checkpoints in the matrix. We can use the road network pixel matrix E to generate the mask M1 = Boolean (E) of the first layer of the convolution network; where Boolean represents Boolean operations, and elements in the matrix are set to 1 if they are greater than 0 and set to 0 if they are equal to 0; E represents the road network pixel matrix. The formula for partial convolutions is:

[0100]

[0101] Among them, W represents the weight of the convolution kernel, X represents the value of the current convolution input, ⊙ represents element-wise multiplication, M represents mask, and b represents the bias term; Used to scale the results.

[0102] Since the effective area of ​​each layer in the convolutional network will change after downsampling, the mask also needs to be updated accordingly. The formula for mask update is:

[0103]

[0104] Among them, sum(M) represents the sum of the matrix values ​​corresponding to the convolution kernel during the convolution process.

[0105] Step 2: Input the time slice to be repaired into the periodic subnetwork to obtain the periodic characteristics of traffic flow.

[0106] The periodic subnetwork is trained using periodic data to learn the periodic characteristics of traffic flow. The periodic interpolation subnetwork inputs the time slice to be repaired X t , the slice of the relevant cycle and slices of adjacent moments The output is the periodic characteristics of traffic flow. Traffic data has obvious periodic characteristics (daily, weekly, monthly), and is greatly affected by the adjacent time such as 5 minutes, 10 minutes, and 15 minutes. Therefore, the input of the periodic subnetwork is {X t-1mon ,X t-1w ,X t-1d ,X t-15min ,X t-10min ,X t-5min ,X t ,X t+5min ,X t+10min ,X t+15min ,X t+1d ,X t+1w ,X t+1mon}. In a specific implementation, the periodic data can be adjusted according to the specific situation of the data.

[0107] The periodic sub-network uses an encoder-decoder structure to enable the model to make better use of periodic data, such as Figure 4 As shown in the figure, a bidirectional BiPConvLSTM is designed in the encoder. That is, the PConvLSTM network is used to downsample the input time slice to be repaired before each layer of BiConvLSTM in the encoder to obtain the hidden states H1, H2, ..., H t ; The hidden state of each layer in the decoder comes from the copy in the encoder, and deconvolution is used for upsampling before each layer of ConvLSTM; The input of the first layer of the decoder comes from the randomly initialized features, and then the input of each layer of the decoder is the output of the previous layer, and finally the periodic characteristics of traffic flow are obtained.

[0108] The LSTM network has good performance in processing time series data, but the fully connected FC-LSTM does not consider the spatial correlation. By applying convolution to LSTM, LSTM can acquire the ability to capture spatial features and better capture the spatiotemporal correlation of traffic flow. The formula of ConvLSTM is:

[0109]

[0110]

[0111]

[0112]

[0113]

[0114] Among them, i t represents the input gate at time step t, σ represents the sigmoid activation function, and W xi Represents the input gate i t Medium X t The weight parameter, X t represents the input at time step t, W hi Represents the input gate i t Medium H t-1 The weight parameter, H t-1 represents the hidden state at time step t-1, W ci Represents the input gate i t Middle C t-1 The weight parameter, C t-1 represents the memory cell at time step t-1, b i represents the bias parameter of the input gate, f trepresents the hidden door at time step t, W xf represents the forget gate f t Medium X t The weight parameter, W hf represents the forget gate f t Medium H t-1 The weight parameter, W cf represents the forget gate f t Middle C t-1 The weight parameter, b f represents the bias parameter of the forget gate, C t represents the memory cell at time step t, tanh(.) represents the hyperbolic tangent activation function, and W xc Represents memory cell C t Medium X t The weight parameter, W hc Represents memory cell C t Medium H t-1 The weight parameter, b c represents the bias parameter of the memory cell, o t represents the output gate of step t, W xo Represents the output gate o t Medium X t The weight parameter, W ho Represents the output gate o t Medium H t-1 The weight parameter, H t-1 represents the hidden state at time step t-1, W co Represents the output gate o t Middle C t-1 The weight parameter, b o represents the bias parameter of the output gate, H t represents the hidden state at time step t, and ° represents the Hadamard product.

[0115] In order to enable ConvLSTM to better process valid pixels in road network traffic images, PartialConvolutions is applied to ConvLSTM.

[0116] Step 3: Input the time slice to be repaired into the spatial subnetwork to obtain the spatial characteristics of traffic flow.

[0117] The spatial sub-network is trained using data from a single moment to learn the spatial characteristics of traffic flow. The input of the spatial sub-network is X t , the output is the periodic feature of traffic flow. Encoder uses partial convolution for downsampling. Decoder uses deconvolution for upsampling to make the output size the same as the input size.

[0118] Step 4: Input the periodic characteristics of traffic flow and the spatial characteristics of traffic flow into the fusion network to obtain the interpolation results of traffic flow.

[0119] The fusion network combines the features of the periodic sub-network and the spatial sub-network outputs and outputs the interpolation result of the traffic flow. The results output by the periodic sub-network and the spatial sub-network are the same size as the target frame to be repaired. The fusion network stacks the features of the two sub-networks and fuses the two networks through 1×1 convolution.

[0120] Through the output structure of the traffic flow interpolation model in the present invention, the missing traffic data can be interpolated to obtain relatively complete traffic data. The model can output the interpolation results at each moment and can cope with data loss in various modes and various missing rates. The relevant departments can carry out subsequent analysis and modeling work based on the interpolation results of traffic data, which can improve the accuracy of their analysis and model.

[0121] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A traffic flow interpolation method based on video restoration technology, characterized in that: include: Acquire vehicle data, and construct a vehicle trajectory according to the acquired vehicle data; Input the vehicle trajectory into the Skip-gram model to extract the checkpoint feature vector; use the t-SNE algorithm to reduce the dimension of the checkpoint feature vector to obtain the checkpoint two-dimensional feature distribution; diffuse the checkpoint two-dimensional feature distribution to generate a checkpoint matrix, fill the checkpoint flow in the checkpoint matrix, and generate a road network flow image; input the road network flow image into the traffic flow interpolation model to obtain the restored flow data; the traffic flow interpolation model includes a periodic subnetwork, a spatial subnetwork and a fusion network; The process of using the t-SNE algorithm to reduce the dimension of the bayonet feature vector includes: Step 1: Calculate each bayonet x according to the bayonet feature vector i Distributed in bayonet x j The probability of surrounding j|i , according to the probability p j|i Calculate bayonet x i and bayonet x j The similarity p ij ; Step 2: Map the high-dimensional bayonet feature vector to the low-dimensional space to obtain the corresponding two-dimensional bayonet feature y i With y j , calculate the two-dimensional bayonet feature y i With y j The similarity q ij ; Step 3: According to the high-dimensional card slot x i With bayonet x j The similarity p ij and the two-dimensional bayonet feature y i With y j The similarity q ij Gradient descent is used to optimize the KL divergence of Q distribution and P distribution to obtain the mapping y1,…,y of the bayonet in two-dimensional space. N ; Step 4: Cut the mapping of the bayonet in the two-dimensional space to obtain grid units; Step 5: Detect the number of checkpoints in the grid unit. If the number of checkpoints in the grid unit is 1, no operation is performed; otherwise, a diffusion algorithm is used to generate a checkpoint matrix and a road network flow image for the grids with checkpoints greater than 1, so that the number of checkpoints in each grid unit is at most 1; The process of using diffusion algorithm to generate checkpoint matrix and road network flow image for grid includes: Step 51: Taking the checkpoint with the largest historical flow in the current grid unit as the reference checkpoint, the outer layer of the reference checkpoint is divided into four areas according to the angle; Step 52: Calculate the azimuth angle between the bayonet and the reference bayonet; Step 53: Place the bayonet at a position corresponding to the angle of the outer layer. If the position is occupied, allocate it to another position in the corresponding area. Step 54: If the corresponding area is completely occupied, expand outward by one layer, and return to step 1 until a position that can be expanded is found, and a bayonet matrix is ​​obtained; the cells with bayonet in the matrix are set to 1, and the cells without bayonet are set to 0; Step 55: setting a time interval, dividing the bayonet flow according to the set time interval, and obtaining the bayonet flow slices; Step 56: Fill the road network flow slices into the corresponding positions of the checkpoint matrix to generate a road network flow image sliced ​​by time; The process of processing the road network flow image using the traffic flow interpolation model includes: Step 1: Perform partial convolution on the road network flow image to obtain the time slice to be repaired; the process of performing partial convolution on the road network flow image includes: inputting the road network flow image and the corresponding initial mask, the initial mask size is the same as the road network flow image size; setting the data in the position corresponding to the checkpoint in the initial mask to 1, and setting other positions to 0; using the mask to block the invalid area where there is no checkpoint in the flow image, and performing convolution on the valid area; updating the mask after the convolution process is completed; obtaining the feature map of traffic flow and the updated mask; Step 2: Input the time slice to be repaired into the periodic sub-network to obtain the periodic characteristics of traffic flow; specifically: the periodic sub-network adopts a codec structure; and BiConvLSTM is used as a component unit in the network; the road network flow images are arranged in chronological order {X t-1d ,X t-10min ,X t-5min ,X,X t+5min ,X t+10min ,X t+1d }, where X is the road network flow image containing missing data, and the other data are the complete road network flow images within the period, where min represents minutes and d represents days; the arranged road network flow image is input into BiConvLSTM, and the hidden state H and unit output Y are output; before each layer of BiConvLSTM in the encoder, the PConvLSTM network is used to downsample the input time slice to be repaired, and the hidden states H1, H2, …, H t ; The hidden state of each layer in the decoder comes from the copy in the encoder, and deconvolution is used for upsampling before each layer of ConvLSTM; the input of the first layer of the decoder comes from the randomly initialized features, and then the input of each layer of the decoder is the output of the previous layer, and finally the periodic characteristics of traffic flow are obtained; Step 3: Input the time slice to be repaired into the spatial subnetwork to obtain the spatial features of the traffic flow; specifically: the spatial subnetwork adopts an encoding and decoding structure; the road network flow image X containing missing data is input into the spatial subnetwork to obtain the spatial feature map of the traffic flow; the encoder Encoder in the spatial subnetwork uses Partial Convolution for downsampling; the decoder Decoder uses deconvolution for upsampling to make the output size of the spatial features of the traffic flow the same as the input size; Step 4: Input the periodic characteristics of traffic flow and the spatial characteristics of traffic flow into the fusion network to obtain the interpolation results of traffic flow; specifically: stack the periodic characteristics and spatial characteristics, use 1×1 convolution to fuse the two features, and output the fused feature matrix.

2. According to claim 1, a traffic flow interpolation method based on video restoration technology is characterized in that: The process of constructing a vehicle trajectory based on the acquired vehicle data includes: the acquired vehicle data includes the vehicle license plate number, driving speed, driving direction and timestamp; constructing the vehicle's driving path in the road network based on the vehicle's driving speed, driving direction and timestamp, and the constructed driving path is the vehicle's trajectory; the expression of the driving path is V i ={m i1 ,m i2 ,…,m in }, where m i1 represents the first checkpoint that vehicle i passes when entering the road network, m in Indicates the last checkpoint that vehicle i passes when leaving the road network.

3. The traffic flow interpolation method based on video restoration technology according to claim 1 is characterized in that: The equations for extracting the bayonet feature vector of vehicle trajectory using the Skip-gram model include: Among them, g(m) represents the Skip-gram model maximization function, m represents the checkpoint, represents the port existing in the context of port m, Context(m) represents the context of port m, u represents the port taken from the union of port m and the negative sample subset, Indicates the processing port The negative sample subset generated when represents the probability of the occurrence of the checkpoint m and the negative sample subset under the premise of the context checkpoint, σ(.) represents the sigmoid function, represents, T represents transpose, θ u represents the learning parameter, L m (u) represents the condition for judging whether the checkpoint u is equal to the checkpoint m, L represents the optimization target, and C represents the vehicle trajectory set.