Snake, the classic arcade game that has entertained generations, has now been conquered by artificial intelligence. In this project, we have developed an intelligent agent capable of playing Snake automatically using deep reinforcement learning techniques. Our agent comes in two versions: one powered by a Multi-Layer Perceptron (MLP) and the other by a Convolutional Neural Network (CNN). Notably, the CNN-based agent consistently achieves higher average game scores, demonstrating the power of convolutional neural networks in solving complex tasks.
We measured the performance of both agents based on several metrics, including the average game score and the highest score achieved during training. The CNN-based agent consistently outperformed the MLP-based agent, achieving higher average game scores and demonstrating superior gameplay.
The following are trained agents playing the Snake Game. The first GIF showcases the CNN agent achieving a score of 700 in just 53 seconds, while the second GIF features the MLP agent scoring 510 points in 128 seconds.
The following graphs represent the training process in Tensorboard: