GANS: Genetic Algorithm and Neural Network Integration for Optimal Brain Selection in Snake Game

Authors

  • Bambang Pudjoatmodjo Multimedia Engineering Technology, School of Applied Science, Telkom University, Indonesia.
  • Mugi Praseptiawan Informatics Engineering, Faculty of Industrial Technology, Institut Teknologi Sumatera, Indonesia.
  • Ulka Chandini Pendit Department of Computing, Sheffield Hallam University, United Kingdom.
  • Rusnida Romli School Computer and Communication Engineering, Universiti Malaysia Perlis, Malaysia.

Keywords:

Snake Game, Genetic Algorithm, Neural Network, Optimization, Artificial Intelligence

Abstract

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.

Downloads

Download data is not yet available.

Downloads

Published

2025-11-30

Similar Articles

You may also start an advanced similarity search for this article.