Predicting Forsyth-Edwards Notation with Chess Images: An Advanced Analysis Using Convolutional Neural Networks
Abstract
In this research, we propose a novel method to predict Forsyth-Edwards Notation (FEN) scores of the digitalchessboard image with the help of Convolutional Neural Networks (CNNs). Our model is able to efficientlytranslate visual board configurations into related FEN representations by employing the extensive use ofdeep learning and in-depth Exploratory Data Analysis (EDA). Our data preprocessing pipeline was basedon the extensive preprocessing of images, including the data labeling, resizing, cleaning, augmentation,and data splitting into stratified batches to guarantee variety and quality of the data that would allow itssuccessful training. In order to further optimize feature extraction and spatial awareness, we incorporatedan example of Principal Component Analysis (PCA) and feature engineering techniques that currentlyenhance the model to help differentiate between different board states. The CNN model that we designedperformed a training accuracy of 98.6 percent and test accuracy of 98.4 percent and the loss and accuracycurves were well behaved within the training epochs. We measured the performance with several metrics,our model had a Micro F1 Score of 0.992, a Macro F1 Score of 0.990, a Weighted F1 Score of 0.989, ourmodel shows strong predictive performance on all classes including rare chess pieces and empty squares.Our model was tested in terms of reliability, collating all predicted FEN strings against ground truth FENscollected at online chess repositories, thus confirming their practicality. The model can be used in the reallifesituation so that with the help of our system it is possible to extract correct FENs on the basis of gameplayscreenshots to analyze the game in real-time and automatically record chess games. We summarize asolid and effective vision-based approach to the chess state recognition and open the path towards furtherdevelopment of the computer vision-based solutions in the choice of the strategic board games.References
Parmar, Shashank. ”Chess Piece Classification Via Convolutional Neural Networks.” In 2023 International Conference on Self Sustainable Artificial Intelligence Systems (ICSSAS), pp. 36-42. IEEE, 2023.
Xie, Youye, Gongguo Tang, and William Hoff. ”Chess piece recognition using oriented chamfer matching with a comparison to cnn.” In 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 2001-2009. IEEE, 2018.
Christie, Dennis Aprilla, Tubagus Maulana Kusuma, and Purnawarman Musa. ”Chess piece movement detection and tracking, a vision system framework for autonomous chess playing robot.” In 2017 Second International Conference on Informatics and Computing (ICIC), pp. 1-6. IEEE, 2017.
Nhat, Vo Quang, and GueeSang Lee. ”Chessboard and Pieces Detection for Janggi Chess Playing Robot.” International Journal of Contents 9, no. 4 (2013): 16-21.
Patria, Reyhan, Sean Favian, Anggoro Caturdewa, and Derwin Suhartono. ”Cheat detection on online chess games using convolutional and dense neural network.” In 2021 4th International Seminar on Research of Information Technology and Intelligent Systems (ISRITI), pp. 389-395. IEEE, 2021.
Han, Xie, Rong Zhao, and Fusheng Sun. ”Methods for Location and Recognition of Chess Pieces Based on Convolutional Neural Network.” Laser & Optoelectronics Progress 56, no. 8 (2019): 081007.
Sabatelli, Matthia, Francesco Bidoia, Valeriu Codreanu, and Marco A. Wiering. ”Learning to Evaluate Chess Positions with Deep Neural Networks and Limited Lookahead.” In ICPRAM, pp. 276-283. 2018.
Kong, Brandon Sean, Irwandi Hipiny, and Hamimah Ujir. ”Classification of Digital Chess Pieces and Board Position using SIFT.” In 2021 IEEE International Conference on Signal and Image Processing Applications (ICSIPA), pp. 66-71. IEEE, 2021.
Wei, Yu-An, Tzu-Wei Huang, Hwann-Tzong Chen, and JenChi Liu. ”Chess recognition from a single depth image.” In 2017 IEEE International Conference on Multimedia and Expo (ICME), pp. 931-936. IEEE, 2017.
Wolff, Regina, Anoshan Indreswaran, Matthias Krauledat, and Ronny Hartanto. ”Towards Computer-Vision-Based Learning from Demonstration (CVLfD): Chess Piece Recognition.” J. Comput. 14, no. 8 (2019): 519-527.
Iqbal, Azlan. ”An Algorithm for Automatically Updating a Forsyth-Edwards Notation String Without an Array Board Representation.” In 2020 8th International Conference on Information Technology and Multimedia (ICIMU), pp. 271-276. IEEE, 2020.
Ganguly, Debasis, Johannes Leveling, and Gareth JF Jones. ”Retrieval of similar chess positions.” In Proceedings of the 37th international ACM SIGIR conference on Research development in information retrieval, pp. 687-696. 2014.
Mallase´n Quintana, David, Alberto Antonio del Barrio Garc´ıa, and Manuel Prieto Mat´ıas. ”LiveChess2FEN: a Framework for Classifying Chess Pieces based on CNNs.” arXiv e-prints (2020): arXiv-2012.
Yang, Yongfeng, Yaoqi Wang, and Xiaopeng Wang. ”Methods for location and recognition of chess pieces based on machine vision.” In 2022 IEEE 5th Advanced Information Management, Communicates, Electronic and Automation Control Conference (IMCEC), vol. 5, pp. 1706-1710. IEEE, 2022.
Campello, Rafael, and Afonso Delgado. ”Chess position identification using pieces classification based on synthetic images generation and deep neural network fine-tuning.” In Anais do XXI Simpo´sio de Realidade Virtual e Aumentada, pp. 68-76. SBC, 2019.
Kagkas, Dimitrios, Despina Karamichailidou, and Alex Alexandridis. ”Chess Position Evaluation Using Radial Basis Function Neural Networks.” Complexity 2023 (2023).
Baxter, Jonathan, Andrew Tridgell, and Lex Weaver. ”Learning to play chess using temporal differences.” Machine learning 40 (2000): 243-263.
Wold, Svante, Kim Esbensen, and Paul Geladi. ”Principal component analysis.” Chemometrics and intelligent laboratory systems 2, no. 1-3 (1987): 37-52.
Chatfield, Chris. ”Exploratory data analysis.” European journal of operational research 23, no. 1 (1986): 5-13.
Sokic, Emir, and Melita Ahic-Djokic. ”Simple computer vision system for chess playing robot manipulator as a project-based learning example.” In 2008 IEEE International Symposium on Signal Processing and Information Technology, pp. 75-79. IEEE, 2008.
Larregay, Guillermo, Federico Pinna, Luis Avila, and Daniel Mora´n. ”Design and implementation of a computer vision system for an autonomous chess-playing robot.” Journal of Computer Science Technology 18 (2018).
Wo¨lflein, Georg, and Ognjen Arandjelovic´. ”Determining chess game state from an image.” Journal of Imaging 7, no. 6 (2021): 94.
Czyzewski, Maciej A., Artur Laskowski, and Szymon Wasik. ”Chessboard and chess piece recognition with the support of neural networks.” Foundations of Computing and Decision Sciences 45, no. 4 (2020): 257-280.
Wikipedia, ”Forsyth-Edwards Notation,” available at https://en.wikipedia.org/wiki/Forsyth-EdwardsN otation, accessedon21April2020.
chess.com. (2019). Chess.com - Play Chess Online - Free Games. Chess.com. https://www.chess.com/
DOI:
https://doi.org/10.31449/inf.v49i13.6168Downloads
Published
How to Cite
Issue
Section
License
Authors retain copyright in their work. By submitting to and publishing with Informatica, authors grant the publisher (Slovene Society Informatika) the non-exclusive right to publish, reproduce, and distribute the article and to identify itself as the original publisher.
All articles are published under the Creative Commons Attribution license CC BY 3.0. Under this license, others may share and adapt the work for any purpose, provided appropriate credit is given and changes (if any) are indicated.
Authors may deposit and share the submitted version, accepted manuscript, and published version, provided the original publication in Informatica is properly cited.







