Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Online Learning for Matrix Factorization and Sparse Coding

Online dictionary learning scales sparse coding to millions of training samples

  • Problem Earlier dictionary learning methods rerun over the whole training set in every iteration. That cannot scale to millions of samples or follow data that keep changing, such as video.
  • Method The authors' online method updates the dictionary one streamed sample at a time. It keeps two small running sums and minimizes a quadratic surrogate built from them, so memory does not grow with the number of samples.
  • Results It is faster than earlier dictionary learning approaches on natural images.

Why batch dictionary learning stalls at scale

Dictionary learning represents each signal as a sparse combination of a few atoms taken from a learned matrix D. D has m rows and k columns, and k can exceed m, so the dictionary may be overcomplete. The training sets are large, since a 10 × 10 patch gives m = 100 and typical image tasks use n of at least 100,000 samples.

Most earlier dictionary learning methods are iterative batch procedures that touch the whole training set in every iteration. That design cannot scale to very large training sets, and it cannot follow data that keep changing, such as video. The problem sharpens in image and video work, where several millions of small patches come from one data source, roughly one per pixel and frame.

The training set is finite, but the real target is the expected cost under the unknown distribution of the data. Because the empirical cost only approximates that expectation, minimizing it very precisely wastes effort. A rough solution can match or beat a precisely optimized one in expected cost, which makes stochastic methods attractive.

A standard stochastic alternative updates the dictionary with one gradient step per sample and a projection onto the constraint set. Its step size has the form a/(t+b), and a and b must be tuned for each data set. The authors' point is that this generic update ignores the structure of sparse coding, which they set out to exploit instead.

The key idea: two running sums and a quadratic surrogate

The key idea is to keep running sums of past codes and samples, and to minimize a quadratic surrogate built from them. The sums are two small matrices, A_t of size k by k and B_t of size m by k, so memory does not grow with the number of samples. Written this way, the dictionary update becomes a quadratic problem in D.

At iteration t the surrogate averages the sparse coding losses of all samples seen so far, with each code kept at the value it had when its sample was processed. It is quadratic in D and upper bounds the empirical cost, so minimizing it also pushes the empirical cost down.

The authors need two facts for this to work: the surrogate must track the empirical cost, and consecutive surrogates must stay close. When consecutive surrogates are close, the previous dictionary is a good warm start for the next update.

One iteration, step by step

Each iteration draws one sample x_t and computes its code over the dictionary from the previous iteration, D_{t-1}. The authors chose LARS-Lasso because simple coordinate descent is fast only when dictionary columns are weakly correlated, and learned dictionaries are highly correlated.

Next the algorithm adds the outer product of the code to A_t and the product of the sample with the code to B_t, using \\( A_t \\leftarrow A_{t-1} + \\alpha_t\\alpha_t^T \\) and \\( B_t \\leftarrow B_{t-1} + x_t\\alpha_t^T \\). A past sample affects the dictionary only through these two sums.

The dictionary update then visits the columns one at a time, computing \\( u_j \\leftarrow \\frac{1}{A[j,j]}(b_j - Da_j) + d_j \\) for each column. It then sets \\( d_j \\leftarrow u_j / \\max(\\|u_j\\|_2, 1) \\), which keeps the column inside the unit ball that defines the constraint set C. This column loop repeats until convergence, starting from the previous dictionary.

Handling finite sets, forgetting and mini-batches

For a finite training set, the authors cycle over a randomly permuted copy of it. For small sets they can replace the old code of a repeated sample with the new one, but storing all codes is impractical at scale. Instead they keep only two epochs of statistics in auxiliary matrices.

A forgetting factor \\( \\beta_t = (1 - 1/t)^{\\rho} \\) rescales the old sums, so that newer codes weigh more. With ρ = 0 the original algorithm is recovered. The authors found the factor useful only for large data sets, with n ≥ 100,000, and they call its tuning not critical.

Drawing η signals per iteration helps because the cost of coding η vectors is not linear in η. The experiments use a mini-batch size of η = 512.

Initializing A_0 = t_0 I and B_0 = t_0 D_0 slows the first steps, but the authors did not need it in their experiments. Those experiments ran with ρ = 0 and t_0 = 0.

Does the dictionary settle? The convergence argument

The analysis rests on three assumptions, labelled A to C. Assumption A is that the data have compact support K, which the authors call natural for audio, image and video processing. Assumption B bounds the smallest eigenvalue of A_t/t below by κ1, which makes each surrogate strictly convex.

Assumption C requires the coding solution to be unique, which holds when the smallest eigenvalue of D_Λ^T D_Λ is at least κ2. The authors defend C as a common assumption in linear regression and LARS, and they note an elastic net penalty can enforce it.

Under A to C, the expected cost converges almost surely, and the gap between it and the surrogate converges almost surely to 0. So the surrogate becomes a converging proxy for the expected cost. A lemma shows that D_t − D_{t−1} = O(1/t), but this does not by itself make D_t converge.

The proof uses the convergence of empirical processes and of quasi-martingales, and it covers only the basic version of the algorithm. Because the problem is non-convex, the result is a stationary point, not a guaranteed global optimum.

Swapping the constraint set for NMF, NNSC and sparse PCA

The authors keep the algorithm and change only the constraint set C, as long as each column has its own independent constraint and its projection is cheap. Two examples are a non-negative set with d_j ≥ 0 and an elastic-net set with ||d_j||_2^2 + γ||d_j||_1 ≤ 1. A fused lasso set adds the penalty \\( FL(u) = \\sum_{i=2}^{m} |u[i] - u[i-1]| \\) to encourage piecewise-constant columns.

With these constraint sets the method still converges to a stationary point.

Non-negative matrix factorization is the case with non-negativity constraints on both D and the coefficients. Hoyer's non-negative sparse coding adds a sparsity penalty on the coefficients, and it equals non-negative matrix factorization when λ = 0.

For sparse PCA the authors put an l1 penalty on the codes and an elastic-net constraint on the dictionary. Each column update then becomes a projection that Algorithm 3 in Appendix B solves in linear time. For the ℓ'' loss, the authors state that their analysis does not apply, and they rely on experiments.

Speed against NMF and NNSC

The authors compare their method with the NMF method of Lee and Seung and with the NNSC method of Hoyer, plotting the objective against computation time. Their computation time includes one final sparse coding pass over the inputs to obtain α. The experiments use k = 49 basis vectors for data sets D and E and k = 64 for data set F, with a mini-batch size η = 512.

Hoyer's method was run with λ set to 1 over the square root of m, and each curve averages 3 runs with different initializations.

The authors report a clear speed gain over the other tested methods on all three data sets. Read from the curves, this means a given objective value is reached sooner.

The NMF and NNSC baselines run as Matlab code, where large matrix products are already well optimized, while the authors' implementation is in C++. The authors add that the NMF and NNSC results could improve a bit with a C++ implementation, so the gap is a reasonable lower bound on the speed-up.

Learned features on faces and natural patches

The authors compare features learned by PCA, NMF, dictionary learning and sparse PCA on faces D and E and on natural patches F. Inputs are centered and normalized for dictionary learning, PCA and SPCA, and the regularizer is set so each input has about 10 nonzero coefficients.

PCA spreads its features over the whole image, and NMF gives more localized features on the face databases D and E. Neither PCA nor NMF learns localized features on the natural patches F, but dictionary learning does. The comparison is visual, and the paper attaches no score to it.

Sparse PCA is the only tested method that lets the authors control the level of sparsity among the learned matrices, through γ and the percentage τ of nonzero dictionary values.

Correlating gene expression with CGH data

The authors apply their formulation to a breast cancer data set that pairs gene expression with CGH measurements. The data hold 89 tissue samples, 2,148 gene expression measurements and 16,962 CGH measurements. The formulation is \\( \\min_{u,v} \\|Y^TX - vu^T\\|_F^2 + \\lambda\\|u\\|_2 \\) subject to \\( \\|v\\|_2^2 + \\gamma_1\\|v\\|_1 + \\gamma_2 FL(v) \\le 1 \\), a variant of the canonical correlation formulation of Witten et al.

The problem is solved once for each of the 23 chromosomes, with γ1 = γ2 = 1 and λ chosen to leave about 25 nonzero coefficients in u. Training uses 3/4 of the samples, and the results average 10 random splits.

The authors report that their correlations are in general similar to those of PMD. The PMD values come from curves that Witten et al. reported, and the authors did not rerun PMD under this protocol. The authors say the aim is to show the method works on genomic data, and that more experiments would be needed for a fair comparison.

Inpainting a 12-Megapixel photograph

The authors remove text from a 12-Megapixel photograph by learning a dictionary from its undamaged color patches. They learn 256 elements in about 8 minutes, with two epochs on eight cores.

The text is then removed with the sparse coding inpainting technique of Mairal et al. (2008b). For comparison, the dictionaries that Mairal et al. (2008b) used for inpainting were learned in batch mode on 200,000 patches only.

The authors say this is, to their knowledge, the first use of dictionary learning for image restoration at this scale. They do not evaluate inpainting quality against state-of-the-art methods, since their aim is to show the procedure runs on a realistic large image.

Limitations

The convergence proof covers only the basic algorithm, not the optimized variants of Section 3.4. It also relies on compact data support and on assumptions B and C. The guarantee is a stationary point, not the global optimum.

Non-convex regularizers such as the l0 pseudo-norm can be used, but no convergence result is known for them. The forgetting parameter ρ helps only on large data sets, with n ≥ 100,000. Assumption B is checked only experimentally after a few iterations.

The inpainting experiment shows that the procedure can run on a large image, and it does not compare inpainting quality with other methods. The genomic comparison is not a careful one against PMD.

Paper info

Authors
Julien Mairal, Francis Bach, Jean Ponce, Guillermo Sapiro
Venue
arXiv · Preprint
First published
2009-8-1
Added
2026-11-12
Updated
2010-2-11
Version
v2
arXiv
0908.0050
Category
stat.ML · cs.LG · math.OC
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Julien Mairal, Francis Bach, Jean Ponce, Guillermo Sapiro (2009). Online Learning for Matrix Factorization and Sparse Coding. arXiv:0908.0050v2. https://arxiv.org/abs/0908.0050v2

BibTeX
@misc{mairal2009online,
  title = {{Online Learning for Matrix Factorization and Sparse Coding}},
  author = {Julien Mairal and Francis Bach and Jean Ponce and Guillermo Sapiro},
  year = {2009},
  eprint = {0908.0050},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/0908.0050v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up