Tantrix Tile Detection

Summary

Wanting to learn more about computer vision, I set out on a task to create neural network to recognise Tantrix tiles. I first tried to get it to recognise the directions of the coloured lines on the tile using techniques from key point detection, but it didn't quite work, so I just simplified it to only recognise the tile. Have not had the chance to validate this on real-time webcam.

Dataset Generation Repository

Computer Vision Repository

Background

Inspired by a video on Playing card detection using YOLO v3, I wanted to see if I could recreate a similar concept for the tiles used in the Tantrix puzzle game. An example of such tile is the picture below.

Example of a Tantrix tile

Results

As we can see from the image below, the neural network is able to find the tile, but not the position of the individual colors. Possibly because of a too small gradient. This image is actually from the training set, because this was before I split the dataset into a training set and a validation set.

Keypoint detection, Top is label(red dots), bottom is Neural network ouput

After seeing how well it did locate the tile, I changed the labeling to only be min max of the keypoints, and as we can see from below it finds it quite well. This image is from the validation set.

Top image is with the validation keypoint values(in red again), bottom is from the neural network.

Below is a graph of the training loss alongside the validation at the same time and we don't see any artifacts of overfitting. The reason the validation is starting out lower is because validation is done after a couple of runs of training. I have yet to try it on a webcam, because I don't have the tiles available anymore.

Mean Training and validation loss from bounding box detection of tile

Last updated

Was this helpful?