Mathematical Morphology Applied to Computer Go Author: Bruno Bouzy Presenter: Ling Zhao June 30, 2004
Outline Motivations Contributions Mathematical Morphology (MM) & Go Zobrist’s model for influence recognition Adaptation of MM to Go Implementation issue Experimental results Conclusions
Motivations Influence Territory Position evaluation
Contributions Link Zobrist’s model with mathematical morphology Extend Zobrist’s model Good results for territory recognition Implemented in both Indigo and GnuGo and is working
Mathematical morphology (MM) “Analysis of signals in terms of shape” Widely used for image processing Applications: 1. Image restoration 2. Edge detection 3. Texture analysis 4. Noise reduction 5. Computer Go!
Operators in MM Input: a set of elements Dilation: A + neighboring elements of A Erosion: A – neighboring elements of ~A Closing set: E(D(A)), Opening set: D(E(A)) Dilation Erosion
Liberties and eyes in Go Find liberties Find eyes
Simple territory Macro Operator:
Fuzzy territory Problems: Boolean values are not sufficient.
Zobrist’s model (’69) Used to recognize influence Init: +64 -> black intersections -64 -> white intersections, 0 -> all else Iterations (4 times) positive points -> send out +1 to neighbors negative points -> send out –1 to neighbors
Improved model using MM terms Key fact: forbid points who has neighbors (including itself) with both positive values and negative values. Dz(point): value(point) + num_of(points with values of same sign) Ez(point): abs(value(point))-num_of(points with value of zero or of opposite sign) no sign change (put it zero then)
Examples D1D D2D D3D E 1 o D E 7 o D 3 e = d (d-1) +1
“Efficient” implementation of D Bouzy’s implementation // init line[0] = line[t+1] = 0; void SI::dilation(SI *q) { for (int i=1; i<=t; i++) { q->line[i] = line[i] | line[i-1] | line[i+1] | (line[i]<<1) & mask | (line[i]>>1) & mask; } My implementation
Experimental results Xz(d, d(d-1)=1) when d=4 or 5 is very good Example using Xz(4,13)
Build into Go program Indigo GnuGo “The Bouzy 5/21 algorithm is interesting in that it corresponds reasonably well to the human concept of territory. This algorithm is still used in GNU Go 3.4 in the function estimate_score “ Author’s claim: 1. “a model which recognized “territories”... as human players do”. 2. “The recognition is accurate and robust”.
My conclusions Nice model to apply mathematical morphology to Go. Quite accurate in territory recognition compared to other computer approaches. Can be efficiently computed.