Back to projects

CS470 · Artificial intelligence

Chess endgame AI

Course project with Halliday and Sieving: training and evaluation around endgame play, including distance-to-mate style signals and iterative gameplay notebooks. Reports and notebooks live under Portfolio Projects.

Theory, graphs, and math

Chess positions are basically one huge directed graph: each position is a state, and each legal move is an edge to another state. Endgames make that graph small enough to actually study, which makes them a great place to explore search, value approximation, and machine learning. This also connects to my interests in theoretical computer science and my mathematics minor, especially linear algebra. Neural networks are built from weights, activations, and compositions of linear maps, so ideas like rank, bases, and eigenstructure help me reason about what a model can actually represent.

Play the endgame net

King + rook vs king, in this page. The CS470 MLP runs in your browser — no Google Cloud, no API, no extra compute bill. First click downloads ~796 KB of int8 weights (not the 6.9 MB Keras save). After that they live in IndexedDB, so repeat games do not hit Netlify again.

chess.js is bundled with the page (75 KB). Visiting this page still does not fetch the network until you press play.

Notebooks & code

View our CNN training algorithm, and gameplay loops here!

Trained model weights (large .keras file)

6.9MB Keras save (includes optimizer state). The in-browser player uses a 796 KB int8 extract instead.

Download chess_model-2.keras