Week 16 - Improving and Testing
Progress This Week
Objective
The objective was to achieve a well-functioning neural pilot. Although not much progress has been made, I feel I am closer to finding a solution.
Offline Testing
The first thing I did was conduct offline testing, feeding the code a dataset. It ran the images through the network and compared outputs. Quite surprisingly, every network performed quite well on this test, even though the dataset I am using was recorded on the same circuit where I am testing them, and they are failing. The network I had from last week resulted in this graph:
Normalization
To get better networks in less time, I implemented normalization based on the max and min speeds of the expert pilot. I think the angular max speed was never reached, but this should mean only that instead of being compressed between 0 and 1, the data would be compressed between 0.25 and 0.75, which, given the amount of decimals we work with, should give no problems to the denormalization.
This proved correct after I tested it offline (adding denormalization in the offline test and in the Neural Pilot):
It trained much faster this way, as can be appreciated in the training graph. This one was exaggerated, but in other trainings, it was appreciated too:
However, this one did not work either, crashing into the wall.
Affine Transformation
Given that all worked greatly in offline testing and none worked in the real scenario, I assumed that the Neural Pilot was encountering itself with an unknown situation (maybe using less speed in straight lines but similar angular speeds it found itself a bit far off the line). To solve this, I used affine transformation, which allowed me to translate the images on the horizontal axis while maintaining the center of the image, giving the impression that the car was a bit outside the line:
This was done before flipping the image so every affined image would also get a flipped image, increasing the amount of data up to 14 thousand. When translating the image, the angular speed was increased proportionally to the translation.
The training went fast, maybe it could have gotten better with more epochs:
And the offline test was great too:
However, in the real training, it performed better to start, but it ended up crashing. Adding this experience to the previous ones, I had the feeling that it has a problem turning left. At first, I thought it might be a problem in the denormalization. But if that were the case, I assume I would have seen it in the offline test as well.
The result can be seen in: https://youtu.be/7FUQ7VWs6tQ
I let it go after crashing because it turns right correctly, but it does not turn left. Every other attempt this week crashed into the right side too.