Hidden Variables, the EM Algorithm, and Mixtures of Gaussians
Computer Vision Jia-Bin Huang, Virginia Tech
Many slides from D. Hoiem
Hidden Variables, the EM Algorithm, and Mixtures of Gaussians - - PowerPoint PPT Presentation
Hidden Variables, the EM Algorithm, and Mixtures of Gaussians Computer Vision Jia-Bin Huang, Virginia Tech Many slides from D. Hoiem Administrative stuffs Final project proposal due soon - extended to Oct 29 Monday Tips for final
Many slides from D. Hoiem
environment
Image Gradient Watershed boundaries
–Fast (< 1 sec for 512x512 image) –Preserves boundaries
–Only as good as the soft boundaries (which may be slow to compute) –Not easy to get variety of regions for multiple segmentations
–Good algorithm for superpixels, hierarchical segmentation
+ Good for thin regions + Fast + Easy to control coarseness of segmentations + Can include both large and small regions
http://www.cs.toronto.edu/~kyros/pubs/09.pami.turbopixels.pdf
Tries to preserve boundaries like watershed but to produce more regular regions
http://infoscience.epfl.ch/record/177415/files/Superpixel_PAMI2011-2.pdf + Fast 0.36s for 320x240 + Regular superpixels + Superpixels fit boundaries
http://www.cs.brown.edu/~pff/segment/
IJCV 2011 (uses trained classifier to merge)
2009
mean-shift segmentations
(Endres Hoiem ECCV 2010, Carreira Sminchisescu CVPR 2010)
http://infoscience.epfl.ch/record/177415/files/Superpixel_PAMI2011-2.pdf + Fast 0.36s for 320x240 + Regular superpixels + Superpixels fit boundaries
Photo: Jam343 (Flickr)
Annotator Ratings 10 8 9 2 8
http://www.robots.ox.ac.uk/~vgg/publications/papers/russell06.pdf
Foreground Background
Foreground Background
n n N
1
n n N
1
2 2 2 2
n n
መ 𝜄 = argmax𝜄 𝑞 𝐲 𝜄) = argmax𝜄 log 𝑞 𝐲 𝜄) መ 𝜄 = argmax𝜄
𝑜
log (𝑞 𝑦𝑜 𝜄 ) = argmax𝜄 𝑀(𝜄) 𝑀 𝜄 = −𝑂 2 log 2𝜌 − −𝑂 2 log 𝜏2 − 1 2𝜏2
𝑜
𝑦𝑜 − 𝜈 2 𝜖𝑀(𝜄) 𝜖𝜈 = 1 𝜏2
𝑜
𝑦𝑜 − 𝑣 = 0 → ො 𝜈 = 1 𝑂
𝑜
𝑦𝑜 𝜖𝑀(𝜄) 𝜖𝜏 = 𝑂 𝜏 − 1 𝜏3
𝑜
𝑦𝑜 − 𝜈 2 = 0 → 𝜏2 = 1 𝑂
𝑜
𝑦𝑜 − ො 𝜈 2 Log-Likelihood
2 2 2 2
2 exp 2 1 ) , | (
n n
x x p
Gaussian Distribution
n n N
1
2 2 2 2
n n
n n
n n
2 2
>> mu_fg = mean(im(labels)) mu_fg = 0.6012 >> sigma_fg = sqrt(mean((im(labels)-mu_fg).^2)) sigma_fg = 0.1007 >> mu_bg = mean(im(~labels)) mu_bg = 0.4007 >> sigma_bg = sqrt(mean((im(~labels)-mu_bg).^2)) sigma_bg = 0.1007
labels im fg: mu=0.6, sigma=0.1 bg: mu=0.4, sigma=0.1 Parameters used to Generate
Foreground Background
component or label
n n
component or label
n m n n n n
Conditional probability
𝑄 𝐵 𝐶 = 𝑄(𝐵, 𝐶) 𝑄(𝐶)
component or label
n m n n n n
k k n n m n n
Marginalization
𝑄 𝐵 =
𝑙
𝑄(𝐵, 𝐶 = 𝑙)
component or label
n m n n n n
k k n k n n m n m n n
k k n n m n n
Joint distribution
𝑄 𝐵, 𝐶 = P B P(A|B)
>> pfg = 0.5; >> px_fg = normpdf(im, mu_fg, sigma_fg); >> px_bg = normpdf(im, mu_bg, sigma_bg); >> pfg_x = px_fg*pfg ./ (px_fg*pfg + px_bg*(1-pfg));
im fg: mu=0.6, sigma=0.1 bg: mu=0.4, sigma=0.1 Learned Parameters p(fg | im)
Foreground Background
m m m n m
2 2 2
m m m n n n n
2 2
m n m m n
2
mixture component
m m m m n n n
2 2 π
component prior component model parameters
) ( ) ( 2 ) ( t t t n n nm
n n nm n nm t m
x 1 ˆ
) 1 (
n m n nm n nm t m
x
2 ) 1 ( 2
ˆ 1 ˆ
N
n nm t m
) 1 (
ˆ
z
See here for proof: www.stanford.edu/class/cs229/notes/cs229-notes8.ps
for concave functions f(x) (so we maximize the lower bound!)
) ( , |
) (
t x z
t
z
) ( ) 1 (
t t
z
z
) ( , |
) (
t x z
t
z
) ( ) 1 (
t t
z
z
log of expectation of P(x|z) expectation of log of P(x|z)
m m m m n m
x
2 2 2 exp
2 1
m m m m n n n
m z x p x p , , | , , , |
2 2 π
σ μ
) ( , |
) (
t x z
t
z
) ( ) 1 (
t t
z
m m m m n m
x
2 2 2 exp
2 1
m m m m n n n
m z x p x p , , | , , , |
2 2 π
σ μ
) ( , |
) (
t x z
t
z
) ( ) 1 (
t t
z
) ( ) ( 2 ) ( t t t n n nm
n n nm n nm t m
x 1 ˆ
) 1 (
n m n nm n nm t m
x
2 ) 1 ( 2
ˆ 1 ˆ
N
n nm t m
) 1 (
ˆ
http://lasa.epfl.ch/teaching/lectures/ML_Phd/Notes/GP-GMM.pdf
−1
at the end
Photo: Jam343 (Flickr)
Annotator Ratings 10 8 9 2 8