Artificial Intelligence: Can a Neural Network Learn to Play Connect 4?
CSEF · 2003 Mathematics & Software
Overview
Objectives/Goals The goal of my project was to find if a neural network would be able to learn how to play Connect 4 (a board game where the goal is to get four tokens in a row) well enough that it could beat a human opponent. A neural network is an artificial intelligence program that uses a network of connections between input values and output values to eventually learn how to do something. A neural network uses weights to determine the output for the given input. To find a good set of weights, the neural network can be trained. One type of training method for a neural network is a genetic algorithm. The genetic algorithm creates a model of individuals, based on the set of weights. It uses the basic idea of natural selection to eliminate the weak and promote the strong. Methods/Materials I created a computer program that played Connect 4 with a simulated opponent for the neural network to play. Then I tried out different ways of training a neural network. Finally, I created a training method for the neural network, using a genetic algorithm. Results The neural network learned to beat the simulated opponent that I could rarely beat, but I could still beat the neural network because I had a different strategy than the opponent. Conclusions/Discussion The neural network did not learn to play a wide variety of strategies. Therefore, it learned to play the opponent, not the game in general. If I had played the neural network instead of the opponent, it probably would have been better at playing me. In conclusion, the neural network did not have all of the information it needs to be very good at the game of Connect 4. It might be improved by having it play against me or several opponents with different strategies.
Summary statement
My project involved creating and training an artificial neural network to play the game of Connect 4.
Help received
My dad showed me how a genetic algorithm worked and helped with editing.
Awards (1)
- Category Award
Competition history
- CSEF 2003
Resources
Related projects
CSEF · 2019
Creating a Neural Network to Play the Game of Connect Four Using a Genetic Algorithm
CSEF · 2010
A. I. Connect-Four
CSEF · 2009
Choice Based on Past Knowledge using Multi-Layered Neural Networks in Tic-Tac-Toe
CSEF · 2014
Game On: Creating a Worthy Connect Four Opponent with Heuristic Algorithms
CSEF · 2012
Artificial Intelligence: Teaching a Computer to Play Tic-Tac-Toe
CSEF · 2011
Evolving Neural Networks to Play Mastermind
CSEF · 2023
Teaching AI to Play Tennis
CSEF · 2010
Utilizing Artificial Neural Networks to Create a Learning Robot
Closest projects by meaning, across every fair and year in the corpus.
Browse more like this
Source: California Science & Engineering Fair public projects