# A Review of Machine Learning and IoT in Smart Transportation
## 2 Machine Learning and IoT in Smart Transportation
### Machine Learning Algorithms
#### 2.1.6 Artificial Neural Networks  
Artificial Neural Networks are mostly characterized by the structure of the neural network and the learning method. A neural network is formed by creating weighted connections among neurons (Figure 2). In a neural network there is an input layer where the input variables are inserted to the network, and each neuron represents a variable, and there is the output layer where the labels are assigned and each neuron represents a label. Between those layers there are one or more hidden layers.  
When there is no looping in the neurons connections the network is called Feed Forward Neural Network (FF-NN), which is most simple form of an ANN.  
In Section 2.1.2, BN-SARIMA algorithm was mentioned and compared with two ANN algorithms, in order to make short-term traffic predictions in large urban traffic networks [18]. The one ANN method was an FF-NN. The predictions in this paper were made for 5, 10, and 15 min in the future. The implemented FF-NN indicated a slight advantage at the 10 and 15 min prediction over the other NN algorithm but it seems to be less effective than the BN-SARIMA approach. As already mentioned, in [27], the authors compared four methods to make short-term traffic predictions in work-zones. Among the methods already analyzed, there is a Multilayer FF-NN. The FF-NN utilizes the linear combination of the input variables to extract features, which are combined using a nonlinear function to predict the traffic flow. This scheme is called a multilayer NN because apart from the input and the output layers, it consists of some hidden layers, where the calculated features are represented. The results highlight that the FF-NN method had the second smallest error metrics after the RF method. The authors in [28], use an FF-NN in order to predict the variations of travel time. Traffic data like speed, history of travel time, and volume are collected from road sensors. Then traffic patterns are clustered with unsupervised learning methods and then an ANN model is trained for each cluster. The ANN which is a FF-NN uses one hidden layer and is trained with the back-propagation technique in order to minimize the predicted error [48]. The output of the FF-NN is a predicted time variation. The full travel time is a sum of the travel time and the variations for each cluster. Back-propagation is a supervised method to train an FF-NN and uses a gradient descent. Taking into consideration the ANN's weighted values, the gradient of the output error is calculated and it is distributed backwards. Multilayered NN use back-propagation like perceptrons use the delta rule. The evaluation of the model is done using the RMSE and the Root Mean Square Percentage Error (RMSP) metrics, which showed satisfactory results. An FF-NN trained with back-propagation is also used in [29] in order to predict road accidents in real time. The FF-NN method is compared with a \(k\)-NN method and a Regression tree. The models take input data from historical data collected from road sensors, with information such as the number of cars, speed, lane occupancy ratio, etc. The results show that all the models are able to identify accidents with great accuracy. However, there is a significant number of false positive estimations. In another research [30], a method to identify potholes using an ANN is suggested. Accelerometer data are collected from Android phones, feeding an FF-NN which runs in the Android phones in real time, using the 'Encg' framework. The FF-NN consists of 6 hidden layers and it is trained with back-propagation. The results indicate a 90%-95% detection accuracy. As mentioned before, in [23] a comparison of the following algorithms is performed for traffic congestion prediction: decision tree, RF, MLP, SVM, and Logistic Regression. MLP stands for a MultiLayer Perceptron [49]. It is a simple FF-NN consisting of multiple perceptrons forming layers.  
Figure 2: A neural network example consisting of two interconnected layers [9].