recording a game of go: hidden markov model improves weak classifier steven scher [email protected]

18
Recording a Game of Recording a Game of Go: Go: Hidden Markov Model Improves Weak Hidden Markov Model Improves Weak Classifier Classifier Steven Scher Steven Scher [email protected] [email protected]

Post on 21-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Recording a Game of Recording a Game of Go:Go:

Hidden Markov Model Improves Weak Hidden Markov Model Improves Weak ClassifierClassifier

Steven ScherSteven Scher

[email protected]@ucsc.edu

Input: video sequenceInput: video sequenceVideo (straightened)

Weak classifierWeak classifier

SimpleSimple Acts Acts

independently independently at each possible at each possible stone locationstone location

Looks for CirclesLooks for Circles Hough Hough

TransformTransform Looks for Looks for

extremely bright extremely bright or dark patchesor dark patches

Very NoisyVery Noisy

Video (straightened)weak frame-by-frame

Stone-classifier

= black stone

= white stone

= wait until next slide

Improve Weak classifier: Ignore Improve Weak classifier: Ignore MotionMotion

Ignore Ignore spurious spurious detections detections caused by caused by handshands

May delete May delete good good detectionsdetections

Overall, Overall, seems to seems to improve the improve the classifierclassifier

Motion

classifier

Video (straightened)weak frame-by-frame

Stone-classifier

= black stone

= white stone

= ignored (motion)

Estimating the Sequence of Estimating the Sequence of moves:moves:

A Simple AlgorithmA Simple Algorithm Discard movie frames where too many new Discard movie frames where too many new

stones appear since the last valid framestones appear since the last valid frame Discard movie frames with inappropriate Discard movie frames with inappropriate

mix of classified black and white stonesmix of classified black and white stones should be equal, +/-1should be equal, +/-1

ResultsResults Relies on occasional clean, noiseless frames Relies on occasional clean, noiseless frames For S > 5, many artifacts introducedFor S > 5, many artifacts introduced For S < 5, algorithm cannot handle a long For S < 5, algorithm cannot handle a long

sequence (if there is no valid frame during the sequence (if there is no valid frame during the time that S stones are actually played)time that S stones are actually played)

A Better Model:A Better Model:Hidden Markov ModelHidden Markov Model

Consider Each Possible Stone Location Consider Each Possible Stone Location IndependentlyIndependently

Consider each transition to depend only on Consider each transition to depend only on current statecurrent state

empty

Blackstone

Whitestone

HMM over time is a treeHMM over time is a tree

timeHidden state

= {empty, black, white}

Observed state

= {empty, black, white, unknown/motion}

time=t time=t+1time=t-1

Transition probabilitiesTransition probabilities

empty

Blackstone

Whitestone

Pnew

Pstay= 1-2*Pnew

1

1

Pnew

10000

1

3019

1

____

1

2

MovesBetweenFramesMovieMovesPossible

Pnew

Estimate:

Probabilities of ObservationsProbabilities of Observationsif there is a stoneif there is a stone

empty

Blackstone

Whitestone

empty Black stone White stoneHand moving

(no information)

(Black stones’ probabilities similar to white stone)

.1 .1 .7 .1

Estimate:

Probabilities of ObservationsProbabilities of Observationsif there is no stoneif there is no stone

empty

Blackstone

Whitestone

empty Black stone White stoneHand moving

(no information)

.7 .1 .1 .1

Estimate:

Data-Derived Estimate fromData-Derived Estimate from Baum-Welch Algorithm Baum-Welch Algorithm

empty

Blackstone

Whitestone

empty Black stone White stoneHand moving

(no information)

.7 .1 .1 .1X .5 X .3

Baum-Welsh:

Baum-Welch & Viterbi Baum-Welch & Viterbi AlgorithmsAlgorithms

Baum-Welch AlgorithmBaum-Welch AlgorithmExpectation-MaximizationExpectation-Maximization

Viterbi AlgorithmViterbi AlgorithmRecursive (Dynamic Programming)Recursive (Dynamic Programming)QuickQuick

Linear in length of sequenceLinear in length of sequenceQuadratic in # of hidden statesQuadratic in # of hidden states

Likely sequence of hidden states:Likely sequence of hidden states:Viterbi AlgorithmViterbi Algorithm

Motion

classifier

Video (straightened)weak frame-by-frame

Stone-classifierLikely SequenceOf Hidden States

hmm 30weak classifier

Algorithm provides a reasonable solutionAlgorithm provides a reasonable solutionnot robust enough to be fully autonomousnot robust enough to be fully autonomous

Motion

classifier

Video (straightened)weak frame-by-frame

Stone-classifierLikely SequenceOf Hidden States

hmm 30weak classifier

mistakes

Minimizing User InteractionMinimizing User InteractionAssign the first frame to be emptyAssign the first frame to be empty

Add e.g. 10 copies to beginning of sequenceAdd e.g. 10 copies to beginning of sequenceCorrect errors in the last frame by handCorrect errors in the last frame by hand

hmm 30

User InterfaceUser InterfaceNot Fully AutomatedNot Fully AutomatedUseful tool, given a good user Useful tool, given a good user

interfaceinterface hmm 30

Future WorkFuture Work Improve the Graphical ModelImprove the Graphical Model

Only one stone allowed to appearOnly one stone allowed to appear Per image frame?Per image frame? Per Per tt seconds of real-time? seconds of real-time?

Improve the stone/empty classifierImprove the stone/empty classifier More robustness against lighting changes desiredMore robustness against lighting changes desired Train on labeled examplesTrain on labeled examples

Viola & Jones?Viola & Jones? Improve the motion detectorImprove the motion detector

Upgrade to a hand-tracking algorithmUpgrade to a hand-tracking algorithm This also be done with a graphical modelThis also be done with a graphical model Incorporate into one model?Incorporate into one model?

GUIGUI Allow a variety of user labeling, update as new labels are Allow a variety of user labeling, update as new labels are

made?made?

Questions?Questions?Weak Classifier is noisyWeak Classifier is noisyEstimating sequence of states from Estimating sequence of states from

observations removes much of the noiseobservations removes much of the noisehmm 30