Classical Recognition

dictionary learning

Dictionary learning is the idea that a complicated image can be rebuilt as a combination of just a few basic visual elements drawn from a learned library — much as any word is spelled from a few letters of an alphabet. Each small image patch is approximated as a weighted sum of a handful of building blocks (called atoms), and almost all of the weights are zero. The library of atoms is the dictionary, the short list of nonzero weights is the sparse code, and learning means discovering, from data, the dictionary that lets the patches in your domain be reconstructed accurately while using as few atoms as possible per patch.

Made precise, you arrange the dictionary atoms as columns of a matrix D and seek, for each signal (patch) x, a sparse coefficient vector a such that D·a reconstructs x well — minimizing the reconstruction error plus a penalty that pushes most entries of a to zero (an L0 count of nonzeros, or its convex L1 relaxation). Training jointly optimizes both the codes a for every patch and the dictionary D itself, typically by alternating: hold D fixed and solve for sparse codes (sparse coding, via methods like matching pursuit or LASSO), then hold the codes fixed and update D (via methods like K-SVD or online dictionary learning). The dictionary is deliberately overcomplete — it has more atoms than the patch dimension — which gives the freedom to represent diverse patterns with very few atoms each; the learned atoms typically come out as oriented edges, bars, and textures, strikingly similar to the receptive fields in the primary visual cortex.

In vision, dictionary learning had two big roles. For recognition, replacing the hard vector-quantization step of bag-of-words with sparse coding (each feature is a soft mixture of a few dictionary atoms instead of being snapped to one cluster), then max-pooling the codes, gave a strong image-classification pipeline (the ScSPM method) that for a time was state of the art. For low-level vision, sparse coding over learned dictionaries set benchmarks in image denoising, inpainting, deblurring, and super-resolution, because natural-image patches genuinely are sparse in a good dictionary while noise is not, so reconstruction suppresses the noise. The conceptual reach is large: sparse coding is a hand-crafted unsupervised feature learner, an intellectual precursor to the learned features of deep networks. Convolutional networks ultimately surpassed it by learning hierarchical features discriminatively and end to end, but the sparse, parts-based, overcomplete-basis viewpoint remains influential, and sparse-coding ideas reappear in compressed sensing and in analyses of how networks represent concepts.

Why overcomplete and sparse go together: with more atoms than dimensions, the system is underdetermined and infinitely many codes reconstruct a patch — the sparsity penalty is what selects a unique, meaningful one (the fewest active atoms). Sparsity is therefore not a minor regularizer but the very thing that makes an overcomplete code well-defined and interpretable.

Also called
sparse codingsparse dictionary learning