An intelligent traffic flow prediction method combined with an improved BWO-BP neural network algorithm

By combining the improved beluga optimization algorithm with a backpropagation neural network, the problems of long training time and easy getting trapped in local optima in traditional backpropagation neural networks in traffic flow prediction are solved, achieving more efficient and accurate traffic flow prediction and improving the practicality and flexibility of intelligent traffic management.

CN120808615BActive Publication Date: 2026-03-31HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Traditional BP neural networks suffer from problems such as long training time, susceptibility to local optima, and slow convergence speed in traffic flow prediction. In particular, they have poor prediction accuracy and robustness when dealing with complex, multidimensional, and noisy traffic data.

Method used

By combining the improved Beluga Whale Optimization (BWO) algorithm with the BP neural network, a feedforward neural network model is constructed through data preprocessing, multi-strategy optimization of the BWO algorithm, and initialization of the connection weights and thresholds of the BP neural network using the improved Beluga Whale Optimization algorithm. The model is then trained using the backpropagation algorithm to improve its global search capability and prediction accuracy.

Benefits of technology

It achieves more accurate and efficient modeling and prediction of traffic flow data, with stronger adaptability and higher prediction stability. It has high computational efficiency and fast system response speed, making it suitable for promotion and application in intelligent traffic dispatching systems. It can effectively alleviate traffic congestion and improve intersection traffic efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808615B_ABST
    Figure CN120808615B_ABST
Patent Text Reader

Abstract

The application discloses an intelligent traffic flow prediction method combined with an improved BWO-BP neural network algorithm, which comprises data preprocessing, construction of a multidimensional input feature set, optimization of the BWO algorithm by using multiple strategies, improvement of the global search capability of the model, initialization of the connection weight and threshold value of the BP neural network by using the improved white whale optimization algorithm, improvement of the initial solution quality of the model, construction of a feedforward neural network model, network training by using an error back propagation algorithm, future traffic flow prediction based on the trained network model, and realization of efficient and intelligent traffic management application. The application has stronger adaptability and higher prediction stability when dealing with complex and variable traffic scenes, can more comprehensively improve the grasping capability of the overall system for traffic trends according to the flow characteristics of different types of vehicles, has higher calculation efficiency, fast system response speed, and good practicability and deployment flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of algorithm-optimized traffic management, and in particular to an intelligent traffic flow prediction method that combines an improved BWO-BP neural network algorithm. Background Technology

[0002] With the accelerating pace of urbanization and the rapid increase in the number of motor vehicles, road traffic flow is exhibiting a trend of high density and high complexity. Traditional traffic management methods are no longer sufficient to meet the real-time and intelligent requirements of modern transportation systems. Common traffic flow prediction methods mainly include statistical time series models, machine learning methods, and neural network algorithms. Backpropagation (BP) neural networks are widely used in traffic flow prediction due to their strong adaptability and nonlinear modeling capabilities. However, they suffer from problems such as long training time, susceptibility to local optima, and slow convergence speed, especially when dealing with complex, multidimensional, and high-noise traffic data, where their prediction accuracy and robustness are poor. Therefore, it is necessary to propose an intelligent traffic flow prediction method with higher prediction accuracy and training efficiency. Summary of the Invention

[0003] Purpose of the invention: The purpose of this invention is to provide an intelligent traffic flow prediction method that combines an improved BWO-BP neural network algorithm.

[0004] Technical solution: The present invention includes the following steps:

[0005] S1. Data preprocessing to construct a multidimensional input feature set;

[0006] S2. Employ multiple strategies to optimize the BWO algorithm and enhance the model's global search capability;

[0007] S3. The connection weights and thresholds of the BP neural network are initialized using the improved beluga optimization algorithm to improve the quality of the initial solution of the model;

[0008] S4. Construct a feedforward neural network model and train the network using the backpropagation algorithm. Based on the trained network model, predict future traffic flow to achieve efficient and intelligent traffic management applications.

[0009] Furthermore, step S1 preprocesses the data, including data cleaning, normalization, and construction of the input feature set.

[0010] Further, step S1 includes:

[0011] S11. The raw data contains multiple sample records, each consisting of 7 elements: time, number of vehicles in the five vehicle types, and total number of vehicles. Vehicle-related data is denoted as:

[0012] X t=[Heavy t Light t Mini t Medium t Long t All t To standardize the original features using the min-max normalization method, each feature value after processing is mapped to the interval [0, 1].

[0013]

[0014] Where, x i,t Let represent the value of the i-th feature at time t, min(x) i ) and max(x i ) represent the minimum and maximum values ​​of the feature in the training set, respectively;

[0015] S12. Construct a training sample set that conforms to the input format of a BP neural network. Use the sliding window method to extract a fixed-length historical sequence from the time series as input, and the value at a future time as the output label. Set the length of the historical time window to L, then the k-th training sample can be represented as:

[0016] X (k) =[X t-k X t-k+1 , ..., X t-1 ], y (k) =X t

[0017] Among them, X (k) The input features for the k-th sample contain six-dimensional feature data from the past L time steps; y (k) This represents the corresponding target prediction value, typically the total number of vehicles at time t.

[0018] Further, step S2 includes:

[0019] S21. Introduce the crossover and mutation operation mechanism in the genetic algorithm to simulate the heredity and recombination of individuals from the perspective of biological evolution, and increase the information entropy of the population through gene fragment recombination and mutation perturbation.

[0020] S22. Introduce an asynchronous update mechanism. Whenever the number of iterations meets the condition, a certain proportion of individuals are selected from the population for "local update" or "maintaining the original state", thereby achieving time-displacement of individual evolution.

[0021] S23. In the development stage of the BWO algorithm, i.e. the stage where individuals approach the current optimal solution, Levy flight perturbation is introduced to enable individuals to make longer jumps during updates and avoid getting trapped in local optima.

[0022] S24. Apply sine and cosine perturbations to the individual positions to achieve periodic fluctuations in the search path;

[0023] S25. Employ a dynamically decaying learning rate strategy to balance the search development process;

[0024] S26. Set the perturbation probability rules;

[0025] S27. Introduce an exponential step size decay mechanism, by updating the step size X of each individual. step The dynamic adjustment enables the algorithm to have strong leaps and search range in the early stages.

[0026] Furthermore, in step S21, the crossover operation randomly selects two individuals from the current population as parents in each iteration, assuming the solution vectors are P1 = [p 11 p 12 , ..., p 1D ]、P2=[p 21 p 22 , ..., p 2D ], where D is the dimension length, and a random integer k∈[1,D-1] is selected as the intersection point. The two parent individuals are crossed at a single point to generate a new individual:

[0027]

[0028] The new individuals resulting from the crossover will replace the original individuals with lower fitness. The mutation operation applies multi-scale perturbation mutations to the crossover individuals according to a preset mutation probability η. i Replace some dimensions with random values:

[0029]

[0030] Among them, [l i u i [] represents the upper and lower bounds of this dimension.

[0031] Furthermore, the updated model for Levy flight in step S23 is as follows:

[0032] X t+1 =r3·X best -r4·X t +C1·Levy(β)·(X t -X r )

[0033] Among them, X best X represents the current optimal individual position. r Individuals are randomly selected from the population; C1 = 2r4(1-t / T) represents the dynamic decay factor; the Levy distribution is generated as follows:

[0034]

[0035] In this case, β = 1.5, and the Levy mechanism enhances the algorithm's ability to traverse the solution space.

[0036] Furthermore, in step S24, sine and cosine perturbations are applied to the individual position. For each individual dimension in the population, the following perturbations are applied according to the parity of the individual dimension:

[0037]

[0038] Where, x p This is the individual's current reference value; x r For random reference individuals; r1, r2∈[0,1] are perturbation coefficients.

[0039] Furthermore, the step size in step S27 decreases exponentially with the number of iterations, as expressed below:

[0040] C2 = 2W f N

[0041] Among them, X step The displacement step size used for the current individual; ub and lb are the upper and lower bounds of the search space, respectively; T is the maximum number of iterations of the algorithm; t is the current iteration number; C2 is a hyperparameter controlling the step size decay rate; W f is the normalized fitness value of the worst-fitting individual in the whale population; N is the current population size;

[0042] When t approaches 0, the exponent term approaches 1, and the step size is the maximum available step size (ub-lb); when t approaches T, the exponent term approaches 0, and the step size approaches 0, achieving local fine-tuning.

[0043] By utilizing a decay step size for individual position updates, the following optimization strategy is adopted:

[0044] x (t+1) =r5·x i -r6·x r +r7·X step

[0045] Where r5, r6, r7∈[0,1] are three independent uniform random coefficients.

[0046] Furthermore, in step S3, the BP neural network has I input nodes, H hidden layer nodes, and O output nodes, and the weights and biases include the following:

[0047] The weight matrix W from the input layer to the hidden layerih ∈R H×I

[0048] The weight matrix W from the hidden layer to the output layer ho ∈R O×H

[0049] Hidden layer bias vector b h ∈R H

[0050] Output layer bias vector b o ∈R O

[0051] After flattening all the above parameters into a one-dimensional vector, the individual representation of the optimization variables is as follows:

[0052] X = [vec(W ih ), vec(W ho ), b h b o ]

[0053] Where vec(·) means that the matrix is ​​flattened into a vector by rows or columns;

[0054] Using the improved white whale optimization algorithm defined in step S2, which incorporates exponential step decay, adaptive weights, and a multi-policy perturbation mechanism, a global search is performed on the vector X. Each individual position update represents a combination replacement of the neural network parameters. Finally, the parameters corresponding to the individual with the best fitness are retained and used to initialize the BP neural network. The optimization and update process is as follows:

[0055]

[0056] in, This represents the update step size vector guided by BWO.

[0057] Furthermore, in step S4, the number of N nodes in the input layer of the feedforward neural network model... in Corresponding to different types of traffic flow; number of hidden layer nodes N h Based on cross-validation, it was determined to be: δ is an adjustment coefficient that enhances the model's expressive power; the number of output layer nodes N out A value of 1 corresponds to the predicted total traffic volume.

[0058] Network forward propagation is calculated as follows:

[0059] z (i) =W ih ·x (i) +b h

[0060]

[0061] Among them, z (i) For hidden layer input; h (i) Output for hidden layer; Output to the output layer;

[0062] Using the root mean square error (RMSE) as the objective function:

[0063]

[0064] Update the backpropagation parameters using gradient descent:

[0065]

[0066] W ho ←W ho +η·δ o ·(h (i) ) T

[0067] W ih ←W ih +η·δ h ·(x (i) ) T

[0068] Where, δ o For output layer error; δ h For hidden layer error; W ho and W ih The weights are updated in reverse order; σ′(·) is the Sigmoid derivative.

[0069] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: By combining the improved BWO algorithm with a BP neural network, this invention achieves more accurate and efficient modeling and prediction of traffic flow data; it has stronger adaptability and higher prediction stability when dealing with complex and variable traffic scenarios. It not only enhances the global search capability of the neural network at the algorithm optimization level, avoiding getting trapped in local optima, but also is more scientific and reasonable in data feature extraction and input structure design, enabling a more comprehensive understanding of traffic trends based on the flow characteristics of different types of vehicles; simultaneously, it has high computational efficiency, fast system response speed, good practicality and deployment flexibility, making it suitable for widespread application in intelligent traffic scheduling systems. It can effectively alleviate traffic congestion, improve intersection traffic efficiency, and has significant social and economic benefits. Attached Figure Description

[0070] Figure 1 This is a flowchart of the method of the present invention;

[0071] Figure 2The prediction results are given for the training set and the test set, (a) is the training set, and (b) is the test set;

[0072] Figure 3 The fitting results are for the training set and the test set, (a) is the training set, and (b) is the test set;

[0073] Figure 4 This represents the fitting effect for all samples. Detailed Implementation

[0074] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0075] like Figure 1 As shown, the present invention includes the following steps:

[0076] S1. Data preprocessing to construct a multidimensional input feature set;

[0077] The dataset used in this invention originates from a publicly available website. The original data is preprocessed, including data cleaning, normalization, and input feature set construction, aiming to improve the training efficiency and prediction accuracy of the model. The original data contains 2017 sample records, each consisting of 7 elements: time t, the number of vehicles in the five vehicle types, and the total number of vehicles. Vehicle-related data is denoted as X. t =[Heavy t Light t Mini t Medium t Long t All t To eliminate the dimensional differences between different features and improve network training efficiency, a min-max normalization method is used to standardize the original features, mapping each feature value to the interval [0, 1].

[0078]

[0079] Where, x i,t Let represent the value of the i-th feature at time t, min(x) i ) and max(x i ) represent the minimum and maximum values ​​of the feature in the training set, respectively.

[0080] To construct the supervised learning samples needed for traffic flow prediction, a sliding window method is used to extract a fixed-length historical sequence from the time series as input, and the value at a future time as the output label. Setting the historical time window length to L, the k-th training sample can be represented as:

[0081] X (k) =[X t-k X t-k+1, ..., X t-1 ], y (k) =X t (2)

[0082] Among them, X (k) The input features for the k-th sample contain six-dimensional feature data from the past L time steps; y (k) This represents the corresponding target predicted value, typically the total number of vehicles at time t. This method allows the construction of a training sample set (X) that conforms to the input format of a BP neural network. (k) y (k) This provides high-quality input for subsequent model training.

[0083] S2. Employ multiple strategies to optimize the BWO algorithm and enhance the model's global search capability;

[0084] In terms of the structure of the BWO algorithm, to address its problems such as premature convergence, local convergence, and insufficient global search capability, an improvement strategy is introduced. From multiple perspectives, such as improving global exploration capability, enhancing individual position update mechanism, and controlling evolutionary stability, the search performance and adaptability of the algorithm are systematically optimized, thereby demonstrating better convergence speed and optimization accuracy in complex nonlinear problems such as traffic flow prediction.

[0085] S21, Crossover and Mutation

[0086] To avoid the population getting stuck in local optima, this invention introduces the crossover and mutation mechanisms from genetic algorithms to simulate the heredity and recombination of individuals from the perspective of biological evolution. By "gene fragment recombination" and "mutation perturbation", the information entropy of the population is effectively increased, thereby improving the diversity of the algorithm in the search space.

[0087] In each iteration, the crossover operation randomly selects two individuals from the current population as "parents," and their solution vectors are P1 = [p 11 p 12 , ..., p 1D ]、P2=[p 21 p 22 , ..., p 2D [], where D is the dimension length. Randomly select an integer k∈[1, D-1] as the intersection point, and perform a single-point crossover between two parent individuals to generate a new individual:

[0088]

[0089] The new individuals resulting from the crossover will replace the original individuals with lower fitness. The mutation operation further applies multi-scale perturbation mutations to the crossover individuals, according to a preset mutation probability η. i Replace some dimensions with random values:

[0090]

[0091] Among them, [l i u i [ ] represents the upper and lower bounds of this dimension. This mechanism ensures that the population generates a completely new solution space distribution in each generation iteration. This strategy introduces mutated individuals while preserving current high-quality solutions, effectively enhancing the breadth and leaps of the search space.

[0092] S22, Asynchronous Update Mechanism

[0093] Traditional BWO algorithms employ a synchronous update mechanism for individuals within the population, which can easily lead to local optima in the early stages due to the influence of a single high-performing individual. This invention introduces an asynchronous update mechanism, allowing some individuals to evolve independently within a specific iteration cycle. Whenever the iteration count meets a certain condition, a certain proportion of individuals are selected from the population for either "local updates" or "maintaining the original state," thus achieving a temporal misalignment of individual evolution.

[0094] S23, Levy Flight Development Strategy

[0095] Levy flight is a jumping strategy that follows a heavy-tailed distribution and can be used to simulate the long-distance foraging behavior of whales in food-scarce environments. This invention introduces a Levy flight perturbation during the development phase of the BWO algorithm (i.e., the phase where individuals approach the current optimal solution), enabling individuals to achieve longer jump distances during updates and avoiding getting trapped in local optima. The Levy flight update model is as follows:

[0096] X t+1 =r3·X best -r4·X t +C1·Levy(β)·(X r -X t (5)

[0097] Among them, X best X represents the current optimal individual position. r Individuals are randomly selected from the population; C1 = 2r4(1-t / T) represents the dynamic decay factor; the Levy distribution is generated as follows:

[0098]

[0099] Where β = 1.5. The Levy mechanism significantly enhances the algorithm's ability to quickly traverse the solution space.

[0100] S24, Sine and Cosine Perturbation Model

[0101] During the exploration phase, this invention applies sine and cosine perturbations to individual locations to achieve periodic fluctuations in the search path. For each individual dimension in the population, the following perturbations are applied according to its parity:

[0102]

[0103] Where, x p This is the individual's current reference value; x r The reference individuals are random; r1, r2∈[0,1] are perturbation coefficients. The periodic perturbation strategy effectively expands the nonlinear variation range of the individual's motion direction, so that the search path is no longer confined to the linear update trajectory, which is conducive to covering a richer solution region.

[0104] S25, Dynamic Learning Rate

[0105] To maintain strong search capabilities in the early stages of evolution and fine-grained local optimization capabilities in the later stages of convergence, this invention employs a dynamically decaying learning rate strategy to balance the search-development process:

[0106] x (t+1) =η t ·x new +(1-η t )·x old (8)

[0107] The learning rate is:

[0108] η t =η0·γ t (9)

[0109] Where η0 is the initial value and γ∈(0,1) is the decay coefficient. This strategy makes it easier for individuals to jump to the far point in the early stages, while they tend to make more detailed adjustments in the later stages.

[0110] S26, Perturbation Probability Rule

[0111] To further prevent premature convergence, this invention sets a perturbation probability P. rand ∈[0.05,0.2], in each iteration, a random position reset is forcibly performed on some individuals with this probability:

[0112]

[0113] This mechanism mimics the behavioral mutations of organisms in extreme environments, effectively avoiding getting trapped in local stable structures and maintaining overall exploratory activity.

[0114] S27, Exponential Convergence Strategy

[0115] In the traditional BWO algorithm, the step size remains within a certain range during individual position updates, lacking the ability to adaptively adjust with the iteration process. This leads to problems such as large solution oscillation amplitude and low local search accuracy in the later stages of convergence. To address these issues, this invention introduces an exponential step size decay mechanism, which adjusts the individual update step size X... step The dynamic adjustment of the algorithm enables it to have strong leaps and search range in the early stage, and tends to be stable and refined in the later stage, thereby improving convergence accuracy and prediction stability.

[0116] The step size decreases exponentially with the number of iterations, as shown in the following expression:

[0117]

[0118] Among them, X step The displacement step size used for the current individual; ub and lb are the upper and lower bounds of the search space, respectively; T is the maximum number of iterations of the algorithm; t is the current iteration number; C2 is a hyperparameter controlling the step size decay rate; W f is the normalized fitness value of the worst-fitting individual in the whale population; N is the current population size. When t approaches 0, the exponent term approaches 1, and the step size is the maximum available step size (ub-lb); when t approaches T, the exponent term approaches 0, and the step size approaches 0, achieving local fine-tuning.

[0119] To further utilize the decay step size for individual position updates, this invention optimizes the following update strategy:

[0120] x (t+1) =r5·x i -r6·x r +r7·X step (12)

[0121] Where r5, r6, r7 ∈ [0, 1] are three independent uniform random coefficients used to increase the uncertainty of the search path. This position update strategy can adaptively adjust the perturbation intensity according to the iteration process, so that the individual can widely cover the solution space in the early exploration period and focus on refining the optimal solution in the local space in the later convergence period, which greatly improves the practical accuracy and generalization ability of the model in the prediction of this invention.

[0122] S3. The connection weights and thresholds of the BP neural network are initialized using the improved beluga optimization algorithm to improve the quality of the initial solution of the model;

[0123] In traditional BP neural networks, connection weights and bias terms are initialized using a random initialization method. This initialization method suffers from problems such as local minima and slow training speed, especially when facing high-dimensional, nonlinear, and complex problems like traffic flow prediction, where it is prone to slow convergence or insufficient prediction accuracy. This invention introduces an improved beluga optimization algorithm into the pre-training stage of BP neural networks, aiming to optimize the initialization of network weights W and bias terms b through a swarm intelligence mechanism, thereby significantly improving the quality of the model's initial solution and convergence performance.

[0124] In this invention, the BP neural network has I input nodes, H hidden layer nodes, and O output nodes. The weights and biases include the following components:

[0125] The weight matrix W from the input layer to the hidden layer ih ∈R H×I

[0126] The weight matrix W from the hidden layer to the output layer ho ∈R O×H

[0127] Hidden layer bias vector b h ∈R H

[0128] Output layer bias vector b o ∈R O

[0129] After flattening all the above parameters into a one-dimensional vector, the individual representation of the optimization variables is as follows:

[0130] X = [vec(W ih ), vec(W ho ), b h b o (13)

[0131] Where vec(·) means that the matrix is ​​flattened into a vector by rows or columns.

[0132] The improved white whale optimization algorithm, defined in step S2, featuring exponential step decay, adaptive weights, and a multi-policy perturbation mechanism, is used to perform a global search on the vector X. Each individual position update represents a combination replacement of the neural network parameters. Finally, the parameters corresponding to the individual with the best fitness are retained and used to initialize the BP neural network. The optimization and update process is shown below:

[0133]

[0134] in, This represents the update step size vector guided by BWO, and the calculation method is the same as the formula in step (S2).

[0135] Once the improved BWO algorithm reaches its maximum number of iterations or meets the convergence condition, the current optimal individual X* is decomposed into parameters for each layer: These parameters are used as the initial parameters for the BP neural network, replacing the traditional random initialization method. This approach significantly reduces training error and improves the network's robustness and generalization ability. The network is then further trained using the standard backpropagation algorithm to achieve optimal prediction performance.

[0136] S4. Construct a feedforward neural network model and train the network using the backpropagation algorithm. Based on the trained network model, predict future traffic flow to achieve efficient and intelligent traffic management applications.

[0137] After setting the initial weights and thresholds based on the improved beluga optimization algorithm, this invention further constructs a standard neural network model and trains it using the backpropagation algorithm. The trained network is then used to predict future traffic flow, enabling precise traffic control at key road sections such as highway entrances and supporting the decision-making and scheduling of intelligent transportation systems.

[0138] The number of nodes in the input layer of this neural network model is N. in Corresponding to different types of traffic flow; number of hidden layer nodes N h Based on cross-validation, it was determined to be: δ is an adjustment coefficient that enhances the model's expressive power; the number of output layer nodes N out A value of 1 corresponds to the predicted total traffic volume.

[0139] Network forward propagation is calculated as follows:

[0140]

[0141] Among them, z (i) For hidden layer input; h (i) Output for hidden layer; Output for the output layer.

[0142] Using the root mean square error (RMSE) as the objective function:

[0143]

[0144] Update the backpropagation parameters using gradient descent:

[0145]

[0146] Where, δ o For output layer error; δ h For hidden layer error; W ho and W ihThe weights are updated in reverse order; σ′(·) is the Sigmoid derivative. Through continuous iteration of error propagation and parameter adjustment, the model gradually converges.

[0147] After model training is complete, new historical time-series traffic flow data is used as input to the trained neural network model to obtain traffic flow predictions for one or more future time points. MATLAB is used to plot and compare the training and test sets with actual traffic flow. Figure 2 , Figure 3 , Figure 4 As shown, the model output curve closely matches the actual traffic flow trend, with a coefficient of determination R0. 2 A value close to 1 indicates that the model fits the data very well; the root mean square error (RMSE), as the objective function, represents the average difference between the model's prediction and the actual value for each time. The average daily traffic flow at this highway entrance is approximately 30,000 vehicles, so this difference is relatively small; the prediction residual ratio (RPD) > 10 indicates that the model's predictive ability is very strong and meets industry standards. Figure 3 and Figure 4 The fitting results show that the prediction model created in this invention is highly consistent with the actual data.

Claims

1. An intelligent traffic flow prediction method combined with an improved BWO-BP neural network algorithm, characterized in that, It comprises the following steps: S1, data preprocessing, constructing a multi-dimensional input feature set; S2, using multiple strategies to optimize the BWO algorithm to improve the global search ability of the model; S3, using the improved white whale optimization algorithm to initialize the connection weights and thresholds of the BP neural network, improving the quality of the initial solution of the model; S4, constructing a feedforward neural network model, using the error back propagation algorithm for network training; Based on the trained network model, future traffic flow prediction is carried out to realize efficient and intelligent traffic management application; The step S2 comprises: S21, introducing the crossover and mutation operation mechanism in genetic algorithm, simulating the genetic and recombination of individuals from the perspective of biological evolution, increasing the information entropy of the population through gene fragment recombination and mutation disturbance; S22, introducing an asynchronous update mechanism, whenever the iteration number meets the condition, a certain proportion of individuals are extracted from the population to "update locally" or "keep the original state", realizing the time dislocation of individual evolution; S23, introducing Levy flight disturbance in the development stage of BWO algorithm, i.e. the stage when individuals approach the current optimal solution, so that individuals can jump farther when updating, avoiding falling into local optimal area; S24, applying sinusoidal and cosine disturbance to individual position to realize periodic fluctuation of search path; S25, using dynamic attenuation learning rate strategy to balance the search development process; S26, setting disturbance probability rules; S27, introduce an exponential step size decay mechanism, by dynamically adjusting the individual update step size to make the algorithm have strong jumping and search range in the early stage; The step S21 crossover operation in each iteration, randomly select two individuals from the current population as parents, set the solution vector respectively as 、 , is the dimension length, randomly select an integer as the crossover point, the two parent individuals are single-point crossover to generate new individuals: The new individual after crossover will replace the original individual with lower fitness, the mutation operation applies multi-scale perturbation mutation to the individual after crossover, according to the preset mutation probability Replace part of the dimension with a random value: wherein are the upper and lower bounds of this dimension; The update model of Levy flight in step S23 is as follows: wherein, is the current optimal individual position; is a randomly selected individual from the population; denotes a dynamic attenuation factor; the Levy distribution is generated as follows: wherein, The Levy mechanism enhances the algorithm's ability to traverse the solution space. In step S24, sinusoidal and cosine disturbance is applied to individual position, and for each individual dimension in the population, according to the parity of individual dimension, the following disturbance is applied respectively: wherein, is the current reference value for the individual; is a random reference individual; is a perturbation coefficient; The step length in step S27 decreases exponentially with the increase of iteration number, and the expression is as follows: wherein, is the displacement step size employed by the current individual; and are the upper and lower bounds of the search space, respectively; is the maximum number of iterations of the algorithm; is the current iteration number; is a hyperparameter that controls the step size decay rate; is the fitness normalized value of the worst individual in the current whale population; is the current population size; When the exponential term approaches 1 and the step size is the maximum available step size ; when the exponential term approaches 0, the step size approaches 0, enabling local fine tuning The individual position is updated by using the decay step length, and the optimization update strategy is as follows: wherein are three independent uniform random coefficients.

2. The intelligent traffic flow prediction method combined with the improved BWO-BP neural network algorithm according to claim 1, characterized in that, In step S1, the data is preprocessed, including data cleaning, normalization processing and input feature set construction. 3.The intelligent traffic flow prediction method with improved BWO-BP neural network algorithm of claim 1, wherein, The step S1 comprises: S11, the original data contains multiple sample records, each record is composed of 7, namely time, five types of vehicle quantity and total vehicle quantity, and vehicle related data is recorded as: , In order to use the minimum-maximum normalization method to standardize the original features, each feature value after processing is mapped to the interval [0, 1]: wherein, represents the value of the th feature at time t, and represent the minimum and maximum values of the feature in the training set, respectively. S12, construct a training sample set conforming to the input format of the BP neural network, adopt a sliding window method to extract a fixed-length historical sequence from the time series as input, and a value at a certain time in the future as output label, set the length of the historical time window as , the th training sample can be expressed as: wherein, is the input feature of the th sample, containing six-dimensional feature data of the past time instants; is the corresponding target prediction value, usually the total number of vehicles at the time instant.

4. The intelligent traffic flow prediction method combined with the improved BWO-BP neural network algorithm according to claim 1, characterized in that, The BP neural network in the step S3 has input nodes, hidden layer nodes, output nodes, and the weights and bias terms include the following parts: input layer to hidden layer weight matrix weight matrix of the hidden layer to the output layer hidden layer bias vector Output layer bias vector After flattening all the above parameters into a one-dimensional vector, the individual representing the optimization variable is: wherein denotes the flattening of a matrix into a vector by row or column; The improved BWO optimization algorithm with exponential step length attenuation, adaptive weight and multi-strategy disturbance mechanism defined in step S2 is used to perform global search on the above vector Each individual position update represents a combination replacement of the neural network parameters, and the parameters corresponding to the optimal individual in fitness are finally reserved for initializing the BP neural network. The optimization update process is shown below. wherein, denotes the update step vector guided by the BWO.

5. The intelligent traffic flow prediction method of claim 4, wherein, The number of input layer nodes of the feedforward neural network model in the step S4 The number of hidden layer nodes corresponding to different types of traffic flow According to cross-validation determination: , is the adjustment coefficient, and the expression ability of the model is improved; the number of output layer nodes is 1, and the predicted value of the total traffic flow corresponds The forward propagation calculation of the network is: wherein, is the input to the hidden layer; is the output of the hidden layer; is the output of the output layer; Taking root mean square error RMSE as the objective function: The gradient descent method is used to update the back propagation parameters: where, is the output layer error; is the hidden layer error; is the sigmoid derivative.

Citation Information

Patent Citations

  • Traffic flow prediction method based on particle swarm optimization neural network

    CN111081022A

  • Short-term traffic flow prediction method based on GWO-Elman neural network

    CN117131899A