What's the best neural network setup for a Snake game AI?

Hey folks, I’m trying to build an AI to play Snake and I’m just starting out in machine learning. I’ve set up the game on a 10x10 grid and I’m using a 3D input (3x10x10) to show the positions of the snake, the apple, and the snake’s head. The AI needs to decide among four moves: up, down, left, or right.

I’m a bit stuck on how to design the neural network. Should I use convolutional layers or go with a fully connected approach? Also, how many layers should it have to learn efficiently without taking too long to train?

Additionally, I’m wondering if using 1s and 0s for marking positions is the best way to represent the game state. Does anyone have suggestions for a better method?

I appreciate any help or tips you can offer. Thanks!

hey there! i’ve worked on something similar. for snake, a simple fully connected network should do the trick. try 2-3 hidden layers with ReLU activation. convolutional layers are overkill here.

for input, instead of 1s and 0s, you could use different values for snake body, head, and apple. like 1, 2, 3. this might help the AI distinguish better.

good luck with ur project!