ROBO-RACE hackathon and hands-on workshop on AI in Artin: how it was
Good afternoon, dear readers! Recently, I was lucky to participate in one hackathon on artificial intelligence, which was organized by the Roboauto group from the Artin company in the city of Brno (Czech Republic), leading the development of an unmanned vehicle. In this article I would like to share my impressions and tell how everything went, what I learned and what I learned. Who cares, I ask under the cat.
About hackathon
It was the first hackathon on machine learning and AI, and the Roboauto group made great strides in this area, so I signed up right away in advance. Hackathon was focused primarily on students of the Technical University of Brno. As the authors reported in advance on the Facebook hackathon page, the hackathon should have been a game competition between the teams on a racing car simulator. The authors promised to provide a simulator project in Java, to which you can connect your program. The main goal: to write a Java program for your car so that the car went faster than its rivals. You can use neural networks or programmed logic.
On the event page on Facebook a video of the competition track was published, which we had to go through: ')
A few days before the day of the hackathon, all participants were sent an e-mail with brief instructions on how to prepare for the event. It was necessary to install IDE Intellij Idea with Gradle support, Java version 8 and create an account on GitLab.
You could register your team or register yourself. In the second case, the organizers connect you to some team. I was assigned to the team with a guy from my firm NXP, who also registered independently.
Theoretical part - introduction
It all started with a 2-hour theory block. We were given access to wifi and had a presentation of the organizers and the hackathon program. During the day, from 12 to midnight, the hackathon was planned with several series of races and breaks for lunch and dinner. From 5 to 7 pm there was a section on the passage of obstacles on radio-controlled cars in a separate room.
The first speaker, Pavel, made an agenda presentation: a presentation of the simulator environment, the connection of his projects, an introduction to AI. Objective: to teach the model of the car in the simulator that she went as quickly as possible. You can also control models from the keyboard. We were shown a demonstration in the simulator and implementation in the code.
We were given a link to the project on Gitlab. Everyone had to request access to the repository, clone the project to themselves locally on the computer and import to IntelliJ IDEA. The project included support for Gradle - a generation system such as Maven or CMake. The project can be immediately launched: a simulator window like this opens:
After that, another speaker, Stepan, made a brief introduction to the theory of machine learning and clarified that the hackathon would use neural networks like Feed forward and training with a teacher. The goal is to teach the car how to drive. To do this, first pass the route themselves with manual control, save the points of the trajectory. The path data set is stored in the CSV table: the distance from the centerline of the road, the angle relative to the road, and one of the values 0, 1, -1 for the amount of rotation. Then we will teach the network to drive along the trajectory as close as possible to the trajectory traversed under manual control.
Among the questions from the participants was an interesting question: how to specify for the network data on the positions of other cars of rivals. Stepan said that the data about the rivals can also be set to the input of the neural network. Also at the entrance you can set the data on the speed, if it helps in learning.
Stepan showed how to make two examples of manual control: incorrect (arbitrary) and correct (neat, close to the middle of the road). When demonstrating a trained auto network, there was a big problem in cornering.
It was possible to configure various network parameters: the number of inputs, outputs, the number of learning epochs, the number of neurons in the hidden layer. The program for the implementation of neural networks used the library DL4J: deeplearning4j.org . Unfortunately, the library does not work on a 32-bit operating system (I had a problem on a laptop with Ubuntu 12.04).
The main part - the competition
Each team determines the color of their car, which must be specified in the program code. We were immediately told how to use the API application to manage your car in the competition.
My colleague and I started by solving the problem of fast passing the route using conventional API-based methods. Our solution was this: depending on the distance to the next turn and the direction of turn, we corrected the acceleration and the angle of turn of the car. For information about the proximity of the rotation, we used the Grid object from the API system. The essence of the Grid: for the car, you can get a rectangular grid of the surface of the playing field in front of the car (left and right of the car) of arbitrary size (for example, a width of 8 and a length of 10 cells). For each cell, you can determine whether the highway passes through it and whether another car is currently in it.
Here is a link to our project . The main files are Driver_team12.java, Team12.java, and RunDev.java. The control logic is in the file Driver_team12.java.
Toward evening, I began to deal with neural networks. I started with a simple recording of the trajectory with manual control. Through training on the recorded data and setting parameters (the number of iterations, the number of learning epochs, learning speed), we managed to achieve some better results of passing the track.
During the hackathon, several competitions were held, in each of which a series of races were held between groups of teams. In the process, participants continually improved their decisions. A big problem was the situation of a collision of several cars, completely blocking the movement on the highway. Here, the teams that implemented the handling of obstacles in the best way won.
In the competition, half of the teams presented a solution based on neural networks. The winner was one of these teams. One of the leading teams built a neural network of 25 layers, took many parameters to the input (among them, the distance to the middle of the road, speed and data from the Grid object). The other team used two neural networks: one for the straight section (to minimize deviation from the middle of the road) and one for turning.
Available video races from hakaton:
Other interesting things
In addition to the hackathon itself, a fascinating event was included in the program - passing an obstacle course on radio-controlled cars. From 5 pm to 7 pm in a separate room you could try your hand at overcoming difficult obstacles on car models with radio control.
Lunch and snacks were organized throughout the day. In the evening, ordered a pizza. It was also possible to unlimitedly pour beer in the kitchen.
That's so interesting, fascinating and energetic the whole day of the hackathon passed. There were a lot of pleasant impressions left, I remember a lot of funny moments from the team competitions. Hackathon became a good brain training on the weekend, where you could break your head over the real tasks of life and try your hand at learning to control an unmanned vehicle in a simple simulator.