Video equipment roadside parking flow prediction method and system
By constructing graph structure data and graph convolution neural network models, the problem that traditional roadside parking management cannot predict roadside parking traffic is solved, and accurate prediction and management of future parking traffic is achieved, and the efficiency of parking traffic is improved. .
Patent Information
- Application Number
- CN202211360036.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-11-02
AI Technical Summary
Traditional roadside parking management methods cannot estimate and predict roadside parking traffic, resulting in the inability to effectively manage roadside parking traffic in the future time period.
By obtaining the device location data of multiple video devices and roadside parking traffic records, graph structure data is constructed, and the graph convolutional neural network model is used to predict parking traffic at future moments. The specific steps include building nodes and edges, calculating distance and traffic correlation weights, forming graph structure data, and conducting model training and prediction based on this.
It realizes effective prediction of roadside parking traffic, promotes the management and analysis of traffic flow, and provides reference value for the number of berths when promoting high-level video technology in other areas.
Smart Images

Figure CN115798196B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and system for predicting roadside parking flow using video equipment. Background Art
[0002] In recent years, with the rapid development of urbanization, the number of cars has gradually increased, and parking difficulties and disorderly parking have become one of the main problems that need to be solved in the development of urban transportation in my country. In order to effectively alleviate the problems of parking difficulties and disorderly parking, traffic management departments in various places have tried and implemented various intelligent parking management technologies. When conducting roadside parking management, the main method is to install high-position video cameras for roadside parking management, and use visual algorithms for license plate detection and license plate recognition to realize parking fee collection and management.
[0003] However, the traditional roadside parking management method is based on the acquisition of monitoring data by high-position video monitoring equipment, and the use of visual processing algorithms to charge and manage roadside parking spaces based on the monitoring data. However, the traditional roadside parking management method cannot estimate and predict the flow of roadside parking, resulting in the inability to predict the roadside parking flow in the future time period, and thus unable to manage roadside parking more effectively. Summary of the invention
[0004] The purpose of this application is to solve the technical problem that the traditional roadside parking management method cannot estimate and predict the flow of roadside parking. To achieve the above purpose, this application provides a video device roadside parking flow prediction method and system.
[0005] The present application provides a method for predicting roadside parking flow using a video device, comprising:
[0006] Acquire a device position data set of a plurality of video devices and a roadside parking flow record set captured by the plurality of video devices, wherein the device position data set includes a device position of each of the video devices and a position distance between each of the video devices, and the roadside parking flow record set includes roadside parking flow data captured by each of the video devices;
[0007] Constructing nodes of graph structure data according to device positions of the plurality of video devices;
[0008] Constructing edges of the graph structure data according to the distance relationship between the position distances of the respective video devices and the correlation relationship between the roadside parking flow data captured by the respective video devices, and forming the graph structure data according to the nodes of the graph structure data and the edges of the graph structure data;
[0009] Based on the graph structure data, the roadside parking flow data captured by each of the video devices at time t is input into the graph convolutional neural network model, and the roadside parking flow data predicted by each of the video devices at time t+1 is output;
[0010] Constructing a loss function according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1, and performing model training on the graph convolutional neural network model according to the loss function to obtain a trained graph convolutional neural network model;
[0011] The roadside parking flow data captured by the video device under test at time k is obtained, and the roadside parking flow data captured by the video device under test at time k is input into the trained graph convolutional neural network model to obtain the roadside parking flow data predicted by the video device under test at time k+1.
[0012] In one embodiment, the constructing the edge of the graph structure data according to the distance relationship between the position distances of the respective video devices and the correlation relationship between the roadside parking flow data captured by the respective video devices, and forming the graph structure data according to the nodes of the graph structure data and the edges of the graph structure data, includes:
[0013] According to the position distance between any two of the video devices, the inverse of the position distance is calculated to obtain a distance correlation weight between any two of the video devices;
[0014] According to the distance correlation weights between any two of the video devices, obtaining a node distance correlation weight matrix;
[0015] According to the entry flow data and the exit flow data in the roadside parking flow data captured by any two of the video devices, the entry correlation weight and the exit correlation weight are calculated respectively by using the Pearson correlation coefficient calculation method;
[0016] Obtaining a node traffic correlation weight matrix according to the entry correlation weight and the exit correlation weight between any two of the video devices;
[0017] A node relationship matrix is obtained according to the node distance correlation weight matrix and the node flow correlation weight matrix, and the node relationship matrix forms the edge of the graph structure data.
[0018] In one embodiment, the Pearson correlation coefficient calculation method is used to calculate the entry correlation weight and the exit correlation weight respectively according to the entry flow data and the exit flow data in the roadside parking flow data captured by any two of the video devices, including:
[0019] According to the admission flow data captured by any two of the video devices, the admission correlation weight is calculated using the Pearson correlation coefficient calculation method, and the admission correlation weight is:
[0020]
[0021] in, represents the covariance of the entrance traffic data captured by any two of the video devices, represents the standard deviation of the admission flow data captured by any two of the video devices, x and y represent the admission flow data captured by any two of the video devices, n represents time in hours, and Respectively represent the mean values of the entrance traffic data captured by any two of the video devices;
[0022] According to the exit flow data captured by any two of the video devices, the exit correlation weight is calculated using the Pearson correlation coefficient calculation method, and the exit correlation weight is:
[0023]
[0024] in, represents the covariance of the traffic data captured by any two video devices, represents the standard deviation of the exit flow data captured by any two of the video devices, x and y represent the exit flow data captured by any two of the video devices, n represents time in hours, and Respectively represent the mean value of the exit traffic data captured by any two of the video devices.
[0025] In one embodiment, the node relationship matrix is obtained according to the node distance correlation weight matrix and the node flow correlation weight matrix, and the node relationship matrix forms the edge of the graph structure data, including:
[0026] Normalizing the node distance correlation weight matrix to obtain a normalized node distance correlation weight matrix;
[0027] Normalizing the node flow correlation weight matrix to obtain a normalized node flow correlation weight matrix;
[0028] The normalized node distance correlation weight matrix and the normalized node flow correlation weight matrix are weightedly calculated to obtain the node relationship matrix.
[0029] In one embodiment, the loss function is constructed according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1, and the graph convolutional neural network model is trained according to the loss function to obtain a trained graph convolutional neural network model, including:
[0030] The loss function is constructed according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1. The loss function is:
[0031]
[0032] in, represents the roadside parking flow data predicted by each of the video devices at time t+1, y represents the roadside parking flow data captured by each of the video devices at time t+1, and m represents the number of the video devices;
[0033] The graph convolutional neural network model is trained according to the loss function to obtain the trained graph convolutional neural network model.
[0034] The present application provides a video device roadside parking flow prediction system, comprising:
[0035] a data acquisition module, configured to acquire a device position data set of a plurality of video devices and a roadside parking flow record set captured by the plurality of video devices, wherein the device position data set includes a device position of each of the video devices and a position distance between each of the video devices, and the roadside parking flow record set includes roadside parking flow data captured by each of the video devices;
[0036] A node construction module, used for constructing nodes of graph structure data according to device positions of the plurality of video devices;
[0037] A graph structure data generating module, configured to construct edges of the graph structure data according to the distance relationship between the position distances of the respective video devices and the correlation relationship between the roadside parking flow data captured by the respective video devices, and to form the graph structure data according to the nodes of the graph structure data and the edges of the graph structure data;
[0038] A graph convolutional neural network model building module is used to input the roadside parking flow data captured by each of the video devices at time t into the graph convolutional neural network model based on the graph structure data, and output the roadside parking flow data predicted by each of the video devices at time t+1;
[0039] A model training module, used to construct a loss function according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1, and perform model training on the graph convolutional neural network model according to the loss function to obtain a trained graph convolutional neural network model;
[0040] A prediction module is used to obtain the roadside parking flow data captured by the video device under test at time k, input the roadside parking flow data captured by the video device under test at time k into the trained graph convolutional neural network model, and obtain the roadside parking flow data predicted by the video device under test at time k+1.
[0041] In one embodiment, the graph structure data generation module includes:
[0042] A distance correlation weight calculation module, used to calculate the inverse of the position distance according to the position distance between any two of the video devices, so as to obtain the distance correlation weight between any two of the video devices;
[0043] A node distance correlation weight matrix acquisition module, used to obtain a node distance correlation weight matrix according to the distance correlation weight between any two of the video devices;
[0044] An entry and exit correlation weight calculation module, used to calculate the entry correlation weight and the exit correlation weight respectively by using the Pearson correlation coefficient calculation method according to the entry flow data and the exit flow data in the roadside parking flow data captured by any two of the video devices;
[0045] A node traffic correlation weight matrix acquisition module, used to obtain a node traffic correlation weight matrix according to the entry correlation weight and the exit correlation weight between any two of the video devices;
[0046] The node relationship matrix acquisition module is used to obtain a node relationship matrix according to the node distance correlation weight matrix and the node flow correlation weight matrix, wherein the node relationship matrix forms the edge of the graph structure data.
[0047] In one embodiment, the entry and exit correlation weight calculation module includes:
[0048] The admission correlation weight calculation module is used to calculate the admission correlation weight according to the admission flow data captured by any two of the video devices using the Pearson correlation coefficient calculation method, and the admission correlation weight is:
[0049]
[0050] in, represents the covariance of the entrance traffic data captured by any two of the video devices, represents the standard deviation of the admission flow data captured by any two of the video devices, x and y represent the admission flow data captured by any two of the video devices, n represents time in hours, and Respectively represent the mean values of the entrance traffic data captured by any two of the video devices;
[0051] The exit correlation weight calculation module is used to calculate the exit correlation weight according to the exit flow data captured by any two of the video devices using the Pearson correlation coefficient calculation method, and the exit correlation weight is:
[0052]
[0053] in, represents the covariance of the traffic data captured by any two video devices, represents the standard deviation of the exit flow data captured by any two of the video devices, x and y represent the exit flow data captured by any two of the video devices, n represents time in hours, and Respectively represent the mean value of the exit traffic data captured by any two of the video devices.
[0054] In one embodiment, the node relationship matrix acquisition module includes:
[0055] A first normalization module, used to normalize the node distance correlation weight matrix to obtain a normalized node distance correlation weight matrix;
[0056] A second normalization module, used to normalize the node flow correlation weight matrix to obtain a normalized node flow correlation weight matrix;
[0057] The weighted calculation module is used to perform weighted calculation on the normalized node distance correlation weight matrix and the normalized node flow correlation weight matrix to obtain the node relationship matrix.
[0058] In one embodiment, the model training module includes:
[0059] The loss function construction module is used to construct the loss function according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1, and the loss function is:
[0060]
[0061] in, represents the roadside parking flow data predicted by each of the video devices at time t+1, y represents the roadside parking flow data captured by each of the video devices at time t+1, and m represents the number of the video devices;
[0062] A parameter optimization module is used to perform model training on the graph convolutional neural network model according to the loss function to obtain the trained graph convolutional neural network model.
[0063] In the above-mentioned video device roadside parking flow prediction method and system, the device location data set of multiple video devices and the roadside parking flow record set captured by multiple video devices are obtained, the nodes of the graph structure data are constructed according to the device locations of the multiple video devices, and the edges of the graph structure data are jointly constructed according to the distance relationship between each video device and the correlation relationship between the roadside parking flow data, thereby further forming the graph structure data. The graph convolutional neural network model is trained based on the graph structure data, and the loss function is constructed according to the predicted output of the model to optimize the model parameters to form a trained graph convolutional neural network model. Furthermore, the roadside parking flow data of the video device to be tested at the next moment is predicted based on the trained graph convolutional neural network model.
[0064] Through the roadside parking flow prediction method using video equipment provided in this application, graph structure data is constructed based on the historical roadside parking flow data set, and a graph convolutional neural network is constructed for model learning to predict the roadside parking flow in the future, thereby more effectively promoting the prediction and management of traffic flow, and is conducive to the analysis of the parking demand in the region and the parking flow statistics in different time periods, which has important reference value for promoting the number of parking spaces when installing high-position video technology in other regions. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a schematic diagram of the steps of the method for predicting roadside parking flow using video equipment provided in this application.
[0066] Figure 2 It is a structural diagram of the video equipment roadside parking flow prediction system provided in this application. DETAILED DESCRIPTION
[0067] The technical solution of the present application is further described in detail below through the accompanying drawings and embodiments.
[0068] See also Figure 1 The present application provides a method for predicting roadside parking flow using a video device, comprising:
[0069] S10, obtaining a device position data set of a plurality of video devices and a roadside parking flow record set captured by the plurality of video devices, wherein the device position data set includes a device position of each video device and a position distance between each video device, and the roadside parking flow record set includes roadside parking flow data captured by each video device;
[0070] S20, constructing nodes of graph structure data according to device positions of multiple video devices;
[0071] S30, constructing edges of graph structure data according to the distance relationship between the position distances of the respective video devices and the correlation relationship between the roadside parking flow data captured by the respective video devices, and forming graph structure data according to the nodes of the graph structure data and the edges of the graph structure data;
[0072] S40, based on the graph structure data, inputting the roadside parking flow data captured by each video device at time t into the graph convolutional neural network model, and outputting the roadside parking flow data predicted by each video device at time t+1;
[0073] S50, constructing a loss function according to the roadside parking flow data predicted by each video device at time t+1 and the roadside parking flow data captured by each video device at time t+1, and performing model training on the graph convolutional neural network model according to the loss function to obtain a trained graph convolutional neural network model;
[0074] S60, obtaining the roadside parking flow data captured by the video device under test at time k, inputting the roadside parking flow data captured by the video device under test at time k into the trained graph convolutional neural network model, and obtaining the roadside parking flow data predicted by the video device under test at time k+1.
[0075] In this embodiment, in S10, the device location data set of multiple video devices and the captured roadside parking flow record set can be a data set obtained in a certain time period of a certain area. For example: a certain area corresponds to multiple video devices, each video device covers 5 to 20 parking spaces, and the specific location of each video device and the distance between each video are obtained to form a device location data set. The roadside parking flow records captured by each video device in the four time periods of 6:00 to 12:00, 12:00 to 18:00, 18:00 to 24:00, and 24:00 to 6:00 form a roadside parking flow record set. The roadside parking flow record set can be all flow data in one of the four time periods. The video device roadside parking flow prediction method provided in this application can be predicted for a certain time period or for the entire time period. The division of time periods can be adjusted according to the peak period of the actual roadside parking flow, and can be set according to actual conditions. Multiple video devices can be high-position video devices. The roadside parking flow record set includes the number of vehicles captured by each video device, the vehicle entry time of each vehicle, vehicle information (such as license plate number, vehicle color, model, etc.), the parking space number where the vehicle enters the venue, the number of the high-position video device that records the entry process, the vehicle exit time, vehicle information (such as license plate number, vehicle color, model, etc.), the parking space number where the vehicle is parked before exiting the venue, and the number of the high-position video device that records the exit process.
[0076] In S20, the positions of all high-position video devices within a certain area are used as nodes of the graph structure data. The distance range of a certain area can be set to 500 square meters or 1000 square meters, etc., and the specific range can be adjusted according to the actual density of high-position video devices. The installation scenarios of high-position video devices can be divided into roadside parallel scenarios, roadside vertical parking scenarios, roadside oblique parking scenarios, etc., which can be adjusted according to actual conditions. The device positions of each video device form the nodes of the graph structure data.
[0077] In S30, the position distance between each video device reflects the position relationship between each node in the graph structure data. The position distance can be understood as the distance between the positions of any two video devices. The correlation relationship between the roadside parking flow data captured by each video device can be established by the number of vehicles captured by each video device. The relationship between each high-level video device is described by the distance relationship and the correlation relationship between each video device, forming the edge E of the graph structure data. The edge E of the graph structure data can be represented by the distance between each high-level video device and the correlation between the roadside parking flow data captured by each high-level video device. The edge E of the graph structure data can be expressed in the form of a matrix, and can be specifically represented as A. park=α1E dis +α2E cor . E dis The distance relationship matrix, E, represents the location distances between various video devices. cor The matrix represents the correlation relationship between each video device, and α1 and α2 represent the weights between different relationship matrices. The edge E of the graph structure data is constructed through the distance relationship between the position distances of each video device and the correlation relationship between the roadside parking flow data captured by each video device. Thus, the graph structure data G is formed according to the node N of the graph structure data and the edge E of the graph structure data. park (N,E).
[0078] In S40, the graph structure data G park (N, E) represents the data relationship between various video devices. Based on the graph structure data, various video devices are connected to each other. Based on the historical data, they influence each other and refer to each other, forming an overall graph structure. park (N,E) can learn the data relationship between each video device. By inputting the roadside parking flow data captured by each video device at time t into the graph convolutional neural network model, the roadside parking flow data predicted by each video device at time t+1 can be predicted. Time t and time t+1 can also be understood as the current time and the next time.
[0079] The graph convolutional neural network includes multiple convolutional layers, nonlinear activation layers, etc. The nonlinear activation layer includes but is not limited to the use of nonlinear activation functions such as ReLu. The graph convolutional neural network (GCN) is a type of graph neural network (GNN), which is mainly used to process unstructured data, such as graph structured data formed by data between multiple video devices. In this application, multiple high-position video devices in a certain area are used as nodes of the graph structure, and the relationship between the roadside parking flow data captured by each high-position video device is used as the edge between each node to form a graph structured data. Through the powerful graph structured data learning ability of the graph convolutional neural network model, the prediction of roadside parking flow can be realized.
[0080] In S50, the loss function of the graph convolutional neural network model is constructed by the prediction results and actual results of the graph convolutional neural network model, and the model is continuously trained to finally obtain a trained graph convolutional neural network model, which can be used to predict the roadside parking flow at the next moment.
[0081] In S60, the video device to be tested can be understood as a device for predicting roadside parking flow. The video device to be tested is in the same area as each video device and belongs to a node of the graph structure data. The trained graph convolutional neural network model is used to predict the roadside parking flow. According to historical data, a graph convolution model is constructed for the device location data set of high-position video devices in a certain time period in a certain area and the roadside parking flow record set to predict the roadside parking flow data in the same time period in the same area in the future. In one embodiment, when predicting roadside parking flow, it may be affected by unexpected situations such as weather conditions, holiday traffic conditions, and whether there are traffic accidents. The graph convolutional neural network model of the present application can be further optimized according to the parking flow data under special circumstances, and is suitable for predicting parking flow under special circumstances.
[0082] The method for predicting roadside parking flow of video devices provided in the present application obtains a device location data set of multiple video devices and a roadside parking flow record set captured by multiple video devices, constructs nodes of graph structure data according to the device locations of multiple video devices, and jointly constructs edges of graph structure data according to the distance relationship between each video device and the correlation relationship between roadside parking flow data, thereby further forming graph structure data. The graph convolutional neural network model is trained based on the graph structure data, and a loss function is constructed to optimize the model parameters based on the predicted output of the model to form a trained graph convolutional neural network model. Furthermore, the roadside parking flow data of the video device to be tested at the next moment is predicted based on the trained graph convolutional neural network model.
[0083] Through the roadside parking flow prediction method using video equipment provided in this application, graph structure data is constructed based on the historical roadside parking flow data set, and a graph convolutional neural network is constructed for model learning to predict the roadside parking flow in the future, thereby more effectively promoting the prediction and management of traffic flow, and is conducive to the analysis of the parking demand in the region and the parking flow statistics in different time periods, which has important reference value for promoting the number of parking spaces when installing high-position video technology in other regions.
[0084] In one embodiment, S30, constructing edges of graph structure data according to the distance relationship between the position distances of the respective video devices and the correlation relationship between the roadside parking flow data captured by the respective video devices, and forming graph structure data according to the nodes of the graph structure data and the edges of the graph structure data, including:
[0085] S310, calculating the inverse of the position distance according to the position distance between any two video devices, and obtaining the distance correlation weight between any two video devices;
[0086] S320, obtaining a node distance correlation weight matrix according to the distance correlation weights between any two video devices;
[0087] S330, according to the entry flow data and the exit flow data in the roadside parking flow data captured by any two video devices, respectively calculate the entry correlation weight and the exit correlation weight by using the Pearson correlation coefficient calculation method;
[0088] S340, obtaining a node traffic correlation weight matrix according to an entry correlation weight and an exit correlation weight between any two video devices;
[0089] S350, obtaining a node relationship matrix according to the node distance correlation weight matrix and the node flow correlation weight matrix, wherein the node relationship matrix forms the edge of the graph structure data.
[0090] In this embodiment, in S310 and S320, for the distance between each video device, it is defined that the closer the distance is, the closer the relationship between each high-position video device is, and the farther the distance is, the weaker the relationship is. The inverse of the position distance is used as the distance correlation weight between any two video devices. Distance represents the distance between two video devices. According to the distance correlation weight E between any two video devices in each video device dis , we can form a node distance correlation weight matrix. Node distance correlation weight matrix A dis for:
[0091]
[0092] In S330 and S340, the correlation between the roadside parking flow data between each high-position video device can be obtained based on the roadside parking data records within a certain time range in the past, and the specific records are divided into entry flow data and exit flow data. The entry flow data includes the number of entry vehicles captured by each video device, the vehicle entry time of each vehicle, vehicle information (such as license plate number, vehicle color, model, etc.), the parking space number where the vehicle enters the venue, and the high-position video device number that records the entry process. The exit flow data includes the number of exit vehicles captured by each video device, the vehicle exit time of each vehicle, vehicle information (such as license plate number, vehicle color, model, etc.), the parking space number where the vehicle is parked before exiting, and the high-position video device number that records the exit process. The entry correlation weight and exit correlation weight between any two high-position video devices are represented by using the Pearson correlation coefficient. According to the entry correlation weight between any two high-position video devices, an entry correlation weight matrix can be formed. According to the exit correlation weight between any two high-position video devices, an exit correlation weight matrix can be formed. Add the entry correlation weight matrix and the exit correlation weight matrix to obtain the node traffic correlation weight matrix A cor The Pearson coefficient is a method to measure similarity, and the output range is -1 to +1, where 0 represents no correlation, negative values represent negative correlation, and positive values represent positive correlation.
[0093] According to the node distance correlation weight matrix A dis Weight matrix A related to node traffic cor , we can get the node relationship matrix A park =α1A dis +α2A cor , the node relationship matrix forms the edge E of the graph structure data. The node relationship matrix fully integrates the distance relationship between each high-level video device and the data relationship of the entrance and exit flow, so that each node of the graph data structure is connected to each other and affects each other.
[0094] In one embodiment, S330, according to the entry flow data and the exit flow data in the roadside parking flow data captured by any two video devices, the entry correlation weight and the exit correlation weight are calculated respectively by using the Pearson correlation coefficient calculation method, including:
[0095] S331, according to the admission flow data captured by any two video devices, the admission correlation weight is calculated by using the Pearson correlation coefficient calculation method, and the admission correlation weight is:
[0096]
[0097] in, represents the covariance of the incoming traffic data captured by any two video devices, represents the standard deviation of the admission flow data captured by any two video devices, x and y represent the admission flow data captured by any two video devices, and n represents the time in hours. and They represent the mean of the entrance traffic data captured by any two video devices;
[0098] S332, according to the exit flow data captured by any two video devices, the exit correlation weight is calculated by using the Pearson correlation coefficient calculation method, and the exit correlation weight is:
[0099]
[0100] in, represents the covariance of the traffic data captured by any two video devices, represents the standard deviation of the exit flow data captured by any two video devices, x and y represent the exit flow data captured by any two video devices, and n represents the time in hours. and They represent the mean of the outbound traffic data captured by any two video devices.
[0101] In this embodiment, during the calculation of the entry correlation weight, x and y respectively represent the entry flow data captured by any two video devices. When calculating the Pearson correlation coefficient, x and y respectively represent the number of vehicles entering the entry flow data captured by any two video devices. and They represent the mean of the number of vehicles entering the venue captured by any two video devices in a period of time in a region. For example, if the number of vehicles entering the venue captured by video device a in a period of time is x, and the number of vehicles entering the venue captured by video device b in a period of time is y, the mean of the number of vehicles entering the venue captured by video device a in a period of time is b The average number of vehicles entering the venue captured by the video device in a period of time is
[0102] The vehicle entry time, vehicle information (such as license plate number, vehicle color, model, etc.), the parking space number where the vehicle enters the venue, and the number of the high-position video device that records the entry process of each vehicle; the vehicle exit time, vehicle information (such as license plate number, vehicle color, model, etc.), the parking space number where the vehicle is parked before exiting the venue, and the number of the high-position video device that records the exit process of each vehicle are auxiliary information of the vehicle and the Pearson correlation coefficient is not calculated.
[0103] Therefore, the entry correlation weight and exit correlation weight between any two video devices are added together, that is, E in_cor With Eout_cor Add to obtain the node traffic correlation E between any two video devices cor According to the node traffic correlation E between any two video devices cor , and obtain the node traffic correlation weight matrix. The node traffic correlation weight matrix is
[0104]
[0105] Thus, according to the node distance correlation weight matrix A dis Weight matrix A related to node traffic cor Get the node relationship matrix A park =α1A dis +α2A cor .
[0106] In one embodiment, S350, a node relationship matrix is obtained according to the node distance correlation weight matrix and the node flow correlation weight matrix, and the node relationship matrix forms an edge of the graph structure data, including:
[0107] S351, normalizing the node distance correlation weight matrix to obtain a normalized node distance correlation weight matrix;
[0108] S352, normalizing the node flow correlation weight matrix to obtain a normalized node flow correlation weight matrix;
[0109] S353, performing weighted calculation on the normalized node distance correlation weight matrix and the normalized node flow correlation weight matrix to obtain a node relationship matrix.
[0110] In this embodiment, since the representation units of the node distance correlation weight matrix and the node flow correlation weight matrix are different, the node distance correlation weight matrix and the node flow correlation weight matrix are normalized respectively, and the two normalized weight matrices are weighted calculated according to the importance of different weights to obtain the node relationship matrix.
[0111] The normalization method may adopt the min-max normalization method or the Z-score normalization method. In the min-max normalization method, the minimum value in the matrix is subtracted from each value in the node distance correlation weight matrix or the node flow correlation weight matrix, and then divided by (maximum value - minimum value). In this embodiment, the method for normalizing the node distance correlation weight matrix or the node flow correlation weight matrix is not limited.
[0112] In one embodiment, S40, based on the graph structure data, the roadside parking flow data captured by each video device at time t is input into the graph convolutional neural network model, and the roadside parking flow data predicted by each video device at time t+1 is output, including:
[0113] S410, construct a graph convolutional neural network model, the graph convolutional neural network model is:
[0114]
[0115] Among them, X in I t , O t They represent the inbound and outbound traffic data captured by each video device at time t, A represents the node relationship matrix of the graph structure data, ReLU() represents the nonlinear activation function, represents the first layer of graph convolutional neural network, W (0) represents the learning parameters of the first layer of graph convolutional neural network, W (1) represents the learning parameters of the second-layer graph convolutional neural network, softmax() represents the normalization function, represents the adjacency matrix of each video device, I represents the identity matrix of each video device, represents the degree matrix.
[0116] In this embodiment, Z represents a graph convolutional neural network model. A represents a node relationship matrix of graph structure data, that is, the node relationship matrix A in the above embodiment. park Node relationship matrix A park It represents the relationship between each node. The adjacency matrix of each video device can be obtained according to the node relationship matrix of the graph structure data. The adjacency matrix of each video device represents the matrix of the adjacent relationship between each video device, and can also be understood as a matrix representing the adjacent relationship between a video device and other adjacent video devices. The adjacency matrix of each video device can be obtained through the unit matrix, degree matrix and node relationship matrix of each video device. I represents the unit matrix of each video device, and the relationship between each video device itself can be added. Represents the degree matrix, which is a diagonal matrix. The data on the diagonal are the sum of the relationship matrices of each video device with all other video devices. For example: the degree matrix for:
[0117] E1 0 0
[0118] 0 E2 0
[0119] 0 0 E3
[0120] E1 represents the sum of the relationship matrices of the first video device and other video devices, E2 represents the sum of the relationship matrices of the second video device and other video devices, E3 represents the sum of the relationship matrices of the third video device and other video devices, and so on.
[0121] In one embodiment, S50, a loss function is constructed according to the roadside parking flow data predicted by each video device at time t+1 and the roadside parking flow data captured by each video device at time t+1, and a graph convolutional neural network model is trained according to the loss function to obtain a trained graph convolutional neural network model, including:
[0122] S510: construct a loss function based on the roadside parking flow data predicted by each video device at time t+1 and the roadside parking flow data captured by each video device at time t+1. The loss function is:
[0123]
[0124] in, represents the roadside parking flow data predicted by each video device at time t+1, y represents the roadside parking flow data captured by each video device at time t+1, and m represents the number of video devices;
[0125] S520, performing model training on the graph convolutional neural network model according to the loss function to obtain a trained graph convolutional neural network model.
[0126] In this embodiment, m represents the number of video devices, which can also be understood as the number of samples in the training sample set. The loss function uses the L2 norm loss function to train the model, and the L2 norm loss function is also called the lowest square error loss function. The goal of the loss function is to minimize the sum of squares. By adjusting the parameters of the graph convolutional neural network, the loss function is minimized, and the optimal network parameters are finally obtained. According to the optimal network parameters, a trained graph convolutional neural network model can be obtained. According to the trained graph convolutional neural network model, the roadside parking flow data predicted by the video device to be tested at time k+1 is predicted.
[0127] See also Figure 2The present application provides a video device roadside parking flow prediction system 100. The video device roadside parking flow prediction system 100 includes a data acquisition module 10, a node construction module 20, a graph structure data generation module 30, a graph convolutional neural network model construction module 40, a model training module 50 and a prediction module 60. The data acquisition module 10 is used to obtain a device position data set of multiple video devices and a roadside parking flow record set captured by multiple video devices. The device position data set includes the device position of each video device and the position distance between each video device. The roadside parking flow record set includes the roadside parking flow data captured by each video device. The node construction module 20 is used to construct nodes of the graph structure data according to the device positions of multiple video devices.
[0128] The graph structure data generation module 30 is used to construct the edges of the graph structure data according to the distance relationship between the position distances of each video device and the correlation relationship between the roadside parking flow data captured by each video device, and form the graph structure data according to the nodes of the graph structure data and the edges of the graph structure data. The graph convolutional neural network model construction module 40 is used to input the roadside parking flow data captured by each video device at time t into the graph convolutional neural network model based on the graph structure data, and output the roadside parking flow data predicted by each video device at time t+1. The model training module 50 is used to construct a loss function according to the roadside parking flow data predicted by each video device at time t+1 and the roadside parking flow data captured by each video device at time t+1, and perform model training on the graph convolutional neural network model according to the loss function to obtain a trained graph convolutional neural network model. The prediction module 60 is used to obtain the roadside parking flow data captured by the video device under test at time k, input the roadside parking flow data captured by the video device under test at time k into the trained graph convolutional neural network model, and obtain the roadside parking flow data predicted by the video device under test at time k+1.
[0129] In this embodiment, the relevant description of the data acquisition module 10 may refer to the relevant description of S10 in the above embodiment. The relevant description of the node construction module 20 may refer to the relevant description of S20 in the above embodiment. The relevant description of the graph structure data generation module 30 may refer to the relevant description of S30 in the above embodiment. The relevant description of the graph convolutional neural network model construction module 40 may refer to the relevant description of S40 in the above embodiment. The relevant description of the model training module 50 may refer to the relevant description of S50 in the above embodiment. The relevant description of the prediction module 60 may refer to the relevant description of S60 in the above embodiment.
[0130] In one embodiment, the graph structure data generation module 30 includes a distance correlation weight calculation module, a node distance correlation weight matrix acquisition module, an entry and exit correlation weight calculation module, a node flow correlation weight matrix acquisition module, and a node relationship matrix acquisition module. The distance correlation weight calculation module is used to calculate the inverse of the position distance according to the position distance between any two video devices, and obtain the distance correlation weight between any two video devices. The node distance correlation weight matrix acquisition module is used to obtain the node distance correlation weight matrix according to the distance correlation weight between any two video devices.
[0131] The entry and exit correlation weight calculation module is used to calculate the entry correlation weight and exit correlation weight respectively according to the entry flow data and exit flow data in the roadside parking flow data captured by any two video devices using the Pearson correlation coefficient calculation method. The node flow correlation weight matrix acquisition module is used to obtain the node flow correlation weight matrix according to the entry correlation weight and exit correlation weight between any two video devices. The node relationship matrix acquisition module is used to obtain the node relationship matrix according to the node distance correlation weight matrix and the node flow correlation weight matrix, and the node relationship matrix forms the edge of the graph structure data.
[0132] In this embodiment, the relevant description of the distance correlation weight calculation module can refer to the relevant description of S310 in the above embodiment. The relevant description of the node distance correlation weight matrix acquisition module can refer to the relevant description of S320 in the above embodiment. The relevant description of the entry and exit correlation weight calculation module can refer to the relevant description of S330 in the above embodiment. The relevant description of the node flow correlation weight matrix acquisition module can refer to the relevant description of S340 in the above embodiment. The relevant description of the node relationship matrix acquisition module can refer to the relevant description of S350 in the above embodiment.
[0133] In one embodiment, the entry and exit correlation weight calculation module includes an entry correlation weight calculation module and an exit correlation weight calculation module. The entry correlation weight calculation module is used to calculate the entry correlation weight using the Pearson correlation coefficient calculation method according to the entry flow data captured by any two video devices. The entry correlation weight is:
[0134]
[0135] in, represents the covariance of the incoming traffic data captured by any two video devices, represents the standard deviation of the admission flow data captured by any two video devices, x and y represent the admission flow data captured by any two video devices, and n represents the time in hours. and They represent the mean of the entrance traffic data captured by any two video devices.
[0136] The exit correlation weight calculation module is used to calculate the exit correlation weight based on the exit flow data captured by any two video devices using the Pearson correlation coefficient calculation method. The exit correlation weight is:
[0137]
[0138] in, represents the covariance of the traffic data captured by any two video devices, represents the standard deviation of the exit flow data captured by any two video devices, x and y represent the exit flow data captured by any two video devices, and n represents the time in hours. and They represent the mean of the outbound traffic data captured by any two video devices.
[0139] In this embodiment, the description of the entry correlation weight calculation module can refer to the description of S331 in the above embodiment. The description of the exit correlation weight calculation module can refer to the description of S332 in the above embodiment.
[0140] In one embodiment, the node relationship matrix acquisition module includes a first normalization module, a second normalization module and a weighted calculation module. The first normalization module is used to normalize the node distance correlation weight matrix to obtain a normalized node distance correlation weight matrix. The second normalization module is used to normalize the node flow correlation weight matrix to obtain a normalized node flow correlation weight matrix. The weighted calculation module is used to perform weighted calculation on the normalized node distance correlation weight matrix and the normalized node flow correlation weight matrix to obtain a node relationship matrix.
[0141] In this embodiment, the relevant description of the first normalization module can refer to the relevant description of S351 in the above embodiment. The relevant description of the second normalization module can refer to the relevant description of S352 in the above embodiment. The relevant description of the weighted calculation module can refer to the relevant description of S353 in the above embodiment.
[0142] In one embodiment, the graph convolutional neural network model construction module 40 includes a model generation module. The model generation module is used to construct a graph convolutional neural network model, and the graph convolutional neural network model is:
[0143]
[0144] Among them, X in I t , O tThey represent the inbound and outbound traffic data captured by each video device at time t, A represents the node relationship matrix of the graph structure data, ReLU() represents the nonlinear activation function, represents the first layer of graph convolutional neural network, W (0) represents the learning parameters of the first layer of graph convolutional neural network, W (1) represents the learning parameters of the second-layer graph convolutional neural network, softmax() represents the normalization function, represents the adjacency matrix of each video device, I represents the identity matrix of each video device, represents the degree matrix.
[0145] In this embodiment, the relevant description of the model generation module may refer to the relevant description of S410 in the above embodiment.
[0146] In one embodiment, the model training module 50 includes a loss function construction module and a parameter optimization module. The loss function construction module is used to construct a loss function based on the roadside parking flow data predicted by each video device at time t+1 and the roadside parking flow data captured by each video device at time t+1. The loss function is:
[0147]
[0148] in, represents the roadside parking flow data predicted by each video device at time t+1, y represents the roadside parking flow data captured by each video device at time t+1, and m represents the number of video devices.
[0149] The parameter optimization module is used to train the graph convolutional neural network model according to the loss function to obtain a trained graph convolutional neural network model.
[0150] In this embodiment, the relevant description of the loss function construction module can refer to the relevant description of S510 in the above embodiment. The relevant description of the parameter optimization module can refer to the relevant description of S520 in the above embodiment.
[0151] In the above-mentioned various embodiments, the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims provide the elements of various steps in an exemplary order and are not intended to be limited to a specific order or hierarchy.
[0152] Those skilled in the art may also understand that the various illustrative logical blocks, modules and steps listed in the embodiments of the present application may be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly demonstrate the interchangeability of hardware and software, the various illustrative components, modules and steps described above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present application.
[0153] The various illustrative logic blocks or modules described in the embodiments of the present application can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or the design of any combination of the above functions. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any traditional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
[0154] The steps of the method or algorithm described in the embodiments of the present application can be directly embedded in the software module executed by the hardware, the processor, or a combination of the two. The software module can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Alternatively, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a user terminal. Optionally, the processor and the storage medium can also be arranged in different components in the user terminal.
[0155] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A method for predicting roadside parking flow using video equipment, characterized in that: include: Acquire a device position data set of a plurality of video devices and a roadside parking flow record set captured by the plurality of video devices, wherein the device position data set includes a device position of each of the video devices and a position distance between each of the video devices, and the roadside parking flow record set includes roadside parking flow data captured by each of the video devices; Constructing nodes of graph structure data according to device positions of the plurality of video devices; Constructing edges of the graph structure data according to the distance relationship between the position distances of the respective video devices and the correlation relationship between the roadside parking flow data captured by the respective video devices, and forming the graph structure data according to the nodes of the graph structure data and the edges of the graph structure data; Based on the graph structure data, the roadside parking flow data captured by each of the video devices at time t is input into the graph convolutional neural network model, and the roadside parking flow data predicted by each of the video devices at time t+1 is output; Constructing a loss function according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1, and performing model training on the graph convolutional neural network model according to the loss function to obtain a trained graph convolutional neural network model; Obtaining the roadside parking flow data captured by the video device under test at time k, inputting the roadside parking flow data captured by the video device under test at time k into the trained graph convolutional neural network model, and obtaining the roadside parking flow data predicted by the video device under test at time k+1; The step of constructing the edge of the graph structure data according to the distance relationship between the position distances of the respective video devices and the correlation relationship between the roadside parking flow data captured by the respective video devices, and forming the graph structure data according to the nodes of the graph structure data and the edges of the graph structure data includes: According to the position distance between any two of the video devices, the inverse of the position distance is calculated to obtain a distance correlation weight between any two of the video devices; According to the distance correlation weights between any two of the video devices, obtaining a node distance correlation weight matrix; According to the entry flow data and the exit flow data in the roadside parking flow data captured by any two of the video devices, the entry correlation weight and the exit correlation weight are calculated respectively by using the Pearson correlation coefficient calculation method; Obtaining a node traffic correlation weight matrix according to the entry correlation weight and the exit correlation weight between any two of the video devices; A node relationship matrix is obtained according to the node distance correlation weight matrix and the node flow correlation weight matrix, and the node relationship matrix forms the edge of the graph structure data.
2. The method for predicting roadside parking flow using video equipment according to claim 1, characterized in that: The method of calculating the entry correlation weight and the exit correlation weight respectively using the Pearson correlation coefficient calculation method according to the entry flow data and the exit flow data in the roadside parking flow data captured by any two of the video devices includes: According to the admission flow data captured by any two of the video devices, the admission correlation weight is calculated using the Pearson correlation coefficient calculation method, and the admission correlation weight is: in, represents the covariance of the entrance traffic data captured by any two of the video devices, represents the standard deviation of the admission flow data captured by any two of the video devices, x and y represent the admission flow data captured by any two of the video devices, n represents time in hours, and Respectively represent the mean values of the entrance traffic data captured by any two of the video devices; According to the exit flow data captured by any two of the video devices, the exit correlation weight is calculated using the Pearson correlation coefficient calculation method, and the exit correlation weight is: in, represents the covariance of the exit traffic data captured by any two of the video devices; represents the standard deviation of the exit flow data captured by any two of the video devices, x and y represent the exit flow data captured by any two of the video devices, n represents time in hours, and Respectively represent the mean value of the exit traffic data captured by any two of the video devices.
3. The method for predicting roadside parking flow using video equipment according to claim 2, characterized in that: The step of obtaining a node relationship matrix according to the node distance correlation weight matrix and the node flow correlation weight matrix, wherein the node relationship matrix forms an edge of the graph structure data, includes: Normalizing the node distance correlation weight matrix to obtain a normalized node distance correlation weight matrix; Normalizing the node flow correlation weight matrix to obtain a normalized node flow correlation weight matrix; The normalized node distance correlation weight matrix and the normalized node flow correlation weight matrix are weightedly calculated to obtain the node relationship matrix.
4. The method for predicting roadside parking flow using video equipment according to claim 1, characterized in that: The step of constructing a loss function according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1, and training the graph convolutional neural network model according to the loss function to obtain a trained graph convolutional neural network model includes: The loss function is constructed according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1. The loss function is: in, represents the roadside parking flow data predicted by each of the video devices at time t+1, y represents the roadside parking flow data captured by each of the video devices at time t+1, and m represents the number of the video devices; The graph convolutional neural network model is trained according to the loss function to obtain the trained graph convolutional neural network model.
5. A video equipment roadside parking flow prediction system, characterized in that: include: a data acquisition module, configured to acquire a device position data set of a plurality of video devices and a roadside parking flow record set captured by the plurality of video devices, wherein the device position data set includes a device position of each of the video devices and a position distance between each of the video devices, and the roadside parking flow record set includes roadside parking flow data captured by each of the video devices; A node construction module, used for constructing nodes of graph structure data according to device positions of the plurality of video devices; A graph structure data generating module, configured to construct edges of the graph structure data according to the distance relationship between the position distances of the respective video devices and the correlation relationship between the roadside parking flow data captured by the respective video devices, and to form the graph structure data according to the nodes of the graph structure data and the edges of the graph structure data; A graph convolutional neural network model building module is used to input the roadside parking flow data captured by each of the video devices at time t into the graph convolutional neural network model based on the graph structure data, and output the roadside parking flow data predicted by each of the video devices at time t+1; A model training module, used to construct a loss function according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1, and perform model training on the graph convolutional neural network model according to the loss function to obtain a trained graph convolutional neural network model; A prediction module, used to obtain the roadside parking flow data captured by the video device under test at time k, input the roadside parking flow data captured by the video device under test at time k into the trained graph convolutional neural network model, and obtain the roadside parking flow data predicted by the video device under test at time k+1; The graph structure data generation module includes: A distance correlation weight calculation module, used to calculate the inverse of the position distance according to the position distance between any two of the video devices, so as to obtain the distance correlation weight between any two of the video devices; A node distance correlation weight matrix acquisition module, used to obtain a node distance correlation weight matrix according to the distance correlation weight between any two of the video devices; An entry and exit correlation weight calculation module, used to calculate the entry correlation weight and the exit correlation weight respectively by using the Pearson correlation coefficient calculation method according to the entry flow data and the exit flow data in the roadside parking flow data captured by any two of the video devices; A node traffic correlation weight matrix acquisition module, used to obtain a node traffic correlation weight matrix according to the entry correlation weight and the exit correlation weight between any two of the video devices; The node relationship matrix acquisition module is used to obtain a node relationship matrix according to the node distance correlation weight matrix and the node flow correlation weight matrix, wherein the node relationship matrix forms the edge of the graph structure data.
6. The video equipment roadside parking flow prediction system according to claim 5, characterized in that: The entry and exit correlation weight calculation module includes: The admission correlation weight calculation module is used to calculate the admission correlation weight according to the admission flow data captured by any two of the video devices using the Pearson correlation coefficient calculation method, and the admission correlation weight is: in, represents the covariance of the entrance traffic data captured by any two of the video devices, represents the standard deviation of the admission flow data captured by any two of the video devices, x and y represent the admission flow data captured by any two of the video devices, n represents time in hours, and Respectively represent the mean values of the entrance traffic data captured by any two of the video devices; The exit correlation weight calculation module is used to calculate the exit correlation weight according to the exit flow data captured by any two of the video devices using the Pearson correlation coefficient calculation method, and the exit correlation weight is: in, represents the covariance of the exit traffic data captured by any two of the video devices; represents the standard deviation of the exit flow data captured by any two of the video devices, x and y represent the exit flow data captured by any two of the video devices, n represents time in hours, and Respectively represent the mean value of the exit traffic data captured by any two of the video devices.
7. The video equipment roadside parking flow prediction system according to claim 6, characterized in that: The node relationship matrix acquisition module includes: A first normalization module, used to normalize the node distance correlation weight matrix to obtain a normalized node distance correlation weight matrix; A second normalization module, used to normalize the node flow correlation weight matrix to obtain a normalized node flow correlation weight matrix; The weighted calculation module is used to perform weighted calculation on the normalized node distance correlation weight matrix and the normalized node flow correlation weight matrix to obtain the node relationship matrix.
8. The video equipment roadside parking flow prediction system according to claim 5, characterized in that: The model training module includes: The loss function construction module is used to construct the loss function according to the roadside parking flow data predicted by each of the video devices at time t+1 and the roadside parking flow data captured by each of the video devices at time t+1, and the loss function is: in, represents the roadside parking flow data predicted by each of the video devices at time t+1, y represents the roadside parking flow data captured by each of the video devices at time t+1, and m represents the number of the video devices; A parameter optimization module is used to perform model training on the graph convolutional neural network model according to the loss function to obtain the trained graph convolutional neural network model.