Detection and classification of the 15 Puzzle with a Convolutional Neural Network

Abstract

The 15 Puzzle is a popular sliding puzzle that provides both entertainment and a challenge to the brain. Solving it in as few moves as possible can be quite challenging. To receive assistance in solving the puzzle or to solve it completely, an Android app has been developed that calculates and displays the shortest path. This paper describes solving the 15 Puzzle on an embedded Android system using image processing and classification by a Convolutional Neural Network (CNN) trained on the Modified National Institute of Standards and Technology (MNIST) dataset. It describes the process of detecting a puzzle in an image, processing it, extracting the digits, and subsequent classification with the CNN, and mentions a method for solving the puzzles with an informed search algorithm. In addition, it elaborates on the challenges that arose and how they were solved. To test the reliability of the application and the accuracy of the CNN within the app, 100 self-made puzzles were evaluated. In the experiments, a total of 2000 digits were classified and compared to their true labels. Based on this, the accuracy of the CNN within the app and the reliability of the app were calculated, indicating how many puzzles were correctly classified. The CNN achieved an accuracy of 91.88%, and the reliability of the app was 43%.