 
              CSSE463: Image Recognition Day 31  Today: Bayesian classifiers  Questions?
Bayesian classifiers  Use training data p(x)  Assume that you know P(x| w 1 ) probabilities of each feature.  If 2 classes: P(x| w 2 )  Classes w 1 and w 2  Say, circles vs. non-circles  A single feature, x Circles  Both classes equally likely  Both types of errors equally Non-circles bad  Where should we set the threshold between classes? x Here? Detected as circles  Where in graph are 2 types of errors? Q1-4
What if we have prior information?  Bayesian probabilities say that if we only expect 10% of the objects to be circles, that should affect our classification Q5-8
Bayesian classifier in general  Bayes rule: p ( b | a ) p ( a )  Verify with example  p ( a | b )  For classifiers: p ( b )  x = feature(s)  w i = class  P( w |x) = posterior probability w w p ( x | ) p ( )  P( w ) = prior w  p ( | x ) i i  P(x) = unconditional probability i p ( x )  Find best class by maximum a posteriori (MAP) priniciple. Find Fixed class i that maximizes P( w i |x). Learned from Learned from  Denominator doesn’t affect examples calculations training set (or (histogram)  Example: leave out if  indoor/outdoor classification unknown)
Indoor vs. outdoor classification  I can use low-level image info (color, texture, etc)  But there’s another source of really helpful info!
Camera Metadata Distributions 0.16 p(FF|I) 0.14 1 0.12 p(BV|I) p(FF|O) 0.9 0.1 p(BV|O) 0.8 0.08 0.7 0.06 0.6 0.04 0.5 0.02 0.4 0 0.3 -6 -0.5 1 0.2 2.5 4 p(FF|O) 5.5 0.1 7 8.5 0 10 p(FF|I) p(BV|I) Subject Distance 11.5 On Off Scene Brightness Flash 0.35 0.6 0.3 0.25 0.4 p(SD|I) 0.2 p(ET|I) p(SD|O) 0.2 0.15 p(ET|O) 0.1 0 0 0.05 0.01 0 0.017 0 0.022 1 2 0.03 p(ET|I) 3 4 0.05 5 p(ET|O) 0.07 7 9 0.1 17 p(SD|I) 0.12 Exposure Time Subject Distance
Why we need Bayes Rule Problem: We know conditional probabilities like P( flash was on | indoor) We want to find conditional probabilities like P(indoor | flash was on, exp time = 0.017, sd=8 ft, SVM output) Let w = class of image, and x = all the evidence. More generally, we know P( x | w ) from the training set (why?) But we want P( w | x) w w p ( x | ) p ( ) w  p ( | x ) i i i p ( x )
Using Bayes Rule P( w |x) = P(x| w )P( w )/P(x) The denominator is constant for an image, so P( w |x) = a P(x| w )P( w ) Q9
Using Bayes Rule P( w |x) = P(x| w )P( w )/P(x) The denominator is constant for an image, so P( w |x) = a P(x| w )P( w ) We have two types of features, from image metadata (M) and from low-level features, like color (L) Conditional independence means P(x| w ) = P(M| w )P(L| w ) P( w |X) = a P(M| w ) P(L| w ) P( w ) From SVM Priors From histograms (initial bias)
Bayesian network  Efficient way to encode conditional probability distributions and calculate marginals  Use for classification by having the classification node at the root  Examples  Indoor-outdoor classification  Automatic image orientation detection
Indoor vs. outdoor classification Each edge in the graph has an associated matrix of conditional probabilities SVM SVM Color Texture Features Features KL Divergence EXIF header
Effects of Image Capture Context Recall for a class C is fraction of C classified correctly
Orientation detection  See IEEE TPAMI paper  Hardcopy or posted  Also uses single-feature Bayesian classifier (answer to #1-4)  Keys:  4-class problem (North, South, East, West)  Priors really helped here!  You should be able to understand the two papers (both posted)
Recommend
More recommend