Skip to main content
Getting.Fa350872

Internship report: Can an AI play Rummikub?

April 1st, 2021
INTERNSHIP REPORT

This internship project explores whether artificial intelligence can play the tile-based game Rummikub by combining computer vision with game algorithms. This contribution comes from Sander Backx at Thomas More Geel.

From screen capture to board state

The project used the official Rummikub app as a game platform, capturing screen sections with Python's Pillow library. OpenCV filtering extracted game elements and created contours to identify individual tiles. Two separate predictions occurred for each tile: digit recognition using a K-Nearest Neighbours algorithm (values 0-13, with 0 for jokers), and colour detection through RGB analysis using K-Means clustering.

Monte Carlo Tree Search for optimal moves

Monte Carlo Tree Search simulated possible game states to determine optimal moves. The algorithm evaluated action sequences using a reward function: 100 points for player victory, move count plus 0.5 for ongoing games, and 0 for opponent victories. Once the board state was reconstructed from the vision pipeline, the algorithm could explore possible moves and select the most promising strategy.

Getting.Fa350872
Exploring AI for games or vision?

LET'S TALK