Home

COMPR[CH]ESS

An innovative approach to lossless chess game compression, seamlessly blending chess engines, machine learning, and Huffman Coding.

DEMO VISUALIZATION

Move

d2d4

e2e3

g1f3

...

Probability

0.27256805

0.1614297

0.1031994

...

Code

11000

11001

11010

...

Code (0 bits):

HOW IT WORKS

This program utilizes Huffman Coding to encode/decode chess games. Huffman Coding is a technique where more probable characters or strings of characters are assigned lower-length, unique bitstrings. In this context, more probable chess moves are given shorter bitstrings.

A machine learning model is used to predict the next move in a chess game. Models are trained on a dataset of thousands of chess games from lichess, filtered to only include games from players with average ratings inside a certain range. As a result, the model is able to accurately predict the next move from a given position based on the player's rating.

From probabilities given by the model, Huffman Coding is used to adaptively encode/decode chess games into binary strings. Due to the model being trained on games from players with similar ratings, the codes generated accurately reflect the probability of a move being played in a given position.

Check it out on Github