I was interested in Artificial Intelligence and the broad spectrum of Neural Networking. Due to my previous experience with Neural Networking in school, I wanted to broaden the scope of Neural Networking to the next big thing: Automated Cars.

What it does

Specifically, in this program, 2D cars move through a map while keeping track of its previous generation's position, and making corrections to where it went wrong in the previous generation. Overall, it is supposed to mirror automated cars and how they are implemented, but obviously, with a much larger data set.

How I built it

In school, in my Machine Learning and Artificial Intelligence club, we started to understand Neural Networking and how artificial genomes are created. With the implementation of the Neural Network and my previous experience with Unity, another club I am involved in at school, I decided to merge these ideas and code in C#. In the beginning, I spawned 20 objects (cars) and assigned each its own Neural Network. With the use of the crosshairs (sensors) in the front of the car, they provide the car with a input which is then relayed through the Neural Network. The Artificial Genome then comes into play. When all cars die, the output values (direction and speed) of the 2 best cars are stored as "genes" and then "mutated with each other" (another process of artificial selection). These mutated genes are then set as the input values for each new generation that are to proceed. The neural network's weight is simply set by the crossed gene. The stronger the gene, the heavier the weight gets. The network starts with 5 inputs, and results in a 2-output function. Each neuron takes in Speed, turning angle, and its "confidence rate at the particular location" Using simple Feed-Foreward networks, the outputs of each node are processed through an activator function that finally results in the 2 genes that are the most prevalent in the end. The fitness is measured through a simple 2D Byte Array representation of the (x, y) coordinates of the map. The indexes represent the current (x, y) coordinates of the car, and the value in the array represents the number of times each car has visited the location. The higher the number, the higher the confidence rate is for the leading car. The Neural Network simply shows the current weights of each neuron. The thicker the green bond, the heavier the weight, which translates into a stronger gene (how much each car "knows" the map).

Challenges I ran into

As I am mostly familiar with Java in Eclipse and the Java Extension in Visual Studio, I had to understand C# Methods, get familiar with them, and be able to implement them into my code.

Accomplishments that I'm proud of

Like I mentioned before the fact that I did not know C# and I had to learn C# implementations and common syntax. Alongside, I am also proud about the fact that I managed to do this myself and required very little Mentor assistance. I applied my previous knowledge of Unity into making the game aspect of my project as Unity is relatively new to me. I had to ask Mentors and other Club members how to implement some of the scripts, but I am very proud of the UI aspect I made.

What I learned

I learned a new language! Although I am not proficient in C#, I would certainly say I learned a lot through this experience, and I am willing to apply these skills to much more interesting applications.

What's next for Neural-Networking Car Race

As I mentioned earlier, I am currently using a Feed-Foreward networks that simply keep track of neurons in the next generation. If I were to learn Recurrent Neural Networks, I would be able to keep track of the other neurons in the same network as well. So not only does the next generation traverse the map more efficiently, the neurons in the current level that are behind of the leading car, also receive information regarding Speed, and Direction. This can lead to rapid improvement in the algorithm and the generations will quickly reach the efficiency with RNN which would take many more for the FFN.

Built With

Share this project: