Ramazan Gokberk Cinbis

Jakob Verbeek

Fellow, IEEE Cordelia Schmid

Lear

Approximate Fisher Kernels of non-iid Image Models for Image Categorization

Keywords: Statistical image representations, object recognition, image classification, Fisher kernels

The bag-of-words (BoW) model treats images as sets of local descriptors and represents them by visual word histograms. The Fisher vector (FV) representation extends BoW, by considering the first and second order statistics of local descriptors. In both representations local descriptors are assumed to be identically and independently distributed (iid), which is a poor assumption from a modeling perspective. It has been experimentally observed that the performance of BoW and FV representations can be improved by employing discounting transformations such as power normalization. In this paper, we introduce non-iid models by treating the model parameters as latent variables which are integrated out, rendering all local regions dependent. Using the Fisher kernel principle we encode an image by the gradient of the data log-likelihood w.r.t. the model hyper-parameters. Our models naturally generate discounting effects in the representations; suggesting that such transformations have proven successful because they closely correspond to the representations obtained for non-iid models. To enable tractable computation, we rely on variational free-energy bounds to learn the hyper-parameters and to compute approximate Fisher kernels. Our experimental evaluation results validate that our models lead to performance improvements comparable to using power normalization, as employed in state-of-the-art feature aggregation methods.

INTRODUCTION

P ATCH-based image representations, such bag of visual words (BoW) [START_REF] Csurka | Visual categorization with bags of keypoints[END_REF], [START_REF] Sivic | Video Google: a text retrieval approach to object matching in videos[END_REF], are widely utilized in image categorization and retrieval systems. BoW descriptor represents an image as a histogram over visual word counts. The histograms are constructed by mapping local feature vectors in images to cluster indices, where the clustering is typically learned using k-means. Perronnin and Dance [START_REF] Perronnin | Fisher kernels on visual vocabularies for image categorization[END_REF] have enhanced this basic representation using the notion of Fisher kernels [START_REF] Jaakkola | Exploiting generative models in discriminative classifiers[END_REF]. In this case local descriptors are soft-assigned to components of a mixture of Gaussian (MoG) density, and the image is represented using the gradient of the log-likelihood of the local descriptors w.r.t. the MoG parameters. As we show below, both BoW as well as MoG Fisher vector representations are based on models that assume that local descriptors are independently and identically distributed (iid). However, the iid assumption is a very poor one from a modeling perspective, see the illustration in Figure 1.

In this work, we consider models that capture the dependencies among local image regions by means of non-iid but completely exchangeable models, i.e. like iid models our models still treat the image as an unordered set of regions. We treat the parameters of the BoW models as latent variables with prior distributions learned from data. By integrating out the latent variables, all image regions become mutually dependent. We generate image representations from these models by applying the Fisher kernel principle, in this case by taking the gradient of the log-likelihood of the data in Fig. 1. Local image appearance is not iid: the visible regions are informative on the masked-out ones; one has the impression to have seen the complete image by looking at half of the pixels.

an image w.r.t. the hyper-parameters that control the priors on the latent model parameters.

However, in some cases, the gradient of the log-likelihood of the data can be intractable to compute. To compute a gradientbased representation in such cases, we replace the intractable loglikelihood with a tractable variational bound. We then compute gradients with respect to this bound instead of the likelihood. Following [START_REF] Chandalia | Using Fisher kernels from topic models for dimensionality reduction[END_REF], which is the first and one of the very few studies utilizing this approximation method, we refer to the resulting kernel as the variational Fisher kernel. We show that the variational Fisher kernel is equivalent to the actual Fisher kernel when the variational bound is tight. Therefore, the variational Fisher kernel provides not only a technique for approximating intractable Fisher kernels, but also an alternative formulation for computing exact Fisher kernels. We demonstrate through examples that the variational formulation can be mathematically more convenient for deriving Fisher vectors representations.

In this work, we analyze three non-iid image models. Our first model is the multivariate Pólya model which represents the set of visual word indices of an image as independent draws from an unobserved multinomial distribution, itself drawn from a Dirichlet prior distribution. By integrating out the latent multinomial distribution, a model is obtained in which all visual word indices are mutually dependent. Interestingly, we find that our non-iid models yield gradients that are qualitatively similar to popular transformations of BoW image representations, such as square-rooting histogram entries or more generally applying power normalization [START_REF] Jégou | Aggregating local image descriptors into compact codes[END_REF], [START_REF] Perronnin | Large-scale image categorization with explicit data embedding[END_REF], [START_REF] Perronnin | Improving the Fisher kernel for large-scale image classification[END_REF], [START_REF] Vedaldi | Efficient additive kernels via explicit feature maps[END_REF]. Therefore, our first contribution is to show that such transformations appear naturally if we remove the unrealistic iid assumption, i.e., to provide an explanation why such transformations are beneficial.

Our second contribution is the analysis of Fisher vector representations over the latent Dirichlet allocation (LDA) model [START_REF] Blei | Latent Dirichlet allocation[END_REF] for image classification purposes. The LDA model can capture the co-occurrence statistics missing in BoW representations. In this case the computation of the gradients is intractable, therefore, we compute approximate variational Fisher vectors [START_REF] Chandalia | Using Fisher kernels from topic models for dimensionality reduction[END_REF]. We compare performance to Fisher vectors of PLSA [START_REF] Hofmann | Unsupervised learning by probabilistic latent semantic analysis[END_REF], a topic model that does not treat the model parameters as latent variables. We find that topic models improve over BoW models, and that the LDA improves over PLSA even when square-rooting is applied.

Our third contribution is our most advanced model, which assumes that the local descriptors are iid samples from a latent MoG distribution, and we integrate out the mixing weights, means and variances of the MoG distribution. Since the computation of the gradients is intractable, we also use the variational Fisher kernel framework for this model. This leads to a representation that performs on par with the improved Fisher vector (FV) representation of [START_REF] Perronnin | Improving the Fisher kernel for large-scale image classification[END_REF] based on iid MoG models, which includes power normalization.

In our experimental analysis, we present a detailed experimental evaluation of the proposed the non-iid image models over local SIFT descriptors. In addition, we demonstrate that the latent MoG image model can effectively be combined with Convolutional Neural Network (CNN) based features. We consider two approaches for this purpose. First, following recent work [START_REF] Gong | Multi-scale Orderless Pooling of Deep Convolutional Activation Features[END_REF], [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF], we compute Fisher vectors over densely sampled image patches that are encoded using CNN features. Second, we propose to extract Fisher vectors over image regions sampled by a selective search method [START_REF] Uijlings | Selective search for object recognition[END_REF]. The experimental results on the PASCAL VOC 2007 [START_REF] Everingham | The Pascal Visual Object Classes Challenge[END_REF] and MIT Indoor Scenes [START_REF] Quattoni | Recognizing indoor scenes[END_REF] datasets confirm the effectiveness of the proposed latent MoG image model, and the corresponding non-iid image descriptors. This paper extends our earlier paper [START_REF] Cinbis | Image categorization using Fisher kernels of non-iid image models[END_REF]. We present more complete and detailed discussions of related work and the variational Fisher kernel framework. We give a proof that Fisher kernels given by the traditional form and the variational framework are equivalent when the variational bound is tight. We extend the experimental evaluation of the proposed non-iid MoG models by evaluating them over CNN-based local descriptors. We also show that the classification results can be further improved by computing the CNN features over selective search windows, compared to using densely sampled image regions. We perform additional experimental evaluation on the MIT Indoor dataset [START_REF] Quattoni | Recognizing indoor scenes[END_REF]. Finally, we present a new empirical study on the relationship between the model likelihood and image categorization performance.

RELATED WORK

The use of non-linear feature transformations in BoW image representations is widely recognized to be beneficial for image categorization [START_REF] Jégou | Aggregating local image descriptors into compact codes[END_REF], [START_REF] Perronnin | Large-scale image categorization with explicit data embedding[END_REF], [START_REF] Perronnin | Improving the Fisher kernel for large-scale image classification[END_REF], [START_REF] Vedaldi | Efficient additive kernels via explicit feature maps[END_REF], [START_REF] Zhang | Local features and kernels for classification of texture and object categories: a comprehensive study[END_REF]. These transformations alleviate an obvious shortcoming of linear classifiers on BoW image representations: the fact that a fixed change ∆ in a BoW histogram, from h to h + ∆, leads to a score increment that is independent of the original histogram h: f

(h + ∆) -f (h) = w (h + ∆) -w h = w ∆.
This means that the effect on the score for a change ∆ is not dependent on the context h in which it appears. Therefore, the score increment from images (a) though (d) in Figure 2 will be comparable, which is undesirable: the classifier score for cow should sharply increase from (a) to (b), and then remain stable among (b), (c), and (d).

Popular remedies to this problem include the use of chi-square kernels [START_REF] Zhang | Local features and kernels for classification of texture and object categories: a comprehensive study[END_REF], or taking the square-root of histogram entries [START_REF] Perronnin | Large-scale image categorization with explicit data embedding[END_REF], also referred to as the Hellinger kernel [START_REF] Vedaldi | Efficient additive kernels via explicit feature maps[END_REF]. Power normalization [START_REF] Perronnin | Large-scale image categorization with explicit data embedding[END_REF], defined as f (x) = sign(x)|x| ρ , is a similar transformation that can be applied to non-histogram feature vectors, and it is equivalent to signed square-rooting for the coefficient ρ = 1/2. The effect of all of these is similar: they transform the features such that the first few occurrences of visual words will have a more pronounced effect on the classifier score than if the count is increased by the same amount but starting at a larger value. This is desirable, since now the first patches providing evidence for an object category can significantly impact the score, and hence making it for example easier to detect small object instances. The qualitative similarity is illustrated in Figure 3, where we compare the 2 , chi-square, and Hellinger distances on the range [0, 1].

The motivation for these transformations tends to vary in the literature. Sometimes it is based on empirical observations of improved performance [START_REF] Perronnin | Large-scale image categorization with explicit data embedding[END_REF], [START_REF] Vedaldi | Efficient additive kernels via explicit feature maps[END_REF], by reducing sparsity in Fisher vectors [START_REF] Perronnin | Improving the Fisher kernel for large-scale image classification[END_REF], or in terms of variance stabilizing transformations [START_REF] Jégou | Aggregating local image descriptors into compact codes[END_REF], [START_REF] Winn | Object categorization by learned universal visual dictionary[END_REF]. Recently, Kobayashi [START_REF] Kobayashi | Dirichlet-based histogram feature transform for image classification[END_REF] showed that a similar discounting transformation based on taking logarithm of histogram entries, can be derived via modeling 1 -normalized descriptors by Dirichlet distribution. Rana et al . [START_REF] Rana | Feature learning for the image retrieval task[END_REF] propose to discriminatively learn power normalization coefficients for image retrieval using a triplet- based objective function, which aims to obtain smaller distances across matching image pairs than non-matching ones. In contrast to these studies, we show that such discounting transformations appear naturally in generative image models that avoid making the unrealistic iid assumption that underlies the standard BoW and MoG-FV image representations. Similar transformations are also used in image retrieval to counter burstiness effects [START_REF] Jégou | On the burstiness of visual elements[END_REF], i.e., if rare visual words occur in an image, they tend to do so in bursts due to the locally repetitive nature of natural images. Burstiness also occurs in text, and the Dirichlet compound multinomial distribution, also known as multivariate Pólya distribution, has been used to model this effect [START_REF] Madsen | Modeling word burstiness using the Dirichlet distribution[END_REF]. This model places a Dirichlet prior on a latent perdocument multinomial, and words in a document are sampled independently from it. Elkan [START_REF] Elkan | Deriving TF-IDF as a Fisher kernel[END_REF] shows the relationship between the Fisher kernel of the multivariate Pólya distribution and the tf-idf document representation. In Section 4, we investigate the Fisher kernel based on multivariate Pólya distribution as our most basic non-iid image representation.

Our use of latent Dirichlet allocation (LDA) [START_REF] Blei | Latent Dirichlet allocation[END_REF] differs from earlier work on using topic models such as LDA or PLSA [START_REF] Hofmann | Unsupervised learning by probabilistic latent semantic analysis[END_REF] for object recognition [START_REF] Larlus | Latent mixture vocabularies for object categorization and segmentation[END_REF], [START_REF] Quelhas | Modeling scenes with local descriptors and latent aspects[END_REF]. The latter use topic models to compress BoW image representations by using the inferred document-specific topic distribution. Similarly, Chandalia and Beal [START_REF] Chandalia | Using Fisher kernels from topic models for dimensionality reduction[END_REF] propose to compress BoW document representation by computing LDA Fisher vector with respect to the parameters of the Dirichlet prior on the topic distributions. We, instead, use the Fisher kernel framework to expand the image representation by decomposing the original BoW histogram into several bags-ofwords, one per topic, so that individual histogram entries not only encode how often a word appears, but also in combination with which other words it appears. Whereas compressed topic model representations were mostly found to at best maintain BoW performance, we find significant gains by using topic models. Finally, in contrast to the PLSA Fisher kernel, which was previously studied as a document similarity measure [START_REF] Chappelier | PLSI: The true Fisher kernel and beyond[END_REF], [START_REF] Hofmann | Learning the similarity of documents: An informationgeometric approach to document retrieval and categorization[END_REF], we show that the LDA Fisher kernel naturally involves discounting transformations.

Several other generative models have been proposed to capture spatial regularities across image regions. For example, the Spatial LDA model [START_REF] Wang | Spatial latent dirichlet allocation[END_REF] extends the LDA model such that spatially neighboring visual words are more likely assigned to the same topic. The counting grid model [START_REF] Perina | Capturing spatial interdependence in image features: the counting grid, an epitomic representation for bags of features[END_REF], which is a grid of multinomial distributions, can be considered as an alternative to the spatial topic models. In this approach, the visual words of an image are treated as samples from a latent local neighborhood of the counting grid. Therefore, each local neighborhood of the model can be interpreted as a spatial grid of topics. While these studies show that incorporation of spatial information can improve unsupervised semantic segmentation results [START_REF] Wang | Spatial latent dirichlet allocation[END_REF], or lead to better generative classifiers compared to LDA [START_REF] Perina | Capturing spatial interdependence in image features: the counting grid, an epitomic representation for bags of features[END_REF], we limit our focus to Fisher kernels of orderless, i.e. exchangeable, generative models in our study.

The computation of the LDA Fisher vector image representation is technically more involved compared to the PLSA model. In the case of the LDA model, the latent model parameters cannot be integrated out analytically, and the computation of the gradients is no longer tractable. Similarly, the Fisher kernel for our Latent MoG image model is intractable since the latent variables (mixing weights, means, and variances) cannot be integrated out analytically. We overcome this difficulty by relying on the variational free-energy bound [START_REF] Jordan | An introduction to variational methods for graphical models[END_REF], which is obtained by subtracting the Kullback-Leibler divergence between an approximate posterior on the latent variables and the true posterior. By imposing a certain independence structure on the approximate posterior, tractable approximate inference techniques can be devised. We then compute the gradient of the variational bound as a surrogate for the intractable gradients of the exact log-likelihood. The method of approximating Fisher kernels with the gradient vector of a variational bound was first proposed by Chandalia and Beal [START_REF] Chandalia | Using Fisher kernels from topic models for dimensionality reduction[END_REF] in order to obtain the LDA Fisher kernel. The only other work incorporating this technique, to the best of our knowledge, is the recent work of Perina et al . [START_REF] Perina | Expression microarray data classification using counting grids and Fisher kernel[END_REF], which proposes a variational Fisher kernel for micro-array data. We show that variational Fisher kernel is equivalent to the exact Fisher vector when the variational bound is tight, and demonstrate that in some cases it can be a mathematically more convenient formulation, compared to the original Fisher kernel definition. Finally, we note that the variational approximation method for Fisher kernels differs from Perina et al . [START_REF] Perina | Free energy score space[END_REF], which uses the variational free-energy to define an alternative encoding, replacing the Fisher kernel.

In the following section we review the Fisher kernel framework, and the variational approximation method. In Section 4 we present our non-iid latent variable models and propose novel Fisher vector representations based on them. We present experimental results in Section 5, and summarize our conclusions in Section 6.

FISHER VECTORS AND VARIATIONAL APPROXI-

MATION

In this section we present an overview of the Fisher kernel framework, variational inference, and the variational Fisher kernel.

Fisher vectors

Images can be considered as samples from a generative process, and therefore class-conditional generative models can be used for image categorization. However, it is widely observed that discriminative classifiers typically outperform classification based on generative models, see e.g. [START_REF] Halevy | The unreasonable effectiveness of data[END_REF]. A simple explanation is that discriminative classifiers aim to maximize the end goal, which is to categorize entities based on their content. In contrast, generative classifiers instead require modeling class-conditional data distributions, which is arguably a more difficult task than only learning decision surfaces, and therefore result in inferior categorization performance.

The Fisher kernel framework proposed by Jaakkola and Haussler [START_REF] Jaakkola | Exploiting generative models in discriminative classifiers[END_REF] allows combining the power of generative models and discriminative classifiers. In particular, Fisher kernel provides a framework for deriving a kernel from a probabilistic model. Suppose that p(x) is a generative model with parameters θ. 1 Then, the Fisher kernel K(x, x ) is defined as

K(x, x ) = g(x) T I -1 g(x ) , (1)
where the gradient g(x) = ∇ θ log p(x) is called the Fisher score, and I is the Fisher information matrix:

I = IE x∼p(x) g(x)g(x) T . (2)
which is equivalent to the covariance of the Fisher score as computed using p(x), since IE x∼p(x) [g(x)] = 0. The inner product space (i.e. explicit feature mapping) induced by a Fisher kernel is given by φ

(x) = I -1 2 g(x), (3)
where I -1 2 is the whitening transform using the Fisher information matrix. Sánchez et al . [START_REF] Sánchez | Image classification with the Fisher vector: Theory and practice[END_REF] refer to the normalized gradient given by φ(x) as the Fisher vector. In practice the term "Fisher vector" is sometimes also used to refer to the non-normalized gradients (i.e. Fisher score) as well.

The essential idea in Fisher kernel is to use gradients g(x) of the data log-likelihood to extract features w.r.t. a generative model. The Fisher information matrix, on the other hand, is of lesser importance. A theoretical motivation for using I is that I -1 g(x) gives the steepest descent direction along the manifold of the parameter space, which is also known as the natural gradient. Another motivation is that I makes the Fisher kernel invariant to the re-parameterization θ → ψ(θ) for any differentiable and invertible function ψ [START_REF] Bishop | Pattern recognition and machine learning[END_REF], which can be easily shown using the chain rule and the Jakobian matrix of the inverse function ψ -1 .

However, the computation of the Fisher information matrix I is intractable for many models. Although in principle it can be approximated empirically as I≈ 1 |X| x∈X g(x)g(x) T , the approximation itself can be costly if g(x) is high dimensional. In such cases, empirical approximation can be used only for the diagonal terms. Alternatively, I can be dropped altogether [START_REF] Jaakkola | Exploiting generative models in discriminative classifiers[END_REF] or analytical approximations can be derived, see e.g. [START_REF] Perronnin | Fisher kernels on visual vocabularies for image categorization[END_REF], [START_REF] Sánchez | Image classification with the Fisher vector: Theory and practice[END_REF], [START_REF] Sánchez | Exponential family Fisher vector for image classification[END_REF].

Variational approximate inference

Variational methods are a family of mathematical tools that can be used to approximate intractable computations, particularly those involving difficult integrals. Originally developed in statistical physics based on the calculus of variations and the mean field theory, the variational approximation framework that we utilize in this paper is known as the variational inference, and it is now among the most successful approximate probabilistic inference techniques [START_REF] Bishop | Pattern recognition and machine learning[END_REF], [START_REF] Jordan | An introduction to variational methods for graphical models[END_REF], [START_REF] Mackay | Information theory, inference, and learning algorithms[END_REF].

In the context of probabilistic models, the central idea in variational methods is to devise a bound on the log-likelihood function in terms of an approximate posterior distribution over the latent variables. Let X denote the set of observed variables, and Λ denote the set of latent variables and latent parameters. Suppose that q(Λ) is an approximate distribution over the latent variables. Then, the distribution p(X) can be decomposed as follows for any choice of the approximate posterior q: ln p(X) = F (p, q) + D q||p .

(4)

1. We drop the model parameters θ from function arguments for brevity.

In this equation, F is the variational free-energy given by

F (p, q) = q(Λ) ln p(X, Λ) q(Λ) dΛ (5) = IE q(Λ) [ln p(X, Λ)] + H(q), (6)
where H(q) is the entropy of the distribution q. The term D (q||p) in Eq. ( 4) is the Kullback-Leibler (KL) divergence between the distributions q(Λ) and p(Λ|X):

D q||p = -q(Λ) ln p(Λ|X) q(Λ) dΛ. (7)
Since the KL-divergence term D (q||p) is strictly nonnegative, the variational free energy F (p, q) is a lower-bound on the true log-likelihood ln p(X), i.e. F (p, q) ≤ ln p(X). When the KL-divergence term is zero, i.e. the distribution q is equivalent to the true posterior distribution, the bound F is tight.

In order to effectively utilize the decomposition in Eq. ( 6) for a given distribution p, we need to choose the distribution q such that it leads to a tractable and as tight as possible lowerbound F (p, q). For this purpose, we constrain q to a family of distributions Q that leads to tractable computations, typically by imposing independence assumptions. For example suppose that Λ = (λ 1 , . . . , λ n ), we may choose Q to be the set of distributions that factorize over the λ i , i.e. with q(Λ) = n i=1 q i (λ i ). Given the family Q, we maximize F (p, q) by minimizing the KL divergence in Eq. ( 4) over all q ∈ Q.

Variational Fisher kernel

In this paper, we utilize the variational free-energy bounds for two purposes. The first is to estimate the hyper-parameters of the LDA (Section 4.2) and the Latent MoG (Section 4.3) models from training data using an approximate maximum likelihood procedure. For this purpose, we iteratively update the variational lowerbound with respect to the variational distribution parameters, and the model hyper-parameters; an approach that is known as the variational expectation-maximization procedure [START_REF] Jordan | An introduction to variational methods for graphical models[END_REF].

Our second main use of the variational free-energy is to compute approximate Fisher vectors where the original Fisher vector is intractable to compute. In particular, we approximate the Fisher vector by the gradient of the variational lower-bound given by Eq. ( 6), i.e. g(x) ≈ ∇ θ F (p, q), which we refer to as variational Fisher vector. Since, the entropy H(q) is constant w.r.t. model parameters, the variational Fisher vector θ q can equivalently be written as

φ q (X) = I -1 2 ∇ θ IE q [ln p(X, Λ)] . ( 8
)
where I is the (approximate) Fisher information matrix.

We have already discussed that the variational bound in Eq. ( 6) is tight when the distribution q matches the posterior on the hyperparameters. We will now show that its gradient equals that of the data log-likelihood if the bound is tight. In order to prove this, we first write the partial derivative of the lower-bound with respect to some model (hyper-)parameter θ:

∂F ∂θ = ∂IE q [ln p(X, Λ)] ∂θ . (9)
By definition, we can interchange the differential operator and the expectation:

∂F ∂θ = IE q ∂ ln p(X, Λ) ∂θ . ( 10
)
Without loss of generality, we assume that all latent variables are continuous, in which case the expectation is equivalent to

∂F ∂θ = q(Λ) ∂ ln p(X, Λ) ∂θ dΛ. (11)
By following differentiation rules, we obtain the equation:

∂F ∂θ = q(Λ) 1 p(Λ|X)p(X) ∂p(X, Λ) ∂θ dΛ. (12)
Since the bound is assumed to be tight, the q(Λ) and p(Λ|X) are identical. In addition, we observe that p(X) is a constant with respect to the integration variables. Therefore, we can simplify the equation as follows:

∂F ∂θ = 1 p(X) ∂p(X, Λ) ∂θ dΛ, (13)
which can be re-written as follows:

∂F ∂θ = 1 p(X) ∂ p(X, Λ)dΛ ∂θ . (14)
Finally, we integrate out Λ and simplify the equation into the following form:

∂F ∂θ = ∂ ln p(X) ∂θ , (15)
which completes the proof.

In addition to presenting a relationship between the original Fisher vector and the variational Fisher vector definitions, the proof shows that the latter formulation can be used as an alternative framework. In fact, we observe that the variational formulation can in some cases be mathematically more convenient to derive Fisher vector representations. Even though our main interest in this paper is to compute approximate representations based on the LDA and latent MoG image models presented in the next section, we present two additional examples in Appendix A that demonstrate the usefulness of the variational formulation.

NON-IID IMAGE REPRESENTATIONS

In this section we present our non-iid models for local image descriptors. We start with a model for BoW quantization indices, and extend the model to capture co-occurrence statistics across visual words using LDA in Section 4.2. Finally, we consider a non-iid extension of mixture of Gaussian models over sets of local descriptors in Section 4.3.

Bag-of-words and the multivariate P ólya model

The standard BoW image representation can be interpreted as applying the Fisher kernel framework to a simple iid multinomial model over visual word indices, as shown in [START_REF] Krapac | Modeling spatial layout with Fisher vectors for image categorization[END_REF]. Let w 1:N = {w 1 , . . . , w N } denote the visual word indices corresponding to N patches sampled in an image, and let π be a learned multinomial over K visual words, parameterized in log-space, i.e. p(

w i = k) = π k with π k = exp(γ k )/ k exp(γ k ).
The data likelihood for the BoW model is given by

p(w 1:N ) = N i=1 p(w i = k). ( 16
)
The gradient of the data log-likelihood is in this case given by where n k denotes the number of occurrences of visual word k among the set of indices w 1:N . This is a shifted version of the standard BoW histogram, where the mean of all image representations is centered at the origin. We stress that this multinomial interpretation of the BoW model assumes that the visual word indices across all images are iid, which directly generates the product form in the likelihood of Eq. ( 16), and the count statistic in the gradient of the log-likelihood in Eq. ( 17).

∂ N i=1 ln p(w i ) ∂γ k = n k -N π k , (17)
Our first non-iid model assumes that for each image there is a different, a-priori unknown, multinomial generating the visual word indices in that image. In this model visual word indices within an image are mutually dependent, since knowing some of the w i provides information on the underlying multinomial π, and thus also provides information on which subsequent indices could be sampled from it. The model is parameterized by a nonsymmetric Dirichlet prior over the latent image-specific multinomial, p(π) = D(π|α) with α = (α 1 , . . . , α K ), and the w i are modeled as iid samples from π. The marginal distribution on the w i is obtained by integrating out π:

p(w 1:N ) = p(π) N i=1 p(w i |π)dπ. ( 18
)
This model is known as the multivariate Pólya, or Dirichlet compound multinomial [START_REF] Madsen | Modeling word burstiness using the Dirichlet distribution[END_REF], and the integral simplifies to

p(w 1:N ) = Γ(α) Γ(N + α) K k=1 Γ(n k + α k ) Γ(α k ) , (19)
where Γ(•) is the Gamma function, and α = K k=1 α k . See Figure 4a and Figure 4b for a graphical representation of the BoW multinomial model, and the Pólya model.

Following the Fisher kernel framework, we represent an image by the gradient w.r.t. the hyper-parameter α of the log-likelihood of the visual word indices w 1:N . The partial derivative w.r.t. α k is given by

∂ ln p(w 1:N ) ∂α k = ψ(α k +n k )-ψ(α+N )-ψ(α k )+ψ(α), (20)
where ψ(x) = ∂ ln Γ(x)/∂x is the digamma function.

Only the first two terms in Eq. ( 20) depend on the counts n k , and for fixed N the gradient is determined up to additive constants by ψ(α k + n k ), i.e. it is given by a transformation of the visual word counts n k . Figure 5 shows the transformation ψ(α + n) for various values of α, along with the square-root function used in the Hellinger distance for reference. We see that the same monotoneconcave discounting effect is obtained as by taking the squareroot of histogram entries. This transformation arises naturally in our latent variable model, and suggests that such transformations are successful because they correspond to a more realistic non-iid model, c.f . Figure 1.

Observe that in the limit of α → ∞ the transfer function becomes linear, since for large α the Dirichlet prior tends to a delta peak on the multinomial simplex and thus removes the uncertainty on the underlying multinomial, with an observed multinomial BoW model as its limit. In the limit of α → 0, corresponding to priors that concentrate their mass at sparse multinomials, the transfer function becomes a step function. This is intuitive, since in the limit of ultimately sparse distributions only one word will be observed, and its count no longer matters, we only need to know which word is observed to determine which α k should be increased to improve the log-likelihood.

Capturing co-occurrence with topic models

The Pólya model is non-iid but it does not model co-occurrence across visual words, this can be seen from the posterior distribution p(w = k|w 1:N ) = p(w = k|π)p(π|w

1:N )dπ ∝ n k + α k .
The model just predicts to see more visual words of the type it has already seen before. In our second model, we extend the Pólya model to capture co-occurrence statistics of visual words using latent Dirichlet allocation (LDA) [START_REF] Blei | Latent Dirichlet allocation[END_REF]. We model the visual words in an image as a mixture of T topics, encoded by a multinomial θ mixing the topics, where each topic itself is represented by a multinomial distribution π t over the K visual words. We associate a variable z i , drawn from θ, with each patch that indicates which topic was used to draw its visual word index w i . We place Dirichlet priors on the topic mixing, p(θ) = D(θ|α), and the topic distributions p(π t ) = D(π t |η t ), and integrate these out to obtain the marginal distribution over visual word indices as:

p(w 1:N ) = p(θ)p(π) N i=1 p(w i |θ, π)dθdπ, (21)
p(w i = k|θ, π) = T t=1 p(z i = t|θ)p(w i = k|π t ). ( 22
) η t α θ z i w i π t i=1,2,...,N
t=1,2,...,T Fig. 6. Graphical representation of LDA. The outer plate refers to images. The index i runs over patches, and index t over topics.

See Figure 6 for a graphical representation of the model. Note that this model is equivalent to the Pólya model discussed above when there is only a single topic, i.e. for T = 1.

Both the log-likelihood and its gradient are intractable to compute for the LDA model. As discussed in Section 3.3, however, we can resort to variational methods to compute a free-energy bound F using an approximate posterior. Here we use a completely factorized approximate posterior as in [START_REF] Blei | Latent Dirichlet allocation[END_REF] of the form q(θ, π 1:T , z 1:N ) = q(θ)

T t=1 q(π t ) N i=1 q(z i ). (23)
The update equations of the variational distributions q(θ) = D(θ|α * ) and q(π t ) = D(π t |η * t ) to maximize the free-energy bound F are given by:

α * t = α t + N i=1 q it , η * tk = η tk + i:wi=k q it , (24)
where q it = q(z i = t), which is itself updated according to

q it ∝ exp[ψ(α * t ) -ψ(α * ) + ψ(η * tk ) -ψ(η * t )
]. These update equations can be applied iteratively to monotonically improve the variational bound.

The gradients of F w.r.t. the hyper-parameters are obtained from these as

∂F ∂α t = ψ(α * t ) -ψ(α * ) -[ψ(α t ) -ψ(α)], (25)
∂F ∂η tk = ψ(η * tk ) -ψ(η * t ) -[ψ(η tk ) -ψ(η t )]. (26)
The gradient w.r.t. α encodes a discounted version of the topic proportions as they are inferred in the image. The gradients w.r.t. the hyper-parameters η t can be interpreted as decomposing the bag-of-word histogram over the T topics, and encoding the soft counts of words assigned to each topic. The entries ∂F ∂η tk in this representation not only code how often a word was observed but also in combination with which other words, since the cooccurrence of words throughout the image will determine the inferred topic mixing and thus the word-to-topic posteriors q it .

In our experiments we compare LDA with the PLSA model [START_REF] Hofmann | Unsupervised learning by probabilistic latent semantic analysis[END_REF]. This model treats the topics π t , and the topic mixing θ as non-latent parameters which are estimated by maximum likelihood. To represent images using PLSA we apply the Fisher kernel framework and compute gradients of the log-likelihood w.r.t. θ and the π t . The PLSA model with a single topic reduces to the iid multinomial model discussed in the previous section.

Modeling descriptors using latent MoG models

In this section we turn to the image representation of Perronnin and Dance [START_REF] Perronnin | Fisher kernels on visual vocabularies for image categorization[END_REF] that applies the Fisher kernel framework to mixture of Gaussian (MoG) models over local descriptors. An improved version of this representation using power normalization was presented in [START_REF] Perronnin | Improving the Fisher kernel for large-scale image classification[END_REF]. 2 The K Gaussian components of the mixture correspond to the K visual words in a BoW model. In [START_REF] Perronnin | Fisher kernels on visual vocabularies for image categorization[END_REF], [START_REF] Perronnin | Improving the Fisher kernel for large-scale image classification[END_REF], local descriptors across images are assumed to be iid samples from a single MoG model underlying all images. They represent an image by the gradient of the log-likelihood of the extracted local descriptors x 1:N w.r.t. the model parameters. Using the softassignments p(k|x) = π k N (x; µ k , σ k )/p(x) of local descriptors to mixture components the partial derivatives are computed as:

A MoG density p(x) = K k=1 π k N (x; µ k , σ k ) is defined by mixing weights π = {π k }, means µ = {µ k } and variances σ = {σ k }.
∂ ln p(x 1:N ) ∂γ k = N i=1 p(k|x i ) -π k , (27)
∂ ln p(x 1:N ) ∂µ k = N i=1 p(k|x i )(x -µ k )/σ k , (28)
∂ ln p(x 1:N ) ∂λ k = N i=1 p(k|x i ) σ k -(x i -µ k ) 2 /2, (29)
where we re-parameterize the mixing weights as

π k = exp(γ k )/ K k =1 exp(γ k )
, and the Gaussians with precisions

λ k = σ -1
k , as in [START_REF] Krapac | Modeling spatial layout with Fisher vectors for image categorization[END_REF]. For local descriptors of dimension D, the gradient yields an image representation of size K(1 + 2D), since for each of the K visual words there is one derivative w.r.t. its mixing weight, and 2D derivatives for the means and variances in the D dimensions. This representation thus stores more information about the local descriptors assigned to a visual word than just their count, as a result higher recognition performance can be obtained using the same number of visual words as compared to the BoW representation.

In analogy to the Pólya model, we remove the iid assumption by defining a MoG model per image and treating its parameters as latent variables. We place conjugate priors on the imagespecific parameters: a Dirichlet prior on the mixing weights, p(π) = D(π|α), and a combined Normal-Gamma prior on the means µ k and precisions

λ k = σ -1 k : p(λ k ) = G(λ k |a k , b k ), (30) p
(µ k |λ k ) = N (µ k |m k , (β k λ k ) -1 ). (31)
The distribution on the descriptors x 1:N in an image is obtained by integrating out the latent MoG parameters:

p(x 1:N ) = p(π)p(µ, λ) N i=1 p(x i |π, µ, λ)dπdµdλ, (32)
p(x i |π, µ, λ) = K k=1 p(w i = k|π)p(x i |w i = k, λ, µ), (33)
where p(w i = k|π) = π k , and p(x

i |w i = k, λ, µ) = N (x i |µ k , λ -1 k )
is the Gaussian corresponding to the k-th visual word. See Figure 7a and Figure 7b for graphical representations of the MoG model and the latent MoG model.

Computing the log-likelihood in this model is also intractable, as is computing the gradient of the log-likelihood which we need for both hyper-parameter learning and to extract the Fisher vector representation. To overcome these problems we replace the intractable log-likelihood with its variational lower bound.

By constraining the variational posterior q in the bound F given by Eq. ( 6) to factorize as q(π, µ, λ, w 1:N ) = q(π, µ, λ)q(w 1:N ) over the latent MoG parameters and the assignments of local descriptors to visual words, we obtain a bound for which we can tractably compute its value and gradient w.r.t. the hyper-parameters. Given this factorization it is easy to show that the optimal q will further factorize as q(π, µ, λ, w 1:N ) = q(π)

K k=1 q(µ k |λ k )q(λ k ) N i=1
q(w i ), [START_REF] Minka | Estimating a Dirichlet distribution[END_REF] and that the variational posteriors on the model parameters will have the form of Dirichlet and Normal-Gamma distributions q

(π) = D(π|α * ), q(λ k ) = G(λ k |a * k , b * k ), q(µ k |λ k ) = N (µ k |m * k , (β * k λ k ) -1
). Given the hyper-parameters we can update the variational distributions to maximize the variational lower bound. In order to write the update equations, it is convenient to define the following sufficient statistics :

s 0 k = N i=1 q ik , s 1 k = N i=1 q ik x i , s 2 k = N i=1 q ik x 2 i . ( 35
)
where q ik = q(w i = k). Then, the parameters of the optimal variational distributions on the MoG parameters for a given image are found as:

α * k = α k + s 0 k , (36)
β * k = β k + s 0 k , ( 37
) m * k = (s 1 k + β k m k )/β * k , ( 38
) a * k = a k + s 0 k /2, ( 39
) b * k = b k + 1 2 (β k m 2 k + s 2 k ) - 1 2 β * k (m * k ) 2 . ( 40
)
The component assignments q(w i ) that maximize the bound given the variational distributions on the MoG parameters are given by:

ln q ik = IE q(π)q(λ k ,µ k ) ln π k + ln N (x i |µ k , λ -1 k ) (41) = ψ(α * k ) -ψ(α * ) + 1 2 ψ(a * k ) -ln b * k (42) - 1 2 a * k b * k (x i -m * k ) 2 + (β * k ) -1 . ( 43
)
Since the sufficient statistics given by Eq. ( 35) depend on the component assignments, the distributions on the MoG parameters and the component assignments can be updated iteratively to improve the bound. Using the above variational update equations, we obtain the variational distribution, and therefore the lower-bound on the loglikelihood for each image. During training, we learn the model hyper-parameters by iteratively maximizing the sum of the lowerbounds for the training images w.r.t. the hyper-parameters, and w.r.t. the variational parameters. Once the latent MoG model is trained, we use the per-image lower-bounds to extract the approximate Fisher vector descriptors according to the gradient of F with respect to the model hyper-parameters.

The gradient of F w.r.t. the hyper-parameters depends only on the variational distributions on the MoG parameters of an image q(π), q(λ k ), and q(µ k |λ k ), and not on the component assignments q(w i ). For the precision hyper-parameters we find:

∂F ∂a k = [ψ(a * k ) -ln b * k ] -[ψ(a k ) -ln b k ] , (44)
∂F ∂b k = a k b k - a * k b * k , (45)
For the hyper-parameters of the means:

∂F ∂β k = 1 2 β -1 k - a * k b * k (m k -m * k ) 2 -1/β * k , (46)
∂F ∂m k = β k a * k b * k (m * k -m k ), (47)
and for the hyper-parameters of the mixing weights:

∂F ∂α k = [ψ(α * k ) -ψ( α * )] -[ψ(α k ) -ψ(α)] . (48)
By substituting the update equation [START_REF] Perina | Capturing spatial interdependence in image features: the counting grid, an epitomic representation for bags of features[END_REF] for the variational parameters α * k in the gradient Eq. ( 48), we exactly recover the gradient of the multivariate Pólya model, albeit using soft-counts s 0 k = N i=1 q(w i = k) of visual word occurrences here. Thus, the bound leaves the qualitative behavior of the multivariate Pólya model intact. Similar discounting effects can be observed in the gradients of the hyper-parameters of the means and variances. Substitution of the update equation [START_REF] Perronnin | Fisher kernels on visual vocabularies for image categorization[END_REF] for the variational parameters m * k in the gradient Eq. ( 47), reveals that the gradient is similar to the square-root of the gradient obtained in [START_REF] Perronnin | Fisher kernels on visual vocabularies for image categorization[END_REF] for the MoG mean parameters. The discounting function for this gradient is however slightly different from the ψ(•) function, but has a similar monotone concave form. We consider examples of the learned discounting functions in Section 5.4.

Our latent MoG model associates two hyper-parameters (m k , β k ) with each mean µ k , and similar for the precisions. Therefore, our image representation are almost twice as long compared to the iid MoG model: K(1 + 4D) vs. K(1 + 2D) dimensions. The updates of the variational parameters β * k and a * k in equations ( 37) and ( 39), however, only involve the zero-order statistics s 0 k . In [START_REF] Perronnin | Fisher kernels on visual vocabularies for image categorization[END_REF] the FV components corresponding to the mixing weights of the MoG, which are also based on zero-order statistics, were shown to be redundant when also including the components corresponding to the means and variances. Therefore, we expect the gradients w.r.t. the corresponding hyper-parameters β k and a k to be of little importance for image classification purposes. Experimental results, not reported here, have empirically verified this. We therefore fix the number of Gaussians rather than the FV dimension when we compare different representations in the next section, and use all FV components to avoid confusion.

EXPERIMENTAL EVALUATION

In this section, we present a detailed evaluation of the latent BoW, LDA and the latent MoG models over SIFT local descriptors using the PASCAL VOC'07 [START_REF] Everingham | The Pascal Visual Object Classes Challenge[END_REF] data set in Section 5.2, Section 5.3 and Section 5.4, respectively. Then, we present a empirical study on the relationship between the model likelihood and image categorization performance in Section 5.5. Finally, we evaluate the Latent MoG model, which is the most advanced model that we consider, over the CNN-based local descriptors, and compare against the state-of-the-art on the PASCAL VOC'07 and MIT Indoor [START_REF] Quattoni | Recognizing indoor scenes[END_REF] data sets in Section 5.6. Now, we first describe our experimental setup for the SIFTbased experiments used in the subsequent sections.

Experimental setup

In order to extract SIFT descriptors, we use the experimental setup described in the evaluation paper of Chatfield et al . [START_REF] Chatfield | The devil is in the details: an evaluation of recent feature encoding methods[END_REF]: we sample local SIFT descriptors from the same dense grid (3 pixel stride, across 4 scales), which results in around 60, 000 patches per image, project the local descriptors to 80 dimensions with PCA, and train the MoG visual vocabularies from 1.5 × 10 6 descriptors. For the PASCAL VOC'07 data set, we use the interpolated mAP score specified by the VOC evaluation protocol [START_REF] Everingham | The Pascal Visual Object Classes Challenge[END_REF].

We compare global image representations, and representations that capture spatial layout by concatenating the signatures computed over various spatial cells as in the spatial pyramid matching (SPM) method [START_REF] Lazebnik | Beyond bags of features: spatial pyramid matching for recognizing natural scene categories[END_REF]. Again, we follow [START_REF] Chatfield | The devil is in the details: an evaluation of recent feature encoding methods[END_REF] and combine a 1 × 1, a 2×2, and a 3×1 grid. Throughout, we use linear SVM classifiers, and we cross-validate the regularization parameter.

Before training the classifiers we apply two normalizations to the image representations. First, we whiten the representations so that each dimension is zero-mean and has unit-variance across images in order to approximate normalization with the inverse Fisher information matrix. Second, following [START_REF] Perronnin | Improving the Fisher kernel for large-scale image classification[END_REF], we also 2 normalize the image representations.

For the BoW, PLSA and MoG models, we compare using Fisher vectors with and without power normalization, and to using the Fisher vectors of the corresponding latent variable models. As in [START_REF] Perronnin | Improving the Fisher kernel for large-scale image classification[END_REF], power normalization is applied after whitening, and before 2 normalization. We evaluate two types of power normalization: (i) signed square-rooting (ρ = 1/2) as in [START_REF] Chatfield | The devil is in the details: an evaluation of recent feature encoding methods[END_REF], [START_REF] Perronnin | Improving the Fisher kernel for large-scale image classification[END_REF], which we denote by a prefix "Sqrt", (ii) more general power normalization, which we denote by a prefix "Pn". In the latter case, we crossvalidate the parameter ρ ∈ {0, 0.1, 0.2, ..., 1} for each setting, but keeping it fixed across the classes.

In Tables 1, 2, 3 and 5, the bold numbers indicate the top performing representations in each setting that are statistically equivalent, which we measure by using the bootstrapping method proposed in Everingham et al . [START_REF] Everingham | The Pascal Visual Object Classes Challenge[END_REF], at 95% confidence interval. In Tables 4 and6, we are unable to run the test on other state-of-theart approaches, as the statistical significance test requires original classification scores on the test images.

Evaluating BoW and P ólya models

In Table 1 we compare the results obtained using standard BoW histograms, two types of power normalized histograms, and the Pólya model. In all three cases, we generate the visual word counts from soft assignments of patches to the MoG components. Overall, we see that the spatial information of SPM is useful, and that larger vocabularies increase performance. We observe that both power normalization and the Pólya model both consistently improve the BoW representation, across all dictionary sizes, and with or without SPM. Furthermore, the Pólya model generally leads to larger improvements than power normalization. These results are in line with the observation of Section 4.1 that the non-iid Pólya model generates similar transformations on BoW histograms as power normalization does, and show that normalization by the digamma function is at least as effective as power normalization.

Figure 8 illustrates the discounting functions learned by the Pólya model for a dictionary of 64 visual words, without a spatial pyramid. Each solid curve in the figure corresponds to one of the visual words, and shows the corresponding digamma function ψ(α k + n k ) as a function of the visual word count n k . Compared to the square-root transformation, which is shown by the dashed curve, we observe that the Pólya model generally leads to similar but somewhat stronger discounting effect.

Evaluating topic model representations

We compare different topic model representations of Section 4.2: Fisher vectors computed on the PLSA model, its power normalized version, and using the corresponding LDA latent variable model. We compare to the corresponding BoW representations, and include SPM in all experiments. For the sake of brevity, we report only cross-validation based power normalization, as squarerooting gives similar results. In order to train LDA models, we first train a PLSA model, and then fit Dirichlet priors on the topic-word and document-topic distributions as inferred by PLSA.

In Figure 9, we consider topic models using T = 2 topics for various dictionary sizes, and in Figure 10 we use dictionaries of K = 1024 visual words, and consider performance as a function of the number of topics. We observe that (i) topic models consistently improve performance over BoW models, and (ii) the plain PLSA representations are consistently outperformed by the power normalized version, and the LDA model. The LDA model requires less topics than (power-normalized) PLSA to obtain similar performance levels. This is in line with our findings with the BoW model of the previous section.

Evaluating latent MoG model

We now turn to the evaluation of the MoG-based image representations. In order to speed-up the learning of the hyperparameters, we fix the patch-to-word soft-assignments as obtained from the MoG dictionary, and pre-compute the sufficient statistics of Eq. ( 35) once. We then iteratively update the model hyperparameters, and the parameters of the posteriors on the per-image latent MoGs, as detailed in Section 4.3.

We initialize the Dirichlet distribution on the mixing weights by matching the moments of the distribution of normalized visual word frequencies s 0 k , which gives an approximate maximum likelihood estimation [START_REF] Minka | Estimating a Dirichlet distribution[END_REF]. Similarly, we initialize the hyper-parameters a k and b k of the Gamma prior on the precision of visual word k, by matching the mean and variance of empirical precision values computed from the sufficient statistics for each visual word, while weighting the contribution of each image by the count of visual word k in that image. In this step, the empirical precision values of visual words with few associated descriptors can become too large and may lead to poor initialization. constant factor, which is cross-validated among a predefined set of values. Finally, we initialize the hyper-parameters m k and β k by matching the mean and variance of the per-image empirical mean values computed from the sufficient statistics, again weighting each image by the count of visual word k in that image. 3 In Table 2, we compare representations based on Fisher vectors computed over MoG models, their two power normalized versions, and the latent MoG model of Section 4.3. We can observe that the MoG representations lead to better performance than the BoW and topic model representations while using smaller vocabularies. Furthermore, the discounting effect of power normalization and our latent variable model has a more pronounced effect here than it has for BoW models, improving mAP scores by around 4 points. Also for the MoG models, our latent variable approach leads to improvements that are comparable to those obtained by power normalization. So again, the benefits of power normalization may be explained by using non-iid latent variable models that generate similar representations.

Similar to Figure 8, we present an empirical comparison of the MoG FV and LatMoG FV based on a vocabulary of size K = 64 components in Figure 11. In this case we consider gradients w.r.t. the Gaussian mean parameters. The transformation given by power normalization is given for reference in dashed black. Each LatMoG curve is obtained by sampling a dimension-cluster pair (d, k), and plotting the LatMoG FV with respect to m k,d as a function of the MoG FV with respect to µ k,d over different images. The LatMoG curves are smoothed via a median filter for visualization purposes. We observe that the LatMoG model naturally generates FVs with discounting effects, as demonstrated by the curves similar to square-root transformation. Note that the gradient in Eq. ( 47) for the LatMoG model is a joint function of the s 0 k , s 1 k and s 2 k statistics, which makes that plotting LatMoG FVs against MoG FVs results in non-smooth curves.

Relationship between model likelihood and categorization performance

We have seen that the Fisher vectors of our non-iid image models provide significantly better image classification performance compared to the Fisher vectors of the corresponding iid models, unless power normalization is used to implement a discounting transformation on the image descriptors. In a broad sense, our experimental results suggest that Fisher kernels combined with more powerful generative models can possibly lead to better image categorization performance.

3. Source code for LatMoG is available at http://lear.inrialpes.fr/software. In order to investigate the relationship between the image models and the categorization performance using the corresponding Fisher vectors, we propose to empirically analyze the MoG models and the corresponding image descriptors at a number of PCA projection dimensions (D) and vocabulary sizes (K). Here, we use the log-likelihood of each model on a validation set as a measure of the generative power of the models and evaluate the image categorization performance of the corresponding Fisher vectors in terms of mAP scores on the PASCAL VOC 2007 dataset.

One important detail is that it may not be meaningful to compare the image categorization performance across image descriptors of different dimensionality: Our previous experimental results have shown that the mAP scores typically increase as the MoG Fisher vector descriptors become higher dimensional. Therefore, we want to compare the categorization performance across the image descriptors of fixed dimensionality, i.e. across the (D, K) pairs such that the product D × K is constant. On the other hand, the log-likelihood of MoG models are comparable only if they operate in the same PCA projection space. In order to overcome this difficulty, we convert each pair of PCA and MoG models into a joint generative model, which allows us to obtain comparable log-likelihood values across different PCA subspaces.

We propose to obtain the joint generative models by first defining a shared descriptor space as follows: Let φ(x) = U T (x -µ 0 ) be the full-dimensional PCA transformation function for the local descriptors, where µ 0 is the empirical mean of the D 0 -dimensional local descriptors and U is the D 0 ×D 0 dimensional matrix of PCA basis column vectors. We note that φ(x) does not apply dimension reduction, and the projection of a local descriptor x onto the D dimensional PCA subspace is given by I D×D0 φ(x), i.e. the first D coordinates of φ(x). Therefore, the density function of a given MoG model in the D-dimensional PCA subspace is given by

p(x) = K k=1 π k N (I D×D0 φ(x); µ k , Σ k ). ( 49
)
where π k is the mixing weight, µ k is the D-dimensional mean vector and σ k is the variances vector of the k-th component. Then, we can map the PCA dimension reduction model and the MoG model into a new MoG model in the space of φ(x) descriptors as follows: where each mean vector is defined as

p 0 (x) = k π k N (φ(x); µ k , σ k ) (50)
µ k = I D0×D µ k , (51)
and each variances vector σ k is obtained by concatenating the corresponding D-dimensional σ k vector with the empirical global variances of the remaining D 0 -D dimensions.

In our experiments, we have randomly sampled 300,000 SIFT descriptors to measure the average model log-likelihoods. We evaluate the image categorization performance using squarerooted and 2 normalized MoG Fisher vectors, without a spatial pyramid. We have utilized (D, K) pairs obtained by varying D from 8 to 128 and K from 64 to 4096.

Figure 12a presents the model log-likelihood values and Figure 12b presents the corresponding image classification mAP scores. The x-axis of each plot shows the number of PCA dimensions. Each curve represents a set of (D, K) values where D × K is constant. From the experimental results first we can see that increasing the number of PCA dimensions (and hence reducing the number of mixing components) consistently increases the model log-likelihood. Second, the mAP scores similarly increase up to D ≤ 64, but then degrade from D = 64 to D = 128. Therefore, even if the model log-likelihood and categorization performance are related, they are not necessarily tightly correlated. Image categorization performance can be affected by several other factors, including the details of target categorization task, and transformations applied to the Fisher vector representations, such as power and 2 normalization here. Despite these findings, we believe that further investigation of the relationship between the modeling strength of generative models and the performance of the corresponding Fisher vectors for recognition tasks can lead to advances in unsupervised representation learning.

Experiments using CNN features

We have so far utilized the SIFT local descriptors in our experiments. In this section, we evaluate the latent MoG representation based on local descriptors extracted using a convolutional neural network (CNN) model [START_REF] Krizhevsky | Imagenet classification with deep convolutional neural networks[END_REF]. For this purpose, we consider two feature extraction schemes. First, we utilize the grid based region sampling approach based on the work by Gong et al . [START_REF] Gong | Multi-scale Orderless Pooling of Deep Convolutional Activation Features[END_REF] and Liu et al . [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF], and extract local descriptors by feeding cropped regions to a CNN model. Second, inspired from the R-CNN object detector [START_REF] Girshick | Rich feature hierarchies for accurate object detection and semantic segmentation[END_REF]

Method mAP

CNN baseline [START_REF] Razavian | CNN features off-the-shelf: an astounding baseline for recognition[END_REF] 73.9 Razavian et al . [START_REF] Razavian | CNN features off-the-shelf: an astounding baseline for recognition[END_REF] 77.2 Bilen et al . [START_REF] Bilen | Weakly supervised object detection with posterior regularization[END_REF] 80.9 Liu et al . [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF] 76.9

Ours (PnMoG, sel. search, fc7) 78.0 Ours (LatMoG, sel. search, fc7) 77.1 method. Unlike the R-CNN detector, however, we utilize the region descriptors to extract image descriptors using the Fisher kernel framework, instead of evaluating individual regions as detection candidates. To the best of our knowledge, we are first to utilize detection proposals for this purpose.

In order to extract CNN features from regions sampled on a grid, we follow the local region sampling approach proposed by Liu et al . [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF]: a given image is first scaled to a size of 512 × 512 pixels, then, regions of size 227 × 227 are sampled in a sliding window fashion with a stride of 8 pixels. This procedure results in around 1300 regions per image. The image patch corresponding to each region sample is cropped and feed into the CNN model of Krizhevsky et al . [START_REF] Krizhevsky | Imagenet classification with deep convolutional neural networks[END_REF], which is pre-trained on the ImageNet ILSVRC2012 dataset [START_REF] Deng | Imagenet: A large-scale hierarchical image database[END_REF] using the Caffe library [START_REF] Jia | Caffe: Convolutional architecture for fast feature embedding[END_REF]. Finally, the outputs of the CNN model are used as the local descriptors.

In our second approach, we utilize the detection proposal regions generated using the selective search method of Uijlings et al . [START_REF] Uijlings | Selective search for object recognition[END_REF]. This method computes multiple hierarchical segmentation trees for a given image, and takes the segment bounding boxes as the detection proposals. This procedure results in around 1, 500 regions per image. Following the R-CNN object detector, we crop and re-size the window proposals to regions of size 224 × 224, as required by the CNN model.

As region descriptors we consider the layer six and seven activations of the CNN model. In order to speed up the Fisher vector computations, we project the original 4, 096-dimensional feature vectors to 128 dimensions using PCA. In our preliminary experiments, we have verified that higher dimensional PCA projections does not improve the image categorization performance. Following the iid MoG based experiments in [START_REF] Gong | Multi-scale Orderless Pooling of Deep Convolutional Activation Features[END_REF] and [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF], we use models with K = 100 Gaussian components, 2 normalize the resulting image representations, and do not use SPM grids.

In Table 3, we compare the MoG Fisher vector, its power normalized versions, and the latent MoG Fisher vector representations. First, we observe that using selective search regions for descriptor pooling leads to consistently better results than using the grid based regions. Given that both approaches use a comparable number of regions, the improvement using selective search regions is probably due to using regions of multiple scales, and having a better object-to-clutter ratio. Second, we observe that also in this setting using the Latent MoG model leads to improvements that are comparable to those obtained by power normalization. Third, best results are obtained with layer seven activations using power normalization and our latent model.

In Table 4 we show that our results are comparable to the recent results based on a similar CNN models. The first row shows the CNN baseline (73.9%), as reported by Razavian et al . [START_REF] Razavian | CNN features off-the-shelf: an astounding baseline for recognition[END_REF], which corresponds to training an SVM classifier over the full image CNN descriptors. The same paper also shows that the performance can be improved to 77.2% by applying feature transformations to image descriptors and incorporating additional training examples via transforming images. Bilen et al . [START_REF] Bilen | Weakly supervised object detection with posterior regularization[END_REF] (80.9%) explicitly localizes object instances in images using an iterative weakly supervised localization method. The result shows that explicit localization of the objects can help better categorization of the images. Liu et al . [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF] (76.9%) extract Fisher vectors of a sparse coding based model over local CNN features (see Appendix A for a detailed discussion of their model). Overall, we observe that our results using power normalized MoG FVs (78.0%) and latent MoG FVs (77.1%) are comparable to the aforementioned recent results, all of which are based on similar CNN models, and validate the effectiveness of our Latent MoG model for local feature aggregation.

We note that better results on the VOC'07 dataset have recently been reported based on significantly different CNN features and/or architectures. For example, Chatfield et al . [START_REF] Chatfield | Return of the devil in the details: Delving deep into convolutional nets[END_REF] achieve 82.4% mAP by utilizing the OverFeat [START_REF] Sermanet | Overfeat: Integrated recognition, localization and detection using convolutional networks[END_REF] architecture, combined with a carefully selected set of data augmentation, data normalization and CNN fine-tuning techniques. Wei et al . [START_REF] Wei | CNN: single-label to multi-label[END_REF] achieve 85.2% by max-pooling the class predictions over candidate windows, utilizing additional training images, and using a two-stage CNN fine-tuning approach. Simonyan and Zisserman [START_REF] Simonyan | Very deep convolutional networks for large-scale image recognition[END_REF] report that the classification performance can be improved up to 89.7% mAP by using very deep network architectures, and combining multiple CNN models. We can expect similar improvements in the feature aggregation methods, including ours, by utilizing these betterperforming CNN features.

In order to validate our results on a second dataset, we evaluate our latent MoG model on the MIT Indoor dataset. The dataset contains 6,700 images, each of which is labeled with one of the 67 indoor scene categories. Before extracting window proposals, we resize each image such that the larger dimension is 500 pixels. We use the standard split for the dataset, which provides 80 train and 20 test images per class, and evaluate the results in terms of average classification accuracy.

The results for MIT Indoor are presented Table 5. In each row, we evaluate a combination of the 6-th or 7-th CNN layer with the grid based or selective search based regions. Our results

Method Accuracy

Juneja et al . [START_REF] Juneja | Blocks that shout: Distinctive parts for scene classification[END_REF] 63.2 Doersch et al . [START_REF] Doersch | Mid-level Visual Element Discovery as Discriminative Mode Seeking[END_REF] 64.0 CNN baseline [START_REF] Razavian | CNN features off-the-shelf: an astounding baseline for recognition[END_REF] 58.4 Razavian et al . [START_REF] Razavian | CNN features off-the-shelf: an astounding baseline for recognition[END_REF] 69.0 Liu et al . [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF] 68.2 Gong et al . [START_REF] Gong | Multi-scale Orderless Pooling of Deep Convolutional Activation Features[END_REF] 68.9

Ours (PnMoG, sel. search, fc7) 69.1 Ours (LatMoG, sel. search, fc7)

69.1 are overall consistent with those we obtain on VOC 2007: (i) using selective search regions leads to better performance, and (ii) using the Latent MoG model leads to significant improvements, comparable to those obtained by power normalization. Therefore, the results again support that the benefits of power normalization can be explained by their similarity to non-iid latent variable models that generate similar transformations.

Finally, in Table 6, we compare our results on the MIT Indoor dataset with the state-of-the-art. The first methods, Juneja et al . [START_REF] Juneja | Blocks that shout: Distinctive parts for scene classification[END_REF] (63.2%) and Doersch et al . [START_REF] Doersch | Mid-level Visual Element Discovery as Discriminative Mode Seeking[END_REF] (64.0%), extract midlevel representations by explicitly localizing discriminative image regions. In the next two rows, we observe that the CNN baseline improves from 58.4% to 69.0% using the feature and image transformations proposed by Razavian et al . [START_REF] Razavian | CNN features off-the-shelf: an astounding baseline for recognition[END_REF]. The sparse coding Fisher vectors proposed by Liu et al . [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF] result in a comparable performance at 68.2%. Gong et al . [START_REF] Gong | Multi-scale Orderless Pooling of Deep Convolutional Activation Features[END_REF] (68.9%) utilizes power normalized VLAD features over the CNN descriptors extracted from multi-scale grid-based regions, in combinations with the full image CNN features. Overall, we observe that our approach using power normalized MoG FVs (69.1%) and latent MoG FVs (69.1%) over selective search regions provide state-of-theart performance on the MIT Indoor dataset.

CONCLUSIONS

In this paper we have introduced latent variable models for local image descriptors, which avoid the common but unrealistic iid assumption. The Fisher vectors of our non-iid models are functions computed from the same sufficient statistics as those used to compute Fisher vectors of the corresponding iid models. In fact, these functions are similar to transformations that have been used in earlier work in an ad-hoc manner, such as the power normalization, or signed-square-root. Our models provide an explanation of the success of such transformations, since we derive them here by removing the unrealistic iid assumption from the popular BoW and MoG models. Second, we have shown that gradients of the variational free-energy bound on the log-likelihood gives exact Fisher score vectors as long as the variational posterior distribution is exact. Third, we have shown that approximate Fisher vectors for the proposed latent MoG model can be successfully extracted using the variational Fisher vector framework. Finally, we have shown that the Fisher vectors of our non-iid MoG model over CNN region descriptors extracted on selectively sampled windows lead to image categorization performance that is comparable or superior to that obtained with state-of-the-art feature aggregation representations based on iid models.

Fig. 2 .

 2 Fig. 2. The score of a linear 'cow' classifier will increase similarly from images (a) through (d) due to the increasing number of cow patches. This is undesirable: the score should sharply increase from (a) to (b), and remain stable among (b), (c), and (d).

Fig. 3 .

 3 Fig. 3. Comparison of 2 , Hellinger, and chi-square distances for values in the unit interval. Both the Hellinger and chi-square distance discount the effect of small changes in large values, unlike the 2 distance.

Fig. 4 .

 4 Fig. 4. Graphical representation of the models in Section 4.1: (a) multinomial BoW model, (b) P ólya model. The outer plate in (b) refer to images. The index i runs over the visual word indices in an image. Nodes of observed variables are shaded, and those of (hyper-)parameters are marked with a central dot in the node.

αFig. 5 .

 5 Fig. 5. Digamma functions ψ(α + n) for various α, and √ n as a function of n; functions have been rescaled to the range [0, 1].

Fig. 7 .

 7 Fig. 7. Graphical representation of the models in Section 4.3: (a) MoG model, (b) latent MoG model. The outer plate in (b) without indexing refer to images. The index i runs over the local descriptors, and index k over Gaussians in the mixture which represent the visual words.

Fig. 8 .

 8 Fig. 8. Comparison of the discounting functions learned by the latent BoW model for 64 visual words (solid), and the square-root transformation (dashed). Transformed counts are rescaled to the range [0, 1].

Fig. 9 .Fig. 10 .

 910 Fig.9. Topic models (T = 2, solid) compared with BoW models (dashed): BoW/PLSA (red), power-normalized BoW/PLSA (green), and P ólya/LDA (blue). SPM grids are used in all experiments.

Fig. 11 .

 11 Fig. 11. Empirical comparison of components related to the Gaussian means of the power normalized MoG FVs (SqrtMoG) and latent MoG FVs (LatMoG) vs. the non-power-normalized FV (horizontal axis). All FV values are scaled to the range [-1,1].

Fig. 12 .

 12 Fig.[START_REF] Doersch | Mid-level Visual Element Discovery as Discriminative Mode Seeking[END_REF]. Evaluation of the model log-likelihood and the classification performance in terms of mAP scores as a function of the number of PCA dimensions (D) and the vocabulary size (K). The x-axis of each plot shows the number of PCA dimensions. Each curve represents a set of (D, K) values such that D × K stays constant.

  To deal with this issue, we truncate per-image empirical precision values with respect to the corresponding global empirical precision values scaled by a

	SPM	Method	32	64	128	256	512	1024
	No	MoG	49.1	51.4	53.1	54.3	55.0	55.9
	No	SqrtMoG	51.8	54.7	56.2	58.2	58.9	60.2
	No	PnMoG	52.6	55.0	56.9	59.0	60.3	61.1
	No	LatMoG	52.9	55.9	56.6	58.6	59.5	60.2
	Yes	MoG	53.1	55.4	56.2	57.1	57.4	57.6
	Yes	SqrtMoG	56.0	57.9	58.9	60.3	60.5	60.8
	Yes	PnMoG	56.6	58.4	59.5	61.1	61.3	61.8
	Yes	LatMoG	57.3	58.9	59.4	60.4	60.7	60.7
				TABLE 2
	Comparison of MoG-based FV representations: plain MoG, two types
		of power normalized MoG, and latent MoG.

TABLE 3

 3 , we propose to extract local CNN features for the image regions sampled by a candidate window generation Comparison of mAP scores on PASCAL VOC'07 dataset: plain MoG, two types of power normalized MoG and latent MoG.

	Regions	CNN Layer	MoG	SqrtMoG	PnMoG	LatMoG
	Grid	fc6	69.4	74.1	74.3	73.3
	Grid	fc7	66.6	74.6	75.7	75.3
	Selective	fc6	74.2	76.8	77.0	75.5
	Selective	fc7	74.5	77.8	78.0	77.1

TABLE 4

 4 Comparison of the power normalized MoG and latent MoG representations against recent results on the PASCAL VOC'07 dataset.

TABLE 5

 5 Comparison of classification accuracy on MIT Indoor: plain MoG, two types of power normalized MoG and latent MoG.

			.1	66.0	67.3	62.2
	Grid	fc7	57.0	64.8	65.0	61.5
	Selective	fc6	66.6	69.4	69.7	68.2
	Selective	fc7	65.2	69.0	69.1	69.1

TABLE 6

 6 Comparison of the power normalized MoG and latent MoG representations against recent results on the MIT Indoor dataset.

We present here the uni-variate case for clarity, extension to the multivariate case with diagonal covariance matrices is straightforward.

Acknowledgements. This work was supported by the European integrated project AXES and the ERC advanced grant ALLEGRO.

APPENDIX A. VARIATIONAL FISHER KERNEL EXAMPLES

In this section, we give two examples that illustrate applications of the variational FV framework, in addition to the models considered in the main text.

In our first example, we derive a fast variant of the MoG FV representation using the variational Fisher kernel formulation. Recall that the final MoG FV image representation is obtained by aggregating K(1 + 2D)-dimensional per-patch FVs. Therefore, the cost of feature extraction grows linearly with respect to K, D and N . One way to speed up this process, without sacrificing the descriptor dimensionality, is to hard-assign each local descriptor to visual word with the highest posterior probability. Using hardassignment, each local descriptor produces a (1+2D) dimensional descriptor, therefore, the aggregation speeds-up by a factor of K. As noted in [START_REF] Sánchez | Image classification with the Fisher vector: Theory and practice[END_REF], the MoG FV descriptor in this case can be also interpreted as a generalization of the VLAD descriptor [START_REF] Jégou | Aggregating local image descriptors into compact codes[END_REF].

Although the hard-assignment method can provide significantly speeds up in the descriptor aggregation process, it may also cause significant information loss [START_REF] Van Gemert | Visual word ambiguity[END_REF]. This problem can be addressed by utilizing clipped posterior weights within the variational FV framework. More specifically, we can define the family of approximate posteriors Q as those distributions with at most K non-zero values. The best approximation to a given p(k|x) is then obtained by re-normalizing the largest K values of p(k|x) and setting the other values to zero. In this case, each patch yields a descriptor with at most K (1+2D) non-zero values, which translates into a aggregation speed up of factor K K . The number of non-zeros K can be set to strike a balance between the information loss and the aggregation cost. This shows that clipping the posteriors to speed-up the computation of FVs, as e.g. done in [START_REF] Cinbis | Segmentation driven object detection with Fisher vectors[END_REF], can be justified in the variational framework. The MoG model can also be learned in a coherent manner, by optimizing the obtained variational bound instead of the log-likelihood. This forces the MoG components to be more separated, so that the true posteriors will concentrate on few components.

As a second example, we show that the derivation of the sparse coding FVs of Liu et al . [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF], which we have experimentally compared against in Section 5.6, can be significantly simplified using the variational formulation. In their approach, a D-dimensional local descriptor x is modeled by a mixture of basis vectors:

where u is the latent vector of mixing weights of length K, and B is the dictionary matrix with each of the K columns corresponding to a D-dimensional basis vector. The distribution p(x|u; B) is a Gaussian with mean Bu, and covariance matrix equal to a multiple of the identity matrix, and p(u) is the Laplacian prior on the mixture weights. Liu et al . [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF] propose to approximate p(x) by the point estimate for u that maximizes the likelihood:

where

In order to compute FVs for this model, we need to compute the gradients of Eq. ( 53) with respect to the dictionary matrix B.

However, as noted in [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF], this is leads to a relatively complicated calculation since u is dependent on B. Using a series of techniques, it is shown in [START_REF] Liu | Encoding high dimensional local features by sparse coding based Fisher vectors[END_REF] that the gradient is given by:

Instead, we can use the variational Fisher kernel formulation to achieve the same result in a simpler way. For this purpose, we define the class of approximate posteriors Q as the set of delta peaks that put all mass at a single value u. It is then easy to see that the optimal q ∈ Q that maximizes the variational bound is q(u ) = 1 and q(u = u ) = 0. Given the optimal q, the variational FV is given by:

Compared to Eq. ( 54), this is a much simpler derivative operation since the gradient is now decoupled from the u estimation step.

It can be easily shown that the resulting gradient is equivalent to Eq. ( 55). This shows that the variational FV formulation can be preferable over the original FV formulation.