Professional Documents
Culture Documents
An Improved Chess Machine On An
An Improved Chess Machine On An
National Conference cum Workshop on Bioinformatics and Computational Biology, NCWBCB- 2014
8
International Journal of Computer Applications® (IJCA) (0975 – 8887)
National Conference cum Workshop on Bioinformatics and Computational Biology, NCWBCB- 2014
of designed system during testing phase. Here the trained piece as well as the next position to be moved together within
system is tested with the moves that are not trained earlier i.e. the board. As shown in the Figure 4, the move e4 is
user fed unknown moves in unknown environment, where the represented as 5254 indicating that a piece is to be moved
system behaves as a move generator. The moves so generated from position 52 to next position 54.The work tries to train the
are validated to check whether they are the valid moves or system by means of the patterns generated by the master and
not. It also checks the suggested move to meet the rules of the grandmaster during the championship games. [13]
game.[13]
5. IMPLEMENTATION
Algebraic notation is a method for recording and describing
the moves in a game of chess. Each square of
the chessboard is identified by a unique coordinate pair, a
letter and a number. Each square has a unique identification of
file letter followed by rank number. [14] Considering the fact
that the Artificial Neural Network only understand the
numeric input values those algebraic notations are to be pre-
processed. Firstly, the ANN understandable board is to be
obtained where each square in the chessboard is represented
Fig 5: Proposed Neural Network Structure[13]
with the unique ANN understandable numerals, the idea here
is the use of numerical notational technique of the board as The use of adaptive Neural Network techniques allows us to
shown in the figure 3, train the system to construct a winning position, as well as to
develop its pieces which result with the best possible move.
The trained system is then deployed in the testing
environment where the result will be examined based on its
performance. The network structure is of high importance in
such ANN based approaches, and the encoding of the problem
into ANN understandable format is essential. The strategy is
to have 16 inputs and 16 output system where each input
connections signifies a piece of the one player (in order) and
each output connection stands for a piece of the other player.
Each input will be active for only one input, showing a
particular piece movement and have values showing from and
to squares in the chess board. The Network Object created is
Fig 3: ANN understandable chessboard[13] then trained using the encoded data that are actually generated
by the human Grandmaster (GM) during Championship
Table 1. Encoding scheme for ANN representation games. The training process requires a set of examples of
White Piece Black Piece proper network behavior - network inputs and the target
outputs. During training the weights and biases of the network
Algebraic Numeric Algebraic Numeric are iteratively adjusted to minimize the error of the network.
e4 5254 d5 4745 The simulation of the designed system allows checking of
Nf6 7163 Nf3 7866 performance for the new input moves. The trained network
object is simulated in the new unknown environment where
with the aid of patterns provided to it. This is to test whether it
In the numeric notation all the squares are numbered with a has learnt to produce an output that is intelligent enough.
unique two-digit numbers. In this simple numeric coordinate
system the file and the rank of the chess board is represented 6. Results and Discussions
by the numerals 1 to 8 starting from left to right (white side) 6.1 Test Case I: Scenario (Initial phase of
and bottom to top respectively. Hence, the individual square
of the chess board can now be denoted by a uniquely
the game)
identifiable co-ordinate value where first digit describes The trained system when tested in the unknown environment
the file and the second one the rank. Hence, the move that found to behave intelligently and was capable enough to
would be written is as shown in the Figure 5.2.The encoded produce the result which drives the chess pieces within the
moves depict the combination of the current position of the board on account of the learned patterns. The system when
tested generated the exact moves as the way grandmasters
9
International Journal of Computer Applications® (IJCA) (0975 – 8887)
National Conference cum Workshop on Bioinformatics and Computational Biology, NCWBCB- 2014
opens the game during the initial stage of the game. The 6.3 Testing of the system in trained
standard patterns followed by the human grandmasters were
clearly imitated by the trained neural network in the early environment:
phase of the game. The designed system when tested with the sequence of trained
move produced the result as shown below in the Table 4. It is
Table 2. Test Data (Scenario 1) found that system behaved very well for the trained sequence
of moves.
Sl. Input Output Remarks
Table 4. Testing result (trained environment)
1 5254 5755 Optimal move
2 2133 7866 Optimal move
3 7163 2836 Optimal move
10
International Journal of Computer Applications® (IJCA) (0975 – 8887)
National Conference cum Workshop on Bioinformatics and Computational Biology, NCWBCB- 2014
The designed system when tested in the untaught environment Table 6. Test data (unknown environment 2)
produced the following results:
Table 5. Testing result (unknown environment 1) Sl. Input Output Observation Remarks
7. CONCLUSION
The ANN’s can be trained to learn moves as complex as those
of chess games have been long debated upon. Apart from
Fig 9: Observation Table 5 Octavian there has been no mention of ANN applications in
chess playing. Even Octavius reports degradation in
The result of the game shown above in the Table 5 was performance. Our work brings out the fact that ANN’s can
readjusted using the concept of game tree technique when indeed be used for playing, teaching or helping humans in
required. The network is then further trained with the input playing chess. A true minimax search of a game tree may be
and the correct output so that the system adapts such scenario. expensive since every leaf node must be visited. Since, for a
Again, after training the system with the moves where system uniform tree with exactly W moves at each node, there are
found difficult to produce good result, the system produced WD nodes at the layer of the tree that is D ply from the root.
results as shown in the Table 6. Because of the depth of the game tree for chess was
potentially too deep to be successful when using a pure
approach, it was found if Artificial Neural Network and tree
searching technique used in hybrid form can substantially
reduce the move searching cost in terms of time and space. If
sufficient number of training patterns is presented to ANN, it
was found that the machine cleverly hints the suitable position
from where the move can be made. This position can be used
to derive a tree which tends to produce effective moves.
In the simplest case the best algorithm is the one that visits
fewest nodes when determining the true value of a tree. It was
found that the scope of chess as a problem domain was too
broad for minimax approach because of the fact that every
leaf node is to be reached for best move. Therefore, the
problem was narrowed by the way ANN performed. A lot of
Fig 10: Observation Table 6 time can be saved by the use of this smarter approach as
because there is no requirement to visit all leaves. This
technique can be used to device a chess engine that can play
suggest moves, and to improvise its play, game after game,
improving the understanding gained by the human players
during the play.
8. REFERENCES
[1] Murray Campbell, A. Joseph Hoane Jr., Feng-hsiung
Hsu, “Deep Blue”, IBM,August 1, 2001.
[2] Richard Peter Dazeley, “Investigations into Playing
Chess Endgames using Reinforcement Learning”
11
International Journal of Computer Applications® (IJCA) (0975 – 8887)
National Conference cum Workshop on Bioinformatics and Computational Biology, NCWBCB- 2014
Bachelor of Computing with Honours, University of [9] Olivier Mehani, “Complex Systems Seminar, Can
Tasmania (October, 2001) complex systems help design better chess-playing
programs”, February, 1 2006
[3] Jeroen W.T. Carolus, “Alpha-Beta with Sibling
Prediction Pruning in Chess” Netherlands 2006 [10] Robert Epstein, Gary Roberts, Grace Beber, “Parsing the
turing test philosophical and Methodological Issues in
[4] C.E. Shannon, “Programming a Computer for Playing the Quest for the Thinking Computer”. Springer, 03-Dec-
Chess”, Philosophical Magazine, Ser. 7, Vol. 41, Bell 2008
Telephone Laboratories, March 1950
[11] Robert Levinson and Ryan Weber, “Chess
[5] AlexandruGodescu, “An information theoretic analysis Neighbourhoods, Function Combination and
of decision in computer chess” ETH Zurich December Reinforcement Learning”, University of California Santa
13, 2011 Cruz, Springer, October 2000
[6] LaurenceFausett, “Fundamentals of Neural Networks [12] JoonatanManttari and Jonas Larsson, “Applications of
Architectures, Algorithms, and Applications”, Dorling Artificial Neural Networks in Games; An Overview”.
Kindersley Pvt. Ltd., South Asia, 2008 School of Innovation, Design and Engineering
[7] Nicolas Lassabe, Stephane Sanchez HerveLuga and Yves [13] Diwas Sharma, Udit Kr. Chakraborty, Artificial Neural
Duthen,“Genetically Programmed Strategies for Chess Network based adaptive chess playing machine.
Endgames”. GECCO’06, July 8-12, 2006 International Journal of Advance Research in Computer
[8] T.A. Marsland and Y. Björnsson, “From Minimax to Science, Vol 4 no. 4, March-April 2013.
Manhattan,”, University of Alberta Canada [14] http://en.wikipedia.org/wiki/ICCF_numeric_notation
dated: 12/10/2012
[15] Adam Berent “ChessBin” Version: 0.0.8.0 (snapsorts)
12