Design and Development of Vehicle Flow System Based on Neural Network

With the development of economy and society, the demand and use of automobiles are increasing all over the world. Cars have become a common means of transportation in people’s daily life, but with it comes the problem of automobile exhaust emission. Nowadays, motor vehicle exhaust has become one of the main sources of air pollutants in many cities. This paper mainly introduces the design and development process of a vehicle flow system based on neural network. In this paper, the demand analysis and overall analysis of the whole system are included, as well as the design and implementation of background algorithms and application functions in the system, which meet the needs of users.


Introduction
With the development of the times and the progress of society, China's economy continues to develop, and at the same time, the automobile industry has gradually grown into one of the pillar industries of China's economy, which has more obvious pull on the whole economy of China. Up to 2015, China's automobile sales have exceeded 24.5 million vehicles, setting a new high in the world, ranking first in the world for ten consecutive years, and at the same time, this figure is still increasing.
The automobile industry is very important to China's economy, and the ten-year strategy of "Made in China 2025" also gives some instructions for the development of the automobile industry. As mentioned in the "Thirteenth Five-Year Plan", taking green manufacturing and intelligent manufacturing as the main goal of the development of China's automobile industry. From the change of the development direction of China's automobile industry from the 12th Five-Year Plan to the 13th Five-Year Plan, it is not difficult to find that China is paying more attention to energy conservation and emission reduction in the automobile industry.
Many car developers believe that in the future development of the automobile industry, cars in the future, like smart phones owned by everyone now, will be widely owned products, and people can install and uninstall various applications in the vehicle system to meet people's different needs in life, travel and transportation. But up to now, automobile exhaust has become one of the main sources of air pollution, which is constantly endangering people's health. It can be seen that energy conservation and emission reduction in the automobile industry are very important.
With the development of the automobile industry, related applications are constantly appearing. At the same time, the continuous construction of urban roads leads to diversified choices of travel routes, so navigation application has become one of the daily applications of people. Nowadays, the production of navigation systems all over the world is more focused on providing users with the shortest path. It is impossible to provide users with more choices of travel routes only by judging the travel time.
This kind of automobile energy saving and emission reduction system based on neural network hopes to solve this problem better. With the continuous development of artificial intelligence technology and the emergence of neural network, we can write better programs to predict and estimate traffic, and provide the most suitable path for each user according to the results. After meeting the user's use requirements, it can not only save fuel costs for users, but also achieve the purpose of' energy saving and emission reduction'. With the increasing demand for car travel and the increasing emphasis on environmental protection, the utilization rate of this system will also increase, which will provide users with better and more suitable personalized travel planning for environmental protection, and also help the world's environmental protection.

Time estimation based on neural network
2.1.1 Circulating neural network, long-term and short-term memory artificial neural network Cyclic neural network (RNN) refers to a recursive cyclic network which takes the sequence data as input, completes recursion in the evolution direction of the sequence, and all nodes, that is, all cyclic units, are linked by chain.
One of the simplest cyclic neural network cyclic units is shown in Figure 1. The neural network has three layers, including input layer X, hidden layer S and output layer Y from bottom to top. According to the time variation, the feed-forward neurons are shared in the cyclic neural network according to the weight value, and each neuron is connected in turn. Therefore, it can be known from the cyclic neural network RNN that "the current output of a sequence is related to the content of the previous input". Long-term and short-term memory network (LSTM) is a kind of time-cycle neural network. LSTM is designed to solve the long-term dependence problem in RNN.
All RNN recurrent neural networks have repetitive module chains. In the standard RNN, the repeating module has a very simple structure, such as a single tanh layer. LSTM also has such a chain structure, but its repeating unit is different from the unit with only one network layer in the standard RNN network, and it has four network layers inside, as shown in Figure 2, to solve the problem of RNN gradient disappearance. week and corresponding weather conditions (including sixteen types such as sunny, rainy and cloudy). The data of this data module will be used for training and testing the model. Data preprocessing: in order to be convenient to use in the program module, the average value and variance of each data are calculated at the data preprocessing stage. When reading and using data, because the data is multi-source, the data range is quite different, which needs to be standardized first, and convolution will be carried out in the model, so it is necessary to ensure that a track is one page long to form a complete matrix, so the sequence is filled with zeros. After the data module is processed, the data form is shown in Figure 3.

Fig.3 Data Patterns Processed in Neural Network Time Estimation Model
In order to make users better understand the composition of data, a sample data diagram is drawn in the algorithm introduction module of the front page, as shown in Figure 4. The program module of time estimation algorithm based on neural network mainly includes three parts: external attribute module, spatio-temporal component module and multi-task learning module. The three modules are interrelated and processed together, thus realizing the function of estimating the travel time of automobiles. The overall program architecture is shown in Figure 5.

External attribute module, spatio-temporal component module and multi-task learning module
In the external attribute module of the time estimation algorithm based on neural network, because many external environment conditions are constantly changing, which will have an impact on the real traffic travel time, these external influencing factors are added to the time estimation algorithm respectively, and several conditions such as travel date, driver information, week and weather are considered in the external attribute module. Because these data are mostly converted into int values in the setting, the change range is large. It can't be used directly in the model, so we choose embedding operation, that is, we use a vector with a relatively low dimension instead of the original feature data with a higher dimension. The embedding method is used to transform each attribute into a vector with a lower dimension. This operation method has two advantages: it can effectively reduce the input dimension and the computational efficiency. On the other hand, when there are categories with the same semantic meaning in the data features, the programs will be mapped very similarly, which is convenient for later use. The overall structure of the external attribute module is shown in Figure 6. The following is a comparison of algorithm effects.

Fig.6 External Attribute Module Structure Diagram
In the spatio-temporal component module, the temporal correlation and spatial correlation of driving track are mainly extracted. Convolution neural network is generally given priority to in spatial features. Two-dimensional mapping is carried out on a table, and driving track is converted into a sequence, so that one-dimensional sliding convolution is carried out, which is transformed into sixteen-dimensional through a linear mapping in the model. According to the set data, the feature map is generated, and then the local path length is added, and then the content of the spatio-temporal component is associated with the data of the external attribute. At this time, the external attribute should be processed as a result with the same convolution size, and the geospatial correlation is followed by the temporal correlation. As mentioned in the characteristics of RNN, the front output in the sequence will affect the back output. In order to avoid gradient disappearance and gradient explosion in long sequences, LSTM is chosen instead of ordinary RNN. LSTM processes the spatio-temporal feature sequence of the output local path. The overall architecture of spatio-temporal component module is shown in Figure 7.
The multi-task learning module is a very important module in the time estimation algorithm based on neural network. In this module, two time estimation methods are combined, including the sum method after local calculation and the overall estimation method. In the multi-task learning module, both of them are calculated once and then adjusted according to the specified weight ratio input by the user. In the local calculation method, the full connection layer is used to convert hi into ri, and adding up each ri is the estimated overall travel route estimation time. The whole estimation method is relatively troublesome, so it is necessary to combine each hi into one H. Considering that each small part has different importance, the average method is not applied, and a weighting mechanism is added in this module. Combining the external attributes of the previous two modules and hi in the NC components, the weights are obtained after processing, and then assigned to each local data in turn. In this way, the calculated h after processing is more reasonable. In the training stage, the loss functions of the two methods should be combined according to a certain proportion, so as to take into account the advantages of the two methods, but in the testing stage, only the whole method is needed. The results analysis part will show the influence of different weights on the training prediction effect. The overall structure flow chart of the multi-task learning module is shown in Figure 8.

Experimental results and analysis
The time estimation algorithm based on neural network realizes more accurate time estimation by combining LSTM with other parts.
In the external attribute component, weather factor and week have great influence on the accuracy of time estimation. However, because this data set uses data related to taxi drivers, taxi drivers are a relatively special driving group, and most of them have the same skilled driving skills, so their influence on prediction does not fluctuate too much. After being used by ordinary drivers in the future, adjusting the data may make the driver information play a proper role.
Secondly, about parameter adjustment, the influence of adjusting Geo Con kernel size on prediction results is tested in experiments. Three, four and five were tested respectively, and the size of three was the best. If the formula is adjusted in Geo Con to increase the road network information, it will get better results, and the prediction error value will drop obviously. Another test is to adjust the weight in the multi-task learning module, which is tested from 0 to 0.99 according to a certain proportion. The error in the middle of the proportion is not much different, and only when 0 and 1 will produce a larger error. If the average calculation method is used instead of weight calculation, the error will increase obviously.

Optimization and application in automobile energy saving and emission reduction system
Four external attribute reference factors are added to the time estimation algorithm based on neural network in the automobile energy saving and emission reduction system, which will better improve the route time prediction of automobile travel, provide users with more accurate travel route planning, and enable users to obtain more green and environmentally friendly travel routes through analysis.
Like the example given in the front-end introduction page, there are many kinds of traffic routes between the same starting point and destination, and the traffic environment changes differently under the influence of different weeks, dates and other factors, so time estimation with external components will have a more accurate effect. At the same time, the red street lamp and other factors in the road have great influence on travel time and fuel consumption. The weight calculation method added in the multitask learning component allows users to select a suitable route through more accurate prediction. It also solves the problem that the error increases obviously with the path lengthening in other previous algorithms.

Convolution neural network and graph convolution neural network
Convolution neural network, CNN, is a depth structure feedforward neural network with convolution calculation. The research of convolutional neural network began in the 1980s and 1990s, and LeNet-5 and time delay network were the earliest convolutional neural networks. Then, with the development of corresponding theory and the improvement of hardware technology, convolutional neural networks developed continuously and were applied in many fields, such as natural language processing and computer vision. Convolutional neural networks are created by imitating the visual perception mechanism of living things, including supervised learning and unsupervised learning. The core of CNN lies in its convolution kernel, which is a small grid that moves on the picture in turn, and realizes feature extraction by convolution. Using the translation invariance of the picture structure, no matter where the picture is moved on a grid, the corresponding structure is exactly the same, so CNN realizes parameter sharing.
Graph convolution neural network has the same function as CNN, and is also a feature extractor, but its feature extraction object is graph data. GCN subtly extracts features from graph data, and allows users to predict edges, classify graphs and nodes of graph data by using these extracted features, and at the same time get embedded representation of graph, which shows that GCN is widely used.

Overall architecture of data module and program module
The data module in the neural network traffic prediction model contains 30-second data which is aggregated into 5-minute data by data preprocessing. The time interval in the processed data set is 5 minutes. Each node in the processed road map contains nearly 300 data points every day. And use linear interpolation method to fill in the vacant values after data cleaning. And the input of data is standardized by standard score. The adjacency matrix of road map is calculated and generated by the distance between stations in traffic data. And generate two files to store data, one file to store historical speed records and the other file to store weighted adjacency matrix of speed records. The processed data file is shown in Figure 9. The traffic prediction model program module based on neural network consists of several spatiotemporal convolution blocks ST-Con, and each spatio-temporal convolution block contains two timegated convolution layers and a spatial map convolution layer. A completely connected output layer is added at the end of the spatio-temporal convolution block, and finally the predicted value is generated. The overall structure of the traffic prediction program module based on neural network is shown in Figure 10.

A spatial map rolling layer module, a time-gated convolution layer module and a space-time convolution block
In the spatial map roll-up in traffic prediction, the structural data of the map is processed by the method of spectrogram, and then the structural data of the map is processed and converted into corresponding signals, so as to obtain the spatial features. The flow chart of spatial map rolling is shown in Figure 11. There is a time-gated convolution layer on both sides of the spatial graph convolution network. After the spatial modeling of the data is completed, the time dimension features are obtained by standard convolution. After a time-gated convolution layer, the information of the corresponding node and its neighboring nodes will be updated, and the nodes will also be associated with neighboring nodes. Through the reprocessing of the time-gated convolution layer, the spatial dimension features and temporal dimension features are captured. The flow of time-gated convolution layer is shown in Figure  12.

Fig.12 Time Gated Convolution Layer Flow Chart
The whole spatio-temporal convolution block consists of a time-gated convolution layer, a spatial map convolution layer and a time-gated convolution layer. Multiple spatio-temporal convolution blocks plus an output layer finally constitute the whole program. The composition and structure of spatiotemporal convolution block is shown in Figure 13.

Experimental results and analysis
Traffic prediction based on neural network uses space-time graph convolution network, which predicts the future traffic situation by analyzing the historical data of time series. It will provide users with more accurate traffic forecast. And through constant adjustment, the characteristics of periodicity of application data are realized. Large traffic flow, complex data and great uncertainty have always been difficult points in traffic prediction. Through this deep learning framework, the realization of spatiotemporal map convolution network will provide users with real-time road conditions or specified time traffic prediction in the future. In this way, users can plan their whole trip. Effectively predict and avoid traffic jams.

Optimization and application in automobile energy saving and emission reduction system
In order to obtain more accurate traffic prediction data, the traffic prediction algorithm based on neural network is used in automobile energy saving and emission reduction system.
At the user level, accurate traffic forecasting will help the user's travel planning and provide more economical and efficient driving routes. Because of the slow driving caused by traffic congestion, a lot of unnecessary environmental pollution will be produced, and avoiding the traffic congestion effectively can achieve better energy saving and emission reduction.
At the level of managers, we can better understand the regular changes of urban traffic conditions, which will help to improve urban traffic infrastructure. And in the future, through accurate traffic prediction, we can speculate and realize the prediction of vehicle emission and pollution warning. Perhaps this information can also help us find out the air pollution problem, solve the emission problem and realize green car travel.

Conclusion
The data module of time estimation and traffic prediction based on neural network: processing and perfecting the driving data sets of different vehicle types and collecting the fuel consumption information of different vehicle types, and completing data analysis, data cleaning and feature engineering for the data to ensure that the data sets can be used normally by the neural network model during training and testing.
Program module of time estimation and traffic prediction based on neural network: Programming with Python and other tools and establishing the corresponding neural network model. The corresponding neural network model can be used for more accurate travel time estimation and traffic prediction.
All the design requirements and functions have been realized normally, but there is more room for improvement in the whole system. For example, the real implementation of the background algorithm can be connected with the map in real time, because the open source environment provided by map development and use companies like Baidu and Gaode is limited, and now only part of the map can be developed and drawn, and many of the permissions and environments are still inaccessible. Therefore, the real-time application of front-end and back-end algorithms is still in the development stage. The designed front-end route navigation system still refers to the route planning provided by the existing map manufacturers, but also provides an algorithm introduction page in the front-end interface, which provides a more direct display for users to understand the algorithm through manually drawn map lines. These are all difficult problems that can be studied and improved in the future. The design and development of this automobile energy saving and emission reduction system is not over yet, and it is constantly being improved and updated. I hope this system can be really applied in the future and contribute to the traffic and environment.