CN116110234B - Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device - Google Patents

Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device Download PDF

Info

Publication number
CN116110234B
CN116110234B CN202310376108.XA CN202310376108A CN116110234B CN 116110234 B CN116110234 B CN 116110234B CN 202310376108 A CN202310376108 A CN 202310376108A CN 116110234 B CN116110234 B CN 116110234B
Authority
CN
China
Prior art keywords
traffic flow
data
artificial intelligence
neural network
flow prediction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310376108.XA
Other languages
Chinese (zh)
Other versions
CN116110234A (en
Inventor
郁强
田雨
来佳飞
曹鹏寅
毛云青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCI China Co Ltd
Original Assignee
CCI China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CCI China Co Ltd filed Critical CCI China Co Ltd
Priority to CN202310376108.XA priority Critical patent/CN116110234B/en
Publication of CN116110234A publication Critical patent/CN116110234A/en
Application granted granted Critical
Publication of CN116110234B publication Critical patent/CN116110234B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/065Traffic control systems for road vehicles by counting the vehicles in a section of the road or in a parking area, i.e. comparing incoming count with outgoing count
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • G08G1/0129Traffic data processing for creating historical data or processing based on historical data
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Analytical Chemistry (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Chemical & Material Sciences (AREA)
  • Traffic Control Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a traffic flow prediction method and device based on artificial intelligence and application thereof, and the method comprises the following steps: s00, acquiring historical traffic flow data of a target road and performing noise reduction treatment; s10, performing mixed data enhancement operation on historical traffic flow data, and constructing a virtual data sample by mining the relation among different samples of different types; s20, detecting an abnormal value of the historical traffic flow data with the reinforced mixed data and processing the abnormal value; s30, acquiring depth features through CNN, acquiring time features through LSTM network, then carrying out feature fusion, further carrying out attention enhancement operation, and enhancing space features, thereby completing the construction of a feature extraction model; and S40, classifying the model-extracted sample by using a classifier and outputting a classification result, wherein the classification result is used as a traffic flow prediction result of the target road. The method has higher robustness and generalization capability.

Description

Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a traffic flow prediction method and device based on artificial intelligence and application of the traffic flow prediction method and device.
Background
Along with the development of scientific technology and the appearance of the technology of the Internet of things, the traffic technology is more and more informationized, intelligent and convenient. The intelligent traffic system is a more efficient and accurate information system, and is a direction of current and future traffic field development. The intelligent traffic can reduce the traffic road operation pressure and maximize the utilization of road infrastructure, and can ensure the safe trip and reduce the traffic jam in the aspect of traffic trip, thereby improving the intelligent traffic operation efficiency. The advent of intelligent transportation is consistent with the current sustainable development, and is therefore receiving more and more attention from regions and cities. Intelligent traffic can reduce traffic jams and improve traffic efficiency mainly by predicting traffic flow in a certain current and future time period, and by predicting people who can help travel, waiting time on roads is reduced.
The current traffic flow is predicted primarily by historical traffic flow data to predict future traffic flow. As artificial intelligence technology has matured and applied in various industries, machine learning and deep learning have also been studied by more students, and intelligent traffic flow prediction has been entered. Machine learning and deep learning also achieve good results in traffic flow prediction. However, most applications in traffic flow prediction are currently based on traditional mathematical statistical model prediction, combined model prediction, and artificial intelligence neural network model prediction. When the neural network algorithm is used for predicting the traffic flow, the selection of parameters such as initial weights and the selection of a network training sample set can influence the convergence speed of the gradient decrease of the network and the probability of the gradient decrease to the minimum training error, so that a large amount of parameter adjustment work is required to be made by technicians according to experience, and therefore, the problem of low accuracy of a single neural network model is caused.
At present, some algorithms can predict the traffic flow by using machine learning or deep learning technology, for example, chinese patent CN202210577402.2 proposes a traffic flow prediction method, device and equipment based on LSTM feedback mechanism. The method comprises the following steps: dividing an initial training data set into a plurality of training data sets, and iteratively training a pre-constructed LTSM model by using the plurality of training data sets to obtain a plurality of candidate prediction models and a final prediction model; predicting the current traffic flow of the area to be predicted according to the candidate prediction models and the final prediction model to obtain a deviation data training set; training a pre-constructed deviation LTSM model by using a deviation data training set to obtain a trained deviation LTSM model; carrying out traffic flow prediction according to the final prediction model and the trained deviation LTSM model to obtain an initial prediction result and a prediction deviation; and correcting the initial prediction result by using the prediction deviation to obtain a final prediction value of the vehicle flow. By adopting the method, the accuracy of traffic flow prediction can be improved.
Chinese patent CN202011455308.7 proposes a network traffic flow prediction method based on deep learning, which belongs to the field of machine learning research. The method establishes a two-way long-short-term memory network model with the historical traffic volume as input, namely, the data of 8-24 hours in the past is taken as input, and the network traffic volume data of one hour in the future is predicted. Acquiring historical data of network about vehicle operation, and counting the network about vehicle flow; (2) Carrying out flow change analysis on the network contract vehicle operation data, and matching and marking external environment attributes of flow sudden increase or sudden decrease; (3) DBSCAN clustering; (4) enlarging the clustering area according to the information points; (5) And constructing an LSTM prediction model taking the historical traffic distribution as input, and predicting network traffic data of each area in a future time period. The method of the invention improves the prediction accuracy, especially in some special cases (such as extreme weather, holidays, large activities, etc.).
Chinese patent CN202110588265.8 proposes a method and system for predicting urban area road network traffic flow based on hybrid deep learning model, comprising: based on the traffic data of the stuck vehicles, carrying out traffic flow statistics; carrying out space-time distribution feature analysis on the traffic flow data of the bus, and carrying out feature extraction according to analysis results to obtain space-time influence factors; constructing and training a ConvLSTM and BiLSTM mixed deep learning model according to the space-time influence factors; synchronously predicting the traffic flow of the urban area road network, selecting a prediction loss function and an evaluation index, and visually expressing the result; and calculating the traffic flow change degree through a linear time sequence prediction model Prophet, and carrying out traffic state identification to realize traffic state prejudgment. The invention can help traffic management departments to dynamically manage and schedule urban roads, optimally manage urban road networks from global start, and formulate management strategies and management schemes so as to provide effective data support for traffic managers and decision makers.
However, although the innovations of these schemes are better, the vehicle flow can be predicted by machine learning or deep learning techniques, the following problems still need to be further solved:
(1) Many existing methods are difficult to carry out depth feature extraction on traffic flow data, so that an algorithm is difficult to accurately identify and classify.
(2) When the vehicle flow is predicted by deep learning or a neural network, the problems of gradient disappearance and gradient explosion easily occur in the process of updating model parameters by the traditional back propagation mode, so that the model training effect is poor and the recognition precision is low.
(3) When deep learning or neural network is used for predicting the traffic flow, the problems of local minimization and slow convergence speed often occur, the model training is influenced, and the traffic flow prediction efficiency is seriously influenced.
Therefore, there is a need for an artificial intelligence-based traffic flow prediction method, apparatus and application thereof to solve the problems of the prior art.
Disclosure of Invention
The embodiment of the application provides a traffic flow prediction method and device based on artificial intelligence and application thereof, aiming at the problems that the prior art algorithm is difficult to accurately identify and classify, the model training effect is poor, the identification precision is low and the like.
The method mainly comprises the steps of carrying out mixed data enhancement, outlier detection, constructing a feature extraction model and classifying by using a classifier on historical traffic flow data, wherein the feature extraction model adopts a longhorn beetle whisker algorithm based on Euclidean distance to replace a traditional gradient descent algorithm in the process of a parameter optimizing method of a neural network, so that gradient elimination and gradient explosion phenomena which are easy to generate by the traditional gradient descent algorithm are avoided.
In a first aspect, the present application provides an artificial intelligence based traffic flow prediction method comprising the steps of:
s00, acquiring historical traffic flow data of a target road and performing noise reduction treatment;
s10, performing mixed data enhancement operation on historical traffic flow data, and constructing a virtual data sample by mining the relation between different samples of different types, so as to realize data amplification;
s20, detecting an abnormal value of the historical traffic flow data with the reinforced mixed data and processing the abnormal value;
s30, acquiring depth features through CNN, acquiring time features through LSTM network, then carrying out feature fusion, further carrying out attention enhancement operation, and enhancing space features, thereby completing the construction of a feature extraction model;
and S40, classifying the model-extracted sample by using a classifier and outputting a classification result, wherein the classification result is used as a traffic flow prediction result of the target road.
Further, in step S00, the historical traffic data is subjected to maximum and minimum normalization so that the data is mapped into a set section.
Further, in step S10, the mixed data enhancement operation performs weighted summation on two samples randomly extracted from the training set in the historical traffic flow data and the labels thereof according to the set weight based on Mixup, so as to obtain a virtual data sample.
Further, in step S20, an outlier is detected by the rad criterion.
Further, in step S30, depth features and time features are fused by a neural network, and the number of neurons of the input layer of the neural network is equal to the total number of the two features.
In the step S30, the parameter optimizing method of the neural network adopts a longhorn whisker algorithm based on Euclidean distance.
Further, the parameter optimizing method of the longhorn beetle whisker algorithm based on the Euclidean distance comprises the following specific steps:
initializing a longhorn beetle population, randomly setting the longhorn beetle position, and taking the longhorn beetle position as a neural network parameter;
carrying out random vector on the whisker direction of the longhorn beetles and carrying out normalization treatment;
creating a coordinate relationship between the left and right longicorn and the centroid based on the normalization processing result;
determining the odor intensity of the right and left beards of the longicorn according to an adaptability function, wherein the adaptability function is established based on Euclidean distance between an input sample characteristic vector and a neuron weight vector value;
establishing a longicorn position iterative updating method and setting a learning rate;
calculating the individual fitness of the longhorn beetles and the average fitness of the longhorn beetles according to the position coordinates of the individual longhorn beetles in the longhorn beetles and comparing the individual fitness of the longhorn beetles with the average fitness of the longhorn beetles;
updating the position of the longicorn individual according to the comparison result, adjusting the weight and the threshold value of the updated neural network, and calculating the fitness function value at the current coordinate position;
and when the fitness function value reaches the set precision or iterates to the maximum times, taking the current position of the longhorn beetle as the parameter value of the current neural network.
In a second aspect, the present application provides an artificial intelligence based traffic flow prediction device comprising:
the acquisition module is used for acquiring historical traffic flow data of the target road and carrying out noise reduction treatment;
the data enhancement module is used for carrying out mixed data enhancement operation on the historical traffic flow data, and constructing a virtual data sample by mining the relation among different samples of different types so as to realize data amplification;
the abnormal value processing module is used for detecting abnormal values of the historical traffic flow data after the mixed data are enhanced and processing the abnormal values;
the feature extraction model construction module is used for acquiring depth features through CNN, acquiring time features through LSTM network, then carrying out feature fusion, further carrying out attention enhancement operation, and enhancing the space features so as to finish the construction of a feature extraction model;
and the output module is used for classifying the samples extracted by the model by using the classifier and outputting a classification result which is used as a traffic flow prediction result of the target road.
In a third aspect, the present application provides an electronic device comprising a memory having a computer program stored therein and a processor configured to run the computer program to perform the artificial intelligence based vehicle flow prediction method described above.
In a fourth aspect, the present application provides a readable storage medium having stored therein a computer program comprising program code for controlling a process to execute a process comprising an artificial intelligence based vehicle flow prediction method according to the above.
The main contributions and innovation points of the invention are as follows: 1. compared with the prior art, the method can effectively improve the prediction precision in the traffic flow prediction task, and meanwhile, the improved algorithm provided in the feature extraction stage is beneficial to full excavation and deep extraction of the traffic flow data features by the algorithm model, and in addition, the algorithm model has higher robustness and generalization capability;
2. compared with the prior art, the generalization capability of the model is improved through mixed data enhancement operation, the sensitivity of the model to noise is reduced, and the stability of the model during training is improved. The data amplification can be respectively carried out on each type of sample, and the data amplification belongs to the similar enhancement.
3. Compared with the prior art, under the condition of facing massive data sets, the manual processing mode is liable to cause excessive workload. Therefore, the application selects Laida criterion
Figure SMS_1
Criteria) for detecting outliers, the method has the advantages of simplicity, easiness, relative accuracy and wide applicability.
4. Compared with the prior art, the method and the device have the advantages that the depth characteristics are obtained by using CNN, the time characteristics are obtained by using LSTM network, then the characteristic fusion is carried out, and the attention enhancement operation is further carried out. In the feature fusion stage, the parameter optimizing method for the neural network in the application adopts the Buffalo whisker algorithm based on Euclidean distance to replace the traditional gradient descent algorithm, so that gradient elimination and gradient explosion phenomena which are easy to generate by the traditional gradient descent algorithm are avoided. In addition, during design, the method adopts the operation of constructing virtual data samples and enhancing data mixing, can improve the generalization capability of the model, enhances the robustness of the model, and can well solve the problem of limited generalization capability of the model existing in the longhorn beetle whisker algorithm.
5. Compared with the prior art, the method and the device have the advantages that through the attention module, the characteristic self-adaptive refinement capability can be improved during characteristic extraction, and therefore the prediction effect is further improved.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the other features, objects, and advantages of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a flow of an artificial intelligence based traffic flow prediction method according to an embodiment of the present application;
FIG. 2 is a flow chart of a feature extraction portion of the present application;
fig. 3 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with aspects of one or more embodiments of the present description as detailed in the accompanying claims.
It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. Furthermore, individual steps described in this specification, in other embodiments, may be described as being split into multiple steps; while various steps described in this specification may be combined into a single step in other embodiments.
The prior art has the problems that the depth feature extraction of the traffic flow data is difficult, so that the algorithm is difficult to accurately identify and classify; when the vehicle flow is predicted by using deep learning or a neural network, the problems of gradient disappearance and gradient explosion easily occur in the process of updating model parameters by using the traditional back propagation mode, so that the model training effect is poor and the recognition precision is low; when deep learning or neural network is used for predicting the traffic flow, the problems of local minimization, slow convergence speed and the like often occur, the model training is influenced, and the traffic flow prediction efficiency is seriously influenced.
Based on this, the present invention solves the problems of the prior art based on improvements in the artificial intelligence and feature extraction stages.
Example 1
The application aims to provide an artificial intelligence-based traffic flow prediction method, and specifically, referring to fig. 1, the method comprises the following steps:
s00, acquiring historical traffic flow data of a target road and performing noise reduction treatment;
in the present embodiment, historical traffic data of a specific road (target road) is acquired, and the data is preprocessed. The influence of noise data on experimental results can be reduced by data preprocessing, and the experimental effects are convenient to measure, so that the data used in the method is subjected to maximum and minimum normalization, and the data is mapped to the interval
Figure SMS_2
And the following formula:
Figure SMS_3
where x is input data, x max Is to take the maximum input data value, x min Is to take the minimum input data value and x' is the normalized output value.
For example, the data set acquisition region is divided into 32x32 different regions. Each area is approximately 1km x1km square, the data set is divided into 48 time intervals according to the definition of traffic flow and 30 minutes as the size of the time intervals, and the traffic inflow and outflow flows of each time interval of each area are counted. External factor characteristic data (unstructured data) can be converted into binary vectors using one-hot encoding.
S10, performing mixed data enhancement operation on historical traffic flow data, and constructing a virtual data sample by mining the relation between different samples of different types, so as to realize data amplification;
in this embodiment, the generalization capability of the model is expected to be increased, the sensitivity of the model to noise is reduced, and the stability of the model during training is improved. In this regard, the increase of the diversity of samples is considered, so that the model can learn a general rule from abundant sample data, and the generalization capability of the model is improved. For this purpose, the application proposes a data amplification mode independent of a data set, and virtual data samples are constructed by mining the relations among different types of different samples. The method introduces and improves the thought of Mixup, and carries out weighted summation on two samples randomly extracted in the training set and the labels thereof according to a certain weight, thereby realizing the construction of the virtual data samples. The formula is as follows:
Figure SMS_4
wherein x is ja Is a data sample before enhancement, y ja Is a pre-enhancement data sample tag, beta () is a Beta function, is an enhanced data sample tag, and is denoted by the symbol lambdaThe combined weights, hyper-parameters γ, control the interpolation strength between feature-tag pairs. And obtaining the enhanced traffic flow data through data enhancement operation.
The original mode in Mixup is linear interpolation, and the weighted summation mode is adopted in the method, so that the method has the advantages of being higher in robustness and good in model learning ability, the generalization ability of the model can be improved, the sensitivity of the model to noise is reduced, the stability of the model in training is improved, and finally the accuracy of vehicle flow prediction is improved.
S20, detecting an abnormal value of the historical traffic flow data with the reinforced mixed data and processing the abnormal value;
in this embodiment, the acquired data has larger or smaller element values, which deviate significantly from the actual situation, which is a so-called outlier. However, in the case of a massive data set, the manual processing method tends to cause excessive workload. Therefore, the application selects the Laida criterion (3 sigma criterion) to detect the abnormal value. Set up data set
Figure SMS_5
Obeying the normal distribution, judging the abnormal value according to the following formula:
Figure SMS_6
where x represents the data of the data set after the mixed enhancement, μ represents the mean value, and δ represents the standard deviation. The Laida rule indicates that if the value of x exceeds the interval (mu-3 delta, mu+3 delta), this data can be treated as outlier data, the outlier detected by the Laida rule is filled with the mean.
S30, acquiring depth features through CNN, acquiring time features through LSTM network, then carrying out feature fusion, further carrying out attention enhancement operation, and enhancing space features, thereby completing the construction of a feature extraction model;
in this embodiment, the present application proposes a feature extraction method based on CNN and LSTM, where the model is shown in fig. 2, and specifically includes:
(1) Depth features are obtained using CNN. CNN mainly includes an input layer, a convolution layer, a pooling layer, and an output layer. Wherein the convolution layer extracts features by learning the weights of the convolution kernels during training. The pooling layer is used for retaining useful features, eliminating redundant useless features and achieving the effect of dimension reduction. And inputting the preprocessed data into a trained CNN model, and sequentially carrying out 64 x3 convolution operation and 128 x3 convolution operation, wherein the overfitting prevention operation ratio is set to be 0.5.
(2) The time signature is obtained using an LSTM network. A recurrent neural network is a neural network for processing sequence data, and is generally applied to time-text data processing tasks. LSTM is a special circulating neural network, and the gradient disappearance problem of the circulating neural network can be well solved by introducing 3 control unit structures of a forgetting gate, an input gate and an output gate into cells to update the cell states in the network. The specific formula is as follows:
Figure SMS_7
wherein f, i, t, o, h, C, W, b represents forgetting, input, time step, output layer, hidden layer, cell state, weight matrix, bias, respectively. In the LSTM model, the emmbedding layer is set to 78×1 dimensions, the LSTM layer unit is set to 32, and the overfitting prevention operation ratio of the overfitting prevention dropout layer is set to 0.1. Both the embedding layer and the dropout layer are part of the LSTM model, which are both in the prior art and are not described herein.
(3) And fusing the depth characteristic and the time characteristic by using a neural network. The two characteristics are fused by adopting a neural network, the number of neurons of an input layer of the neural network is equal to the total number of the two input characteristics, and the number of neurons of an output layer is 100. Thus, the performance and generalization capability of the model can be effectively improved.
Preferably, the method for optimizing the parameters of the neural network adopts the longhorn beetle whisker algorithm based on Euclidean distance to replace the traditional gradient descent algorithm, thereby avoiding the gradient elimination and gradient explosion phenomena which are easy to generate by the traditional gradient descent algorithm. The longhorn beetle whisker search algorithm is a new technology inspired by the longhorn beetle searching food, and can be used for optimizing an objective function, and the biological principle is as follows: when the longicorn individual searches for food, the specific position of the food is not known at first, and only the intensity of the odor concentration of the food in the air can be perceived, so that the longicorn individual can eat the food by using the perception capability. Each longicorn individual senses the concentration of the food smell in the current environment through the left long tentacle and the right long tentacle, if the sensing concentration of the right tentacle is larger than that of the left tentacle, the longicorn will fly to the right next step, otherwise, the longicorn will fly to the left. According to the simple food searching principle, the individual longhorn beetles can effectively and quickly find the specific position of food. The longhorn beetle whisker search algorithm can easily realize the process of automatic optimization without knowing specific expression forms of functions, gradients and other various information in advance, and the optimization speed is obviously improved due to the fact that the number of longhorn beetles is only one.
In this embodiment, the steps of building the longhorn beetle whisker search algorithm model based on the euclidean distance are as follows:
solving for
Figure SMS_8
When the dimension model is optimized, the longicorn individual can be represented by 3 points of mass center, left whisker and right whisker.
1) Firstly, initializing the longicorn population, and randomly setting the longicorn position, namely randomly setting the parameters of the neural network.
2) The orientation of the longhorn beetle beards is subjected to random vector and normalization treatment to obtain the longhorn beetle beards:
Figure SMS_9
wherein, the ranges () is a random function; d represents the spatial dimension.
3) Creating a coordinate relation between the left and right longhorn beetles and the mass center:
Figure SMS_10
wherein x is rs Representing the position coordinate of the right beard of the longhorn beetle at the s-th iteration, x 1s Representing the position coordinate of the longhorn beetle's left whisker at the s-th iteration, x s Representing the centroid coordinates of the longhorn beetle at the s-th iteration, L representing the distance between the left and right beards.
4) Determining the odor intensity of the longicorn, i.e. f (x) r ) And f (x) 1 ) The f function is an fitness function, and the fitness function is defined as follows:
Figure SMS_11
wherein X is i For input samples, |omega j -X i And II is the Euclidean distance between the input sample characteristic vector and the neuron weight vector value, and n is the input sample number.
5) The method for iteratively updating the position of the longhorned beetles comprises the following steps:
Figure SMS_12
where β(s) represents the step size at the s-th iteration, f (x) 1s ) And f (x) rs ) Respectively representing the odor intensity of the longicorn left and right beards at the s-th iteration; sign () is a sign function; mu is the learning rate, generally 0.95 is taken, and the learning rate is reduced by 50% every 100 iterations. If the adaptability of the right whisker is greater than that of the left whisker, the longicorn moves towards the right whisker direction by a step length beta(s); otherwise, move to the left whisker direction.
6) According to the coordinate position of the longicorn individual in the longicorn group, respectively obtaining the adaptability f of the longicorn individual and the average adaptability fag of the longicorn group by utilizing an algorithm formula (a adaptability function definition formula), comparing the intensity of the adaptability f of the longicorn individual and the average adaptability fag of the longicorn group, updating the position of the longicorn individual, immediately adjusting the weight and the threshold value of the updated neural network, and calculating the adaptability function value under the current coordinate position.
7) Judging whether the fitness function value reaches the set precision (the value is 0.001) or iterating for the maximum times (500 times), and if the condition requirement is met, stopping the searching process, and taking the current position of the longhorn beetle as the parameter value of the current neural network.
(4) The attention-introducing enhancement module performs spatial feature enhancement. The combination of the CNN and the LSTM can use the CNN as the feature extraction and the LSTM as the sequence prediction, and the attention mechanism can select more important parts from a large amount of information, thereby being beneficial to improving the accuracy rate of traffic flow detection. Since self-attention can reduce the influence of external information, the attention mechanism and the self-attention mechanism are selected. The self-attention mechanism calculates the matrix output by the following formula:
Figure SMS_13
wherein Q represents a set of query vector moments, K represents a set of key vector matrices, d k Representing the dimension of key, V represents the vector matrix of features. The point multiplication of Q and K is calculated first, and then divided by
Figure SMS_14
And normalizing the result into probability distribution by using Softmax operation, and multiplying the probability distribution by a matrix V to obtain the weight.
And S40, classifying the model-extracted sample by using a classifier and outputting a classification result, wherein the classification result is used as a traffic flow prediction result of the target road.
In this embodiment, the present application classifies the samples after feature extraction using a Softmax classification function. The Softmax function is:
Figure SMS_15
Y i representing the i-th element in the feature vector,
Figure SMS_16
is the score of each category, softmax function S Yi Mapping elements in the input vector to (0, 1) intervalsAnd obtaining a probability vector of the input vector, wherein the output category of the traffic flow prediction is a category corresponding to the maximum probability value in the probability vector obtained by mapping the Softmax function.
Example two
Based on the same conception, the application also provides an artificial intelligence-based traffic flow prediction device, which comprises:
the acquisition module is used for acquiring historical traffic flow data of the target road and carrying out noise reduction treatment;
the data enhancement module is used for carrying out mixed data enhancement operation on the historical traffic flow data, and constructing a virtual data sample by mining the relation among different samples of different types so as to realize data amplification;
the abnormal value processing module is used for detecting abnormal values of the historical traffic flow data after the mixed data are enhanced and processing the abnormal values;
the feature extraction model construction module is used for acquiring depth features through CNN, acquiring time features through LSTM network, then carrying out feature fusion, further carrying out attention enhancement operation, and enhancing the space features so as to finish the construction of a feature extraction model;
and the output module is used for classifying the samples extracted by the model by using the classifier and outputting a classification result which is used as a traffic flow prediction result of the target road.
Example III
This embodiment also provides an electronic device, referring to fig. 3, comprising a memory 404 and a processor 402, the memory 404 having stored therein a computer program, the processor 402 being arranged to run the computer program to perform the steps of any of the method embodiments described above.
In particular, the processor 402 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more integrated circuits of embodiments of the present application.
The memory 404 may include, among other things, mass storage 404 for data or instructions. By way of example, and not limitation, memory 404 may comprise a Hard Disk Drive (HDD), floppy disk drive, solid State Drive (SSD), flash memory, optical disk, magneto-optical disk, tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Memory 404 may include removable or non-removable (or fixed) media, where appropriate. Memory 404 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 404 is a Non-Volatile (Non-Volatile) memory. In particular embodiments, memory 404 includes Read-only memory (ROM) and Random Access Memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or FLASH memory (FLASH) or a combination of two or more of these. The RAM may be Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM) where appropriate, and the DRAM may be fast page mode dynamic random access memory 404 (FPMDRAM), extended Data Output Dynamic Random Access Memory (EDODRAM), synchronous Dynamic Random Access Memory (SDRAM), or the like.
Memory 404 may be used to store or cache various data files that need to be processed and/or used for communication, as well as possible computer program instructions for execution by processor 402.
Processor 402 implements any of the artificial intelligence based traffic flow prediction methods of the above embodiments by reading and executing computer program instructions stored in memory 404.
Optionally, the electronic apparatus may further include a transmission device 406 and an input/output device 408, where the transmission device 406 is connected to the processor 402 and the input/output device 408 is connected to the processor 402.
The transmission device 406 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through the base station to communicate with the internet. In one example, the transmission device 406 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
The input-output device 408 is used to input or output information. In this embodiment, the input information may be historical traffic data of a certain road, and the output information may be a traffic prediction result of the certain road, and the like.
Example IV
The present embodiment also provides a readable storage medium having stored therein a computer program comprising program code for controlling a process to execute the process, the process comprising the artificial intelligence based vehicle flow prediction method according to the first embodiment.
It should be noted that, specific examples in this embodiment may refer to examples described in the foregoing embodiments and alternative implementations, and this embodiment is not repeated herein.
In general, the various embodiments may be implemented in hardware or special purpose circuits, software, logic or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software which may be executed by a controller, microprocessor or other computing device, although the invention is not limited thereto. While various aspects of the invention may be illustrated and described as block diagrams, flow charts, or using some other pictorial representation, it is well understood that these blocks, apparatus, systems, techniques or methods described herein may be implemented in, as non-limiting examples, hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controller or other computing devices, or some combination thereof.
Embodiments of the invention may be implemented by computer software executable by a data processor of a mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and/or macros can be stored in any apparatus-readable data storage medium and they include program instructions for performing particular tasks. The computer program product may include one or more computer-executable components configured to perform embodiments when the program is run. The one or more computer-executable components may be at least one software code or a portion thereof. In addition, in this regard, it should be noted that any blocks of the logic flows as illustrated may represent program steps, or interconnected logic circuits, blocks and functions, or a combination of program steps and logic circuits, blocks and functions. The software may be stored on a physical medium such as a memory chip or memory block implemented within a processor, a magnetic medium such as a hard disk or floppy disk, and an optical medium such as, for example, a DVD and its data variants, a CD, etc. The physical medium is a non-transitory medium.
It should be understood by those skilled in the art that the technical features of the above embodiments may be combined in any manner, and for brevity, all of the possible combinations of the technical features of the above embodiments are not described, however, they should be considered as being within the scope of the description provided herein, as long as there is no contradiction between the combinations of the technical features.
The foregoing examples merely represent several embodiments of the present application, the description of which is more specific and detailed and which should not be construed as limiting the scope of the present application in any way. It should be noted that variations and modifications can be made by those skilled in the art without departing from the spirit of the present application, which falls within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (8)

1. The traffic flow prediction method based on artificial intelligence is characterized by comprising the following steps of:
s00, acquiring historical traffic flow data of a target road and performing noise reduction treatment;
s10, performing mixed data enhancement operation on the historical traffic flow data, and constructing a virtual data sample by mining the relation between different samples of different types so as to realize data amplification;
s20, detecting an abnormal value of the historical traffic flow data with the reinforced mixed data and processing the abnormal value;
s30, acquiring depth features through CNN, acquiring time features through LSTM network, fusing the depth features and the time features through neural network, further performing attention enhancement operation, and enhancing the space features, so that the construction of a feature extraction model is completed;
the quantity of neurons of the input layer of the neural network is equal to the total quantity of the two characteristics; the parameter optimizing method of the neural network adopts a longhorn beetle whisker algorithm based on Euclidean distance;
and S40, classifying the model-extracted sample by using a classifier and outputting a classification result, wherein the classification result is used as a traffic flow prediction result of the target road.
2. The artificial intelligence based traffic prediction method according to claim 1, wherein in step S00, the historical traffic data is subjected to maximum and minimum normalization so that the data is mapped into a set interval.
3. The artificial intelligence based traffic flow prediction method according to claim 1, wherein in step S10, the mixed data enhancement operation is based on mix up, and two samples randomly extracted from the training set in the historical traffic flow data and their labels are weighted and summed according to a set weight to obtain a virtual data sample.
4. The artificial intelligence based traffic flow prediction method according to claim 1, wherein in step S20, outliers are detected by the rada criterion.
5. The traffic flow prediction method based on artificial intelligence according to claim 4, wherein the parameter optimizing method of the longhorn beetle whisker algorithm based on the euclidean distance is specifically as follows:
initializing a longhorn beetle population, randomly setting the longhorn beetle position, and taking the longhorn beetle position as a neural network parameter;
carrying out random vector on the whisker direction of the longhorn beetles and carrying out normalization treatment;
creating a coordinate relationship between the left and right longicorn and the centroid based on the normalization processing result;
determining the odor intensity of the right and left beards of the longicorn according to an adaptability function, wherein the adaptability function is established based on Euclidean distance between an input sample characteristic vector and a neuron weight vector value;
establishing a longicorn position iterative updating method and setting a learning rate;
calculating the individual fitness of the longhorn beetles and the average fitness of the longhorn beetles according to the position coordinates of the individual longhorn beetles in the longhorn beetles and comparing the individual fitness of the longhorn beetles with the average fitness of the longhorn beetles;
updating the position of the longicorn individual according to the comparison result, adjusting the weight and the threshold value of the updated neural network, and calculating the fitness function value at the current coordinate position;
and when the fitness function value reaches the set precision or iterates to the maximum times, taking the current position of the longhorn beetle as the parameter value of the current neural network.
6. An artificial intelligence based traffic flow prediction device, comprising:
the acquisition module is used for acquiring historical traffic flow data of the target road and carrying out noise reduction treatment;
the data enhancement module is used for carrying out mixed data enhancement operation on the historical traffic flow data, and constructing a virtual data sample by mining the relation among different samples of different types so as to realize data amplification;
the abnormal value processing module is used for detecting abnormal values of the historical traffic flow data after the mixed data are enhanced and processing the abnormal values;
the feature extraction model construction module is used for acquiring depth features through CNN, acquiring time features through LSTM network, fusing the depth features and the time features through neural network, further performing attention enhancement operation, and enhancing the space features so as to finish the construction of the feature extraction model;
wherein the number of neurons of the input layer of the neural network is equal to the total number of the two characteristics; the parameter optimizing method of the neural network adopts a longhorn beetle whisker algorithm based on Euclidean distance;
and the output module is used for classifying the samples extracted by the model by using the classifier and outputting a classification result which is used as a traffic flow prediction result of the target road.
7. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the artificial intelligence based vehicle flow prediction method of any one of claims 1 to 5.
8. A readable storage medium, characterized in that the readable storage medium has stored therein a computer program comprising program code for controlling a process to execute a process comprising the artificial intelligence based traffic flow prediction method according to any one of claims 1 to 5.
CN202310376108.XA 2023-04-11 2023-04-11 Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device Active CN116110234B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310376108.XA CN116110234B (en) 2023-04-11 2023-04-11 Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310376108.XA CN116110234B (en) 2023-04-11 2023-04-11 Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device

Publications (2)

Publication Number Publication Date
CN116110234A CN116110234A (en) 2023-05-12
CN116110234B true CN116110234B (en) 2023-07-14

Family

ID=86267618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310376108.XA Active CN116110234B (en) 2023-04-11 2023-04-11 Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device

Country Status (1)

Country Link
CN (1) CN116110234B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117312783B (en) * 2023-11-30 2024-02-06 山东大学 Ship heave compensation prediction method and device based on neural network and storage medium
CN117454124B (en) * 2023-12-26 2024-03-29 山东大学 Ship motion prediction method and system based on deep learning

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113222239A (en) * 2021-05-08 2021-08-06 浙江科技学院 Short-time traffic flow prediction method based on CNN-LSTM-At neural network

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10940863B2 (en) * 2018-11-01 2021-03-09 GM Global Technology Operations LLC Spatial and temporal attention-based deep reinforcement learning of hierarchical lane-change policies for controlling an autonomous vehicle
CN109859469A (en) * 2019-02-15 2019-06-07 重庆邮电大学 A kind of vehicle flowrate prediction technique based on integrated LSTM neural network
CN111383452A (en) * 2019-12-03 2020-07-07 东南大学 Method for estimating and predicting short-term traffic running state of urban road network
CN112000084B (en) * 2020-09-07 2022-11-15 华北电力大学 Intelligent BIT design method of controller module based on 1D-CNN and GRU-SVM
CN113642225A (en) * 2021-05-24 2021-11-12 国网新疆电力有限公司经济技术研究院 CNN-LSTM short-term wind power prediction method based on attention mechanism
CN113673775A (en) * 2021-08-25 2021-11-19 武汉科技大学 Time-space combination prediction method based on CNN-LSTM and deep learning
CN115344927A (en) * 2022-08-17 2022-11-15 中国三峡建工(集团)有限公司 High arch dam construction simulation parameter dynamic updating method based on engineering historical data
CN115712857A (en) * 2022-10-31 2023-02-24 上海电力大学 Abnormal flow detection method, equipment and medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113222239A (en) * 2021-05-08 2021-08-06 浙江科技学院 Short-time traffic flow prediction method based on CNN-LSTM-At neural network

Also Published As

Publication number Publication date
CN116110234A (en) 2023-05-12

Similar Documents

Publication Publication Date Title
CN116110234B (en) Traffic flow prediction method and device based on artificial intelligence and application of traffic flow prediction method and device
US20240132078A1 (en) Driving model training method, driver identification method, apparatus, device and medium
CN112085947A (en) Traffic jam prediction method based on deep learning and fuzzy clustering
CN111091196B (en) Passenger flow data determination method and device, computer equipment and storage medium
CN110164129B (en) Single-intersection multi-lane traffic flow prediction method based on GERNN
CN109598936A (en) A kind of prediction of short-term traffic volume method based on dynamic STKNN model
Chen et al. A multiscale-grid-based stacked bidirectional GRU neural network model for predicting traffic speeds of urban expressways
CN104156943A (en) Multi-target fuzzy cluster image variance detecting method based on non-control-neighborhood immune algorithm
CN110738362A (en) method for constructing prediction model based on improved multivariate cosmic algorithm
CN115018193A (en) Time series wind energy data prediction method based on LSTM-GA model
CN117094535B (en) Artificial intelligence-based energy supply management method and system
CN117636183A (en) Small sample remote sensing image classification method based on self-supervision pre-training
CN105678798A (en) Multi-target fuzzy clustering image segmentation method combining local spatial information
CN116245259B (en) Photovoltaic power generation prediction method and device based on depth feature selection and electronic equipment
CN110944295B (en) Position prediction method, position prediction device, storage medium and terminal
CN115345257B (en) Flight trajectory classification model training method, classification method, device and storage medium
US20230252282A1 (en) Method, server, and system for deep metric learning per hierarchical steps of multi-labels and few-shot inference using the same
CN113656707A (en) Financing product recommendation method, system, storage medium and equipment
CN115544259B (en) Long text classification preprocessing model and construction method, device and application thereof
EP4250190A1 (en) Cost equalization special clustering
Reddy et al. Survey on traffic flow prediction for intelligent transportation system using machine learning
Le et al. An Implementation of Traffic Volume Forecasting System using Distributed Deep Learning
Chen Brain Tumor Prediction with LSTM Method
Alshmrany LFD-CNN: Levy flight distribution based convolutional neural network for an adaptive learning style prediction in E-learning environment
US20240044663A1 (en) System and method for predicting destination location

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant