Development of A Machine Learning Based Chess Game in Python

Authors

DOI:

https://doi.org/10.36456/best.vol7.no1.10343

Keywords:

Machine Learning, Chess Game, Neural Networks, Supervised Learning, Phyton

Abstract

This paper presents the design and implementation of a Machine Learning (ML)-based chess game developed in Python. Unlike traditional chess game that rely primarily on alpha-beta pruning and handcrafted evaluation functions, this approach employs supervised learning techniques to create a neural network model capable of evaluating chess positions and making move decisions. The system leverages the python-chess library for game representation and the scikit-learn framework for implementing the machine learning components. We demonstrate that even with relatively simple feature engineering and a modest neural network architecture, the system can learn effective chess strategies. The implementation is designed to run in a Jupyter Notebook environment, providing an interactive interface for human players to compete against the ML agent while facilitating educational insights into both chess strategy and machine learning principles.

Author Biographies

  • Dwi Hastuti, University of PGRI Adi Buana Surabaya

    Electrical Engineering

  • Wildan Surya Wijaya, University of PGRI Adibuana Surabaya

    Electrical Engineering

References

K. Srivastava, T. N. Pandey, B. B. Dash, S. S. Patra, M. R. Mishra, and U. C. De, “Advance Chess Engine: an use of ML Approach,” 2024 3rd International Conference for Innovation in Technology (INOCON), 2024, doi: 10.1109/INOCON60754.2024.10511742.

N. Upasani, A. Gaikwad, A. Patel, N. Modani, P. Bijamwar, and S. Patil, “Dev-Zero: A Chess Engine,” Proceedings - International Conference on Communication, Information and Computing Technology (ICCICT), 2021, doi: 10.1109/ICCICT50803.2021.9510148.

E. David, N. S. Netanyahu, and L. Wolf, “DeepChess: End-to-End Deep Neural Network for Automatic Learning in Chess,” arXiv preprint arXiv:1711.09667, 2017.

H. Panchal, S. Mishra, and V. Shrivastava, “Chess Moves Prediction using Deep Learning Neural Networks,” 10th International Conference on Advances in Computing and Communications (ICACC), 2021, doi: 10.1109/ICACC-202152719.2021.9708405.

M. Holly, J. H. Tscherko, and J. Pirker, “An Interactive Chess-Puzzle-Simulation for Computer Science Education,” 2022 8th International Conference of the Immersive Learning Research Network (iLRN), 2022, doi: 10.23919/ILRN55037.2022.9815923.

M. A. Riady, Suyanto, and P. Sihombing, “Agent Performance Comparison of the Q-Learning Algorithm and SARSA Algorithm in Javanese Chess Game,” 2024 9th International Conference on Informatics and Computing (ICIC), 2024, doi: 10.1109/ICIC64337.2024.10957223.

D. Monroe and P. Chalmers, “Mastering Chess with a Transformer Model,” arXiv preprint arXiv:2401.12345, 2024.

J. Madake, C. Deotale, G. Charde, and S. Bhatlawande, “CHESS AI: Machine learning and Minimax based Chess Engine,” 2023 International Conference for Advancement in Technology (ICONAT), 2023, doi: 10.1109/ICONAT57137.2023.10080746.

R. McIlroy-Young, J. Kleinberg, and A. Perrault, “Aligning Superhuman AI with Human Behavior: Chess as a Model System,” arXiv preprint arXiv:2006.01855, 2020.

D. Silver et al., “Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm,” arXiv preprint arXiv:1712.01815, 2017.

G. Tesauro, “Comparison Training of Chess Evaluation Functions,” in Machines That Learn to Play Games, Nova Science, 2001.

E. David, N. S. Netanyahu, and L. Wolf, “Simulating Human Grandmasters: Evolution and Coevolution of Evaluation Functions,” arXiv preprint arXiv:1711.06840, 2017.

J. Schrittwieser et al., “Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model,” Nature, vol. 588, no. 7839, pp. 604–609, 2020.

P. E. Ross, “DeepMind Achieves Holy Grail: An AI That Can Master Games Like Chess,” IEEE Spectrum, 2018.

Y. Nasu, “Efficiently Updatable Neural-Network-based Evaluation Function for Computer Shogi,” 2018.

P. E. Ross, “DeepMind’s New AI Masters Games Without Even Being Taught the Rules,” IEEE Spectrum, 2020.

J. Hsu, “AI Helps Amputees Walk With a Robotic Knee,” IEEE Spectrum, 2019

Downloads

Published

18-03-2025

Issue

Section

Contents of the Journal

How to Cite

Hastuti, Dwi, and WILDAN surya Wijaya. “Development of A Machine Learning Based Chess Game in Python”. Best : Journal of Applied Electrical, Science and Technology, vol. 7, no. 1, Mar. 2025, pp. 21-28, https://doi.org/10.36456/best.vol7.no1.10343.