Chess has experienced a large increase in viewership since the pandemic, driven largely by the accessibility of online learning platforms. However, no equivalent assistance exists for physical chess games, creating a divide between analog and digital chess experiences. This paper presents CVChess, a deep learning framework for converting chessboard images to Forsyth-Edwards Notation (FEN), which is later input into online chess engines to provide you with the best next move. Our approach employs a convolutional neural network (CNN) with residual layers to perform piece recognition from smartphone camera images. The system processes RGB images of a physical chess board through a multistep process: image preprocessing using the Hough Line Transform for edge detection, projective transform to achieve a top-down board alignment, segmentation into 64 individual squares, and piece classification into 13 classes (6 unique white pieces, 6 unique black pieces and an empty square) using the residual CNN. Residual connections help retain low-level visual features while enabling deeper feature extraction, improving accuracy and stability during training. We train and evaluate our model using the Chess Recognition Dataset (ChessReD), containing 10,800 annotated smartphone images captured under diverse lighting conditions and angles. The resulting classifications are encoded as an FEN string, which can be fed into a chess engine to generate the most optimal move
翻译:自疫情以来,国际象棋的观众数量大幅增长,这主要得益于在线学习平台的可及性。然而,实体国际象棋对局缺乏相应的辅助工具,导致模拟与数字象棋体验之间存在鸿沟。本文提出CVChess,一种将棋盘图像转换为Forsyth-Edwards Notation(FEN)的深度学习框架,该FEN随后可输入在线象棋引擎以提供最佳下一步走法。我们的方法采用带有残差层的卷积神经网络(CNN),从智能手机摄像头图像中识别棋子。系统通过多步骤处理实体棋盘的RGB图像:使用霍夫线变换进行边缘检测的图像预处理、通过投影变换实现棋盘俯视对齐、分割为64个独立方格,并利用残差CNN将棋子分类为13个类别(6种不同的白方棋子、6种不同的黑方棋子及空方格)。残差连接有助于保留低层视觉特征,同时实现更深层次的特征提取,从而提高训练过程中的准确性和稳定性。我们使用国际象棋识别数据集(ChessReD)训练和评估模型,该数据集包含10,800张在不同光照条件和角度下拍摄的带标注智能手机图像。最终分类结果被编码为FEN字符串,可输入象棋引擎以生成最优走法。