Eight-direction four-order traffic signal control method and system based on deep learning

Through the eight-way fourth-order traffic signal control method based on deep learning, the deep learning model is used to process intersection data, and the refined control and real-time dynamic adjustment of complex traffic patterns are achieved, which solves the problem that traditional systems cannot adapt to the needs of complex intersections and improves the problem that traditional systems cannot adapt to the needs of complex intersections. Traffic efficiency and system scalability.

CN119007471APending Publication Date: 2024-11-22SHANGHAI SEARI INTELLIGENT SYST CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411284985.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

Traditional traffic signal control systems cannot adapt to the diverse traffic needs of complex intersections, have rough control particle size, lack the ability to understand and predict complex traffic patterns, are difficult to achieve real-time dynamic adjustment and optimization, and are unable to effectively coordinate traffic flow at adjacent intersections.

Method used

Using the eight-way fourth-order traffic signal control method based on deep learning, the intersection data is collected through sensors, cameras and IoT devices, data cleaning, feature scaling and time encoding are carried out, deep learning model is constructed, using embedded layer, self-attention mechanism, and multi-head Attention mechanism and feedforward neural network generate state probability matrix, realize real-time traffic signal control decisions, and update the model through sliding window strategy.

Benefits of technology

It realizes refined control of complex intersections, improves traffic efficiency, can accurately capture and predict complex traffic patterns, has real-time dynamic adjustment capabilities, supports coordinated optimization of adjacent intersections, has good scalability and adaptability, and ensures the system stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119007471A_ABST
    Figure CN119007471A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of intelligent traffic systems, and particularly relates to an eight-direction four-order traffic signal control method and system based on deep learning, and the method comprises the steps: collecting intersection data; preprocessing the data; constructing and training a deep learning model; and processing the intersection data collected in real time to obtain a real-time control decision, and executing traffic signal control. The system comprises a data collection layer, a data preprocessing layer, a deep learning model layer, a decision output layer and a signal control execution layer. According to the invention, the precise control of the complex intersection is realized, and the traffic efficiency is improved; a complex traffic mode can be accurately captured and predicted through deep learning and an attention mechanism; the system has a real-time dynamic adjustment capability and can quickly respond to traffic condition changes; collaborative optimization is supported, coordination with adjacent intersections can be realized, and regional traffic flow optimization is realized; the method has good expandability and adaptability, and continuous learning and improvement can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent transportation systems, and in particular to an eight-way fourth-order traffic signal control method and system based on deep learning. Background Art

[0002] With the acceleration of urbanization, traffic congestion is becoming increasingly serious. Traditional traffic signal control systems can usually only provide simple traffic light switching and cannot adapt to the diverse traffic needs of complex intersections. The existing technology has the following shortcomings: 1. The control granularity is coarse and it is impossible to perform fine control for different directions; 2. Lack of understanding and prediction capabilities of complex traffic patterns; 3. It is difficult to achieve real-time dynamic adjustment and optimization; 4. It is impossible to effectively coordinate the traffic flow of adjacent intersections. Summary of the invention

[0003] The purpose of the present invention is to solve the technical problems existing in the background technology. To this end, a deep learning-based eight-way fourth-order traffic signal control method and system are provided.

[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0005] An eight-way fourth-order traffic signal control method based on deep learning comprises the following steps:

[0006] Step S1: Use sensors, cameras and other IoT devices to collect intersection data and obtain a structured dataset D;

[0007] Step S2: Perform data cleaning, feature scaling, time coding and feature engineering on the structured data set D to obtain an enhanced feature matrix X';

[0008] Step S3: Build a deep learning model: input the enhanced feature matrix X', then go through embedding processing, self-attention processing, multi-head attention processing, position encoding processing, feedforward neural network processing, multi-layer stacking processing, and output processing, and finally obtain the state probability matrix S of the initial model structure;

[0009] Step S4: training the deep learning model: input the enhanced feature matrix X', the state probability matrix S and the true label Y, and then go through forward propagation processing, loss function calculation, Adam optimization processing, learning rate scheduling processing, parameter update processing, obtain the trained model parameter θ, and perform new data inference;

[0010] Step S5: Based on the trained deep learning model, the intersection data collected in real time is processed to obtain real-time control decisions. At the same time, based on the intersection data collected in real time, a sliding window strategy is used to update the deep learning model.

[0011] Step S6: Execute traffic signal control based on the real-time control decision.

[0012] The following is a technical solution further defined by the method in the present invention, which uses sensors, cameras and other IoT devices to collect intersection data, and the intersection data parameter information includes but is not limited to: vehicle flow, waiting queue length, vehicle type, pedestrian flow, time information, weather conditions, and structured processing is performed on the intersection data to obtain a structured data set D = {d_1, d_2, ..., d_n}, where each d_i is a data point containing intersection data parameter information.

[0013] The following is a technical solution further defined by the method of the present invention, in the process of data cleaning, including: removing outliers from the structured data set D, processing missing data, and obtaining a cleaned data set D_clean;

[0014] The process of feature scaling includes: using the Min-Max scaling method to normalize the cleaned data set D_clean to obtain the scaled data set D_scaled;

[0015] The process of time encoding includes: converting the time information of the scaled data set D_scaled into periodic features, thereby obtaining a feature matrix X∈R^(n×d), where n is the number of samples, d is the number of features, and R is a parameter.

[0016] The following is a technical solution further defined by the method of the present invention, which includes:

[0017] Input feature matrix X;

[0018] Enhanced feature count: Create feature vectors for each direction, calculate relative traffic and waiting time ratios between directions, and extract time series features;

[0019] The enhanced feature matrix X'∈R^(n×d') is obtained, where d' is the number of enhanced features.

[0020] The following is a technical solution further defined by the method in the present invention, which includes:

[0021] Step 31: Input the enhanced feature matrix X', use the embedding matrix to convert the high-dimensional sparse features into low-dimensional dense representations, and obtain the embedding matrix E∈R^(n×m×e), where m=8 is the number of directions and e=64 is the embedding dimension;

[0022] Step 32: Input the embedding matrix E∈R^(n×m×e), and calculate the attention output A∈R^(n×8×64) based on the weight matrices W_q, W_k, W_v∈R^(64×64);

[0023] Step 33: Input the embedding matrix E∈R^(n×m×e), and calculate the multi-head attention output M∈R^(n×8×64) based on the weight matrix W_o∈R^(512×64);

[0024] Step 34: Input the multi-head attention output M∈R^(n×8×64), use the sine and cosine functions to generate position encoding, and obtain the position encoded feature P∈R^(n×8×64);

[0025] Step 35: Input the position-encoded feature P∈R^(n×8×64), use a two-layer fully connected network, use the ReLU activation function in the middle, and get the feedforward network output F∈R^(n×8×64);

[0026] Step 36: Repeat steps 32-35 for multiple layers to increase the depth of the model;

[0027] Step 37: Input the output O_L∈R^(n×8×64) of the last layer of step 36, use a fully connected layer followed by a softmax function, and obtain the state probability matrix S∈R^(n×8×4).

[0028] The following is a technical solution further limited by the method in the present invention, using a trained deep learning model to infer new data: input new intersection data X_new∈R^(1×d'), forward propagate the new data, select the state with the highest probability predicted_state=argmax(S,axis=2), and obtain the predicted state predicted_state∈R^(1×8) for each direction.

[0029] The following is a technical solution further defined by the method in the present invention, using a trained deep learning model for real-time data decision-making: input real-time intersection data X_real∈R^(1×d') to obtain a real-time control decision decision∈R^(1×8) and an updated model parameter θ_updated.

[0030] The following is a technical solution further defined by the method of the present invention, in which the intersection data collected by each user each time is stored in a database, and the deep learning model is subjected to online learning, training and updating based on the intersection data in the database; the system is optimized and maintained in real time.

[0031] An eight-way fourth-order traffic signal control system based on deep learning, used to implement the above control method, including a data collection layer, a data preprocessing layer, a deep learning model layer, a decision output layer and a signal control execution layer;

[0032] Data collection layer, used to obtain intersection data;

[0033] Data preprocessing layer, used for data cleaning, feature scaling, time encoding and feature engineering;

[0034] The deep learning model layer is used to build and train deep learning models and perform data reasoning;

[0035] The decision output layer uses the trained deep learning model based on real-time intersection data to obtain real-time control decisions;

[0036] The signal control execution layer executes traffic signal control based on real-time control decisions.

[0037] The following is a technical solution further defined by the system in the present invention, wherein the deep learning model layer includes an input layer, an embedding layer, a self-attention layer, a multi-head attention layer, a feedforward neural network, and an output layer;

[0038] Input layer, used to enhance the feature matrix X';

[0039] Embedding layer, which converts high-dimensional sparse features into low-dimensional dense representations using an embedding matrix;

[0040] The self-attention layer calculates the attention output A based on the weight matrices W_q, W_k, and W_v;

[0041] The multi-head attention layer calculates the multi-head attention output M based on the weight matrix W_o, and uses sine and cosine functions to generate position encoding to obtain the position-encoded feature P;

[0042] Feedforward neural network, which uses two layers of fully connected networks for the position-encoded feature P, with ReLU activation function in the middle to obtain the feedforward network output F;

[0043] The output layer is used to use a fully connected layer followed by a softmax function on the output O_L of the last layer to obtain the state probability matrix S.

[0044] Compared with the prior art, the present invention has the following technical effects:

[0045] The present invention realizes refined control of complex intersections and improves traffic efficiency. Through deep learning and attention mechanism, it can accurately capture and predict complex traffic patterns. It has real-time dynamic adjustment capabilities and can quickly respond to changes in traffic conditions. It supports collaborative optimization and can coordinate with adjacent intersections to achieve regional-level traffic flow optimization. It has good scalability and adaptability and can continuously learn and improve. It adopts multiple optimization and safety mechanisms to ensure the stability and reliability of the system.

[0046] The present invention is further described below in conjunction with the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 It is a schematic flow chart of the method of the present invention;

[0049] Figure 2 It is a flowchart of the training process in the present invention;

[0050] Figure 3 It is a schematic diagram of the structure of the multi-head attention mechanism in the present invention;

[0051] Figure 4 It is a connection block diagram of the system in the present invention;

[0052] Figure 5 It is a connection block diagram of the deep learning model layer in the present invention. DETAILED DESCRIPTION

[0053] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.

[0054] like Figure 1-5 As shown, an eight-way fourth-order traffic signal control method based on deep learning and an eight-way fourth-order traffic signal control system based on deep learning are provided.

[0055] like Figure 1 As shown, the eight-way fourth-order traffic signal control method based on deep learning includes the following contents:

[0056] Data collection and preprocessing

[0057] 1.1 Data collection: Use sensors, cameras and other IoT devices to collect intersection data, including but not limited to: traffic volume, waiting queue length, vehicle type, pedestrian flow, time information, and weather conditions;

[0058] Input: raw sensor data;

[0059] Output: structured dataset D = {d_1, d_2, ..., d_n}, where each d_i is a data point containing the above information.

[0060] 1.2 Data cleaning: remove outliers and process missing data;

[0061] Input: structured dataset D;

[0062] Output: cleaned dataset D_clean.

[0063] 1.3 Feature Scaling: Use the Min-Max scaling method to normalize the data;

[0064] For each feature f, the following formula applies:

[0065] f_scaled=(f-f_min) / (f_max-f_min);

[0066] Input: cleaned data set D_clean;

[0067] Output: scaled dataset D_scaled.

[0068] 1.4 Time coding: converting time information into periodic features;

[0069] For hour "h" and day of week "d", calculate:

[0070] h_sin=sin(2π*h / 24);

[0071] h_cos = cos(2π*h / 24);

[0072] d_sin=sin(2π*d / 7);

[0073] d_cos = cos(2π*d / 7);

[0074] Input: scaled dataset D_scaled;

[0075] Output: The preprocessed feature matrix X∈R^(n×d), where n is the number of samples, d is the number of features, and R is the parameter.

[0076] Feature Engineering

[0077] 2.1 Create feature vectors for each direction, including:

[0078] Current flow f_current;

[0079] Waiting time t_wait;

[0080] Vehicle type distribution v_type = [v_car, v_bus, v_truck];

[0081] Historical average flow rate f_avg.

[0082] 2.2 Calculate the relative flow and waiting time ratio between directions:

[0083] r_flow = f_current / f_avg;

[0084] r_wait=t_wait / t_wait_avg.

[0085] 2.3 Extracting time series features:

[0086] The average flow rate in the past hour f_1h;

[0087] Traffic trend in the past 24 hours trend_24h;

[0088] Historical traffic for the same period of the week f_week;

[0089] Input: feature matrix X∈R^(n×d);

[0090] Output: Enhanced feature matrix X'∈R^(n×d'), where d' is the number of enhanced features.

[0091] Deep Learning Models

[0092] 3.1 Embedding Layer

[0093] Use trainable embedding matrices to convert high-dimensional sparse features into low-dimensional dense representations;

[0094] Input: enhanced feature matrix X'∈R^(n×d');

[0095] Output: Embedding matrix E∈R^(n×m×e), where m=8 is the number of directions and e=64 is the embedding dimension.

[0096] 3.2 Self-Attention Mechanism

[0097] Calculation steps:

[0098] a) Q = E*W_q, K = E*W_k, V = E*W_v; where W_q, W_k, W_v∈R^(64×64) are learnable weight matrices;

[0099] b)score=softmax((Q*K^T) / √64);

[0100] c) A = score * V;

[0101] Input: embedding matrix E∈R^(n×8×64);

[0102] Output: Attention output A∈R^(n×8×64).

[0103] 3.3 Multi-Head Attention

[0104] Calculation steps:

[0105] a) For each head h_i (i=1...8): A_i=Attention(E*W_qi, E*W_ki, E*W_vi);

[0106] b) M = Concat(A_1, ..., A_8) * W_o, where W_o∈R^(512×64) is a learnable weight matrix;

[0107] Input: embedding matrix E∈R^(n×8×64);

[0108] Output: Multi-head attention output M∈R^(n×8×64).

[0109] 3.4 Positional Encoding

[0110] Generate positional encodings using sine and cosine functions:

[0111] P=M+PositionalEncoding(8,64);

[0112] Input: multi-head attention output M∈R^(n×8×64);

[0113] Output: Position-encoded feature P∈R^(n×8×64).

[0114] 3.5 Feedforward Neural Network

[0115] Use a two-layer fully connected network with a ReLU activation function in the middle:

[0116] F=max(0,P*W_1+b_1)*W_2+b_2;

[0117] Where W_1∈R^(64×256), W_2∈R^(256×64) are weight matrices, b_1, b_2 are bias terms;

[0118] Input: Position-encoded feature P∈R^(n×8×64);

[0119] Output: Feedforward network output F∈R^(n×8×64).

[0120] 3.6 Multi-layer stacking

[0121] Repeat steps 3.2-3.5 a total of 4 times to increase the model depth.

[0122] 3.7 Output Layer

[0123] Use a fully connected layer followed by a softmax function:

[0124] S=softmax(O_L*W_out+b_out);

[0125] Where W_out∈R^(64×4) is the weight matrix and b_out is the bias term;

[0126] Input: The output of the last layer O_L∈R^(n×8×64);

[0127] Output: state probability matrix S∈R^(n×8×4).

[0128] Training process

[0129] 4.1 Loss Function: Using Cross Entropy Loss

[0130] Loss=CrossEntropyLoss(S,Y).

[0131] 4.2 Optimizer: Use Adam optimizer with initial learning rate η=0.001.

[0132] 4.3 Learning rate scheduling: using warmup and cosine annealing strategies

[0133] η_t=η_max*(cos((t-t_warmup) / (t_max-t_warmup)*π)+1) / 2;

[0134] Where t_warmup = 1000 steps, t_max = 100000 steps.

[0135] 4.4 Parameter update:

[0136]

[0137] Input: enhanced feature matrix X'∈R^(n×d'), state probability matrix S∈R^(n×8×4) and true label Y∈R^(n×8×4);

[0138] Output: Updated model parameters θ.

[0139] Reasoning process

[0140] 5.1 Use the trained model to forward propagate the new data and select the state with the highest probability:

[0141] predicted_state=argmax(S,axis=2);

[0142] Input: New intersection data X_new∈R^(1×d');

[0143] Output: predicted state predicted_state∈R^(1×8) for each direction.

[0144] Decision deployment and online learning

[0145] 6.1 Model quantization: Use INT8 quantization technology to convert floating-point weights into 8-bit integers.

[0146] 6.2 Online Learning: Fine-tune the model using new data and update the training data using a sliding window strategy

[0147] Window size: data from the last 7 days;

[0148] Update frequency: every 24 hours.

[0149] 6.3A / B test: compare with the traditional fixed time control method to evaluate system performance;

[0150] Evaluation indicators: average waiting time, throughput;

[0151] Input: real-time intersection data X_real∈R^(1×d');

[0152] Output: real-time control decision decision∈R^(1×8) and updated model parameters θ_updated.

[0153] Decision execution

[0154] 7.1 Perform traffic signal control based on real-time control decisions.

[0155] System Optimization

[0156] 8.1 Performance Monitoring

[0157] Key Performance Indicators (KPIs):

[0158] Average waiting time < 60 seconds;

[0159] Throughput>1000 vehicles / hour;

[0160] Automatic alarm threshold:

[0161] Average waiting time > 90 seconds;

[0162] Throughput <800 vehicles / hour.

[0163] 7.2 Data Management

[0164] Distributed storage system: Apache Cassandra;

[0165] Data version control: Git LFS (Large File Storage).

[0166] 7.3 Collaborative Optimization

[0167] Communication protocol between intersections: MQTT (Message Queuing Telemetry Transport);

[0168] Region-level optimization algorithm: Distributed reinforcement learning (D3QN: Distributed Double Deep Q-Network).

[0169] Security and robustness

[0170] 8.1 Fault Detection and Recovery Mechanism

[0171] Model health check frequency: every 5 minutes;

[0172] Alternative control strategy: Fixed time control.

[0173] 8.2 Anti-interference design

[0174] Data enhancement techniques: Gaussian noise injection, random masking;

[0175] Multimodal input: combining camera vision data and ground sensor coil data.

[0176] 8.3 Privacy Protection

[0177] Federated learning: using the FedAvg algorithm;

[0178] Differential privacy: Add Laplace noise with a privacy budget of ε=0.1.

[0179] like Figure 2 As shown, the training process is described in detail:

[0180] 1. Data collection and preprocessing

[0181] Input: raw sensor data; Output: feature matrix X.

[0182] 2. Feature Engineering

[0183] Input: feature matrix X; Output: enhanced feature matrix X'.

[0184] 3. Deep learning model construction

[0185] Input: enhanced feature matrix X'; Output: initial model structure;

[0186] Eight-way fourth-order regular attention mechanism

[0187] 1) Direction encoding: assigning a unique embedding vector to each direction to capture spatial relationships;

[0188] 2) Phase encoding: assign unique embedding vectors to the four signal phases to represent the temporal relationship;

[0189] 3) Regular attention mask: Design the attention mask matrix M∈R^(8x8x4x4) according to the eight-way fourth-order rule to limit invalid direction-stage combinations;

[0190] 4). Attention calculation: Q, K, V matrices fuse direction and stage information, attention(Q, K, V) = softmax((QK^T / √d_k+M)*V);

[0191] 5) Multi-scale features: Use convolution kernels of different sizes to extract local and global features and enrich the receptive field of the model;

[0192] 6) Residual connection: Add skip connection to retain low-level features and alleviate the gradient disappearance problem.

[0193] Based on the eight-way fourth-order rule attention mechanism, the model can better understand and learn the complex constraints and interactions in traffic signal control, and improve the accuracy and efficiency of decision-making.

[0194] 4. Model Training

[0195] Input: enhanced feature matrix X', true label Y; Output: trained model parameters θ.

[0196] 5. Training Results

[0197] Output: trained model; Evaluation: model performance indicators (accuracy loss value, etc.). Figure 3 As shown, the structure of the multi-head attention mechanism is described in detail:

[0198] 1. Head 1: Direction of flow

[0199] This header focuses on traffic flow information in eight directions:

[0200] The number of vehicles in each direction;

[0201] Vehicle type (car, truck, etc.);

[0202] Traffic speed and density.

[0203] 2. Head 2: Stage Status

[0204] This header focuses on the current stage status:

[0205] The current stage (1-4);

[0206] Status of traffic lights in each direction;

[0207] The time the current phase has lasted.

[0208] 3. Head 3: Time Dependence

[0209] This header focuses on time-related factors:

[0210] Time period (morning peak, evening peak, off-peak, etc.);

[0211] Relative time within the cycle;

[0212] Temporal patterns in historical data.

[0213] 4. Head 4: Spatial Relationship

[0214] This head focuses on the relationship between space and direction:

[0215] Traffic flow relationship between adjacent directions;

[0216] Impact on oncoming traffic;

[0217] Characteristics of intersection geometry.

[0218] 5. Head 5: Rule Constraints

[0219] This header ensures that the system obeys the eight-way fourth-order rule:

[0220] the sequence and composition of the four phases;

[0221] Directions of traffic allowed within each stage;

[0222] The conditions and timing of phase switching;

[0223] Minimum and maximum phase durations.

[0224] How the long mechanism works:

[0225] 1. Each head independently processes the specific information it focuses on and generates an attention distribution;

[0226] 2. Splice the outputs of all heads together;

[0227] 3. The concatenated vectors are linearly transformed;

[0228] 4. Use the output of the rule head to adjust the rules to ensure that the requirements of the eight-way fourth order are met;

[0229] 5. Generate the final output to determine the next signal control action.

[0230] Implementation of rule integration

[0231] 1. Rule encoding: Encode the eight-way fourth-order rules into vector or matrix form.

[0232] 2. Attention adjustment: Consider the constraints of rules when calculating attention.

[0233] 3. Output filtering: Use rules to ensure that the output control decisions always meet the eight-way fourth-order requirements.

[0234] 4. Dynamic weight: Dynamically adjust the influence of the rule based on the current status.

[0235] In the above new design, special attention is paid to the characteristics of the eight-way fourth order:

[0236] Directional traffic: Consider traffic flow in eight directions.

[0237] Stage Status: Focus on the status and switching of the four stages.

[0238] Time dependence: Consider the impact of time on traffic patterns.

[0239] Spatial relations: Analyze the spatial relations among eight directions.

[0240] Rule constraints: Ensure that the system strictly abides by the eight-way fourth-order rules.

[0241] like Figure 4 As shown, an eight-way fourth-order traffic signal control system based on deep learning is used to implement the above-mentioned control method, including a data collection layer, a data preprocessing layer, a deep learning model layer, a decision output layer and a signal control execution layer.

[0242] The data collection layer is used to obtain intersection data.

[0243] The data preprocessing layer is used to clean the data, perform feature scaling, time encoding, and feature engineering.

[0244] The deep learning model layer is used to build and train deep learning models and perform data reasoning.

[0245] The decision output layer uses the trained deep learning model based on real-time intersection data to obtain real-time control decisions.

[0246] The signal control execution layer executes traffic signal control based on real-time control decisions.

[0247] like Figure 5 As shown, the deep learning model layers include input layer, embedding layer, self-attention layer, multi-head attention layer, feedforward neural network, and output layer.

[0248] Input layer, used to enhance the feature matrix X'.

[0249] Embedding layer, which is used to convert high-dimensional sparse features into low-dimensional dense representation using an embedding matrix.

[0250] The self-attention layer calculates the attention output A based on the weight matrices W_q, W_k, and W_v.

[0251] The multi-head attention layer calculates the multi-head attention output M based on the weight matrix W_o, and uses sine and cosine functions to generate position encoding to obtain the position encoded feature P.

[0252] The feedforward neural network uses a two-layer fully connected network for the position-encoded feature P, with a ReLU activation function in the middle to obtain the feedforward network output F.

[0253] The output layer is used to use a fully connected layer followed by a softmax function on the output O_L of the last layer to obtain the state probability matrix S.

[0254] This system cleverly integrates the eight-way fourth-order rules into the deep learning model to achieve more accurate and efficient traffic scheduling. It mainly includes:

[0255] Modeling of eight-way fourth-order intersection:

[0256] The intersection model is expanded to eight directions (east, south, west, north, northeast, southeast, northwest, southwest), and each direction has four traffic states (try your best, pass, not recommended, prohibited). This modeling method fully captures the traffic flow characteristics and control requirements of complex intersections.

[0257] State-direction matrix:

[0258] Design a state-direction matrix S∈R^(8×4), where S_{ij} represents the weight of the jth state in the i-th direction. This matrix encodes traffic control strategies such as phase conflict, priority, and safety interval.

[0259] Adaptive Weight Attention Mechanism:

[0260] An adaptive weighted attention mechanism based on the eight-way fourth-order rule is developed. The attention weight A is calculated by the following formula:

[0261] A=softmax(QK^T / √d_k+β*S)

[0262] Where Q and K are query and key matrices, d_k is the attention dimension, and β is a learnable adaptation factor. This enables the model to automatically adjust its focus based on the current state of the intersection and the traffic demand in each direction.

[0263] Multi-objective optimization framework:

[0264] Design a multi-objective optimization framework that takes into account traffic flow, waiting time, safety factor, and environmental impact. The optimization objective function is defined as:

[0265] O=w1*O_flow+w2*O_wait+w3*O_safety+w4*O_environment

[0266] Among them, O_flow, O_wait, O_safety, and O_environment are the objective functions of flow optimization, waiting time reduction, safety improvement, and environment improvement, respectively, and w1~w4 are weight coefficients.

[0267] Dynamic Phase Generation:

[0268] Based on the eight-way fourth-order rule, a dynamic phase generation algorithm is developed. This algorithm can dynamically adjust the signal phase according to the real-time traffic conditions, such as merging low-demand directions and separating high-conflict directions, to achieve more flexible traffic control.

[0269] Multi-scale spatiotemporal feature extraction:

[0270] A multi-scale spatiotemporal feature extraction module is introduced, combined with a convolutional neural network (CNN) and a long short-term memory network (LSTM) to capture traffic characteristics of different time spans (short-term, medium-term, and long-term) and spatial ranges (local, regional, and global).

[0271] Collaborative learning and transfer:

[0272] A collaborative learning mechanism is designed to allow multiple intersection controllers to share learning experience. At the same time, a model migration technology is developed so that the model trained at one intersection can be quickly adapted to other intersections with similar characteristics.

[0273] In summary, based on the four-order (try your best, pass, not recommended, prohibited) rules in eight directions (east, south, west, north, northeast, southeast, northwest, southwest), the intersection modeling is carried out and applied in traffic signal control. The design method of the state-direction matrix and its integration technology in the deep learning model are used to encode complex traffic control strategies. The adaptive weighted attention mechanism based on the eight-way fourth-order rule is used to dynamically adjust the model's attention to different directions and states. The multi-objective optimization framework combining traffic flow, waiting time, safety factor and environmental impact is used to comprehensively evaluate and optimize traffic control strategies. The dynamic phase generation algorithm based on the eight-way fourth-order rule is used to adjust the signal phase in real time to adapt to complex and changeable traffic conditions. The design and implementation of the multi-scale spatiotemporal feature extraction module is used to comprehensively capture traffic characteristics at different spatiotemporal scales. The collaborative learning and model transfer method based on the eight-way fourth-order rule is used to improve the learning efficiency and adaptability of the multi-intersection control system.

[0274] This intelligent traffic signal control system based on eight-way fourth-order rules not only improves traffic efficiency, but also enhances road safety and environmental friendliness. By embedding refined traffic control strategies directly into deep learning models, the system is able to make smarter and more flexible decisions in complex urban environments. It significantly improves urban traffic management, reduces congestion, and improves road use efficiency while taking into account safety and environmental factors.

[0275] The eight-way fourth-order traffic signal control method and system based on deep learning provided by the present invention provides a comprehensive, intelligent and efficient solution for traffic management at complex intersections through innovative control strategies and advanced machine learning technology. The system can not only significantly improve traffic efficiency and reduce congestion, but also has good scalability and adaptability, laying the foundation for traffic management in future smart cities.

[0276] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present invention by using the above disclosed methods and technical contents without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Therefore, all equivalent changes made according to the shape, structure and principle of the present invention without departing from the content of the technical solution of the present invention should be included in the protection scope of the present invention.

Claims

1. An eight-way fourth-order traffic signal control method based on deep learning, characterized in that: The following steps are involved: Step S1: Use sensors, cameras and other IoT devices to collect intersection data and obtain a structured dataset D; Step S2: Perform data cleaning, feature scaling, time coding and feature engineering on the structured data set D to obtain an enhanced feature matrix X'; Step S3: Build a deep learning model: input the enhanced feature matrix X', then go through embedding processing, self-attention processing, multi-head attention processing, position encoding processing, feedforward neural network processing, multi-layer stacking processing, and output processing, and finally obtain the state probability matrix S of the initial model structure; Step S4: training the deep learning model: input the enhanced feature matrix X', the state probability matrix S and the true label Y, and then go through forward propagation processing, loss function calculation, Adam optimization processing, learning rate scheduling processing, parameter update processing, obtain the trained model parameter θ, and perform new data inference; Step S5: Based on the trained deep learning model, the intersection data collected in real time is processed to obtain real-time control decisions. At the same time, based on the intersection data collected in real time, a sliding window strategy is used to update the deep learning model. Step S6: Execute traffic signal control based on the real-time control decision.

2. The eight-way fourth-order traffic signal control method based on deep learning as claimed in claim 1, characterized in that: Use sensors, cameras and other IoT devices to collect intersection data. The intersection data parameter information includes but is not limited to: vehicle flow, waiting queue length, vehicle type, pedestrian flow, time information, weather conditions, and perform structured processing on the intersection data to obtain a structured data set D = {d_1, d_2, ..., d_n}, where each d_i is a data point containing intersection data parameter information.

3. The eight-way fourth-order traffic signal control method based on deep learning as claimed in claim 1, characterized in that: The data cleaning process includes: removing outliers from the structured data set D, processing missing data, and obtaining the cleaned data set D_clean; The process of feature scaling includes: using the Min-Max scaling method to normalize the cleaned data set D_clean to obtain the scaled data set D_scaled; The process of time encoding includes: converting the time information of the scaled data set D_scaled into periodic features, thereby obtaining a feature matrix X∈R^(n×d), where n is the number of samples, d is the number of features, and R is a parameter.

4. The eight-way fourth-order traffic signal control method based on deep learning as claimed in claim 3, characterized in that: The process of feature engineering includes: Input feature matrix X; Enhanced feature count: Create feature vectors for each direction, calculate relative traffic and waiting time ratios between directions, and extract time series features; The enhanced feature matrix X'∈R^(n×d') is obtained, where d' is the number of enhanced features.

5. The eight-way fourth-order traffic signal control method based on deep learning as claimed in claim 1, characterized in that: The process of building a deep learning model includes: Step 31: Input the enhanced feature matrix X', use the embedding matrix to convert the high-dimensional sparse features into low-dimensional dense representations, and obtain the embedding matrix E∈R^(n×m×e), where m=8 is the number of directions and e=64 is the embedding dimension; Step 32: Input the embedding matrix E∈R^(n×m×e), and calculate the attention output A∈R^(n×8×64) based on the weight matrices W_q, W_k, W_v∈R^(64×64); Step 33: Input the embedding matrix E∈R^(n×m×e), and calculate the multi-head attention output M∈R^(n×8×64) based on the weight matrix W_o∈R^(512×64); Step 34: Input the multi-head attention output M∈R^(n×8×64), use the sine and cosine functions to generate position encoding, and obtain the position encoded feature P∈R^(n×8×64); Step 35: Input the position-encoded feature P∈R^(n×8×64), use a two-layer fully connected network, use the ReLU activation function in the middle, and get the feedforward network output F∈R^(n×8×64); Step 36: Repeat steps 32-35 for multiple layers to increase the depth of the model; Step 37: Input the output O_L∈R^(n×8×64) of the last layer of step 36, use a fully connected layer followed by a softmax function, and obtain the state probability matrix S∈R^(n×8×4).

6. The eight-way fourth-order traffic signal control method based on deep learning as claimed in claim 1, characterized in that: Use the trained deep learning model to infer new data: input new intersection data X_new∈R^(1×d'), forward propagate the new data, select the state with the highest probability predicted_state=argmax(S,axis=2), and obtain the predicted state predicted_state∈R^(1×8) for each direction.

7. The eight-way fourth-order traffic signal control method based on deep learning as claimed in claim 6, characterized in that: Use the trained deep learning model to make real-time data decisions: input real-time intersection data X_real∈R^(1×d'), obtain the real-time control decision decision∈R^(1×8) and the updated model parameters θ_updated.

8. The eight-way fourth-order traffic signal control method based on deep learning as claimed in claim 1, characterized in that: The intersection data collected by each user is stored in the database, and the deep learning model is updated online based on the intersection data in the database; Optimize and maintain the system in real time.

9. An eight-way fourth-order traffic signal control system based on deep learning, used to implement the control method of any one of claims 1-8, characterized in that: It includes data collection layer, data preprocessing layer, deep learning model layer, decision output layer and signal control execution layer; Data collection layer, used to obtain intersection data; Data preprocessing layer, used for data cleaning, feature scaling, time encoding, and feature engineering; The deep learning model layer is used to build and train deep learning models and perform data reasoning; The decision output layer uses the trained deep learning model based on real-time intersection data to obtain real-time control decisions; The signal control execution layer executes traffic signal control based on real-time control decisions.

10. The eight-way fourth-order traffic signal control system based on deep learning as claimed in claim 9, characterized in that: The deep learning model layers include input layer, embedding layer, self-attention layer, multi-head attention layer, feedforward neural network, and output layer; Input layer, used to enhance the feature matrix X'; Embedding layer, which converts high-dimensional sparse features into low-dimensional dense representations using an embedding matrix; The self-attention layer calculates the attention output A based on the weight matrices W_q, W_k, and W_v; The multi-head attention layer calculates the multi-head attention output M based on the weight matrix W_o, and uses sine and cosine functions to generate position encoding to obtain the position-encoded feature P; Feedforward neural network, which uses two layers of fully connected networks for the position-encoded feature P, with ReLU activation function in the middle to obtain the feedforward network output F; The output layer is used to use a fully connected layer followed by a softmax function on the output O_L of the last layer to obtain the state probability matrix S.

Citation Information

Cited By

  • Crossing centralized control method and system based on multi-source perception

    CN121516090A