Design and Implementation of Chess and Card Recognition System Based on Deep Learning

Authors

  • Yong Jin

DOI:

https://doi.org/10.54097/fcis.v2i1.3171

Keywords:

Image Recognition, Image Processing, Self-Attention, Transformer

Abstract

 In order to improve the speed and accuracy of mahjong factory packaging detection, the neural network-based chess and card recognition system designed in this paper mainly includes image preprocessing and image recognition. The image preprocessing uses the OpenCV computer vision library to segment the complete chess and cards into individual chess and cards. It is mainly to grayscale the image, use Gaussian blur to denoise the image, calculate the gradient of the image, transform the gradient image into a threshold image, perform morphological operations on the image, and perform contour detection to find the surrounding matrix of the contour. The target and the background can be divided by the vertex coordinates, and a 9x4 grid is superimposed on the divided target image and can be divided into a single mahjong chess card for neural network recognition. Image recognition uses the Vision Transformer neural network. In this paper, we first use the convolution layer to obtain the feature map, and use the feature map as the input of the Vision Transformer. The data set is mainly derived from the shooting of the mobile phone and the image expansion. Here, the image is mainly expanded according to the image brightness, blur and rotation at a certain angle. Finally, the accuracy rate of the model on the test set can reach 98%. Finally, the trained model is deployed on the android mobile terminal using TensorFlow-Lite.

Downloads

Download data is not yet available.

References

Bi Mingde, Sun Zhigang, Li Yesong Fabric defect detection system based on machine vision [J] Instrument Technology and Sensors, 2012 (12): 4.

Wang Zhaoyang, Du Chenhao, Lu Xinrong Research on mahjong intelligent recognition algorithm based on depth learning [J] China's Strategic Emerging Industries, 2019

Wang J , Wu X , Qian T , et al. Design and Implementation of Chinese Chess Based on Manipulator[C]// 2019 IEEE 3rd Advanced Information Management, Communicates, Electronic and Automation Control Conference (IMCEC). IEEE, 2019.

Chen W Y, Kuo D Y, Tung C K. Mahjong image recognition scheme using Fourier transform technique[C]// Industrial Electronics and Applications (ICIEA), 2012 7th IEEE Conference on. IEEE, 2012.

Suzuki R, Ozono T, Shintani T. A Context-aware Image Recognition System with Self-localization in Augmented Reality[J]. International Journal of Service and Knowledge Management, 2021, 5(1): 36-50.

Vaswani A , Shazeer N , Parmar N , et al. Attention Is All You Need[C]// arXiv. arXiv, 2017.

Dosovitskiy A , Beyer L , Kolesnikov A , et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale[J]. two thousand and twenty.

Liu Z , Lin Y , Cao Y , et al. Swin Transformer: Hierarchical Vision Transformer using Shifted Windows[C]// 2021.

Kingma D , Ba J.Adam: A Method for Stochastic Optimization [J]. Computer Science, 2014.

Downloads

Published

30-11-2022

Issue

Section

Articles

How to Cite

Jin, Y. (2022). Design and Implementation of Chess and Card Recognition System Based on Deep Learning. Frontiers in Computing and Intelligent Systems, 2(1), 96-100. https://doi.org/10.54097/fcis.v2i1.3171