Skip to main content
. Author manuscript; available in PMC: 2015 Feb 1.
Published in final edited form as: Med Image Anal. 2013 Nov 6;18(2):253–271. doi: 10.1016/j.media.2013.10.012
Algorithm 1 Multiscale Appearance Dictionary Learning

Require: appearance vector samples {Yt11}k={y1,ik}i=1M1 and {Yt12}k={y2,jk}j=1M2, k = 1,…, S, initial dictionaries {Dt11,Dt12}z,z=1,,J, and sparsity factor T.
w11={w1,i1}i=1M1=1, w21={w2,j1}j=1M2=1.
for z = 1,…,J do k = S if z%S = 0; k = z%S, otherwise.
  Resampling: Draw sample sets Y1z from {Yt11}k and Y2z from {Yt12}k based on distributions p1z={p1,iz}i=1M1=w1zi=1M1w1,iz and p2z={p2,jz}j=1M2=w2zj=2M2w2,jz.
  Dictionary Update: Apply the K-SVD to learn {Dt1,Dt2}z from Y1z and Y2z: min{Dtc}z,XYcz{Dtc}zX22s.t.i,xi0T;c{1,2}.
  Sparse Coding: y{Yt11,Yt12}k, solve for the sparse representations with respect to {Dt1}z and {Dt2}z using the OMP, and get residues R(y,Dt1)z and R(y,Dt2)z.
  Classification: Make a hypothesis hz:y{Yt11,Yt12}k{0,1}:hz(y)=Heaviside(R(y,Dt2)zR(y,Dt1)z). Calculate the error of hz:z=i=1M1p1,iz|hz(y1,ik)1|+j=1M2p2,jzhz(y2,jk). Set βz = z/(1 − z).
  Weight Update: w1,iz+1=w1,izβz1|hz(y1,ik)1|,w2,jz+1=w2,jzβz1hz(y2,jk)
end for dictionary pairs {Dt1,Dt2}z, weighting parameters βz, z = 1,…,J.