GANS: Genetic Algorithm and Neural Network Integration for Optimal Brain Selection in Snake Game - Bambang Pudjoatmodjo; Mugi Praseptiawan; Ulka Chandini Pendit; Rusnida Romli (JICO: International Journal of Informatics and Computing, 2025)
Snake games have emerged as an engaging subject in artificial intelligence and optimization research due to the growing interest in developing autonomous agents capable of controlling the snake intelligently. This study presents a hybrid approach by integrating a Genetic Algorithm (GA) with a Neural Network (NN) to enhance the snake game’s performance, effectively forming an adaptive and intelligent control system or “brain.” In this framework, the Snake game is modeled as an optimization problem, where the GA is employed to optimize the parameters of the NN to improve the decision-making process of the snake. The GA operates by evolving a population of individuals each representing a set of strategies through selection, crossover, and mutation. These operations are iteratively applied to discover optimal solutions within the vast parameter space. The integrated neural network enables the snake to make real-time decisions based on environmental stimuli, enhancing its survival and goal-seeking behavior. Fitness evaluation is performed based on everyone’s gameplay performance, where the most successful individuals contribute to the next generation. Experimental results demonstrate that the combination of GA and NN significantly improves snake gameplay performance. The fitness score acts as a performance indicator, showing that higher-generation populations tend to yield better results. For instance, snakes trained over 100 generations achieved scores around 8, while those trained over 500 generations exceeded scores of 15. This confirms the effectiveness of evolutionary optimization in training neural networks for game-based AI tasks.