An interpretable traffic cognition method based on fuzzy theory

By introducing fuzzy theory and graph convolutional neural networks into intelligent transportation systems, and combining fuzzy inference mechanisms and gated recurrent units, the problem of low interpretability of deep learning models is solved, and the spatiotemporal characteristics and external attribute features of traffic data are effectively captured, thereby improving the accuracy and transparency of traffic cognition.

CN115796017BActive Publication Date: 2026-03-03HUNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing intelligent transportation cognition methods based on statistical models or deep learning models suffer from low interpretability and cannot effectively capture the interaction between the spatiotemporal characteristics and external attribute features of traffic data, thus limiting their application in fields with high safety requirements.

Method used

An interpretable traffic cognition method based on fuzzy theory is adopted, which combines fuzzy inference mechanism and graph convolutional neural network model. The influence of external attributes on traffic data is extracted through fuzzy rules and graph convolution operations, and the spatiotemporal features are processed by gated recurrent units to construct fuzzy membership function for fuzzy classification.

Benefits of technology

It improves the interpretability of the model and the transparency of traffic data processing, enabling it to more accurately capture the interaction between the spatiotemporal characteristics and external attribute features of traffic data, thereby enhancing the accuracy and safety of traffic cognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115796017B_ABST
    Figure CN115796017B_ABST
Patent Text Reader

Abstract

The application relates to an interpretable traffic cognition method based on fuzzy theory and belongs to the technical field of artificial intelligence. Real-time traffic data of a traffic scene is organized into an external attribute feature matrix, a traffic cognition feature matrix and an adjacency matrix. The preprocessed external attribute feature matrix is sent into a fuzzy reasoning mechanism, and an attribute influence feature matrix is output after feature calculation. The matrix, the traffic cognition feature matrix and the adjacency matrix are input into a graph convolutional neural network, and then input into a time characteristic capturing network based on a gated recurrent unit. Finally, a prediction result is output and used for attribute influence fuzzy classification and traffic cognition. The application can efficiently extract time and space dependence characteristics between multiple roads in a traffic scene, has higher traffic data cognition performance and interpretability, and solves the problems of low transparency, poor interpretability of a deep neural network and insufficient consideration of external attribute features of a traffic scene in a traffic cognition process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an interpretable traffic cognition method based on fuzzy theory, belonging to the fields of intelligent transportation, fuzzy logic, and artificial intelligence. Background Technology

[0002] In recent years, intelligent transportation systems (ITS) have been gradually shifting from perceptual intelligence to cognitive intelligence. Intelligent transportation cognition is a type of research that provides decision-making assistance to ITS, aiming to make better travel decisions, reduce traffic congestion, and improve traffic operation efficiency. Methods of cognitive intelligent transportation include traffic perception-based decision-making, traffic flow prediction, traffic speed prediction, route planning, driving behavior analysis, and traffic decision support. ITS utilizes roadside sensors (such as induction loops, radar, and cameras) to achieve intelligent perception and acquire traffic data. By further analyzing and inferring flow data, traffic data, and traffic conditions, researchers can improve the cognitive capabilities of ITS and ultimately alleviate traffic pressure. Although a large number of researchers have focused on ITS research, the interpretability of intelligent transportation cognition and its methods remains unresolved. Traditional traffic cognition methods are based on statistical models that utilize traffic data patterns for cognitive work. However, because statistical models oversimplify complex and stochastic traffic scenarios, their cognitive performance is poor. With the development of deep learning, researchers have begun using deep neural networks such as LSTM and convolutional neural networks to understand traffic. However, these models only consider the temporal or spatial characteristics of traffic data, without simultaneously considering its spatiotemporal characteristics. Researchers then attempted to combine temporal and spatial capture models to capture the spatiotemporal characteristics of traffic data. However, due to the black-box nature of these models, their interpretability is low, limiting their application in fields with high safety requirements. The introduction of visualization methods has improved the interpretability of deep learning models, but the interpretability provided by these methods is still low and does not improve the interpretability of the model itself. Therefore, this invention proposes an interpretable traffic cognition method based on fuzzy theory, which can effectively improve the overall interpretability of the model and solve the problem that the processing of deep learning models is invisible to developers.

[0003] Furthermore, by introducing a fuzzy inference mechanism, some external characteristic attributes in traffic scenarios, such as weather, holidays, time periods, and traffic congestion indices, are considered in the traffic cognition process. Therefore, how to express the impact of external attribute features on traffic data and how to capture the interaction relationships between different attribute features are also innovations of this patent. This patent constructs some fuzzy rules based on expert experience, allowing external attribute features to act on the traffic cognition process under the guidance of expert experience, thus solving the problem of low transparency in deep learning models. Traditional traffic cognition methods focus on the impact of historical traffic data on current traffic data, but this impact can vary greatly in different traffic scenarios. Therefore, a traffic cognition process that considers the impact of external attributes is more accurate than simply focusing on historical traffic data. This invention incorporates different external attribute features to further analyze the impact of attribute features on traffic data, fully explore the relationship between attribute features and traffic data, and utilizes the coefficient of determination to achieve more effective traffic cognition. Finally, based on the fuzziness, randomness, and subjectivity of the classification criteria of attribute feature impact, fuzzy set theory is introduced to further construct fuzzy membership functions and perform fuzzy classification on the extracted impact features, constructing three types of fuzzy sets: those with small impact, those with medium impact, and those with large impact. Summary of the Invention

[0004] To address the aforementioned problems, this invention proposes an interpretable traffic cognition method based on fuzzy theory. "Interpretable" means that the processing steps of the method can be presented to developers in a simple and easy-to-understand manner. This concept was proposed by researchers in the field of deep learning to address the black-box nature of deep learning models and to improve their interpretability. In this invention, it is achieved by embedding a fuzzy inference mechanism into the deep learning model. Since the fuzzy rules in the fuzzy inference mechanism can be directly expressed semantically, this patented method is therefore considered interpretable.

[0005] The fuzzy inference mechanism designed in this invention can effectively capture the impact of attribute features on traffic data, as well as the interaction relationships between different attribute features. The constructed fuzzy rules improve the overall interpretability of the model. In the traffic data processing part, a graph convolutional neural model and gated recurrent units are proposed to solve the problem of capturing the spatiotemporal characteristics of traffic data. Utilizing the characteristic that different attribute features have different impacts on traffic data, attribute influence features are constructed, and fuzzy theory is introduced to perform fuzzy classification of the influence features.

[0006] This invention is achieved through the following technical solution, including the following steps:

[0007] Step 1: An input data processing algorithm combining fuzzy inference mechanism and graph convolutional neural network model:

[0008] It includes historical data describing all roads in a traffic scenario, an adjacency matrix describing the interaction characteristics between roads, a traffic congestion index describing external characteristics, time periods, holidays, weather, traffic flow changes, and an interpretable traffic data cognition algorithm.

[0009] Step 2: Design of the graph convolutional neural network model structure incorporating fuzzy inference mechanism, including three parts:

[0010] The first part is a fuzzy inference mechanism based on fuzzy theory, which consists of fuzzy membership functions, fuzzy rules, and defuzzification functions, and can effectively extract the influence of external attributes on traffic data. The traffic cognitive feature tensor, composed of traffic data tensor and traffic congestion index tensor, is combined with the output of the first part as the input data of the second part of the model.

[0011] The second part is a graph convolutional neural network, which can directly perform graph convolution operations on traffic cognition-related tensors; the graph convolutional neural network can extract the spatial correlation between road traffic data more efficiently; the output of the second part is used as spatial features and input into the third part of the network;

[0012] The third part is a deep neural network based on gated recurrent units. This network further processes spatial features to extract temporal features. The spatiotemporal features are finally processed into predicted traffic data and used for subsequent traffic cognition work.

[0013] Step 3: Train the graph convolutional neural network model;

[0014] This includes setting the appropriate model parameters and training environment, and training the model.

[0015] Step 4: Conduct multi-class traffic cognition experiments based on the trained model;

[0016] Step 5: Construct attribute influence description features based on traffic cognition experiment results;

[0017] Step 6: Perform fuzzy classification of attribute influence based on influence description features.

[0018] The input data in step 1 is specifically defined as follows:

[0019] Step 1.1: Historical traffic data and predicted traffic data for all roads in the predicted traffic scenario:

[0020] Let X be the historical road data matrix for the traffic scenario. traffic It consists of traffic data from τ historical time steps:

[0021]

[0022] The traffic data at each time step is as follows: It consists of traffic data from N roads in a traffic scenario at time t, where N is the number of roads. S represents t Let N×1 be a vector, and all elements of the vector are real numbers;

[0023] Let X′ be the prediction data matrix for the traffic scenario. traffic It consists of traffic data from T prediction time steps:

[0024]

[0025] The traffic data format for each time step is the same as the historical traffic data, where τ is the historical time step, T is the predicted time step, and N is the number of roads. This indicates that the size of the matrix is ​​T×N, where all elements are real numbers;

[0026] The problem of traffic data prediction is formatted as: X′ traffic =f(X) traffic );

[0027] Traffic data refers to data that describes traffic scenarios and has spatiotemporal characteristics, including traffic speed, traffic flow, and traffic congestion.

[0028] Step 1.2: Adjacency matrix describing the interaction features between roads:

[0029] An undirected graph G = {V, E} is used to describe the connectivity of roads in a traffic scenario, and the set of nodes V is represented as V = {v1, v2, ..., v...}. N}, where N is the number of roads in the traffic scenario;

[0030] When roads are interconnected, the edges representing the road interactions should be connected; therefore, the edge set E is represented as E = {v...} i v j |1≤i≤N,1≤j≤N}, where v i v j This indicates that there is a connection between node i and node j;

[0031] The element-wise definition of adjacency matrix A is:

[0032]

[0033] This formula indicates that when nodes i and j are connected, the weight of the corresponding edge is 1; otherwise, it is 0. ij The size is N×N, where N is the number of roads;

[0034] Step 1.3: Feature matrix describing external attributes:

[0035] Let X be the feature matrix describing the external attributes. featureIncluding the traffic congestion index matrix X TTI Time period matrix X time Holiday Matrix X holiday Weather Matrix X weather Traffic flow change matrix X flowChange :

[0036] X feature ∈{X TTI ,X time ,X holiday ,X weather ,X flowChange},

[0037] Among them, the traffic congestion index matrix Calculated from historical traffic speeds, this indicates the degree of road congestion. τ represents the time step length, and N represents the number of roads in the traffic scenario. Let the matrix be of size τ×N, where all elements are real numbers. The formula for calculating the traffic congestion index is as follows:

[0038]

[0039] Where V free For free passage speed, V current Current speed;

[0040] Set up a time period matrix The element-level definition of a matrix is:

[0041]

[0042] Where [t] n ,t n+1 The data within a continuous time period exhibits similar patterns of change. In actual calculations, different time periods are represented by different positive integers, where τ represents the time step and N represents the number of roads. Let represent a matrix of size τ×N, where all elements are real numbers, ij indicates that the element is located in the i-th row and j-th column of the matrix, and n indicates that the 24 hours of a day are divided into n time periods;

[0043] Set up a holiday matrix The element-wise definition of a matrix is:

[0044]

[0045] This formula indicates when the date is a weekend or a public holiday. The value is 1 if the condition is not met, and 0 otherwise. τ represents the time step, and N represents the number of roads. Let represent a matrix of size τ×N, where all elements are real numbers, and ij indicates that the element is located in the i-th row and j-th column of the matrix;

[0046] Weather Matrix The element-wise definition of a matrix is:

[0047]

[0048] The weather conditions included in the weather matrix are represented as follows:

[0049] X weatherCondition ∈{sunny,cloudy,light rain,medium rain,heavy rain}

[0050] Different weather conditions are represented by different positive integers. The same weather condition has a similar impact on traffic data. τ represents the time step, and N represents the road length. Let represent a matrix of size τ×N, where all elements are real numbers, and ij indicates that the element is located in the i-th row and j-th column of the matrix;

[0051] Set up a traffic flow change matrix The element-wise definition of a matrix is:

[0052]

[0053] Where [flow] k ,flow k+1 [ ] represents a continuous range of traffic flow changes, within which the changes in traffic flow have a similar impact on traffic data. τ represents the time step, and N represents the number of roads. The matrix is ​​of size τ×N, where all elements are real numbers, ij indicates that the element is located in the i-th row and j-th column of the matrix, and k indicates that the traffic flow change data is divided into k intervals;

[0054] Step 1.4, Interpretable Traffic Data Cognitive Algorithm:

[0055] In this invention, "interpretable" means that the model's data processing is presented to developers in a simple and easy-to-understand way. Specifically, the fuzzy rules in the fuzzy inference mechanism are represented by intuitive IF-THEN statements. The definitions of the four important fuzzy rules are as follows:

[0056] Fuzzy Rule 1: IF flowChange is zero AND time is seven THEN the effect is small

[0057] Fuzzy rule 2: IF flowChange is three AND time is seven THEN the effect is Lar ge

[0058] Fuzzy rule 3: IF holiday is a holiday AND time is nine THEN the effect is super lar ge

[0059] Fuzzy Rule 4: IF weather is foggy THEN the effect is middle

[0060] Fuzzy rule 1 indicates that when traffic flow changes are around 0 and the time is between 7:00 and 9:00, the impact on traffic data is small. Fuzzy rule 2 indicates that when traffic flow changes are around 30 and the time is between 7:00 and 9:00, the impact on traffic data is large. Fuzzy rule 3 indicates that when the date is a holiday and the time is between 9:00 and 11:00, the impact on traffic data is very large. Fuzzy rule 4 indicates that when the weather is foggy, the impact on traffic data is moderate. Numerical terms, adjectives, and nouns in the fuzzy rules, such as zero, seven, small, holiday, and foggy, represent a fuzzy interval after fuzzy partitioning, and the values ​​within the interval have similar characteristics. The high interpretability of fuzzy rules in the fuzzy inference system solves the black-box problem in deep learning models, i.e., the processing process is invisible, has low transparency, and poor security.

[0061] In step 2, the fuzzy reasoning mechanism based on fuzzy theory can handle multi-dimensional external attribute tensors and can interpretably extract the impact of external attributes on traffic data; the graph convolutional neural network can handle three-dimensional tensors and can more efficiently extract the spatial correlation between different roads in the traffic scene, and extract the temporal correlation between traffic data by combining the use of gated recurrent units.

[0062] Let the input matrix of the fuzzy inference mechanism be... From the external attribute matrix X time X holiday X weather ,

[0063] X flowChange Composition, defined as follows:

[0064] X fuzzy =ω1·X time +ω2·X holiday +ω3·X weather +ω4·X flowChange

[0065] Where ω1, ω2, ω3, and ω4 are the weights of the time period matrix, holiday matrix, weather matrix, and traffic flow change matrix, respectively, representing the degree of influence of different external attributes on traffic perception data. The larger the weight, the greater the influence on traffic perception data. τ represents the time step, and N represents the number of roads. This indicates a matrix of size τ×N, where all elements are real numbers;

[0066] Let the output matrix of the fuzzy inference system be... Its definition is as follows:

[0067]

[0068] Where m is the number of fuzzy rules, k is the number of Gaussian membership functions, and X fuzzy The three-dimensional feature matrix composed of external attribute matrices, μ i σ is the width of the i-th Gaussian membership function. i It is the center of the i-th Gaussian membership function; X Effect The elements in the array are signed numbers. The larger the absolute value of the value, the greater the influence of external attributes on traffic perception data. Positive numbers indicate the impact of increased traffic flow on traffic perception data, while negative numbers indicate the impact of decreased traffic flow on traffic perception data. This indicates the impact of external attributes on traffic perception data at time t. This indicates a matrix of size τ×N, where all elements are real numbers;

[0069] Suppose an attribute matrix related to traffic cognition By X traffic and X TTI Composition, defined as follows: X cognition =ω1·X traffic +ω2·X TTI

[0070] Where ω1 and ω2 are the traffic data matrix X traffic Traffic congestion index matrix X TTI The weights represent the degree of influence of historical traffic data and traffic congestion index on traffic perception data; the larger the weight, the greater the influence on traffic perception data. This indicates a matrix of size τ×N, where all elements are real numbers;

[0071] The output of the l-th layer in the convolutional neural network. Defined as:

[0072] C l+1 =σ(L sym C l W l )

[0073]

[0074] C0 = X,

[0075] Where L sym It is the normalized Laplacian operator, D is the degree matrix calculated from the adjacency matrix, and C is the normalized Laplacian operator. l+1 This is the output of the l-th convolutional layer, where A is the adjacency matrix describing the relationships between road nodes, X is the feature matrix describing traffic features and external attributes, and W... l This is the weight matrix of the l-th layer, using the ReLU non-linear activation function, where τ represents the time step and N represents the number of road nodes. This indicates a matrix of size τ×N, where all elements are real numbers;

[0076] After processing by a graph convolutional neural network, a spatial feature matrix is ​​generated. At this point, the spatial characteristics of the traffic cognitive data have been captured. The data is then input into a gated recurrent unit, where the gate is reset at time t. Update Gate and candidate hidden state The definition is as follows:

[0077] R t =σ(X) t W xr +H t-1 W hr +b r )

[0078] Z t =σ(X) t W xz +H t-1 W hz +b z )

[0079]

[0080] Where h is the number of hidden units, Let be the input features at time t, and P be the number of external feature attributes. It is the hidden state of the previous time step. These are the two weight matrices of the reset gate. It is the bias matrix of the reset gate. These are the two weight matrices of the update gate. This is the bias matrix of the update gate. The activation function used for both the reset and update gates is the sigmoid function. These are the two weight matrices of the candidate hidden states. This is the bias matrix of the candidate hidden state, and the activation function used for the candidate hidden state is the tanh function. Used to represent the size of each matrix, where all elements are real numbers;

[0081] The adjacency matrix and feature matrix, after passing through the graph convolutional layer and gated recurrent unit, generate predicted traffic data for subsequent traffic cognition work.

[0082] The training data in step 3 is set as follows:

[0083] The optimizer Adam is trained with a learning rate of 0.001, 64 gated recurrent units, a batch size of 32 (bat hsize), a time step of 12 for historical traffic cognition data, and the loss function is defined as follows:

[0084]

[0085] Where t f It is the prediction time step, Y pred It is predicted traffic data, Y true It is real traffic data;

[0086] The model was trained using the public dataset Los-loop and the real taxi dataset SZBZ near Shenzhen North Railway Station, and divided into training and test sets according to a certain ratio. A custom Dataloader object was used to encapsulate the data, intelligently iteratively process the input feature matrix, and output data tensors in the corresponding format to the model for training.

[0087] The various traffic cognition experiments in step 4 are set up as follows:

[0088] The first type of traffic cognition experiment aims to verify the impact of different external characteristic attributes on traffic data. It includes four different experimental settings: the first is that the input data consists only of historical traffic data; the second is that, in addition to the first setting, holiday data and weather data are added; the third is that, in addition to the second setting, time period data and traffic flow change data are added; and the fourth is that, in addition to the third setting, traffic congestion index data is added.

[0089] The second type of traffic cognition experiment was designed to verify the cognitive performance of the method over different time periods. It included three different experimental setups: the first was to predict traffic data for the next 10 minutes; the second was to predict traffic data for the next 30 minutes; and the third was to predict traffic data for the next 60 minutes.

[0090] The prediction results from these experimental setups will be used for subsequent traffic cognition work.

[0091] In step 5, attribute influence description features are constructed for the traffic prediction data. The influence of attributes on traffic data is directly reflected in the impact of this method on the accuracy of traffic prediction. Through different experimental settings in step 4, prediction data under these experimental settings were obtained; the coefficient of determination R... 2 It is used to measure prediction performance under different experimental settings, and is defined as follows:

[0092] Where Y t Based on real traffic data, For predicted traffic data, R represents the average of real traffic data, where n is the total number of traffic data points; 2 The value of is between 0 and 1. The closer it is to 1, the better the regression fit. This not only reflects the prediction performance of this method under different experimental settings, but also facilitates subsequent fuzzy classification work.

[0093] In step 6, the descriptive features are subjected to fuzzy classification of attribute influence, using the coefficient of determination R. 2 This study describes the impact of attribute features on traffic data prediction, fully considering the influence of attribute features within a traffic scenario context. Due to the fuzziness, randomness, and subjectivity of the classification criteria, fuzzy set theory is introduced to further classify the obtained influence features into three fuzzy sets: low impact, medium impact, and high impact. R0 2 The membership function μ is used to describe the degree to which a member belongs to these fuzzy sets; a Gaussian membership function is selected, and the threshold parameters λ1 and λ2 are determined heuristically.

[0094] The beneficial effects of this invention are as follows:

[0095] (1) The interpretable traffic cognition method based on fuzzy theory proposed in this invention can use a novel data processing fuzzy method to capture the influence of attribute features on traffic cognition and the interaction between different attribute features, thus solving the problem that traditional traffic cognition models cannot extract the interaction between different feature attributes.

[0096] (2) The fuzzy reasoning mechanism proposed in this invention makes up for the shortcomings of low interpretability and invisible processing of deep learning models.

[0097] (3) The present invention proposes to divide attribute features into external attribute features and traffic cognition-related attribute features for processing, which fully considers the influence of different types of attribute features on traffic cognition and adopts different processing methods for different types of attribute features, thereby improving the performance of the model in extracting the influence of attribute features.

[0098] (4) The graph convolutional neural network and gated recurrent network constructed in this invention take into account both the temporal and spatial characteristics of traffic cognitive data, thereby improving the model’s cognitive performance on traffic data.

[0099] (5) The impact features based on traffic data constructed in this invention fully consider the relationship between traffic data and the environment, and more comprehensively depict the traffic cognition process. It also introduces fuzzy sets to describe the fuzziness, randomness, and subjectivity of the classification criteria of the attribute impact.

[0100] (6) This invention provides a training method for a specific deep neural network model, the construction process of fuzzy rules in the fuzzy inference mechanism, relevant hyperparameters, and the implementation details of the model's internal structure. This ensures the accuracy and efficiency of model training and effectively avoids underfitting and overfitting during model training. Attached Figure Description

[0101] Figure 1 This is a structural diagram of the present invention.

[0102] Figure 2 This is a fuzzy inference mechanism used to capture the influence of attributes on features.

[0103] Figure 3 This is a graph convolutional neural network used to capture spatial features of traffic data.

[0104] Figure 4 The attribute influences the membership function of the fuzzy set. Detailed Implementation

[0105] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments and the accompanying drawings. It should be understood that these descriptions are merely exemplary and not intended to limit the scope of the invention. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concept of the invention; moreover, the technical features involved in the different embodiments of the invention described below can be combined with each other as long as they do not conflict with each other.

[0106] In this invention, "interpretable" refers to the ability to present the processing steps of a method in a simple and easy-to-understand manner to developers. This concept was proposed by researchers in the field of deep learning to address the black-box nature of deep learning models and to improve their interpretability. In this invention, it is achieved by embedding a fuzzy inference mechanism into the deep learning model. Since the fuzzy rules in the fuzzy inference mechanism can be directly expressed semantically, this patented method is called interpretable.

[0107] This invention includes the following steps:

[0108] Step 1: An input data processing algorithm combining fuzzy inference mechanism and graph convolutional neural network model:

[0109] It includes historical data describing all roads in a traffic scenario, an adjacency matrix describing the interaction characteristics between roads, a traffic congestion index describing external characteristics, time periods, holidays, weather, traffic flow changes, and an interpretable traffic data cognition algorithm.

[0110] The input data in step 1 is specifically defined as follows:

[0111] Step 1.1: Historical traffic data and predicted traffic data for all roads in the predicted traffic scenario:

[0112] Let X be the historical road data matrix for the traffic scenario. traffic It consists of traffic data from τ historical time steps:

[0113]

[0114] The traffic data at each time step is as follows: It consists of traffic data from N roads in a traffic scenario at time t, where N is the number of roads. S represents t Let N×1 be a vector, and all elements of the vector are real numbers;

[0115] Let X′ be the prediction data matrix for the traffic scenario. traffic It consists of traffic data from T prediction time steps:

[0116]

[0117] The traffic data format for each time step is the same as the historical traffic data, where τ is the historical time step, T is the predicted time step, and N is the number of roads. This indicates that the size of the matrix is ​​T×N, where all elements are real numbers;

[0118] The problem of traffic data prediction is formatted as: X′ traffic =f(X) traff );

[0119] Traffic data refers to data that describes traffic scenarios and has spatiotemporal characteristics, including traffic speed, traffic flow, and traffic congestion.

[0120] Step 1.2: Adjacency matrix describing the interaction features between roads:

[0121] An undirected graph G = {V, E} is used to describe the connectivity of roads in a traffic scenario, and the set of nodes V is represented as V =

[0122] {v1,v2,…,v N}, where N is the number of roads in the traffic scenario;

[0123] When roads are interconnected, the edges representing the road interactions should be connected; therefore, the edge set E is represented as E = {v...} i v j |1≤i≤N,1≤j≤N}, where v i v j This indicates that there is a connection between node i and node j;

[0124] The element-wise definition of adjacency matrix A is:

[0125]

[0126] This formula indicates that when nodes i and j are connected, the weight of the corresponding edge is 1; otherwise, it is 0. ij The size is N×N, where N is the number of roads;

[0127] Step 1.3: Feature matrix describing external attributes:

[0128] Let X be the feature matrix describing the external attributes. feature Including the traffic congestion index matrix X TTI Time period matrix X time Holiday Matrix X holiday Weather Matrix X weather Traffic flow change matrix X flowChange :

[0129] X feature ∈{X TTI ,X time ,X holiday ,X weather ,X flowChange},

[0130] Among them, the traffic congestion index matrix Calculated from historical traffic speeds, this indicates the degree of road congestion. τ represents the time step length, and N represents the number of roads in the traffic scenario. Let the matrix be of size τ×N, where all elements are real numbers. The formula for calculating the traffic congestion index is as follows:

[0131]

[0132] Where V free For free passage speed, V current Current speed;

[0133] Set up a time period matrix The element-wise definition of a matrix is:

[0134]

[0135] Where [t] n ,t n+1 The data within a continuous time period exhibits similar patterns of change. In actual calculations, different time periods are represented by different positive integers, where τ represents the time step and N represents the number of roads. Let represent a matrix of size τ×N, where all elements are real numbers, ij indicates that the element is located in the i-th row and j-th column of the matrix, and n indicates that the 24 hours of a day are divided into n time periods;

[0136] Set up a holiday matrix The element-wise definition of a matrix is:

[0137]

[0138] This formula indicates when the date is a weekend or a public holiday. The value is 1 if the condition is not met, and 0 otherwise. τ represents the time step, and N represents the number of roads. Let represent a matrix of size τ×N, where all elements are real numbers, and ij indicates that the element is located in the i-th row and j-th column of the matrix;

[0139] Weather Matrix The element-wise definition of a matrix is:

[0140]

[0141] The weather conditions included in the weather matrix are represented as follows:

[0142] X weatherCondition ∈{sunny,cloudy,light rain,medium rain,heavy rain}

[0143] Different weather conditions are represented by different positive integers. The same weather condition has a similar impact on traffic data. τ represents the time step, and N represents the road length. Let represent a matrix of size τ×N, where all elements are real numbers, and ij indicates that the element is located in the i-th row and j-th column of the matrix;

[0144] Set up a traffic flow change matrix The element-wise definition of a matrix is:

[0145]

[0146] Where [flow] k ,flow k+1[ ] represents a continuous range of traffic flow changes, within which the changes in traffic flow have a similar impact on traffic data. τ represents the time step, and N represents the number of roads. The matrix is ​​of size τ×N, where all elements are real numbers, ij indicates that the element is located in the i-th row and j-th column of the matrix, and k indicates that the traffic flow change data is divided into k intervals;

[0147] Step 1.4, Interpretable Traffic Data Cognitive Algorithm:

[0148] In this invention, "interpretable" means that the model's data processing is presented to developers in a simple and easy-to-understand way. Specifically, the fuzzy rules in the fuzzy inference mechanism are represented by intuitive IF-THEN statements. The definitions of the four important fuzzy rules are as follows:

[0149] Fuzzy Rule 1: IF flowChange is zero AND time is seven THEN the effect is small

[0150] Fuzzy rule 2: IF flowChange is three AND time is seven THEN the effect is large

[0151] Fuzzy rule 3: IF holiday is a holiday AND time is nine THEN the effect is super large

[0152] Fuzzy Rule 4: IF weather is foggy THEN the effect is middle

[0153] Fuzzy rule 1 indicates that when traffic flow changes are around 0 and the time is between 7:00 and 9:00, the impact on traffic data is small. Fuzzy rule 2 indicates that when traffic flow changes are around 30 and the time is between 7:00 and 9:00, the impact on traffic data is large. Fuzzy rule 3 indicates that when the date is a holiday and the time is between 9:00 and 11:00, the impact on traffic data is very large. Fuzzy rule 4 indicates that when the weather is foggy, the impact on traffic data is moderate. Numerical terms, adjectives, and nouns in the fuzzy rules, such as zero, seven, small, holiday, and foggy, represent a fuzzy interval after fuzzy partitioning, and the values ​​within the interval have similar characteristics. The high interpretability of fuzzy rules in the fuzzy inference system solves the black-box problem in deep learning models, i.e., the processing process is invisible, has low transparency, and poor security.

[0154] Step 2: Design of the graph convolutional neural network model structure incorporating fuzzy inference mechanism, including three parts:

[0155] The first part is a fuzzy inference mechanism based on fuzzy theory, which consists of fuzzy membership functions, fuzzy rules, and defuzzification functions, and can effectively extract the influence of external attributes on traffic data. The traffic cognitive feature tensor, composed of traffic data tensor and traffic congestion index tensor, is combined with the output of the first part as the input data of the second part of the model.

[0156] The second part is a graph convolutional neural network, which can directly perform graph convolution operations on traffic cognition-related tensors; the graph convolutional neural network can extract the spatial correlation between road traffic data more efficiently; the output of the second part is used as spatial features and input into the third part of the network;

[0157] The third part is a deep neural network based on gated recurrent units. This network further processes spatial features to extract temporal features. The spatiotemporal features are finally processed into predicted traffic data and used for subsequent traffic cognition work.

[0158] In step 2, the fuzzy reasoning mechanism based on fuzzy theory can handle multi-dimensional external attribute tensors and can interpretably extract the impact of external attributes on traffic data; the graph convolutional neural network can handle three-dimensional tensors and can more efficiently extract the spatial correlation between different roads in the traffic scene, and extract the temporal correlation between traffic data by combining the use of gated recurrent units.

[0159] Let the input matrix of the fuzzy inference mechanism be... From the external attribute matrix X time X holiday X weather X flowChange Composition, defined as follows:

[0160] X fuzzy =ω1·X time +ω2·X holiday +ω3·X weather +ω4·X flowChange

[0161] Where ω1, ω2, ω3, and ω4 are the weights of the time period matrix, holiday matrix, weather matrix, and traffic flow change matrix, respectively, representing the degree of influence of different external attributes on traffic perception data. The larger the weight, the greater the influence on traffic perception data. τ represents the time step, and N represents the number of roads. This indicates a matrix of size τ×N, where all elements are real numbers;

[0162] Let the output matrix of the fuzzy inference system be... Its definition is as follows:

[0163]

[0164] Where m is the number of fuzzy rules, k is the number of Gaussian membership functions, and X fuzzy The three-dimensional feature matrix composed of external attribute matrices, μ i σ is the width of the i-th Gaussian membership function. i It is the center of the i-th Gaussian membership function; X Effect The elements in the array are signed numbers. The larger the absolute value of the value, the greater the influence of external attributes on traffic perception data. Positive numbers indicate the impact of increased traffic flow on traffic perception data, while negative numbers indicate the impact of decreased traffic flow on traffic perception data. This indicates the impact of external attributes on traffic perception data at time t. This indicates a matrix of size τ×N, where all elements are real numbers;

[0165] Suppose an attribute matrix related to traffic cognition By X traffic and X TTI Composition, defined as follows: X cognition =ω1·X traffic +ω2·X TTI

[0166] Where ω1 and ω2 are the traffic data matrix X traffic Traffic congestion index matrix X TTI The weights represent the degree of influence of historical traffic data and traffic congestion index on traffic perception data; the larger the weight, the greater the influence on traffic perception data. This indicates a matrix of size τ×N, where all elements are real numbers;

[0167] The output of the l-th layer in the convolutional neural network. Defined as:

[0168] C l+1 =σ(L sym C l W l )

[0169]

[0170] C0 = X,

[0171] Where L sym It is the normalized Laplacian operator, D is the degree matrix calculated from the adjacency matrix, and C is the normalized Laplacian operator. l+1 This is the output of the l-th convolutional layer, where A is the adjacency matrix describing the relationships between road nodes, X is the feature matrix describing traffic features and external attributes, and W... lThis is the weight matrix of the l-th layer, using the ReLU non-linear activation function, where τ represents the time step and N represents the number of road nodes. This indicates a matrix of size τ×N, where all elements are real numbers;

[0172] After processing by a graph convolutional neural network, a spatial feature matrix is ​​generated. At this point, the spatial characteristics of the traffic cognitive data have been captured. The data is then input into a gated recurrent unit, where the gate is reset at time t. Update Gate and candidate hidden state The definition is as follows:

[0173] R t =σ(X) t W xr +H t-1 W hr +b r )

[0174] Z t =σ(X) t W xz +H t-1 W hz +b z )

[0175]

[0176] Where h is the number of hidden units, Let be the input features at time t, and P be the number of external feature attributes. It is the hidden state of the previous time step. These are the two weight matrices of the reset gate. It is the bias matrix of the reset gate. These are the two weight matrices of the update gate. This is the bias matrix of the update gate. The activation function used for both the reset and update gates is the sigmoid function. These are the two weight matrices of the candidate hidden states. This is the bias matrix of the candidate hidden state, and the activation function used for the candidate hidden state is the tanh function. Used to represent the size of each matrix, where all elements are real numbers;

[0177] The adjacency matrix and feature matrix, after passing through the graph convolutional layer and gated recurrent unit, generate predicted traffic data for subsequent traffic cognition work.

[0178] Step 3: Train the graph convolutional neural network model;

[0179] This includes setting the corresponding model parameters and training environment, and training the model; in step 3, the training data is set as follows: training optimizer Adam, learning rate 0.001, number of gated recurrent units 64, batch size = 32, time step of historical traffic cognition data 12, and the loss function is defined as follows:

[0180]

[0181] Where t f It is the prediction time step, Y pred It is predicted traffic data, Y true It is real traffic data;

[0182] The model was trained using the public dataset Los-loop and the real taxi dataset SZBZ near Shenzhen North Railway Station, and divided into training and test sets according to a certain ratio. A custom Dataloader object was used to encapsulate the data, intelligently iteratively process the input feature matrix, and output data tensors in the corresponding format to the model for training.

[0183] Step 4: Conduct multi-class traffic cognition experiments based on the trained model.

[0184] The various traffic cognition experiments in step 4 are set up as follows:

[0185] The first type of traffic cognition experiment aims to verify the impact of different external characteristic attributes on traffic data. It includes four different experimental settings: the first is that the input data consists only of historical traffic data; the second is that, in addition to the first setting, holiday data and weather data are added; the third is that, in addition to the second setting, time period data and traffic flow change data are added; and the fourth is that, in addition to the third setting, traffic congestion index data is added.

[0186] The second type of traffic cognition experiment was designed to verify the cognitive performance of the method over different time periods. It included three different experimental setups: the first was to predict traffic data for the next 10 minutes; the second was to predict traffic data for the next 30 minutes; and the third was to predict traffic data for the next 60 minutes.

[0187] The prediction results from these experimental setups will be used for subsequent traffic cognition work.

[0188] Step 5: Construct attribute influence descriptive features based on traffic cognition experiment results.

[0189] In step 5, attribute influence description features are constructed for the traffic prediction data. The influence of attributes on traffic data is directly reflected in the impact of this method on the accuracy of traffic prediction. Through different experimental settings in step 4, prediction data under these experimental settings were obtained; the coefficient of determination R...2 It is used to measure prediction performance under different experimental settings, and is defined as follows:

[0190]

[0191] Where Y t Based on real traffic data, For predicted traffic data, R represents the average of real traffic data, where n is the total number of traffic data points; 2 The value of is between 0 and 1. The closer it is to 1, the better the regression fit. This not only reflects the prediction performance of this method under different experimental settings, but also facilitates subsequent fuzzy classification work.

[0192] Step 6: Perform fuzzy classification of attribute influence based on influence description features.

[0193] In step 6, the descriptive features are subjected to fuzzy classification of attribute influence, using the coefficient of determination R. 2 This study describes the impact of attribute features on traffic data prediction, fully considering the influence of attribute features within a traffic scenario context. Due to the fuzziness, randomness, and subjectivity of the classification criteria, fuzzy set theory is introduced to further classify the obtained influence features into three fuzzy sets: low impact, medium impact, and high impact. R0 2 The membership function μ is used to describe the degree to which a member belongs to these fuzzy sets; a Gaussian membership function is selected, and the threshold parameters λ1 and λ2 are determined heuristically.

[0194] The invention will now be described in more detail with reference to the accompanying drawings. In the various drawings, the same elements are indicated by similar reference numerals. For clarity, the various parts in the drawings are not drawn to scale; the following description is in conjunction with the accompanying drawings. Figures 1 to 4 Preferred examples of the present invention will be further described below:

[0195] Step 1: Processing Model Input Data

[0196] Before model training, the raw data needs to be processed into the required format. External attribute features related to traffic cognition undergo fuzzy classification to generate an external attribute feature matrix, which serves as the input to the fuzzy inference mechanism. Road traffic data for traffic cognition is observed and calculated to generate an adjacency matrix and a traffic cognition feature matrix, which, together with the attribute influence feature matrix output by the fuzzy inference mechanism, serve as the input to the graph convolutional neural network. These are described below:

[0197] (1) Road traffic data

[0198] The original road traffic data is a two-dimensional table, with each row representing a data sampling point. This table includes information such as timestamps, road sign numbers, average vehicle speeds, and traffic flow changes. The data is sliced ​​according to time (each slice's length is the sum of the historical step size and the predicted step size). Specifically, the historical road traffic data for this scenario consists of road speed data from τ historical time steps. The velocity data for each time step is as follows: It consists of the speeds of N roads in the traffic scenario at time t. The predicted speed of the traffic scenario is composed of speed data from T prediction time steps: The velocity data format for each time step is the same as the historical velocity data; the velocity prediction problem is formatted as: X′ traffic =f(X) traffic ).

[0199] Traffic data was sampled every 10 minutes. Comparative experiments showed that a historical speed duration of 120 minutes (12 historical time steps) resulted in better prediction performance. Predicted speed durations of 10 minutes, 30 minutes, and 60 minutes were tested (1, 3, and 6 prediction time steps, respectively). Therefore, in the experiment, τ = 12, T = {1, 3, 6}, and the total step size for each data segment was 13, 15, and 18, respectively. N represents the total number of roads used in the experiment, here N = 12.

[0200] (2) Fuzzy classification processing

[0201] Before processing the external attribute data into the required external attribute feature matrix, fuzzy classification is required. First, the semantically formatted data is digitally normalized, and then fuzzy classification is performed based on the normalized numerical matrix. This fuzzy classification method cleverly solves problems such as inconsistent data types, large data spans, and non-digitalization of external attributes through a clever fuzzification strategy, and determines the generalization, specialization, and aggregation properties between different types of data.

[0202] Deterministic classification requires assigning an element to a specific category; that is, an element either belongs to a certain class or does not belong to one, and an element belongs to exactly one class, leaving no room for ambiguity, similar to the concept of a set in mathematics. While this can digitize non-digital data and control the data within a relatively small scope, data in real-life scenarios is often impossible to describe precisely. Therefore, deterministic classification cannot effectively describe the characteristics of data.

[0203] Fuzzy classification reclassifies elements based on the probability of them belonging to a certain class, controlling the classification result within the range of 0 to 1. A classification result of 0 indicates that the element clearly does not belong to that class, a classification result of 1 indicates that the element clearly belongs to that class, and values ​​between 0 and 1 indicate that the element may belong to that class; the larger the value, the greater the probability of belonging to that class. Furthermore, fuzzy classification can be performed using classification functions, including fuzzy Gaussian membership functions, fuzzy larger value transformation functions, fuzzy smaller value transformation functions, fuzzy linear transformation functions, fuzzy MS larger value transformation functions, fuzzy MS smaller value transformation functions, and fuzzy nearest neighbor transformation functions. Developers can choose an appropriate classification function based on data characteristics and expert experience; here, the fuzzy Gaussian membership function is used.

[0204] (3) Adjacency matrix, traffic cognition feature matrix and external attribute feature matrix

[0205] For an undirected graph G = {V, E} describing the connectivity of roads in a traffic scenario, the node set V is represented as V = {v1, v2, ..., v...}. N}, where N is the number of roads in the traffic scenario. When roads are interconnected, edges representing road interactions should be connected. The edge set E is represented as E = {v i v j |1≤i≤N,1≤j≤N}, where v i v j This indicates that there is a connection between node i and node j;

[0206] The element-wise definition of adjacency matrix A is:

[0207]

[0208] This formula indicates that when nodes i and j are connected, the weight of the corresponding edge is 1; otherwise, it is 0. ij The size is N×N, where N is the number of roads;

[0209] Traffic Congestion Index Matrix It is calculated from historical traffic speeds and indicates the degree of road congestion.

[0210] The formula for calculating the traffic congestion index is:

[0211]

[0212] Where V free For free passage speed, V current Current speed;

[0213] Traffic cognitive feature matrix Traffic data matrix X traffic Traffic congestion index matrix XTTI Composition, which is defined as X cognition =ω1·X traffic +ω2·X TTI Where ω1 and ω2 are X traffic and X TTI The weights represent the degree of influence of historical traffic data and traffic congestion index on traffic perception data. The greater the weight, the greater the influence on traffic perception data.

[0214] The attribute matrix obtained after fuzzy classification of external attributes includes External attribute feature matrix It is composed of these attribute matrices, which are defined as follows:

[0215] X fuzzy =ω1·X time +ω2·X holiday +ω3·X weather +ω4·X flowChange

[0216] Where ω1, ω2, ω3, and ω4 are the weights of the time period matrix, holiday matrix, weather matrix, and traffic flow change matrix, respectively, representing the degree of influence of different external attributes on traffic perception data. The larger the weight, the greater the influence on traffic perception data. τ represents the time step, and N represents the number of roads.

[0217] Step 2: Building the Model

[0218] (1) Overall structure of the model

[0219] After the input traffic data and external attribute data are processed into the required feature matrix in the preceding data processing section, the data will be input into three sub-modules. The external attribute feature data first enters the fuzzy inference mechanism to generate the attribute influence feature matrix X. Effect The attribute affects the feature matrix X Effect Traffic cognitive feature matrix X c ionThe spatial characteristics of the data are captured by a graph convolutional neural network, generating a spatial feature matrix. This spatial feature matrix is ​​then input into a module composed of gated recurrent units for final temporal characteristic capture, outputting traffic data prediction results. Therefore, the overall model structure consists of three parts: the first part is a fuzzy inference mechanism for capturing the influence of external attributes, composed of fuzzy membership functions, fuzzy rules, and defuzzification functions, capable of extracting the influence features of external attributes on traffic data and between different external attributes; the second part is a graph convolutional neural network for capturing the spatial characteristics of the data, with inputs of a traffic cognition feature matrix, an external attribute feature matrix, and an adjacency matrix, capable of capturing the spatial dependency characteristics between different roads; the third part is a submodule based on gated recurrent units, with inputs of spatial feature data processed by the graph convolutional neural network, capable of further extracting temporal dependency characteristics from the data and ultimately decoding it into predicted road traffic data.

[0220] (2) Fuzzy reasoning mechanism

[0221] The fuzzy inference mechanism is constructed based on data characteristics and expert experience to extract the influence features of external attributes on traffic data and generate an attribute influence feature matrix. Before inputting the data into the fuzzy inference mechanism, different weights can be added to different attribute feature matrices according to the data characteristics. Here, to simplify the experimental process, the weights of all attribute feature matrices are directly reset to 1. Then, each attribute feature matrix... After fuzzification using the fuzzy Gaussian membership function, the probability that a feature element belongs to a certain class is obtained, thus converting the input definite value into a probability value in the range of 0 to 1.

[0222] The fuzzy rules in the fuzzy inference system are determined based on expert experience and attribute characteristics. The purpose is to enable the model to better capture the features of external attributes and the interaction between different attributes. In this layer, the input data and fuzzy rules are not fully connected. Only some rules that have a greater impact on the final result are retained. This also speeds up the data processing speed of the fuzzy inference mechanism and greatly shortens the running time.

[0223] The inference results obtained from fuzzy rule calculations are defuzzified to obtain the control output, which is the influence value of all input attributes on traffic data. Commonly used defuzzification functions include the maximum membership function method, the centroid method, and the weighted average method; the centroid method is used here. The centroid method takes the centroid of the area enclosed by the membership function curve and the horizontal axis as the final output value of the fuzzy inference, defined as:

[0224]

[0225] Compared to the other two methods, the center-of-gravity method has smoother output inference control. Even if the input data changes slightly, the output data will also change, making it more suitable for this application scenario.

[0226] (3) Spatial characteristic extraction structure

[0227] Spatial feature extraction structures, namely graph convolutional neural networks, can process three-dimensional tensors and more efficiently extract the dynamic interaction characteristics and spatial dependencies between roads in traffic scenarios. This three-dimensional tensor X consists of an adjacency matrix A describing the relationships between road nodes, a traffic cognition feature matrix describing traffic characteristics, and an external attribute feature matrix. The output of the l-th layer of a graph convolutional neural network... Defined as:

[0228] C l+1 =σ(L sym C l W l )

[0229]

[0230] C0 = X,

[0231] Where L sym It is the normalized Laplacian operator, D is the degree matrix calculated from the adjacency matrix, and C is the normalized Laplacian operator. l+1 W is the output of the l-th convolutional layer. l is the weight matrix of the l-th layer, and the activation function used is the non-linear activation function ReLU, where τ represents the time step and N represents the number of road nodes;

[0232] The aforementioned adjacency matrix A and feature matrix X, after being processed by a graph convolutional neural network, will generate a spatial feature matrix and complete the capture of spatial characteristics of traffic cognitive data for subsequent feature extraction.

[0233] (4) Time characteristic extraction structure

[0234] The temporal characteristic extraction structure based on the gated recurrent unit further extracts features from the spatial feature matrix output by the convolutional neural network in the previous figure. The reset gate of the gated recurrent unit at time t... Update Gate and candidate hidden state The definition is as follows:

[0235] R t =σ(X) t W xr +H t-1 W hr +b r )

[0236] Z t =σ(X) t W xz +H t-1 W hz +b z )

[0237]

[0238] Where h is the number of hidden units, in this case h = 64. Let be the input features at time t, and P be the number of external attribute features. It is the hidden state of the previous time step. These are the two weight matrices of the reset gate. It is the bias matrix of the reset gate. These are the two weight matrices of the update gate. This is the bias matrix of the update gate. The activation function used for both the reset and update gates is the sigmoid function. These are the two weight matrices of the candidate hidden states. is the bias matrix of the candidate hidden state, and the activation function used for the candidate hidden state is the tanh function;

[0239] After the spatial feature matrix is ​​processed by the gated cyclic unit here, its temporal characteristics are further extracted, and the spatial and temporal features are fused to generate predicted traffic data for subsequent traffic cognition work.

[0240] Step 3: Model Training

[0241] (1) Training data

[0242] Training data was sampled every 10 minutes, with historical data spanning 12 time steps and a time span of 120 minutes. Prediction data were sampled at 1, 3, and 6 time steps, spanning 10, 30, and 60 minutes respectively. To prevent gradient explosion and other issues during the experiment, the input data was normalized to between 0 and 1. The training dataset comprised 80% of the data, with the remaining 20% ​​used as the test dataset. For more convincing results, the Los-loop dataset (measured on a Los Angeles freeway) and the SZBZ dataset (a real-world taxi dataset near Shenzhen North Railway Station) were used as the model training datasets. A custom Dataloader object was used to encapsulate the data, intelligently iteratively processing the input feature matrix and outputting data tensors in the corresponding format to the model for training. The SZBZ dataset is richer than the Los-loop dataset; therefore, the SZBZ dataset was used for hyperparameter tuning, ablation experiments, noise testing, and comparison experiments with other models. The Los-loop dataset was used for comparison experiments of the model's cognitive performance under different prediction durations.

[0243] (2) Training environment

[0244] The training environment is a laboratory server, 3.19GHz 12 th The system features a Gen. Intel® Core™ i9-12900K processor, 64 GiB of RAM, and an NVIDIA GeForce RTX 3090 graphics card with 128GB of VRAM. The development language is Python 3.7.11, the deep learning framework is Tensorflow 2.5.0, and the development platform is PyCharm 2021.2.3 and MATLAB R2021b. The training optimizer is Adam, with a learning rate of 0.001, 64 gated recurrent units, a batch size of 32, and a loss function of [missing information]. Where t f It is the prediction time step, Y pred It is predicted traffic data, Y true It is real traffic data;

[0245] (3) The number of training sessions should be adjusted according to the actual experimental needs and training results. After each round of training, the model parameter file should be saved once.

[0246] (4) Model running process

[0247] The overall structure of the model is as follows Figure 1 As shown. The traffic cognition-related data has three feature channels. The external attribute feature matrix is ​​processed by a fuzzy inference mechanism to generate an attribute influence feature matrix. The attribute influence feature matrix, the traffic cognition feature matrix, and the adjacency matrix are input together into a graph convolutional neural network. The spatial feature matrix output by the graph convolutional neural network is then input into subsequent gated recurrent units. The internal details of the fuzzy inference mechanism are as follows. Figure 2 As shown, the data is first preprocessed and fuzzy-divided using constructed fuzzy rules. The processed data is then combined with these fuzzy rules for decision-making, i.e., feature calculation. Fuzzy values ​​are obtained after feature calculation, and finally, a defuzzification function is used to obtain definite values ​​and generate an attribute influence feature matrix. The input to the convolutional neural network consists of the attribute influence feature matrix, the traffic cognition feature matrix, and the adjacency matrix. After passing through normalization and convolutional layers, the spatial dependency features of the data are extracted, generating a spatial feature matrix. Simultaneously, the module's entry and exit points are processed by activation functions to avoid gradient vanishing or exploding problems. Finally, a submodule based on a gated recurrent unit (GRU) with 32 hidden units extracts the temporal characteristics of the data and generates a predicted traffic data matrix.

[0248] Step 4: Predict traffic data

[0249] Input the traffic data to be tested into the trained traffic data prediction model. The input format should be the same as the input during training. The predicted data output by the model are:

[0250] The data format for each time step is the same as the historical data. The predicted traffic data can be used to calculate model performance metrics, and can also be further used for subsequent traffic cognition work and fuzzy classification of attribute influences.

[0251] Step 5: Construct attribute impact descriptive features for traffic forecast data

[0252] The impact of attributes on traffic data is directly reflected in the accuracy of traffic data prediction using this method. Leveraging this characteristic, we can further understand traffic data by comparing and analyzing different experimental results. Different experimental settings are obtained by controlling different input attribute features. Through the four steps described above, we have obtained the prediction data under these experimental settings. Before proceeding to the next step of traffic data understanding, we need to construct descriptive features of attribute influence, and, combined with the characteristics of traffic data, use the coefficient of determination R... 2 It is used to measure prediction performance under different experimental settings, and is defined as follows:

[0253]

[0254] Where Y t Based on real traffic data, For predicted traffic data, R represents the average of real traffic data, where n is the total number of traffic data points; 2 The value is between 0 and 1. The closer it is to 1, the better the regression fit. This not only reflects the prediction performance of this method under different experimental settings, but also facilitates subsequent traffic cognition and fuzzy classification work.

[0255] Step 6: Perform traffic cognition and fuzzy classification of attribute influence based on attribute influence descriptive features.

[0256] Define an interpretable traffic cognition method based on the coefficient of determination R. 2 This study describes the degree of influence of attribute features on traffic cognition, fully considering the influence of attribute features in specific traffic scenarios. Based on the fuzziness, randomness, and subjectivity of classification criteria inherent in attribute influence, fuzzy set theory is introduced to further classify the influencing features into three categories: low-influence, medium-influence, and high-influence fuzzy sets. Furthermore, cognition is conducted in an easily understandable and interpretable manner; the coefficient of determination R0 is used. 2The membership function μ is used to describe the degree to which an element belongs to these fuzzy sets. A fuzzy Gaussian membership function is selected, and the threshold parameters λ1 and λ2 are determined heuristically. Specifically, on the SZBZ dataset, λ1 = 0.3 and λ2 = 0.7. Note that since traffic conditions on the road do not change immediately in a short period of time, and the changes are significantly different in different time periods, the cognitive method will span multiple time steps to interpret the experimental results at different time steps.

[0257] The unified form of the three fuzzy sets is as follows: The fuzzy Gaussian membership function is defined as follows: The width of the function curve is determined by k (k>0), and the center position of the curve is determined by α. Specifically, the membership functions of the three fuzzy sets are respectively... Among them, α1=0, α2=0.5, α3=1, and k=0.7.

[0258] After constructing the fuzzy set and its fuzzy membership function, the following steps utilize experimental results under different experimental settings to perform fuzzy classification and traffic cognition. Specifically, different feature attributes are first input into the model, and experimental processing is conducted separately. The determination coefficients under different experimental settings are calculated using the model's prediction results. After obtaining the determination coefficients, fuzzy classification is performed using the constructed fuzzy membership function, and traffic cognition is performed based on the classification results to obtain the influence of different attribute features on traffic data.

[0259] The detailed descriptions listed above are merely specific descriptions of feasible embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. All equivalent methods or modifications that do not depart from the technology of the present invention should be included within the scope of protection of the present invention.

Claims

1. An interpretable traffic cognition method based on fuzzy theory, characterized in that, The method comprises the following steps: Step 1, an input data processing algorithm combining a fuzzy reasoning mechanism and a graph convolutional neural network model: It includes historical data describing all roads in the traffic scene, an adjacency matrix describing the interaction characteristics between roads, a traffic congestion index describing external features, a time period, a holiday, weather, traffic flow changes, and an interpretable traffic data cognition algorithm; Interpretable means that the model presents the data processing process to the developer in a simple and understandable form, specifically represented by the intuitive sentences in the fuzzy rules in the fuzzy reasoning mechanism, and the definitions of the four important fuzzy rules are as follows: Fuzzy rule 1: IF flowChange is zero AND time is seven THEN the effect is small Fuzzy rule 2: IF flowChange is three AND time is seven THEN the effect is large Fuzzy rule 3: IF holiday is a holiday AND time is nine THEN the effect is super large Fuzzy rule 4: IF weather is foggy THEN the effect is middle Fuzzy rule 1 indicates that when the traffic flow change is around 0 and the time is between 7 and 9, the impact on traffic data is small; fuzzy rule 2 indicates that when the traffic flow change is around 30 and the time is between 7 and 9, the impact on traffic data is large; fuzzy rule 3 indicates that when the date is a holiday and the time is between 9 and 11, the impact on traffic data is very large; fuzzy rule 4 indicates that when the weather is foggy, the impact on traffic data is moderate; Step 2, design of the structure of the graph convolutional neural network model combined with the fuzzy reasoning mechanism, including three parts: The first part is a fuzzy reasoning mechanism based on fuzzy theory, which is composed of a fuzzy membership function, fuzzy rules and a defuzzification function, which can effectively extract the influence of external attributes on traffic data; the traffic cognition feature tensor composed of the traffic data tensor and the traffic congestion index tensor is combined with the output of the first part as the input data of the second part of the model; The second part is a graph convolutional neural network that can directly perform graph convolution operations on traffic cognition related tensors; the graph convolutional neural network can more efficiently extract the spatial correlation between road traffic data; the output of the second part is used as a spatial feature and input into the third part of the network; The third part is a deep neural network based on a gated recurrent unit, which further processes the spatial features to extract temporal features; the spatio-temporal features are finally processed into predicted traffic data and used for subsequent traffic cognition work; Step 3, training the graph convolutional neural network model; It includes setting the corresponding model parameters and training environment, and training the model; Step 4, based on the trained model, perform multi-class traffic cognition experiments; Step 5, constructing attribute influence description features based on traffic cognition experiment results; Step 6, performing attribute influence fuzzy classification based on influence description features.

2. The interpretable traffic cognition method based on fuzzy theory according to claim 1, characterized in that, The input data in step 1 is specifically defined as follows: Step 1.1, historical traffic data and prediction data of all roads in the predicted traffic scene: A road history data matrix of a traffic scenario is provided by traffic data of the history time step Composition: , wherein the traffic data of each time step is , which is composed of traffic data of N roads in the traffic scene at time t, N is the number of road sections, represents is a Nx1 vector, and the elements in the vector are all real numbers; A prediction data matrix for a traffic scenario consists of T prediction time steps of traffic data: , The traffic data format of each time step is the same as the historical traffic data, wherein is the historical time step, T is the prediction time step, and N is the number of road segments, represents the size of the matrix T×N, wherein each element is a real number; The problem of traffic data prediction is formatted as: ; Traffic data refers to data that describes the traffic scene and has spatiotemporal characteristics, including traffic speed, traffic flow, and traffic congestion; Step 1.2, adjacency matrix describing the interaction features between roads: with undirected graphs The connectivity of the roads in the traffic scenario is described, the set of nodes V is denoted as , N being the number of roads in the traffic scenario; When the roads are connected to each other, the edges representing the interaction relationship of the roads should be connected; therefore, the edge set E is represented as , wherein represents that the node i and the node j are connected. The element level of the adjacency matrix A is defined as: , The formula represents that the weight of the corresponding edge is 1 when nodes i and j are connected, and 0 otherwise; The size of the matrix is N x N, where N is the number of road segments. Step 1.3, feature matrix describing external attributes: Set of feature matrices describing external attributes Including a traffic congestion index matrix , a time period matrix , a holiday matrix , a weather matrix , a traffic flow variation matrix : , wherein the traffic congestion index matrix is calculated from historical traffic speed, indicating the congestion level of the road, denotes the time step length, and N denotes the number of road segments in the traffic scene, denotes the size of the matrix , wherein the elements are all real numbers, and the calculation formula of the traffic congestion index is as follows: wherein is the free flow speed, is the current speed; Set time period matrix The element level of the matrix is defined as: , wherein is a continuous time period, the traffic data in this time period has similar change state, in actual calculation process, different time periods are represented by different positive integers, denotes time step, N denotes road number, denotes matrix size , wherein elements are real numbers, ij denotes that the element is located in the ith row and jth column of the matrix, and n denotes that 24 hours of a day are divided into n time periods; Holiday matrix The element level of the matrix is defined as: , The formula represents when the date is a weekend or a statutory holiday, the value is 1, otherwise 0, represents the time step, N represents the number of roads, represents the matrix size , wherein the elements are all real numbers, and ij represents that the element is located in the i-th row and the j-th column of the matrix; Weather matrix The element level of the matrix is defined as: , The weather conditions included in the weather matrix are represented as: , Different weather conditions are represented by different positive integers, and the influence of the same weather condition on traffic data is similar, denotes the time step, and N denotes the number of roads, denotes the matrix size , where each element is a real number, and ij denotes that the element is located in the ith row and the jth column of the matrix; Let traffic flow change matrix , the element level of the matrix is defined as: , wherein is a continuous traffic flow variation interval, the traffic flow variation values in this interval have similar influence on traffic data, denotes a time step, and N denotes the number of roads, denotes a matrix with a size of , wherein each element is a real number, ij denotes that the element is located in the ith row and jth column of the matrix, and k denotes that the traffic flow variation data is divided into k intervals; Step 1.4, interpretable traffic data cognition algorithm.

3. The interpretable traffic cognition method based on fuzzy theory according to claim 1, characterized in that, The fuzzy reasoning mechanism based on fuzzy theory in step 2 can handle multi-dimensional external attribute tensors and can extract the influence of external attributes on traffic data in an interpretable manner; graph convolutional neural networks can handle three-dimensional tensors and can more efficiently extract the spatial correlation between different roads in the traffic scene, and through the use of gated recurrent units, the temporal correlation between traffic data can be extracted; Input matrix for a fuzzy inference mechanism Composed of an external attribute matrix , , , , which is defined as follows: , wherein ω1, ω2, ω3, ω4 are weights of time period matrix, holiday matrix, weather matrix, flow change matrix respectively, representing the influence degree of different external attributes on traffic cognitive data, the greater the weight, the greater the influence on traffic cognitive data, denotes time step, N denotes road number, denotes matrix size , wherein the elements are all real numbers; Output matrix of a fuzzy inference system defined as follows: , where m is the number of fuzzy rules, k is the number of Gaussian membership functions, is a three-dimensional feature matrix composed of external attribute matrix, is the width of the i-th Gaussian membership function, is the center of the i-th Gaussian membership function; The elements in are signed numbers, the greater the absolute value of the number, the greater the influence of external attributes on traffic cognition data, positive numbers represent the influence on traffic cognition data when traffic flow increases, and negative numbers represent the influence on traffic cognition data when traffic flow decreases; represents the influence of external attributes on traffic cognition data at time t, represents the matrix size , where the elements are real numbers; An attribute matrix related to traffic cognition is provided , wherein and consisting of the following definitions: , wherein are weights of the traffic data matrix and the traffic congestion index matrix respectively, representing the degree of influence of the historical traffic data and the traffic congestion index on the traffic cognition data, the greater the weight, the greater the influence on the traffic cognition data, represents a matrix with a size of , wherein the elements are all real numbers; the output of the i-th layer of the graph convolutional neural network is defined as: the output of the i-th layer of the graph convolutional neural network is defined as: the output of the i-th layer of , , , wherein is a normalized Laplacian operator, D is a degree matrix calculated from an adjacency matrix, is the output of the first layer convolution, A is an adjacency matrix describing the relationship of road nodes, X is a feature matrix describing traffic features and external attributes, is the output of the first layer convolution, A is an adjacency matrix describing the relationship of road nodes, X is a feature matrix describing traffic features and external attributes, is the output of the first layer convolution, A is an adjacency matrix describing the relationship of road nodes, X is a feature matrix describing traffic features and external attributes, represents the time step, N represents the number of roads, , wherein each element is a real number; After processing by the graph convolutional neural network, a spatial feature matrix is generated, at which time the spatial characteristic capture of the traffic cognition data has been completed, and then input into the gated recurrent unit. The definitions of the reset gate , update gate and candidate hidden state at time t of the gated recurrent unit are as follows: , where h is the number of hidden units, is the input feature at time t, P is the number of external feature attributes, is the hidden state at the previous time step, are two weight matrices of the reset gate, is the bias matrix of the reset gate, are two weight matrices of the update gate, is the bias matrix of the update gate, the activation function used by the reset gate and the update gate is the sigmoid function, are two weight matrices of the candidate hidden state, is the bias matrix of the candidate hidden state, the activation function used by the candidate hidden state is the hyperbolic tangent function, to denote the size of each matrix, where the elements are real numbers; The adjacency matrix and the feature matrix, after passing through the graph convolution layer and the gated recurrent unit here, generate predicted traffic data for subsequent traffic cognition work.

4. The interpretable traffic cognition method based on fuzzy theory of claim 1, wherein, The training data in step 3 is set as: The training optimizer Adam, learning rate 0.001, the number of gated recurrent units 64, batch data size , time step 12 of historical traffic cognition data, and the loss function is defined as follows: , wherein is a prediction time step, is predicted traffic data, is real traffic data; Using public datasets and real taxi datasets near Shenzhen North Station as the dataset for model training, and divided into training set and test set in a certain proportion; using custom Object encapsulates data, intelligently iterates through the input feature matrix, and outputs the corresponding format data tensor to the model for training.

5. The interpretable traffic cognition method based on fuzzy theory according to claim 1, characterized in that, The multi-class traffic cognition experiment in step 4 is set as follows: The first type of traffic cognition experiment is to verify the influence of different external feature attributes on traffic data, which includes four different experimental settings: the first is to input only historical traffic data; the second adds holiday data and weather data based on the first; the third adds time period data and traffic flow change data based on the second; the fourth adds traffic congestion index data based on the third; The second type of traffic cognition experiment is to verify the cognition performance of the method in different time periods, which includes three different experimental settings: the first is to predict traffic data for the next 10 minutes; the second is to predict traffic data for the next 30 minutes; the third is to predict traffic data for the next 60 minutes; The prediction results under these experimental settings will be used for subsequent traffic cognition work.

6. The interpretable traffic cognition method based on fuzzy theory according to claim 1, characterized in that, The step 5 constructs the attribute influence description feature for the traffic prediction data. The influence of the attribute on the traffic data is directly reflected in the influence of the method on the prediction accuracy of the traffic data. Through the different experimental settings in step 4, the prediction data under these experimental settings is obtained. The coefficient of determination is used to measure the prediction performance under different experimental settings, and is defined as follows: , wherein is the real traffic data, is the predicted traffic data, is the average of the real traffic data, n is the total number of traffic data; The value of R2 is between 0 and 1, the closer to 1, the better the regression fitting effect, which not only shows the prediction performance of the method under different experimental settings, but also facilitates subsequent fuzzy classification work.

7. The interpretable traffic cognition method based on fuzzy theory according to claim 1, characterized in that, The step 6 attributes the influence of the described features to the fuzzy classification with the determination coefficient The described attribute features describe the influence degree of the traffic data prediction, fully consider the attribute influence features in the traffic scene background, and due to the fuzziness, randomness and subjectivity of the classification standard, introduce the fuzzy set theory, further attribute the obtained influence features to the fuzzy classification, and construct three fuzzy sets of small influence, medium influence and large influence, The membership function Describes the degree of belonging to these fuzzy sets; The Gaussian membership function is selected, and the threshold parameter is determined based on heuristics and .