ncridlig / OthelloAI

ECE176 Final Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OthelloAI

This Github repository contains the code necessary to train and play an expert level AI player in Othello.

Our goal is to create a CNN model to play the game of Othello at an expert level. Based on previous research in this field, Convolutional Neural Networks can achieve strong performance because Othello can be interpreted as an image-like matrix and CNN's are skilled at computer vision tasks. This problem can be motivated as a multi-class classification problem in which our model must choose 60 different moves for a current Othello board state. We use a Kaggle Othello dataset of games played by expert Othello players to construct a dataset of over 8 million board states and moves to train our player model. For our best model, we achieve an accuracy of 55.91%, a top-3 accuracy of 87.47%, and top-5 accuracy of 96.25%, making it a difficult Othello player to beat. We also perform qualitative analysis of our Othello AI player model by playing against it, in which it easily wins the majority of the games.

Prerequesites

You just need to have Python 3.7+ installed (3.10+ for the simplified typehinting).

Usage

  1. Create a Python virtual environment

    python3 -m venv env
  2. Start the virtual environment

    source env/bin/activate
  3. Install dependencies

    pip install -U pip
    pip install -r requirements.txt
  4. Run the game

    python game.py

Additionally

View our presentation.

Othello AI

You play first as the black player. Scores are viewable in the top left of the game board. Every move inference time is printed to the console. The game closes automatically 7 seconds after a player wins.

About

ECE176 Final Project


Languages

Language:Python 59.9%Language:Jupyter Notebook 40.1%