Method, system and device for predicting traffic flow abnormal behavior and medium

By classifying traffic flow data into multiple types according to temporal characteristics and fusing and optimizing them using convolutional neural networks and residual networks, the network degradation problem in traffic flow prediction in existing technologies is solved, and accurate prediction in both temporal and spatial dimensions is achieved.

CN121787617APending Publication Date: 2026-04-03JIANGXI VANDT COLLEGE OF COMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies cannot accurately predict traffic flow simultaneously in both time and space dimensions, and are prone to network degradation, leading to inaccurate prediction results.

Method used

By categorizing traffic flow data into multiple types based on temporal characteristics, fusing them using matrix addition, extracting spatial features using a convolutional neural network, constructing an optimized residual network, adding a noise processing module, training a traffic flow prediction model, removing noise, and making predictions.

Benefits of technology

It achieves accurate traffic flow prediction in both time and space dimensions, avoids network degradation, and improves the accuracy of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121787617A_ABST
    Figure CN121787617A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow abnormal behavior prediction method, system and device and a medium, and relates to the technical field of traffic prediction, and the method comprises the steps: carrying out the fusion of traffic flow data under a plurality of time features through matrix addition, and obtaining the fusion traffic flow data under the time features; inputting the fused traffic flow data under the time features into a spatial feature extraction model trained by a convolutional neural network to obtain space-time traffic flow data having the time features and spatial features at the same time; inputting the space-time traffic flow data into a traffic flow prediction model, removing noise in the data through a noise processing module, and inputting the noise-removed data into a residual network to obtain traffic flow prediction data with time characteristics and space characteristics at the same time; and determining the traffic flow abnormal behavior according to the prediction result. According to the invention, traffic flow prediction in time and space dimensions can be realized, and an accurate prediction result can be obtained at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic prediction technology, and in particular to a method, system, device, and medium for predicting abnormal traffic flow behavior. Background Technology

[0002] With continued economic development, urban traffic conditions are becoming increasingly worrying. Timely traffic flow forecasting and road condition monitoring can help alleviate congestion by addressing pedestrian and vehicle traffic in advance, preventing abnormal traffic behaviors such as unnatural gatherings and congestion.

[0003] In existing technologies, traditional machine learning methods can construct various linear or nonlinear models to predict traffic flow. These methods include nearest neighbor algorithms, support vector machines, integrated moving average autoregressive models, Bayesian algorithms, and clustering. Deep learning methods can extract spatial features from traffic flow data, largely solving the difficulty of spatial feature extraction in traffic flow prediction. However, traffic flow data is highly variable, exhibiting diverse behavior in both time and spatial dimensions. Traditional traffic flow prediction methods can only predict traffic flow on time-series or spatial data individually, failing to simultaneously consider both temporal and spatial dimensions. Furthermore, existing models improve experimental accuracy by increasing neural network depth, which easily leads to gradient vanishing, gradient exploding, and network degradation problems, resulting in less than ideal experimental results.

[0004] In summary, the methods described above cannot achieve traffic flow prediction in both time and space dimensions while avoiding inaccurate prediction results caused by network degradation. Summary of the Invention

[0005] This invention provides a method, system, device, and medium for predicting abnormal traffic flow behavior, which can solve the problem in the prior art that it is impossible to predict traffic flow in both time and space dimensions while avoiding inaccurate prediction results caused by network degradation.

[0006] This invention provides a method for predicting abnormal traffic flow behavior, comprising the following steps: collecting urban traffic flow data and dividing it into multiple time-specific traffic flow data; fusing the traffic flow data under multiple time-specific features by matrix addition to obtain fused traffic flow data under time-specific features; training a convolutional neural network using historical traffic flow data to extract spatial features, thereby obtaining a spatial feature extraction model; inputting the fused traffic flow data under time-specific features into the spatial feature extraction model to obtain spatiotemporal traffic flow data with both time and spatial features; adding a noise processing module to the residual network to construct an optimized residual network; training the optimized residual network using historical traffic flow data to predict traffic flow, thereby obtaining a traffic flow prediction model; inputting the spatiotemporal traffic flow data with both time and spatial features into the traffic flow prediction model, removing noise from the spatiotemporal traffic flow data with both time and spatial features using the noise processing module, and inputting the noise-removed spatiotemporal traffic flow data with both time and spatial features into the residual network to obtain traffic flow prediction data with both time and spatial features; and determining abnormal traffic flow behavior based on the traffic flow prediction data with both time and spatial features.

[0007] Furthermore, the specific steps of fusing traffic flow data under multiple time characteristics by matrix addition include: acquiring adjacent traffic flow data, periodic traffic flow data, and trend traffic flow data, and generating matrices with consistent dimensions for each; stacking the adjacent traffic flow data matrix, periodic traffic flow data matrix, and trend traffic flow data matrix according to the depth of the matrix.

[0008] Furthermore, the specific steps for obtaining the traffic flow prediction model include: adding two fully connected layers and two RelU activation functions to the residual network to handle noise and optimize it; the residual unit consists of convolution operations, RelU functions, skip connections, and ADD fusion; preprocessing historical traffic flow data and dividing the data into training set, validation set, and test set; inputting the training set into the optimized residual network, training the optimized residual network using the backpropagation algorithm, and validating it using the validation set; and evaluating the model using the evaluation function RMSE based on the test set to obtain the traffic flow prediction model.

[0009] Furthermore, determining abnormal traffic flow behavior specifically includes: when there are high values ​​in the traffic flow prediction data that simultaneously have temporal and spatial characteristics, it indicates that the traffic is congested in the time and space corresponding to that value.

[0010] This invention provides a system for predicting abnormal traffic flow behavior, comprising:

[0011] The data acquisition module is used to divide the traffic flow data of the collected city into traffic flow data under various time characteristics according to time.

[0012] The spatiotemporal data acquisition module is used to fuse traffic flow data under multiple time features by matrix addition to obtain fused traffic flow data under time features; to train a convolutional neural network using historical traffic flow data to extract spatial features to obtain a spatial feature extraction model; and to input the fused traffic flow data under time features into the spatial feature extraction model to obtain spatiotemporal traffic flow data that has both time and spatial features.

[0013] The abnormal behavior prediction module adds a noise processing module to the residual network to construct an optimized residual network. It trains the optimized residual network using historical traffic flow data to predict traffic flow, thus obtaining a traffic flow prediction model. Spatiotemporal traffic flow data with both temporal and spatial characteristics is input into the traffic flow prediction model. The noise processing module removes noise from this data, and the noise-removed data is then input into the residual network to obtain traffic flow prediction data with both temporal and spatial characteristics. Based on this traffic flow prediction data, abnormal traffic flow behaviors are determined.

[0014] This invention provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor executes the computer program to implement the above-described method for predicting abnormal traffic flow behavior.

[0015] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for predicting abnormal traffic flow behavior.

[0016] This invention provides a method, system, device, and medium for predicting abnormal traffic flow behavior. Compared with the prior art, its advantages are as follows:

[0017] Traffic flow data is categorized into multiple data types based on different temporal characteristics. These traffic flow data types are then fused using matrix addition to obtain fused traffic flow data with the same temporal characteristics. A convolutional neural network is trained using historical traffic flow data to extract spatial features, resulting in a spatial feature extraction model. This fused traffic flow data with temporal characteristics is then input into the spatial feature extraction model to obtain spatiotemporal traffic flow data that simultaneously possesses both temporal and spatial features. A noise processing module is added to the residual network to construct an optimized residual network. This optimized residual network is then trained using historical traffic flow data to predict traffic flow, resulting in a traffic flow prediction model. Finally, the spatiotemporal traffic flow data with both temporal and spatial features is input into the traffic flow prediction model to obtain predicted traffic flow data that simultaneously possesses both temporal and spatial features.

[0018] This method distinguishes traffic flow data according to temporal and spatial characteristics to obtain spatiotemporal traffic flow data that simultaneously possesses both temporal and spatial features. Then, a traffic flow prediction model containing a residual network that can avoid network degradation is used to obtain accurate prediction results. This achieves traffic flow prediction in both temporal and spatial dimensions while avoiding inaccurate prediction results caused by network degradation. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of a convolutional neural network extracting spatial features according to an embodiment of the present invention;

[0020] Figure 2 This is a schematic diagram of data resampling for extracting time features provided in an embodiment of the present invention;

[0021] Figure 3 The residual network provided in the embodiments of the present invention;

[0022] Figure 4 A technical roadmap for predicting abnormal traffic flow behavior provided in embodiments of the present invention. Detailed Implementation

[0023] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0024] This invention provides a method for predicting abnormal traffic flow behavior, comprising the following steps:

[0025] Step 1: Collect traffic flow data from the city and categorize it into traffic flow data with various time characteristics.

[0026] Step 2: Merge traffic flow data under multiple time features by matrix addition to obtain fused traffic flow data under time features. Train a convolutional neural network using historical traffic flow data to extract spatial features, thus obtaining a spatial feature extraction model; input the fused traffic flow data under time features into the spatial feature extraction model to obtain spatiotemporal traffic flow data that simultaneously possesses both time and spatial features.

[0027] Step 3: Add a noise processing module to the residual network to construct an optimized residual network; train the optimized residual network using historical traffic flow data to predict traffic flow, thus obtaining a traffic flow prediction model; input spatiotemporal traffic flow data with both temporal and spatial characteristics into the traffic flow prediction model, remove noise from the spatiotemporal traffic flow data using the noise processing module, and input the noise-removed spatiotemporal traffic flow data with both temporal and spatial characteristics into the residual network to obtain traffic flow prediction data with both temporal and spatial characteristics. Identify abnormal traffic flow behaviors based on the traffic flow prediction data with both temporal and spatial characteristics.

[0028] The specific implementation steps are as follows:

[0029] 1. Extraction of temporal and spatial features from spatiotemporal data.

[0030] Based on real urban traffic flow data (vehicle GPS data), the data is initially processed to form a traffic flow matrix. The spatiotemporal data is obtained after processing this traffic flow data. Traffic flow data can be acquired along a time axis, such as obtaining all GPS traffic data from March to June. This data exhibits periodicity and a certain regularity, possessing temporal characteristics. Traffic flow changes between different areas of the city are closely related; for example, traffic flow out of street A is related to traffic flow into street B, and traffic flow into a cinema is related to traffic flow out of a subway station. This characteristic constitutes the spatial nature of the data.

[0031] Based on the characteristics of the above data, processing the spatiotemporal features of traffic flow data is a key aspect of constructing a traffic flow prediction model, utilizing convolutional neural networks (such as...) Figure 1 (As shown) is used to process spatial characteristics, resampling the obtained traffic data and dividing it into three parts: proximity, periodicity, and trend (e.g.) Figure 2 (As shown) can be used to process time characteristics.

[0032] 2. Deep residual optimization using artificial neural networks.

[0033] Residual networks can specifically address a series of problems caused by excessive network depth. The residual network used in this study is composed of concatenated residual units, which include convolutional operations (CNN), ReLU functions, skip connections, and ADD fusion. This achieves both feature extraction and model optimization. Its specific optimization construction is as follows: Figure 3 As shown.

[0034] 3. Construction of a traffic flow analysis and prediction model based on machine learning and deep learning.

[0035] A spatiotemporal data prediction model based on residual analysis was constructed for traffic flow prediction. To better extract both spatial and temporal features from the spatiotemporal data, the model classifies and packages the data into three parts: proximity spatiotemporal data, periodic spatiotemporal data, and trend spatiotemporal data, to extract temporal features. The packaged data are then processed using a Convolutional Neural Network (CNN) to extract spatial features from the spatiotemporal dataset. The spatiotemporal data after initial convolution are fused through matrix addition (Fusion), facilitating centralized training and optimization of the entire model while simplifying it. The model is optimized using a ResNet (ResDurative Network), where the residual network consists of concatenated residual units. The residual unit structure used in this project comprises convolutional operations, ReLU functions, skip connections, and ADD (Additional Derivatives). To make the prediction results closer to reality, noise (such as rain, holidays, and news) was added to predict future traffic flow. The noise processing involves two fully connected layers and two ReLU functions. The model is trained using Python as the development tool, and performs operations such as neural network stacking and layer skipping on the Keras architecture.

[0036] 4. Simulation and testing of traffic flow detection technology.

[0037] Based on research on traffic flow detection models using traditional machine learning and deep learning, a new and optimized algorithm model was proposed to develop a traffic flow prediction simulation program. This program was then tested and compared with other traditional models at the system level.

[0038] like Figure 4 As shown, this illustrates the framework of the research approach.

[0039] The formulas (1) for convolutional neural networks and (2) for residual networks are as follows:

[0040]

[0041] F(x)=H(x)+x (2)

[0042] Regarding convolution, * indicates convolution calculation, W is the convolution kernel, and X is the input. If X is a two-dimensional input matrix, then W is also a two-dimensional matrix; if X is a multidimensional tensor, then W is also a multidimensional tensor. Regarding residuals, if we take X as input, then F(X) is the output. F(x) represents a series of calculations within the residual, which can be convolution kernels, ReLU functions, etc.

[0043] In the constructed model, we divide the obtained traffic flow data into three categories: proximity traffic flow data, periodic traffic flow data, and trend traffic flow data. All of these categories share the same dimension. Where m and n are the number of rows and columns of the city after division, and K is the number of data collections. The data collection method is shown in formulas (3)(4)(5), T x <T y <T z After obtaining the three data sets, the data is fused using a depth-based stacking method (the length and width dimensions of the three data sets are consistent). The fused data is then fed into convolutional and residual units to train the prediction model. The data to be predicted is the traffic flow data M corresponding to time t.

[0044]

[0045] The innovation of this invention lies in:

[0046] (1) Improvement and innovation of algorithms: By applying neural network algorithms in deep learning at multiple levels and from multiple angles, a traffic flow spatiotemporal data prediction model with multiple algorithms is formed, which can effectively capture the temporal and spatial features of spatiotemporal data and overcome the problem of complex multidimensional feature extraction of temporal and spatial features of spatiotemporal data.

[0047] (2) Innovation of optimization method: This invention utilizes the advantages of residual network in handling deep problems of neural network and introduces it into the model for optimization. It can effectively avoid the network degradation problem caused by too many network layers and fill the technical defect of inaccurate prediction due to network depth in the research direction of traffic flow prediction.

[0048] (3) Innovation of the research platform: This invention uses the programming language Python and the deep learning platform Keras to implement regional traffic flow prediction based on deep learning.

[0049] This invention project is mainly used to study the detection of abnormal traffic behavior in spatiotemporal traffic flow data, and to use traffic flow prediction technology to mine the real-time traffic flow distribution in various urban areas. The specific research objectives are as follows:

[0050] (1) By cleaning and preprocessing traffic flow data, a spatiotemporal data matrix library is constructed, and feature extraction of both time and space dimensions of spatiotemporal data is achieved.

[0051] (2) Introduce residual networks for optimization to solve network degradation problems such as gradient vanishing caused by excessive network depth.

[0052] (3) Construct a traffic flow spatiotemporal data prediction model based on convolutional neural network (CNN) and residual network (ResNet) to predict the traffic flow of each local area in the next time slice, and then achieve anomaly detection through the prediction results, thereby bringing positive effects to traffic management and epidemic prevention and control.

[0053] This invention provides a system for predicting abnormal traffic flow behavior, comprising:

[0054] The data acquisition module is used to categorize the traffic flow data collected from the city into traffic flow data under various time characteristics.

[0055] The spatiotemporal data acquisition module is used to fuse traffic flow data under multiple time features by matrix addition to obtain fused traffic flow data under time features; to train a convolutional neural network using historical traffic flow data to extract spatial features to obtain a spatial feature extraction model; and to input the fused traffic flow data under time features into the spatial feature extraction model to obtain spatiotemporal traffic flow data with both time and spatial features.

[0056] The abnormal behavior prediction module adds a noise processing module to the residual network to construct an optimized residual network. It trains the optimized residual network using historical traffic flow data to predict traffic flow, thus obtaining a traffic flow prediction model. Spatiotemporal traffic flow data with both temporal and spatial characteristics is input into the traffic flow prediction model. The noise processing module removes noise from this data, and the noise-removed data is then input into the residual network to obtain traffic flow prediction data with both temporal and spatial characteristics. Based on this traffic flow prediction data, abnormal traffic flow behaviors are determined.

[0057] This invention provides a computer device, including: a memory and a processor; the memory stores a computer program, and the processor executes the computer program to implement the steps of a method for predicting abnormal traffic flow behavior.

[0058] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a method for predicting abnormal traffic flow behavior.

[0059] A specific example is as follows:

[0060] The experiment included data cleaning (removing incomplete data), data standardization (mapping data to the range [-1,1]), data collection and packaging (proximity, periodicity, trend), and setting experimental parameters (learning rate, etc.).

[0061] First, the obtained traffic flow data is preprocessed to obtain spatiotemporal data with temporal and spatial characteristics. Next, this data is cleaned and standardized, and then collected and packaged. Finally, the resulting data is input into the constructed traffic flow prediction model to train the model. The model's data processing includes three parts:

[0062] (1) Divide the data into three parts: proximity, periodicity, and trend, to extract the time characteristics of the data.

[0063] (2) After the data is extracted for time features, it is input into a convolutional neural network to extract the spatial features of the data again.

[0064] (3) The traffic flow data after spatiotemporal feature extraction is input into the residual network to optimize the model, making the model sufficiently deep. The model is learned and trained using the backpropagation algorithm to achieve optimal model performance. The loss function for training is MSE, and the function for evaluating the model on the test set is RMSE. After the model is learned and trained, it can be used to predict future traffic flow data.

[0065] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for predicting abnormal traffic flow behavior, characterized in that, Includes the following steps: The collected urban traffic flow data is divided into traffic flow data under various time characteristics according to time. Traffic flow data under multiple time characteristics are fused by matrix addition to obtain fused traffic flow data under different time characteristics. Historical traffic flow data is used to train a convolutional neural network to extract spatial features, thus obtaining a spatial feature extraction model. The fused traffic flow data with temporal features is then input into the spatial feature extraction model to obtain spatiotemporal traffic flow data that simultaneously possesses both temporal and spatial features. A noise processing module is added to the residual network to construct an optimized residual network; the optimized residual network is trained using historical traffic flow data to predict traffic flow, thereby obtaining a traffic flow prediction model; spatiotemporal traffic flow data with both temporal and spatial characteristics is input into the traffic flow prediction model, and noise is removed from the spatiotemporal traffic flow data with both temporal and spatial characteristics through the noise processing module. The noise-removed spatiotemporal traffic flow data with both temporal and spatial characteristics is then input into the residual network to obtain traffic flow prediction data with both temporal and spatial characteristics. Identify abnormal traffic flow behavior based on traffic flow prediction data that simultaneously possesses temporal and spatial characteristics.

2. The method for predicting abnormal traffic flow behavior as described in claim 1, characterized in that, The process of fusing traffic flow data under multiple time characteristics through matrix addition includes the following steps: Acquire proximity traffic flow data, periodic traffic flow data, and trend traffic flow data, and generate matrices with consistent dimensions for each. Stack the proximity traffic flow data matrix, periodic traffic flow data matrix, and trend traffic flow data matrix according to the depth of the matrix.

3. The method for predicting abnormal traffic flow behavior as described in claim 1, characterized in that, The specific steps for obtaining the traffic flow prediction model include: Two fully connected layers and two RelU activation functions are added to the residual network to handle noise and optimize it; the residual unit is composed of convolution operation, ReLU function, skip layer connection and ADD fusion. Historical traffic flow data is preprocessed and divided into training, validation, and test sets. The training set is input into the optimized residual network, the backpropagation algorithm is used to train the optimized residual network, and the network is validated using the validation set. Based on the test set, the model is evaluated using the evaluation function RMSE to obtain the traffic flow prediction model.

4. The method for predicting abnormal traffic flow behavior as described in claim 1, characterized in that, The determination of abnormal traffic flow behavior specifically includes: when there are high values ​​in the traffic flow prediction data that have both time and space characteristics, it indicates that the traffic is congested in the time and space corresponding to that value.

5. A system for predicting abnormal traffic flow behavior, characterized in that, include: The data acquisition module is used to divide the traffic flow data of the collected city into traffic flow data under various time characteristics according to time. The spatiotemporal data acquisition module is used to fuse traffic flow data under multiple time features by matrix addition to obtain fused traffic flow data under time features; to train a convolutional neural network using historical traffic flow data to extract spatial features to obtain a spatial feature extraction model; and to input the fused traffic flow data under time features into the spatial feature extraction model to obtain spatiotemporal traffic flow data that has both time and spatial features. The abnormal behavior prediction module adds a noise processing module to the residual network to construct an optimized residual network. It trains the optimized residual network using historical traffic flow data to predict traffic flow, thus obtaining a traffic flow prediction model. Spatiotemporal traffic flow data with both temporal and spatial characteristics is input into the traffic flow prediction model. The noise processing module removes noise from this data, and the noise-removed data is then input into the residual network to obtain traffic flow prediction data with both temporal and spatial characteristics. Based on this traffic flow prediction data, abnormal traffic flow behaviors are determined.

6. A computer device, comprising: Memory and processor; The memory stores a computer program, characterized in that when the processor executes the computer program, it implements a method for predicting abnormal traffic flow behavior according to any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements a method for predicting abnormal traffic flow behavior as described in any one of claims 1 to 4.