K-SVD

Dictionary learning algorithm
Part of a series on
Machine learning
and data mining
Paradigms
  • Supervised learning
  • Unsupervised learning
  • Online learning
  • Batch learning
  • Meta-learning
  • Semi-supervised learning
  • Self-supervised learning
  • Reinforcement learning
  • Curriculum learning
  • Rule-based learning
  • Quantum machine learning
Problems
Learning with humans
Machine-learning venues
  • v
  • t
  • e

In applied mathematics, k-SVD is a dictionary learning algorithm for creating a dictionary for sparse representations, via a singular value decomposition approach. k-SVD is a generalization of the k-means clustering method, and it works by iteratively alternating between sparse coding the input data based on the current dictionary, and updating the atoms in the dictionary to better fit the data. It is structurally related to the expectation–maximization (EM) algorithm.[1][2] k-SVD can be found widely in use in applications such as image processing, audio processing, biology, and document analysis.

k-SVD algorithm

k-SVD is a kind of generalization of k-means, as follows. The k-means clustering can be also regarded as a method of sparse representation. That is, finding the best possible codebook to represent the data samples { y i } i = 1 M {\displaystyle \{y_{i}\}_{i=1}^{M}} by nearest neighbor, by solving

min D , X { Y D X F 2 } subject to  i , x i = e k  for some  k . {\displaystyle \quad \min \limits _{D,X}\{\|Y-DX\|_{F}^{2}\}\qquad {\text{subject to }}\forall i,x_{i}=e_{k}{\text{ for some }}k.}

which is nearly equivalent to

min D , X { Y D X F 2 } subject to  i , x i 0 = 1 {\displaystyle \quad \min \limits _{D,X}\{\|Y-DX\|_{F}^{2}\}\qquad {\text{subject to }}\quad \forall i,\|x_{i}\|_{0}=1}

which is k-means that allows "weights".

The letter F denotes the Frobenius norm. The sparse representation term x i = e k {\displaystyle x_{i}=e_{k}} enforces k-means algorithm to use only one atom (column) in dictionary D {\displaystyle D} . To relax this constraint, the target of the k-SVD algorithm is to represent the signal as a linear combination of atoms in D {\displaystyle D} .

The k-SVD algorithm follows the construction flow of the k-means algorithm. However, in contrast to k-means, in order to achieve a linear combination of atoms in D {\displaystyle D} , the sparsity term of the constraint is relaxed so that the number of nonzero entries of each column x i {\displaystyle x_{i}} can be more than 1, but less than a number T 0 {\displaystyle T_{0}} .

So, the objective function becomes

min D , X { Y D X F 2 } subject to  i , x i 0 T 0 . {\displaystyle \quad \min \limits _{D,X}\{\|Y-DX\|_{F}^{2}\}\qquad {\text{subject to }}\quad \forall i\;,\|x_{i}\|_{0}\leq T_{0}.}

or in another objective form

min D , X i x i 0 subject to  i , Y D X F 2 ϵ . {\displaystyle \quad \min \limits _{D,X}\sum _{i}\|x_{i}\|_{0}\qquad {\text{subject to }}\quad \forall i\;,\|Y-DX\|_{F}^{2}\leq \epsilon .}

In the k-SVD algorithm, the D {\displaystyle D} is first fixed and the best coefficient matrix X {\displaystyle X} is found. As finding the truly optimal X {\displaystyle X} is hard, we use an approximation pursuit method. Any algorithm such as OMP, the orthogonal matching pursuit can be used for the calculation of the coefficients, as long as it can supply a solution with a fixed and predetermined number of nonzero entries T 0 {\displaystyle T_{0}} .

After the sparse coding task, the next is to search for a better dictionary D {\displaystyle D} . However, finding the whole dictionary all at a time is impossible, so the process is to update only one column of the dictionary D {\displaystyle D} each time, while fixing X {\displaystyle X} . The update of the k {\displaystyle k} -th column is done by rewriting the penalty term as

Y D X F 2 = Y j = 1 K d j x j T F 2 = ( Y j k d j x j T ) d k x k T F 2 = E k d k x k T F 2 {\displaystyle \|Y-DX\|_{F}^{2}=\left\|Y-\sum _{j=1}^{K}d_{j}x_{j}^{\text{T}}\right\|_{F}^{2}=\left\|\left(Y-\sum _{j\neq k}d_{j}x_{j}^{\text{T}}\right)-d_{k}x_{k}^{\text{T}}\right\|_{F}^{2}=\|E_{k}-d_{k}x_{k}^{\text{T}}\|_{F}^{2}}

where x k T {\displaystyle x_{k}^{\text{T}}} denotes the k-th row of X.

By decomposing the multiplication D X {\displaystyle DX} into sum of K {\displaystyle K} rank 1 matrices, we can assume the other K 1 {\displaystyle K-1} terms are assumed fixed, and the k {\displaystyle k} -th remains unknown. After this step, we can solve the minimization problem by approximate the E k {\displaystyle E_{k}} term with a r a n k 1 {\displaystyle rank-1} matrix using singular value decomposition, then update d k {\displaystyle d_{k}} with it. However, the new solution for the vector x k T {\displaystyle x_{k}^{\text{T}}} is not guaranteed to be sparse.

To cure this problem, define ω k {\displaystyle \omega _{k}} as

ω k = { i 1 i N , x k T ( i ) 0 } , {\displaystyle \omega _{k}=\{i\mid 1\leq i\leq N,x_{k}^{\text{T}}(i)\neq 0\},}

which points to examples { y i } i = 1 N {\displaystyle \{y_{i}\}_{i=1}^{N}} that use atom d k {\displaystyle d_{k}} (also the entries of x i {\displaystyle x_{i}} that is nonzero). Then, define Ω k {\displaystyle \Omega _{k}} as a matrix of size N × | ω k | {\displaystyle N\times |\omega _{k}|} , with ones on the ( i , ω k ( i ) ) th {\displaystyle (i,\omega _{k}(i)){\text{th}}} entries and zeros otherwise. When multiplying x ~ k T = x k T Ω k {\displaystyle {\tilde {x}}_{k}^{\text{T}}=x_{k}^{\text{T}}\Omega _{k}} , this shrinks the row vector x k T {\displaystyle x_{k}^{\text{T}}} by discarding the zero entries. Similarly, the multiplication Y ~ k = Y Ω k {\displaystyle {\tilde {Y}}_{k}=Y\Omega _{k}} is the subset of the examples that are current using the d k {\displaystyle d_{k}} atom. The same effect can be seen on E ~ k = E k Ω k {\displaystyle {\tilde {E}}_{k}=E_{k}\Omega _{k}} .

So the minimization problem as mentioned before becomes

E k Ω k d k x k T Ω k F 2 = E ~ k d k x ~ k T F 2 {\displaystyle \|E_{k}\Omega _{k}-d_{k}x_{k}^{\text{T}}\Omega _{k}\|_{F}^{2}=\|{\tilde {E}}_{k}-d_{k}{\tilde {x}}_{k}^{\text{T}}\|_{F}^{2}}

and can be done by directly using SVD. SVD decomposes E ~ k {\displaystyle {\tilde {E}}_{k}} into U Δ V T {\displaystyle U\Delta V^{\text{T}}} . The solution for d k {\displaystyle d_{k}} is the first column of U, the coefficient vector x ~ k T {\displaystyle {\tilde {x}}_{k}^{\text{T}}} as the first column of V × Δ ( 1 , 1 ) {\displaystyle V\times \Delta (1,1)} . After updating the whole dictionary, the process then turns to iteratively solve X, then iteratively solve D.

Limitations

Choosing an appropriate "dictionary" for a dataset is a non-convex problem, and k-SVD operates by an iterative update which does not guarantee to find the global optimum.[2] However, this is common to other algorithms for this purpose, and k-SVD works fairly well in practice.[2][better source needed]

See also

References

  1. ^ Michal Aharon; Michael Elad; Alfred Bruckstein (2006), "K-SVD: An Algorithm for Designing Overcomplete Dictionaries for Sparse Representation" (PDF), IEEE Transactions on Signal Processing, 54 (11): 4311–4322, Bibcode:2006ITSP...54.4311A, doi:10.1109/TSP.2006.881199, S2CID 7477309
  2. ^ a b c Rubinstein, R., Bruckstein, A.M., and Elad, M. (2010), "Dictionaries for Sparse Representation Modeling", Proceedings of the IEEE, 98 (6): 1045–1057, CiteSeerX 10.1.1.160.527, doi:10.1109/JPROC.2010.2040551, S2CID 2176046{{citation}}: CS1 maint: multiple names: authors list (link)