# Lane following Learning Based on Semantic Segmentation with Chroma Key and Image Superposition
## 4 Experimental Results
### Driving Learning Task  
This section will describe the experimentation carried out on the driving learning task--in this case, the steering of the vehicle. The neural network used in this part relies on the feature vector delivered by the encoder part of the trained Autoencoder to learn the required steering value. Learning to drive takes place in the target scenario, with supervised driving sequences that serve to build a dataset by pairing both the captured image and the steering value. One of the advantages of dividing the work into two tasks (extraction of features and learning to drive) is that the decision network (MLP) will have a smaller input, with fewer weights, making training easier and faster. The network will be trained with the values from the latent vector as the input and the steering angle as the target. In this way, it will be possible to determine whether the network is capable of learning to infer the adequate steering angle from the characteristics of the lines. The first experiment uses the network described in Section 3.2. In this case, the metric used is the error given by the Mean Squared Error function (MSE). For comparison, both image sizes are used to train the MLP, coupled with the corresponding encoder. Figure 11 shows graphs with rapidly decreasing errors. Figure 10: Camera images in the target stage vs. decoded output. (**a**) Captured in the target scenario \(320\times 240\). (**b**) Output of the Autoencoder \(320\times 240\). (**c**) Captured in the target scenario \(160\times 120\). (**d**) Output of the Autoencoder \(160\times 120\). Each MLP relies on the corresponding encoder part trained for images sizes of \(320\times 240\) or \(160\times 120\). Both cases reach convergence in the epoch range 40-60, with very similar evolutions and loss errors. Once the models have been trained, they are transferred to the vehicle to test the driving operation. When testing the driving models, the vehicle has difficulties in following the road when using images of size \(320\times 240\). This is mainly due to the poor inference rate (\(2.5\) frames/second). The driving model using \(160\times 120\)-sized images improves overall but still loses track on some occasions. This problem could be related to the driving style used for the supervised training. The scatter plots in Figure 12 show the correlation between the expected steering angle and the real output of the driving model, using both the training and the validation set for the case of images sized \(320\times 240\). With an ideally trained model, the scatter plots should show a thin straight line following the identity function. In the real world, one difficulty is that the decisions of the human driver will not be sufficiently consistent. In similar situations, the driver may make slightly different decisions, with inevitable slight delays. These inconsistencies may partially explain why the represented curve is not thinner. Nonetheless, the results seem to be very acceptable. A small number of outliers can be seen, but only a few of them deviate notably from the midline. Figure 11: Evolution of the error loss functions. (**a**) Image size \(320\times 240\). (**b**) Image size \(160\times 120\). Figure 12: Correlation graphs for the expected vs. the predicted steering angle, images sized at \(320\times 240\), and the dataset DR1. (**a**) Scatter plot for the training set. (**b**) Scatter plot for the validation set. Figure 13 shows the graphs for the driving model trained with the images sized at \(160\times 120\). In this case, the model has a slightly weaker ability to approximate the identity function. For example, for some samples, a steering value near \(1.0\) is expected, but the model delivers a lower value. In the physical evaluation, the driving model tends to take the curves somewhat more gently with respect to the human driver. A few more outliers can be identified with respect to the previous case. Despite achieving the worst approximation, with this model, the car drives with greater correction.