
Neural Networks and Connect 4 Strategy
Hard
Can a neural network (a program that learns through practice) teach itself to play Connect 4 well enough to beat a person? You build the network and train it using a genetic algorithm. This method creates many versions of the program and keeps the ones that perform best.
The network plays against a simulated opponent over many rounds. It learns to beat that opponent reliably. But when a human player with a different strategy steps in, the human still wins.
The network learned to beat one style of play rather than the game itself. Training it against several opponents with different strategies could help it play more broadly.
Hypothesis
The hypothesis is that a neural network can learn to play Connect 4 well enough to beat a human opponent.
Method & Materials
You will create a computer program that plays Connect 4 with a simulated opponent, and then use a genetic algorithm to train a neural network.
You will need a computer, a Connect 4 board, and tokens.
MEL Math — monthly math & computer science experiment kits delivered to your door. (Affiliate link)
See what’s includedResults
The neural network was able to beat the simulated opponent, but the human player was still able to beat the neural network. This shows that the neural network did not have all the information it needed to be very good at the game.
Why do this project?
This science project is unique because it uses a neural network to learn how to play a board game, and it shows that artificial intelligence can be used to learn how to play a game.
Also Consider
Experiment variations to consider include having the neural network play against multiple opponents with different strategies, or having the neural network play against the human player.
Full project details
Additional information and source material for this project are available below.Share this Science Project:
Related Science Fair Project Ideas
Swap the CPU and RAM in a desktop computer and time the difference to find out which upgrade matters more.
Hard
Write a program in Scheme that solves differential equations and use it to model how atoms spread through solids.
Hard
Simulate 6,300 billiard ball paths and discover that a single property of the launch angle predicts whether the ball reaches a corner.
Hard
Share this Science Project:
