Inspiration
We were inspired by the success of game-playing AIs for games as simple as tic tac toe or as complex as chess. We settled somewhere in the middle to create a Connect4 agent that combines classical game search with deep learning. We wanted to explore how a neural network could learn strong strategies by imitating an expert search algorithm, and whether we could build an agent that humans could play against interactively.
What it does
Our project lets you play Connect4 against a CNN-based agent that was trained on board positions evaluated by a Monte Carlo Tree Search (MCTS). The MCTS acts as the “expert,” and the CNN learns to predict its best moves. The final model can evaluate board states instantly and select strong actions without running MCTS during gameplay.
How we built it
We implemented a Connect4 game class to handle all gameplay logic and mechanics. Next, we generated a large dataset of board states paired with expert move decisions from MCTS. Using this data, we trained our CNN to imitate the expert’s strategy. Finally we created an interactive environment where users could play against the model.
Challenges we ran into
Choosing the most efficient CNN architecture that balanced depth, speed and accuracy and implementing the model into the frontend.
Accomplishments that we're proud of
Created model good enough to think long term strategy and outperform average play.
What we learned
Different model architectures have precise use cases. Importance of thinking the architecture through before committing to training as well as the quality of the data to train on.
What's next for Connect4 game player
We are looking to improve the model performance by training it against different style of play and experimenting with attention. Additionally hosting the website.
Log in or sign up for Devpost to join the conversation.