# Using Neural Networks for Bicycle Route Planning
## 3 Materials and Methods
### Modelling Bicycle Paths Using Neural Networks  
The other approach to multicriteria road analysis, aiming to find the most suitable path, is using artificial intelligence. Encouraged by paper [17], we decided to compare the results provided by the ArcGIS Network Analyst tool with the results provided by various NN architectures. For the NN training and testing, the \"nntool\" from MATLAB was used. Neural Network Details  
Similar to the previous chapters' GIS modelling described, we used NN to model two bicycle routes: the flatter one and the steeper one. The first step was to train both models. As the source of information for model training, we decided to use the existing bicycle routes. We used web pages [24; 25] as the data source for training our NN model. We decided to use bicycle routes from Vrgorac town and Knin area since their similarity with Imotski in location, elevation, and relief. For Vrgorac town, we used the \"Tri polja\" route as the training data for the flatter route (it is marked as the semi-flat on the website) and the \"Mate Svijetskoga\" route as the training data for the steeper route (marked as steep in the website). For the Knin area, as the training data for the flatter route, the \"Lopuska glavica\" route was used since it was marked as flat on the website. Finally, the steeper route model was built based on the \"Napoleonova staza\" route marked as steep on the website. Using these four routes, we trained four models of our NN. The input for NNs were road segments. The number of segments used as input to the NN is shown in Table 1. The input for each segment was the same data as in the MA models--five normalised parameters presented in 3.1.2. There was no weight added to the parameter's value; input to the NN was normalised parameter's data. The score for segments used in the route was set to 1, while those not used were set to 0. The gathering and labelling training data were time-consuming--scores for road segments needed to be labelled manually. However, the training process carried out in MATLAB was fast for the number of layers we were dealing with. After we trained the four NN models, two for the Knin area and two for the Vrgorac area, we used trained networks on road segments in the Imotski area. The score given by the NN gave us information on which road segment can be considered suitable for a bicycle route. The road segment's suitability for the bicycle route was expressed as a number ranged [0,1]. The value closer to 0 showed that the NN model decided that the road segment is not desirable, while the value closer to 1 showed that the road segment is desirable. We created a hybrid model that combines the brute force algorithm for the travelling salesman problem with NN to produce the NN routes. As stated before, the NN gave information about each road segment's desirability expressed by numbers ranged [0,1]. That information was used as a road segment weight, and the travelling salesman problem was used to connect points of interest, but now with the NNs information (Figure 2). On the right side of this figure, one can see the workflow for bicycle path selection using NN compared to the workflow when using GIS MA analysis. The first part of both methods is to determine the weights of road segments. With GIS MA, this is performed using a formula specified by the operator. With NN, the weights are produced by the NN trained on other already established bicycle paths. The second part of both methods is to apply the travelling salesman problem to the network road topology. Since the roads segment data were arranged so that the connected segment data are located next to each other, we decided to use the layer recurrent NN. The network architecture was made of five layers. The input layer contained ten neurons, while the output layer has one neuron. In hidden layers, the second layer had one neuron; the rest of the hidden layers consisted of 10 neurons. This NN constitution was chosen due to the compromise between the training speed and accuracy.