The present application relates to image classification.
Recent state-of-the-art image classification systems consist of two major parts: bag-of-features (BoF) and spatial pyramid matching (SPM). The BoF method represents an image as a histogram of its local features. It is especially robust against spatial translations of features, and demonstrates decent performance in whole-image categorization tasks. However, the BoF method disregards the information about the spatial layout of features, hence it is incapable of capturing shapes or locating an object. Of the many extensions of the BoF method, including the generative part models, geometric correspondence search and discriminative codebook learning, the most successful results were reported by using SPM. The SPM method partitions the image into increasingly finer spatial sub-regions and computes histograms of local features from each sub-region. Typically, subregions, are used. Other partitions such as has also been attempted to incorporate domain knowledge for images with “sky” on top and/or “ground” on bottom. The resulting “spatial pyramid” is a computationally efficient extension of the orderless BoF representation, and has shown very promising performance on many image classification tasks.
A typical flowchart of the SPM approach based on BoF is illustrated on the left of
Although the traditional SPM approach works well for image classification, people empirically found that, to achieve good performance, traditional SPM has to use classifiers with nonlinear Mercer kernels, e.g., Chi-square kernel. Accordingly, the nonlinear classifier has to afford additional computational complexity, implying a poor scalability of the SPM approach for real applications.
To improve the scalability, researchers aim at obtaining nonlinear feature representations that work better with linear classifiers. In a method called the ScSPM method, sparse coding (SC) is used instead of VQ to obtain nonlinear codes. In ScSPM, the restrictive cardinality constraint of VQ is relaxed, and a small number of basis from the codebook can be selected to jointly reconstruct the input descriptor. The final representation achieved superior image classification performance using only linear SVM classifiers. Although the ScSPM method saves the computation of calculating Chi-square kernel in non-linear classifier, it, however, migrates the cost from classifier to feature extractor, because the SC process is very computational demanding. This is due to the fact that the objective function in SC is not differentiable at 0. Most existing SC solvers, such as Matching Pursuit (MP) or Orthogonal MP, CoordinateDescent, LARS, among others, operate iteratively.
In one aspect, systems and methods are disclosed for classifying an input image by detecting one or more feature points on the input image; extracting one or more descriptors from each feature point; applying a codebook to quantize each descriptor and generate code from each descriptor; applying spatial pyramid matching to generate histograms; and concatenating histograms from all sub-regions to generate a final representation of the image for classification.
Implementations of the system may include one or more of the following. The final representation of the image for classification can be a feature vector. The descriptor can be a SIFT descriptor or a color moment descriptor. Each code has only one non-zero element if hard vector quantization (VQ) is used. A small group of elements can be non-zero for soft VQ. Multiple codes from inside each sub-region can be pooled together by averaging and normalizing into a histogram. A fast approximated LLC can be applied first performing a K-nearest-neighbor search and then solving a constrained least square fitting problem. The LLC utilizes locality constraints to project each descriptor into a local-coordinate system, and the projected coordinates are integrated by max pooling to generate a final representation. The system can reconstruct input xi with codebook Bi
The method includes finding K-Nearest Neighbors of xi, denoted as Bi; reconstructing xi using Bi as c*=argmin∥xi−ciTBi∥2; and generating ci as an M×1 vector with K non-zero elements whose values are the corresponding c*.
Advantages of the preferred embodiments may include one or more of the following. The LLC is a fast implementation that utilizes the locality constraint to project each descriptor into its local-coordinate system. The LLC coding scheme replaces the VQ coding in traditional SPM and utilizes the locality constraints to project each descriptor into its local-coordinate system, and the projected coordinates are integrated by max pooling to generate the final representation. With linear classifier, the proposed approach performs remarkably better than the traditional nonlinear SPM, achieving state-of-the-art performance on several benchmarks.
Experimental results show that, the final representation generated by using LLC code can achieve an impressive image classification accuracy even with a linear SVM classifier. In addition, the optimization problem used by LLC has an analytical solution, where the computational complexity is low for each descriptor.
In another embodiment, an approximated LLC method performs a K-nearest-neighbor (K-NN) search and then solves a constrained least square fitting problem. In tests using a codebook with 2048 entries, a 300×300 image requires only 0.24 second on average for processing (including dense local descriptors extraction, LLC coding and SPM pooling to get the final representation). This efficiency significantly adds to the practical values of LLC for many real applications.
With linear classifier, the system performs remarkably better than the traditional nonlinear SPM, achieving state-of-the-art performance on several benchmarks. Compared with the sparse coding strategy, the objective function used by LLC has an analytical solution. A fast approximated LLC method by first performing a K-nearest-neighbor search and then solving a constrained least square fitting problem, bearing low computational complexity. Hence even with very large codebooks, the system can still process multiple frames per second. This efficiency significantly adds to the practical values of LLC for real applications.
In the embodiment of
In the coding operation of
where diεRM is the locality adaptor that gives different freedom for each basis vector proportional to its similarity to the input descriptor xi. Specifically,
di=exp−1(−dist(xi,B)/σ)
where dist(xi,B)=[dist(xi,b1), . . . , dist(xi,bM)], and dist(xi,bj) is the Euclidean distance between xi and bj. Typically the system subtracts max(dist(xi,B)) from dist(xi,B) such that di ranges between [0,1).
Alternatively, an approximated LLC coding process 300 can be done. The approximated LLC method performs a K-nearest-neighbor (K-NN) search and then solves a constrained least square fitting problem. As observed from experiments, using a codebook with 2048 entries, extracting dense local descriptors, converting to LLC codes and finally SPM pooling to get the final representation from 300×300 image input requires only 0.24 second in average. This significantly adds to the practical values of LLC for many applications.
The codes are pooled and spatial pyramid matching (SPM) layer 40 can be applied. After suitable concatenation, a feature vector 50 can be generated.
With linear classifier, the system performs remarkably better than the traditional nonlinear SPM, achieving state-of-the-art performance on several benchmarks. Compared with the sparse coding strategy, the objective function used by LLC has an analytical solution. A fast approximated LLC method by first performing a K-nearest-neighbor search and then solving a constrained least square fitting problem, bearing low computational complexity. Hence even with very large codebooks, the system can still process multiple frames per second. This efficiency significantly adds to the practical values of LLC for real applications.
Next, more details on locality-constrained linear coding are discussed. In the following, X is a set of D-dimensional local descriptors extracted from an image, X=[x1, x2, . . . , xN]εRD×N. Given a codebook with M entries, B=[b1, b2, . . . , bM]εRD×M, different coding schemes convert each descriptor into a M-dimensional code to generate the final image representation.
Traditional SPM uses VQ coding which solves the following constrained least square fitting problem:
where C=[c1, c2, . . . , cN] is the set of codes for X. The cardinality constraint PciPl
To ameliorate the quantization loss of VQ, the restrictive cardinality constraint PciPl
The sparsity regularization term plays several important roles: First, the codebook B is usually over-complete, M>D, and hence l1 regularization is necessary to ensure that the under-determined system has a unique solution; Second, the sparsity prior allows the learned representation to capture salient patterns of local descriptors; Third, the sparse coding can achieve much less quantization error than VQ. Accordingly, even with linear SVM classifier, ScSPM can outperform the nonlinear SPM approach by a large margin on benchmarks like Caltech-101.
In Locality-constrained Linear Coding (LLC), as suggested by LCC, locality is more essential than sparsity, as locality must lead to sparsity but not necessary vice versa. LLC incorporates locality constraint instead of the sparsity constraint in Eq. (2), which leads to several favorable properties as explained in Subsection 2.4. Specifically, the LLC code uses the following criteria:
where e denotes the element-wise multiplication, and diεRM is the locality adaptor that gives different freedom for each basis vector proportional to its similarity to the input descriptor xi. Specifically,
where dist(xi,B)=[dist(xi,b1), . . . , dist(xi,bM)]T, and dist(xi,bj) is the Euclidean distance between xi and bj. σ is used for adjusting the weight decay speed for the locality adaptor. Usually we further normalize di to be between (0,1] by subtracting max(dist(xi,B)) from dist(xi,B). The constraint 1Tci=1 follows the shift-invariant requirements of the LLC code. Note that the LLC code in Eqn. 3 is not sparse in the sense of l0 norm, but is sparse in the sense that the solution only has few significant values. In practice, we simply threshold those small coefficients to be zero.
To achieve good classification performance, the coding scheme should generate similar codes for similar descriptors. Following this requirement, the locality regularization term ∥di e ci∥2 in Eq. (3) presents several attractive properties:
1. Better reconstruction. In VQ, each descriptor is represented by a single basis in the codebook, as illustrated in FIG. 1.a. Due to the large quantization errors, the VQ code for similar descriptors might be very different. Besides, the VQ process ignores the relationships between different bases. Hence non-linear kernel projection is required to make up such information loss. On the other side, as shown in FIG. 1.c in LLC, each descriptor is more accurately represented by multiple bases, and LLC code captures the correlations between similar descriptors by sharing bases.
2. Local smooth sparsity. Similar to LLC, SC also achieves less reconstruction error by using multiple bases. Nevertheless, the regularization term of l1 norm in SC is not smooth. As shown in FIG. 1.b, due to the over-completeness of the codebook, the SC process might select quite different bases for similar patches to favor sparsity, thus losing correlations between codes. On the other side, the explicit locality adaptor in LLC ensures that similar patches will have similar codes.
3. Analytical solution. Solving SC usually requires computationally demanding optimization procedures. For instance, the Feature Sign algorithm utilized by Yang [22] has a computation complexity of O(M×K) in the optimal case [16], where K denotes the number of non-zero elements. Unlike SC, the solution of LLC can be derived analytically by:
{tilde over (c)}i=(Ci+λdiag(d))\1 (5)
ci={tilde over (c)}i/1T{tilde over (c)}i, (6)
where Ci=(B−1xiT)(B−1xiT)T denotes the data covariance matrix. As seen in Section 3, the LLC can be performed very fast in practice.
Next, an approximated LLC for Fast Encoding is discussed. The LLC solution only has a few significant values, or equivalently, solving Eq. (3) actually performs feature selection: it selects the local bases for each descriptor to form a local coordinate system. This suggests that we can develop an even faster approximation of LLC to speedup the encoding process. Instead of solving Eq. (3), K(K<D<M) nearest neighbors of xi can be used as the local bases Bi, and a much smaller linear system is solved to get the codes:
This reduces the computation complexity from O(M2) to O(M+K2), where K=M. The final implementation of such approximated LLC process is illustrated in
As K is usually very small, solving Eq. (7) is very fast. For searching K-nearest neighbors, an efficient hierarchical K-NN search strategy can be used, where each descriptor is first quantized into one of L subspaces, and then in each subspace an RM×D codebook was applied. The effective size of the codebook becomes L×M. In this way, a much larger codebook can be used to improve the modeling capacity, while the computation in LLC remains almost the same as that in using a single RM×D codebook.
Next, codebook optimization is discuseed. One way to generate the codebook is to use clustering based method such as K-Means. In another embodiment, the LLC coding criteria is used to train the codebook, which further improves the performance. Next, an effective on-line learning method for this purpose is discussed.
Revisiting Eq. (3), the process factorizes each training descriptor into the product of an LLC code and a codebook. Hence an optimal codebook B* can be obtained by
Eq. (8) can be solved using Coordinate Descent method to iteratively optimizing C(B) based on existing B(C). However, in practice, the number of training descriptors N is usually large (2,000,000+ in our experiment), such that holding all the LLC codes together in each iteration is too memory consuming. The on-line method reads a small batch of descriptors x at a time and incrementally updates the codebook B.
One embodiment uses a codebook trained by K-Means clustering to initialize B. Then the system loops through all training descriptors to update B incrementally. Each iteration takes in a single examples xi (or a small batch of them), and solves Eq. (3) to obtain the corresponding LLC codes using current B. Then, this is used as a feature selector. The system only keeps the set of basis Bi whose corresponding weights are larger than a predefined constant, and refits xi without the locality constraint. The obtained code is then used to update the basis in a gradient descent fashion. Finally, those basis outside the unit circle are projected onto the unit circle. Pseudo code for the incremental codebook optimization process is:
The foregoing system presents an efficient image representation method called Locality-constrained Linear Coding (LLC). LLC is easy to compute and gives superior image classification performance than many existing approaches. LLC applies locality constraint to select similar basis of local image descriptors from a codebook, and learns a linear combination weight of these basis to reconstruct each descriptor. An approximation method can be used to further speed-up the LLC computation, and an optimization method can be used to incrementally learn the LLC codebook using large-scale training descriptors. Experimental results based on several well-known dataset validate the good performance of LLC.
The present inventors contemplate that additional codebook training methods, such as supervised training, can be used. Additionally, besides exact-nearest-neighbor search applied in the paper, approximated-nearest-neighbor search algorithms can be used to further improve the computational efficiency of approximated LLC. Moreover, integration of the LLC technique into practical image/video search/retrieval/indexing/management applications can improve the performance of those systems.
The invention may be implemented in hardware, firmware or software, or a combination of the three. Preferably the invention is implemented in a computer program executed on a programmable computer having a processor, a data storage system, volatile and non-volatile memory and/or storage elements, at least one input device and at least one output device.
By way of example, a computer to support the 3D CNN is discussed next in
Each computer program is tangibly stored in a machine-readable storage media or device (e.g., program memory or magnetic disk) readable by a general or special purpose programmable computer, for configuring and controlling operation of a computer when the storage media or device is read by the computer to perform the procedures described herein. The inventive system may also be considered to be embodied in a computer-readable storage medium, configured with a computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner to perform the functions described herein.
The invention has been described herein in considerable detail in order to comply with the patent Statutes and to provide those skilled in the art with the information needed to apply the novel principles and to construct and use such specialized components as are required. However, it is to be understood that the invention can be carried out by specifically different equipment and devices, and that various modifications, both as to the equipment details and operating procedures, can be accomplished without departing from the scope of the invention itself.
This application claims priority to U.S. Provisional Application Ser. No. 61/262,269 filed Nov. 18, 2009, the content of which is incorporated by reference.
Number | Name | Date | Kind |
---|---|---|---|
6404923 | Chaddha | Jun 2002 | B1 |
8055081 | Luo et al. | Nov 2011 | B2 |
8116596 | McIntyre et al. | Feb 2012 | B2 |
20100054535 | Brown et al. | Mar 2010 | A1 |
20100124377 | Yu et al. | May 2010 | A1 |
Number | Date | Country | |
---|---|---|---|
20110116711 A1 | May 2011 | US |
Number | Date | Country | |
---|---|---|---|
61262269 | Nov 2009 | US |