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 {Yt−11}k={y1,ik}i=1M1 and {Yt−12}k={y2,jk}j=1M2, k = 1,…, S, initial dictionaries {Dt−11,Dt−12}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 Y∼1z from {Yt−11}k and Y∼2z from {Yt−12}k based on distributions p1z={p1,iz}i=1M1=w1z∑i=1M1w1,iz and p2z={p2,jz}j=1M2=w2z∑j=2M2w2,jz.
  Dictionary Update: Apply the K-SVD to learn {Dt1,Dt2}z from Y∼1z and Y∼2z: min{Dtc}z,X‖Y∼cz−{Dtc}zX‖22s.t.∀i,‖xi‖0≤T;c∈{1,2}.
  Sparse Coding: ∀y∈{Yt−11,Yt−12}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∈{Yt−11,Yt−12}k→{0,1}:hz(y)=Heaviside(R(y,Dt2)z−R(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βz1−hz(y2,jk)
 end for dictionary pairs {Dt1,Dt2}z, weighting parameters βz, z = 1,…,J.