More Algorithms for Provable Dictionary Learning
Sanjeev Arora, Aditya Bhaskara, Rong Ge, Tengyu Ma
Introduction
Provable guarantees for dictionary learning have seemed difficult because the obvious math programming formulation is nonconvex: both and the ’s are unknown. Even when the dictionary is known, it is in general NP-hard to get the sparse combination given worst-case [DMA97]. This problem of decoding given with full knowledge of is called sparse recovery or sparse regression, and is closely related to compressed sensing. For many types of dictionary , sparse recovery was shown to be tractable even on worst-case , starting with such a result for incoherent matrices by Donoho and Huo [DH01]. However in most early works was constrained to be -sparse, until Candes, Romberg and Tao [CRT06] showed how to do sparse recovery even when the sparsity is , assuming satisfies the restricted isometry property (RIP) (which random matrices do).
But dictionary learning itself (recovering given samples ) has proved much harder and heuristic algorithms are widely used. Lewicki and Sejnowski [LS00] designed the first one, which was followed by the method of optimal directions (MOD) [EAHH99] and K-SVD [AEB06]. See [Aha06] for more references. However, until recently there were no algorithms that provably recovers the correct dictionary. Recently Spielman et al. [SWW12] gave such an algorithm for the full rank case (i.e., ) and the unknown feature vector is -sparse. However, in practice overcomplete dictionaries () are preferred. Arora et al. [AGM13] gave the first provable learning algorithm for overcomplete dictionaries that runs in polynomial-time; they required to be -sparse (roughly speaking) and to be incoherent. Independently, Agarwal et al. [AAN13] gave a weaker algorithm that also assumes is incoherent and allows to be -sparse. Thus all three of these recent algorithms cannot handle sparsity more than , and this is a fundamental limitation of the technique: they require two random to intersect in no more than coordinates with high probability, which fails to hold when sparsity . Since sparse recovery (where is known) is possible even up to sparsity , this raised the question whether dictionary learning is possible in that regime. In this paper we will refer to feature vectors with sparsity as slightly-sparse, since methods in this paper do not seem to allow density higher than that.
In our recent paper on deep learning ([ABGM13], Section 7) we showed how to solve dictionary learning in this regime for dictionaries which are adjacency matrices of random weighted sparse bipartite graphs; these are known to allow sparse recovery albeit with a slight twist in the problem definition [Ind08, JXHC09, BGI+08]. Since real-life dictionaries are probably not random, this raises the question whether dictionary learning is possible in the slightly sparse case for other dictionaries. The current paper gives quasipolynomial-time algorithms for learning more such dictionaries. The running time is quasipolynomial time because it uses limited enumeration (similarly, e.g., to algorithms for learning gaussian mixtures). Now we discuss this class of dictionaries.
Some of our discussion below refers to nonnegative dictionary learning, which constrains matrices and hidden vector to have nonnegative entries. This is a popular variant proposed by Hoyer [Hoy02], motivated again partly by the neural analogy. Algorithms like NN-K-SVD [AEB05] were then applied to image classification tasks. This version is also related to nonnegative matrix factorization [LS99], which has been observed to lead to factorizations that are usually sparser and more local than traditional methods like SVD.
Now we discuss what versions of dictionary learning make more sense than others. For exposition purposes we refer to the coordinates of the hidden vector as features, and those of the visible vector as pixels, even though the discussion applies to more than just computer vision. Dictionary learning as defined here —which is the standard definition—assumes that features’ effect on the pixels add linearly.
But, the problem definition is somewhat arbitrary. On the one hand one could consider more general (and nonlinear) versions of this problem —for instance in vision, dictionary learning is part of a system that has to deal with occlusions among objects that may hide part of a feature, and to incorporate the fact that features may be present with an arbitrary translation/rotation. On the other hand, one could consider more specific versions that place restrictions on the dictionary, since not all dictionaries may make sense in applications. We consider this latter possibility now, with the usual caveat that it is nontrivial to cleanly formalize properties of real-life instances.
One reasonable property of real-life dictionaries is that each feature does not involve most pixels. This implies that column vectors of are relatively sparse. Thus matrices with RIP property —at least if they are dense— do not seem a good matchBy contrast, in the usual setting of compressed sensing, the matrix provides a basis for making measurements, and its density is a nonissue..
Another intuitive property is that features are individually recoverable, which means, roughly speaking, that to an observer who knows the dictionary, the presence of a particular feature should not be confusable with the effects produced by the usual distribution of other features (this is an average-case condition, since satisfies stochastic assumptions). In particular, one should be able to detect its presence by looking only at the pixels it would affect.
Thus it becomes clear that not all matrices that allow sparse recovery are of equal interests. The paper of Arora et al. [AGM13] restricts attention to incoherent matrices, where the columns have pairwise inner product at most where is small, like . These make sense on both the above counts. First, they can have fairly sparse columns. Secondly they satisfy , so given one can take its inner product with the th column to roughly determine the extent to which feature is present. But incoherent matrices restrict sparsity to , so one is tempted by RIP matrices but, as mentioned, their columns are fairly dense. Furthermore, RIP matrices were designed to allow sparse recovery for worst-case feature vectors whereas in dictionary learning these are stochastic. As mentioned, sparse random graphs (with random edges weights in $$) check all the right boxes (and were handled in our recent paper on deep learning) but require positing that the dictionary has no structure. The goal in the current paper is to move beyond random graphs.
Let us try to formulate the property that features are individually recoverable. We hope this definition and discussion will stimulate further work (similar, we hope, to Dasgupta’s formalization of separability for gaussian mixtures [Das99]). Let us assume that the coordinates of are pairwise independent. Then the presence of the th feature (i.e., ) changes the conditional distribution of those pixels involved in , the th column of . Features are said to be individually recoverable if this change in conditional distribution is not obtainable from other combinations of features that arise with reasonable probability. This statistical property is hard to work with and below we suggest some (possibly too strong) combinatorial properties of the support of that imply it. Better formalizations seem quite plausible and are left for future work.
Definitions and Results
The th column of is denoted by , the th row of by , and the entries of are denoted by .
For ease of exposition we first describe our learning algorithm for nonnegative dictionaries (i.e., , for all ) and then in Section 4 describe the generalization to the general case. Note that the subcase of nonnegative dictionaries is also of practical interest.
(Every feature has significant effect on pixels) There are at least edges with weights larger than for every feature . That is, the degree of on the feature side is always larger than .
(Low pairwise intersections among features) In the neighborhood of each feature (that is, ) has intersection up to (with total weight ) with each of at most other features, and intersection at most with the neighborhood of each remaining features. Here is as explained below and .
Guideline through notation: We will think of as a small constant, a constant, and a sufficiently large constant which is used to control the assumption. Let and we use the notation to hide the dependencies of . Also, we think of as not much larger than , , and . The normalization assumption implies (for all practical purposes in the algorithm) that . We typically think of as , hence a running time of would be bad (though it is unclear a priori how to even achieve that).
Precisely, for our algorithms to work, we need , and for some sufficiently large constant and the density . Note that if were like a random graph (i.e. if features affect random sets of pixels) when , the pairwise intersection between the neighborhoods of two features in would be . However, we allow these intersections to be .
Now we give a stronger version of Assumption 2 which will allow a stronger algorithm.
In , the pairwise intersection of the neighborhoods of any two features is less than , where and .
The algorithm can only learn the real-valued matrix approximately. Two dictionaries are close if they satisfy the following definition:
Under Assumptions 1 and 2, when , Algorithm 2 runs in time, uses samples and outputs a matrix that is -equivalent to the true dictionary . Furthermore, under Assumptions 1 and 2’ the same algorithm returns a dictionary that is -equivalent to the true dictionary, while using samples, where is a large constant depending on . Recall that is a sufficiently large constant that controls the parameters of the assumptions.
2 Dictionaries with negative entries
When the edges can be both positive and negative, it is no longer valid to assume the expectation of ’s are equal to . Instead, we choose a different normalization: the variances of ’s are 1. We still assume magnitude of edge weights are at most , and that features don’t overlap a lot as described in Assumption 1 and 2. We also need one more assumption to bound the variance contributed by the small entries.
The degree of on side of is always larger than .
In , the pairwise intersection of the neighborhoods of any two features is less than ,where and .
(small entries of don’t cause large effects) , where be the vector that only contains the entries of that are at most , and .
Note that Assumption G1 differs from Assumption 1 by a constant factor 2 just to simplify some notations later. Assumption G2’ is the same as before.
This assumption G3 intuitively says that for each , the smaller ’s should not contribute too much to the variance of . This is automatically satisfied for nonnegative dictionaries because there can be no cancellations. Notice that this assumption is talking about rows of matrix (corresponding to pixels), whereas the earlier assumptions talk about columns of (corresponding to features). Also, consider to be the smallest number between what is required by Assumption G2’ and G3.
In term of parameters, we still need , and . As before is a large enough constant.
Under Assumptions G1, G2’ and G3, when there is an algorithm that runs in time, uses samples and outputs a matrix that is -equivalent to the true dictionary , where is a constant depending on .
The algorithm and the proof of Theorem 2 are sketched in Section 4.
Nonnegative Dictionary Learning
Recall that dictionary learning seems hard because both and are unknown. To get around this problem, previous works (e.g. [AGM13]) try to extract information about the assignment without first learning (but assuming nice properties of ). After finding , recovering becomes easy. In [AGM13] the unknown ’s were recovered via an overlapping clustering procedure. The procedure relies on incoherence of , as when is incoherent it is possible to test whether the support of , intersect. This idea fails when is only slightly sparse, because in this setting the supports of always have a large intersection.
Our algorithm here relies on correlation among pixels. The key observation is: if the th bit in is 1, then . Pixels with high values in tend to be elevated above their mean values (recall is nonnegative). At first it is unclear how this simultaneous elevation can be spotted, since is unknown and these elevations/correlations among pixels are much smaller than the standard deviation of individual pixels. Therefore we look for local regions —small subsets of pixels— in where this effect is significant in the aggregate (i.e., sum of pixel values), and can be used to consistently predict the value of . These are called the signature sets (see Definition 2). If we can identify signature sets, they can give us a good estimation of whether the feature is present.
Since the signature sets are small, in quasi-polynomial time we can afford to enumerate all sets of that size, and check if the pixels in these sets are likely to be elevated together. However, this does not solve the problem, because there can be many sets —called correlated sets below— that show similar correlations and look similar to signature sets. It is hard to separate signature sets from other correlated sets when the size of the set is small. This leads to the next idea: try to expand a signature set by first estimating the corresponding column of , and then picking large entries in that column. The resulting sets are called expanded signature sets; these have size (and hence could not have been found by exhaustive guessing alone). If the set being expanded is indeed a signature set, this expansion process can correctly estimate the column of . We give algorithms that can find expanded signature sets, and using these sets we can get a rough estimation for the matrix . Finally, we also give a procedure that leverages the individually recoverable properties of the features, and refines the solution to be inverse polynomially equivalent to the true dictionary.
The high level algorithm is described in Algorithm 2 (the concepts such as correlated sets, and empirical bias are defined later). To simplify the proof the algorithm description uses Assumption 2’; we summarize later (in Section 3.4) what changes with Assumption 2.
The main algorithm has three main steps. Section 3.1 explains how to test for correlated sets and expand a set (1-2 in Algorithm 2); Section 3.2 shows how to find expanded signature sets and a rough estimation of (3-6 in Algorithm 2); finally Section 3.3 shows how to refine the solution and get that is inverse polynomially equivalent to (7-10 in Algorithm 2).
We consider a set of size (to be specified later), and denote by the random variable representing the sum of all pixels in , i.e., . We can expand as
Let be the contribution of to the sum , then is just
Now we make this precise by defining such set with only one large coefficient as signature sets.
A set of size is a signature set for , if , and for all , the contribution . Here is a large enough constant.
The following lemma formalizes the earlier intuition that if is a signature set for , then a large is highly correlated with the event .
.
, and .
where is a large constant depending .
Part (2) immediately follows: if , then iff the sum deviates from its expectation by more than , which happens with probability . So also if , occurs with probability .
This then implies part (1), since the probability of is precisely .
Combining the (1) and (2), and using Bayes’ rule , we obtain (3).
Thus if we can find a signature set for , we would roughly know the samples in which . The following lemma shows that assuming the low pairwise assumptions among features, there exists a signature set for every feature .
Suppose satisfies Assumptions 1 and 2, let , then for any , there exists a signature set of size for node .
We show the existence by probabilistic method. By Assumption 1, node has at least neighbors in . Let be a uniformly random set of neighbors of in . Now by the definition of we have .
Using a bound on intersection size (Assumption 2’) followed by Chernoff bound, we show that is a signature set with good probability. For , let be the number of edges from to in graph . Then we can upperbound by since all edge weights are at most and there are at most edges with weights larger than . Using simple Chernoff bound and union bound, we know that with probability at least , for all , . Therefore for , and .
Although signature sets exist for all , it is difficult to find them; even if we enumerate all subsets of size , it is not clear how to know when we found a signature set. Thus we first look for “correlated” sets, which are defined as follows:
It follows easily (Lemma 3) that signature sets must be correlated sets.
If of size is a signature set for , and , then is a correlated set.
Although signature sets are all correlated sets, the other direction is far from true. There can be many correlated sets that are not signature sets . A simple counterexample would be that there are and such that both and are larger than . This kind of counterexample seems inevitable for any test on a set of polylogarithmic size.
2 Identify Expanded Signature Sets
The following notion of empirical bias is a more precise way (compared to correlated set) to measure the simultaneous elevation effect.
The key lemma in this part shows the expanded set with largest empirical bias must be an expanded signature set:
We make the arguments above precise by the following claims. First, we shall show there cannot be too many large coefficients for any set of size (although we only apply the claim on expanded sets).
This implies that , when . Note that any subset of also satisfies equation (3), thus we don’t have to worry about the other range of the solution of (3)
Now we have found expanded signature sets, we can then apply Algorithm 1 (but with threshold instead of ) on that to get an estimation.
Combining the two parts, we know the number of samples that is in (the symmetric difference between and ) is bounded by . Also, with high probability all the samples have entries bounded by by Bernstein’s inequality (variance of is bounded by ). Notice that this is a statement of the entire sample independent of the set , so we do not need to apply union bound over all expanded signature sets.
The previous lemma looks very similar to the lemma for signature sets, however, the benefit is we know how to find a set that is guaranteed to be expanded signature set! So we can iteratively find all expanded signature sets.
The proof is almost identical to Lemma 8.
3 Getting an Equivalent Dictionary
In the final step, we look at all the large entries in the column , and use them to identify whether feature is 1 or 0. The ability to do this justifies the individually recoverable property of the dictionary.
By Assumption 2, for any , the number of edges in between and is bounded by , so .
Since has a unique large coefficient , and the rest of the coefficients are much smaller, when is large enough, and we know is entry-wise close to (this is using the same argument as in Lemma 6). We shall show this is enough to proof -equivalence between and .
The proof is an easy application of Bernstein’s inequality (see Appendix A.1).
We now formally write down the steps in the algorithm.
4 Working with Assumption 2
In order to assume Assumption 2 instead of 2’, we need to change the definition of signature sets to allow “moderately large” () entries. This makes the definition look similar to expanded signature sets. Such signature sets still exist by similar probabilistic argument as in Lemma 4. Lemma 7 and Claims 9 and 10 can also be adapted.
Finally, for Lemma 14, the guarantee will be weaker (there can be moderately large coefficients). The algorithm will only estimate incorrectly if at least such coefficients are “on” (has the corresponding being 1), which happens with less than probability. By argument similar to Lemma 6 and Lemma 14 we get the first part of Theorem 1.
General Case
With minor modifications, our algorithm and its analysis can be adapted to the general case in which the matrix can have both positive and negative entries.
We follow the outline from the non-negative case, and look at sets of size . The quantities and are defined exactly the same as in Section 3.1. Additionally, let be the standard deviation of , and let be the standard deviation of . That is,
The definition of signature sets requires an additional condition to take into account the standard deviations.
A set of size is a signature set for , if for some large constant , we have: (a) , (b) for all , the contribution , and additionally, (c) .
In the nonnegative case the additional condition was automatically implied by nonnegativity and scaling. Now we use Assumption G3 to show there exist in which (c) is true along with the other properties. To do that, we prove a simple lemma which lets us bound the variance (the same lemma is also used in other places).
Let be a set of size and be an arbitrary subset of features, and consider the sum . Suppose for each , the number of edges from to in graph is bounded by . Then the variance of is bounded by .
The idea is to split the weights into the big and small ones (threshold being ). Intuitively, on one hand, the contribution to the variance from large weights is bounded above because the number of such large edges in bounded by . On the other hand, by assumption (3), the total variance of small weights is less than , which implies that the contribution of small weight to the variance is also bounded. Formally, we have
In the fourth line we used Cauchy-Schwarz inequality and in the last step, we used Assumption G3 about the total variance due to small terms being small, as well as the normalization of the variance in each pixel.
Suppose satisfies our assumptions for general dictionaries, and let . Then for any , there exists a general signature set of size for node (as in Definition 7).
As before, we use the probabilistic method. Suppose we fix some . By Assumption G1, in , node has either at least positive neighbors or negative ones. W.l.o.g., let us assume there are negative neighbors. Let be uniformly random subset of size of these negative neighbors. By definition of , we have .
For , let be the number of edges from to in graph . Using the same argument as in the proof of Lemma 4, we have w.h.p. for all such . Thus . Thus it remains to bound .
We could apply Lemma 15 with , and on set : we get . Recall that and thus .
The proof of Lemma 3 now follows in the general case (here we will use the variance bound (c) in the general definition of signature sets), except that we need to redefine event to handle the negative case. For completeness, we state the general version of Lemma 3 in Appendix A.2. As before, signature sets give a great idea of whether .
Let us now define correlated sets: here we need to consider both positive and negative bias
Our earlier definitions of expanded signature sets and bias can also be adapted naturally:
Let us now intuitively describe why the analog of Lemma 8 holds in the general case. We provides the formal statement and the proof in Appendix A.2
The main lemma in the nonnegative case, which shows that Algorithm 1 roughly recovers a column, is Lemma 11. The proof uses the property that signature sets are elevated “almost iff” the to conclude that we get a good approximation to one of the columns. We have seen that this also holds in the general case, and since the rest of the argument deals only with the magnitudes of the entries, we conclude that we can roughly recover a column also in the general case. Let us state this formally.
Once we have all the entries which are in magnitude, we can use the ‘refinement’ trick of Lemma 13 to conclude that we can recover the entries.
When the number of samples is at least , the matrices and are entry-wise close. Further, the two dictionaries are -equivalent.
The first part of the proof (showing entry-wise closeness) is very similar to Lemma 6. In order to show equivalent, notice when the entries are very close this just follows from Bernstein’s inequality, with variance bounded by . In Section 3 we do not just use this bound, because we want to be able to also handle the case when the entrywise error is only inverse polylog (for Assumption 2).
References
Appendix A Full Proofs
In this section we give the omitted proofs.
Let us focus on the th row of and denote it by . Then we have . Now consider the random variable , where are i.i.d. Bernoulli r.v.s with probability of being . Then by Bernstein’s inequality (Theorem 23), we have
Since for all , we can bound the variance as .
Thus setting (notice that this is the in Bernstein’s inequality, not the same as the size of signature sets), we obtain an upper bound of on the probability.
A.2 Missing Lemmas and Proofs of Section 4
.
, and .