Semantically Grounded Visual Embeddings for Zero-Shot Learning

Shah Nawaz\(^{1*\dagger}\), Jacopo Cavazza\(^{1*}\), Alessio Del Bue\(^{1,2}\)
\(^{1}\)Pattern Analysis & Computer Vision (PAVIS) - Istituto Italiano di Tecnologia (IIT),
\(^{2}\)Visual Geometry & Modelling (VGM) - Istituto Italiano di Tecnologia (IIT)
{shah.nawaz,jacopo.cavazza,alessio.delbue}@iit.it


Abstract

1

2

3

Zero-shot learning methods rely on fixed visual and semantic embeddings, extracted from independent vision and language models, both pre-trained for other large-scale tasks. This is a weakness of current zero-shot learning frameworks as such disjoint embeddings fail to adequately associate visual and textual information to their shared semantic content. Therefore, we propose to learn semantically grounded and enriched visual information by computing a joint image and text model with a two-stream network on a proxy task. To improve this alignment between image and textual representations, provided by attributes, we leverage ancillary captions to provide grounded semantic information. Our method, dubbed joint embeddings for zero-shot learning is evaluated on several benchmark datasets, improving the performance of existing state-of-the-art methods in both standard (\(+1.6\)% on aPY, \(+2.6\%\) on FLO) and generalized (\(+2.1\%\) on AWA\(2\), \(+2.2\%\) on CUB) zero-shot recognition.

Zero-shot learning (ZSL) aims at classifying images into new “unseen” categories at test time without having been provided any corresponding visual examples in the training stage. This is possible by taking advantage of semantic embeddings describing the visual categories by means of auxiliary text information i.e. attributes. In recent years, several approaches have been proposed to tackle ZSL: A metric/score can be learnt to quantify the compatibility between semantic embeddings and pre-computed visual features (visual embedding[1]. Alternatively, visual features can be synthesized from semantic embeddings with adversarial generative training [2][4]. In these terms, ZSL and its extension named generalised ZSL (GZSL) [1], naturally appear as multimodal classification problems. However, visual and semantic embeddings adopted in ZSL approaches are usually extracted independently from ancillary tasks. In fact, visual embedding are usually features trained for object/scene recognition on classical vision benchmarks such as ImageNet [5], [6]. On the other hand, semantic embeddings in ZSL are either manually defined, by collecting attributes which describe a certain category, or extracted using natural language processing [5][8].

Figure 1: For these three bird species of CUB [9] dataset, the attributes “brown spotted wings” is not discriminative. In fact, a “Brown Thrasher” is characterized by the presence of white wingbars. An “Arcadian Flycatcher” features spots which are present over the whole side of the animal – not just over the wings. A “Song Sparrow” shows peculiar tips over the stripes. We posit that captions can provide ancillary semantic information which we propose to exploit altogether with attributes and visual data.

Independently extracted semantic embeddings convey only general information about a given visual category. For this reason, their sensitivity may be limited in describing specific semantic nuances that actually help in discriminating between another category whose instances look extremely similar (see Figure 1). In this paper, we posit that this problem is affecting zero-shot learning and, in order to mitigate it, we propose to exploit captions to inject semantic information into visual embeddings. This is achieved by means of a joint training, finalized at better enriching the embeddings using both visual and semantic cues, in order to ease a zero-shot learning recognition paradigm.

Generally, a jointly learned image and text representation is referred as pretrain-then-transfer, a defacto standard paradigm to process vision and language information [10], [11] The success of pretrain-then-transfer learning is instrumental in developing methods which can capture connections between vision and language domains on so-called “proxy tasks” with large-scale image and text datasets i.e. MSCOCO [12], Flickr30K [13], Conceptional Captions (ConcCapt) [14], Visual Genome [15]. Therefore, in the recent years, an increased interest was registered in unifying models as to learn joint image and text representations [11], [16][18]. These models utilize cross-modal attention mechanisms to capture interaction between image regions and fine-grained text information. However, zero-shot learning methods cannot leverage these powerful models to improve visual or semantic information because the zero-shot learning problem does not account for fine-grained text description for visual information. Therefore, we solve for this deficiency by presenting a framework to learn joint image and text representation to improve visual information for ZSL and GZSL tasks.

We propose a novel framework, called joint-embeddings for zero-shot learning (JE-ZSL), to learn a semantically-grounded visual representation. We use a two-stream network, consisting of two layers of non-linearities on top of the image and captions, trained with a bi-directional loss function. We implement structure-preserving constraints to align the alternative visual and textual sources of information. We posit that, by means of our joint training, we can better capture the interaction between semantically-related image and text components, ultimately bridging the gap between visual and semantic representations and, in turn, improving the performance of a zero-shot learning mechanism. We evaluate our proposed semantically grounded embeddings on various well-know compatibility function and GAN based methods, improving standard and generalised zero-shot learning performance on coarse-grained and fine-grained dataset. This empirically demonstrates the benefits of corroborating the representation adopted for visual data in zero-shot learning by means of semantically grounded information.

Figure 2: Overview of Joint Embeddings for Zero-Shot Learning (JE-ZSL). Our model consists of a visual and semantic embedding modules, \mathbf{V} and \mathbf{S} respectively, which are responsible for the joint training of the image embeddings starting from textual cues (here, sentences). We stack two fully-connected layers, using ReLU non-linearity, batch normalization (BN), L2 normalization and a Structure-Preserving Alignment Loss which is responsible of injecting semantic patterns into visual descriptors (see Section 2.2). Once the jointly trained visual embeddings \mathbf{x} are optimized over a set of seen classes (in the figure, watercress, daffodil, primula, ...), they can be used to train the optimization objective of an arbitrary zero-shot learning framework. Consequently, even if we never saw an image of a “buttercup”, we can still manage to classify it (decision boundary represented in red) while leveraging the side information which provides the attributes that the class “buttercup” is expected to own.

1 Related Work↩︎

We summarize previous work on both joint image and text representations (Section 1.1) along with standard/generalized zero-shot learning (Section 1.2).

1.1 Joint Image and Text Representation↩︎

In the recent years, several works have been proposed to learn joint image and text representation for various vision and languages tasks in a multimodal setting [10], [19][22]. Usually, joint image and text representation strategies start with separate vision and language models (pre-trained for other large-scale tasks) and then perform a task-specific training [22], [23]. However, the last years have seen a paradigm shift in learning joint image and text representations on proxy tasks designed to bridge the semantic gap between visual and textual clues leveraging large-scale datasets [11], [16][18], [24]. These joint representations transfer to various downstream vision and language tasks including visual question answering, grounding referring expression, visual commonsense reasoning and image retrieval, without the necessity of extra-training. In this spirit, we proposed to learn semantically grounded enriched visual embedding using joint image and text representation on a proxy task. The key differences between our JE-ZSL approach and the other methods are twofold: (i) Interaction between image and text representations only occur at the last layer of the two-stream network; and (ii) JE-ZSL uses global visual and text representation to capture interaction between image and textual clues. These key differences enable our JE-ZSL model to handle downstream zero-shot learning tasks.

1.2 Zero-shot Learning↩︎

In ZSL, a compatibility function is used to measure the matching between visual and semantic embeddings. For that scope, either metric [25][28], scoring [29][31] or ranking functions [32], [33] are adopted. However, the main drawback of those methods is the shallowness of the architectural design. As a result, an improvement in the recognition of unseen classes usually corresponds to a decreased performance in the seen classes and vice-versa [1], damaging the overall generalization capabilities. In this paper, we propose to tackle this issue by the usage of joint embeddings, which we conjecture that can help shallow models in better generalizing.

As an alternative strategy to compatibility functions, the pivotal paper [34] proposed to directly synthesize visual descriptors conditioned on semantic embeddings. A Generative Adversarial Network (GAN) is trained to synthesize visual features which are indistinguishable from the ones extracted from a ResNet\(-101\) backbone. At the deployment stage, the very same model can be utilized to generate synthetic visual features for the unseen classes. Finally, a shallow softmax classifier is trained using both real features from seen classes and unseen features from the unseen ones. This baseline architectural design was recently advanced in various approaches, such as the adoption of variational inference to boost the generator [35][39]. Additional loss functions were investigated to better handle the problem, like cycle-consistency [40], triplet [41] or contrastive loss [42]. In this paper, we show that the semantic conditioning used to generate visual features can be furthermore boosted by the usage of joint embeddings: since they are endowed of semantically-grounded visual information, the “gap” between semantic and visual embeddings is already bridged at the input level already.

2 Joint Embeddings for Zero-Shot Learning: Methodology↩︎

Our proposed strategy JE-ZSL is to ground visual embeddings through the usage of textual information for the sake of enhancing zero-shot learning methods from the data representation point of view.

2.1 Overview of the Proposed Architecture↩︎

In Figure 2, we visualize the joint embeddings model that we propose. It is composed by three input streams, each of them corresponding to a different type of input data (images, sentences and class attributes). The modules \(\mathbf{V}\) and \(\mathbf{S}\) provide vectorial representation extracted from ResNet\(-101\) [5] and Bidirectional Encoder Representations from Transformers (BERT) [7] models respectively to learn joint embeddings. On top of the output of \(\mathbf{V}\) and \(\mathbf{S}\), JE-ZSL stacks two-fully connected layers, the first of which followed by a rectified linear unit (ReLU) and the second of which is followed by batch-norm operator followed by an L2 normalization. These two fully-connected layers are then responsible for the joint training of the visual embeddings \(x\) supported by the sentence embeddings \(y\), by means of a structure-preserving alignment loss [43] (see Section 2.2). Once visual embeddings are optimized, they can be used in an arbitrary zero-shot learning framework, together with attributes - or other class embeddings - without requiring any modification in the pipeline of the zero-shot learner, thus ensuring a broad applicability (additional details in Section 2.3).

2.2 Structure-Preserving Alignment Loss↩︎

The JE-ZSL loss function is defined as follow. Given a visual embedding \(x_i\), let \(Y_i^+\) and \(Y_i^-\) represent sets of positive and negative sentence embeddings respectively. The distance between a positive pair should be smaller than the distance between a negative pair with margin \(m\): \[\label{eq:sent-pos} d\left(x_{i}, y_{j}\right)+m<d\left(x_{i}, y_{k}\right) \quad \forall y_{j} \in Y_{i}^{+}, \forall y_{k} \in Y_{i}^{-},\tag{1}\] where \(x_i\) and \(y_j\) represents positive pair while \(x_i\) and \(y_k\) is negative pair. Similarly, given a sentence \(y_{i^{\prime}}\): \[d\left(x_{j^{\prime}}, y_{i^{\prime}}\right)+m<d\left(x_{k^{\prime}}, y_{i^{\prime}}\right) \quad \forall f_{j^{\prime}} \in X_{i^{\prime}}^{+}, \forall x_{k^{\prime}} \in X_{i^{\prime}}^{-},\] where \(X_{i^{\prime}}^{+}\) and \(X_{i^{\prime}}^{-}\) represents the sets of positive and negative images for \(y_{i^{\prime}}\).

In addition, the loss function includes neighborhood constraints to project semantically similar images and sentences close to each other in the embedding space. Let \(N(x_i)\) represent the neighborhood of \(x_i\) with images that contains the same concept. In our scenario, it contains images represented by the set of sentences associated with \(x_i\) Furthermore, a margin \(m\) is enforced between \(N(x_i)\) and any point outside of the neighborhood:

\[\label{eq:n1} d\left(x_{i}, x_{j}\right)+m<d\left(x_{i}, x_{k}\right) \quad \forall x_{j} \in N\left(x_{i}\right), \forall x_{k} \notin N\left(x_{i}\right)\tag{2}\]

Similarly to Eq. 2 , the constraint is enforced for sentences: \[d\left(y_{i^{\prime}}, y_{j^{\prime}}\right)+m<d\left(y_{i^{\prime}}, y_{k^{\prime}}\right) \quad \forall y_{j^{\prime}} \in N\left(y_{i^{\prime}}\right), \forall y_{k^{\prime}} \notin N\left(y_{i^{\prime}}\right)\]

Finally, constraints are converted to the training objective using hinge loss. The resulting loss function is given by:

\[\begin{align} L(X, Y) &=\sum_{i, j, k} \max \left[0, m+d\left(x_{i}, y_{j}\right)-d\left(x_{i}, y_{k}\right)\right] \\ &+\lambda_{1} \sum_{i^{\prime}, j^{\prime}, k^{\prime}} \max \left[0, m+d\left(x_{j^{\prime}}, y_{i^{\prime}}\right)-d\left(x_{k^{\prime}}, y_{i^{\prime}}\right)\right] \\ &+\lambda_{2} \sum_{i, j, k} \max \left[0, m+d\left(x_{i}, x_{j}\right)-d\left(x_{i}, x_{k}\right)\right] \\ &+\lambda_{3} \sum_{i^{\prime}, j^{\prime}, k^{\prime}} \max \left[0, m+d\left(y_{i^{\prime}}, y_{j^{\prime}}\right)-d\left(y_{i^{\prime}}, y_{k^{\prime}}\right)\right]. \end{align}\]

The hyperparameter \(\lambda_{1}\) balances strengths of both ranking terms and the value is fixed to \(2\). Similarly, \(\lambda_{2}\) and \(\lambda_{3}\) controls the neighborhood constraint and values are set to \(0.1\) or \(0.2\) respectively [43]. The distance \(d\) is fixed to be the Euclidean distance. In addition, triplets are selected within the mini-batch only. To learn our joint embeddings, the network is trained in end-to-end fashion with large-scale datasets MSCOCO [12], Flickr30K [13], Conceptional Captions (ConcCapt)) [14], using captioning annotations to leverage the fine-grained datasets Caltech-UCSD-Birds (CUB) [44] and Oxford Flowers (FLO) [45].

2.3 Joint Embeddings for Zero-shot Learning↩︎

Once the joint embeddings \(x\) are extracted by means of the structure-preserving alignment loss, they are then fed to a second computational module which is responsible for the zero-shot learning task. In order to classify a pool of unseen classes \(c \in \mathcal{C}_U\), we take advantage of training data \((x_i,c_i), i = 1,\dots,N\) where the labels \(c_i\) belong to the seen classes (\(c_i \in \mathcal{C}_S)\) for every \(i\). In order to bridge the gap between seen and unseen classes, either of them need to be describes in terms of class-embeddings \(a = a_c\) such as manually defined attributes. The learning problem writes as minimizing the empirical risk defined through the following loss function \[\label{eq:generic-zsl} \sum_{i = 1}^N\mathcal{L}_{\rm ZSL}(x_i, a_{c_i}; \theta),\tag{3}\] which depends upon the learnable parameters \(\theta\). In turn, the parameters \(\theta\) can be optimized exploiting different strategies, using alternative expressions for \(\mathcal{L}_{\rm ZSL}\) in eq 3 . For methods based on a compatibility function, \(\mathcal{L}_{\rm ZSL}\) is chosen to be either a distance [25][28], scoring [29][31] or ranking function [32], [33]. The optimization attempts to match \(x_i\) and \(a_i\) when and only when they belongs to the same class. Additional regularization terms are used to make sure that the distance/scoring/ranking function \(\mathcal{L}_{\rm ZSL}\) can generalize towards unseen classes. In fact, when a new test instance \(\tilde{x}\) occurs, inference is solved as \[\label{eq:generic-inference} \arg \max_c F_{\rm ZSL}(\tilde{x},\theta),\tag{4}\] being \(F_{\rm ZSL}\) a 1-nearest neighbor classifier based on the learned compatibility function \(\mathcal{L}_{\rm ZSL}\). Alternatively, \(F_{\rm ZSL}\) can be chosen to be a softmax classifier trained on real joint embeddings from seen classes \(\mathcal{C}_S\) and synthesized features from the unseen classes \(\mathcal{C}_U\). For the feature synthesis, models such as generative adversarial networks [34], [46][49] or variational autoencoders [36], [38], [50], [51] are adopted to generate visual descriptors conditioned on the class-specific embeddings \(a_c\), \(c \in \mathcal{C}_U\).

3 Experiments↩︎

3.1 Data Sources↩︎

Datasets for Joint Embeddings. We trained joint image and text model on three publicly available datasets including MSCOCO [12], Flickr30K [13] and Conceptional Captions (ConcCapt) [14]. MSCOCO dataset contains 123,287 images, and each image is annotated with five text descriptions or captions. Similarly, Flickr30K contains 31,783 images along with five captions for each image. While, ConcCapt dataset consists of \(\sim\!\!3.3\) million image and text pairs collected from alt-text enabled images on the web. At time of access, some links are broken which resulted in \(\sim\!\!1.3\) million image and text pairs.

Datasets for Zero-shot Learning. We evaluate JE-ZSL on two fine-grained and two coarse-grained zero-shot object recognition data sources: CUB [44], FLO [45], Animals with Attributes (AWA\(2\)[52] and Attribute Pascal & Yahoo (aPY) [53] containing \(200\), \(102\), \(717\), \(50\) and \(32\) categories, respectively. For fair comparison, we followed the standard zero-shot splits proposed by Xian et al. [34].

3.2 Backbone ZSL Methods↩︎

We evaluate the performance of JE-ZSL when adopting the following backbone zero-shot learning methods: We select one of the most efficient methods based on a compatibility function [54], while also including two state-of-the-art approaches based on feature generation [3], [36]. Further details on these methods are provided below, including how we combined them with our joint embeddings.

Coupled Dictionary Learning [54] (CDL) is composed of the following stages. First, given the semantic embeddings of the classes to be recognized, visual prototypes are learnt by preserving neighborhood relationship across the visual and semantic spaces. This is obtained through a structure alignment module and implemented in the form of visual and semantic dictionaries which are then learnt and coupled. We take advantage of our jointly training embeddings for the sake of learning these dictionary-based representations.

f-CLSWGAN [3] is implemented as a Wasserstein GAN which attempts to generate visual features, which are similar to the ones available for seen classes, while also performing semantic-to-visual translation. To better enhance the discrimination capability of the learnt feature, a classification loss is used. Instead of standard ResNet\(-101\) descriptors, we take advantage of jointly training embedding as the real features, supervising the adversarial learning. Once features have been generated for the unseen classes, a softmax classifier is trained from real joint embeddings from the seen classes and synthesized features for the unseen ones. The trained softmax classifier is the model used for the final inference.

A recent generative approach, called tf-VAEGAN [36], improved upon [3] under multiple perspectives. First, the generation capability of a GAN are paired with a variational autoencoder and a cycle consistency loss is adopted, aiming at predicting attributes from synthesized features using a regression paradigm. We modify the original implementation by exploiting joint embeddings as either the real features from the seen classes and the input data for the approach regressing attributes. For the final inference stage, the concatenation of the generated visual features and regressed semantic embeddings are used to train the final softmax classifier. Joint embeddings are adopted also at this stage.

3.3 Implementation Details↩︎

We used listed hyperparameters to learn joint image and text embedding with a structure perserving alignment loss [43]. Similarly, we employed listed hyperparameters for zero-shot learning methods [2], [3], [54].
Baseline Visual and Semantic Embeddings. For visual embedding, we extract \(2048\)-dim top layer pooling units of ResNet\(-101\) [5]. For the semantic embeddings, we employ the class-level attributes for CUB (\(312-d\)), AWA (\(85-d\)) and aPY (\(64-d\)). For FLO, fine-grained visual descriptions of image with size (\(1024-d\)) are extracted from a character-based CNN-RNN [55].
Semantically Grounded Embeddings. The proposed embedding is extracted from joint image and text representation trained with structure preserving alignment loss. For fair comparison, we learn joint image and text representation with ResNet\(-101\) embeddings.
Evaluation Metrics. To evaluate the performance on standard zero-shot learning, we utilized the recommended top-1 classification accuracy over seen classes (T1). Similarly, we adopted common metrics for generalized zero-shot learning as well [1]: Mean per-class accuracy over seen and unseen classes \(s\) and \(u\), respectively, while reporting also their harmonic mean \(H\).

4 Joint Embeddings for Zero-Shot Learning: Ablation Study and the Fine-Grained case↩︎

In this section, we provide an experimental analysis to understand and evaluate the impact of two distinct factors influencing the performance of JE-ZSL. First, we present an ablation study with to monitor if there is an effect of varying the dimensionality of our proposed joint embeddings while training them using the structure-preserving alignment loss (presented in Section 2.2) on various image-text datasets. Then, we will evaluate the impact of using fine-grained captions leveraging fine-grained datasets.

Table 1: Joint Embeddings for zero-shot learning (JE-ZSL) - ablation study on the effect of the dimensionality. We mark in blue and bold any improvement scored by joint embeddings over the respective backbone zero-shot learning method used as baseline.
AWA\(2\) [56] aPY [57]
T1 \(u\) \(s\) \(H\) T1 \(u\) \(s\) \(H\)
Baseline \(\colon\) CDL [54] 69.9 28.1 73.5 40.6 43.0 19.8 48.6 28.1
\(d = 256\) 65.6 24.2 71.7 36.2 18.1 46.1 26.0
\(d = 512\) 67.1 26.2 39.0 19.4 47.3 27.5
\(d = 1024\) 69.2 27.1 39.8
JE-ZSL (ours) Flickr30K \(d = 2048\) 68.2 27.9
\(d = 256\) 68.1 27.1 69.3 39.0 45.1 18.6 48.6 26.9
\(d = 512\) 69.3
\(d = 1024\)
JE-ZSL (ours) MSCOCO \(d = 2048\) 27.8
\(d = 256\) 68.3 26.1 71.7 38.3 42.1 20.2 46.7 28.2
\(d = 512\) 69.9 28.1 73.5 40.7 43.3 21.8 49.2 30.2
\(d = 1024\) 69.3 28.1 77.1 41.2 44.8 22.8 50.4 31.4
JE-ZSL (ours) ConcCapt \(d = 2048\) 71.0 29.3 77.1 42.5 45.9 24.5 51.1 33.1
Baseline \(\colon\) f-CLSWGAN [3] 68.2 57.9 61.4 59.6 40.5 25.8 59.5 36.0
\(d = 256\) 67.0 55.4 58.2 56.8 38.6 28.1 18.0 22.0
\(d = 512\) 65.6 59.0 62.1 60.5 39.3 24.5 50.6 33.0
\(d = 1024\) 68.0 55.2 65.8 60.1 38.7 27.9 44.9 34.4
JE-ZSL (ours) Flickr30K \(d = 2048\) 65.0 55.8 67.6 61.1 37.6 23.4 63.2 34.1
\(d = 256\) 72.7 61.5 62.3 61.9 39.3 31.4 27.2 29.2
\(d = 512\) 70.7 63.4 64.0 63.8 41.7 26.5 48.5 34.3
\(d = 1024\) 70.4 62.8 63.8 63.3 38.0 25.7 49.9 34.0
JE-ZSL (ours) MSCOCO \(d = 2048\) 70.3 60.8 69.1 64.7 38.4 28.2 50.6 36.2
\(d = 256\) 68.5 59.0 65.0 61.9 39.0 24.4 29.2 26.6
\(d = 512\) 70.0 62.1 65.4 63.7 38.3 26.4 41.4 32.2
\(d = 1024\) 68.4 60.0 65.8 62.6 40.1 26.4 57.3 36.2
JE-ZSL (ours) ConcCapt \(d = 2048\) 67.0 61.2 61.5 61.3 41.0 27.4 67.3 39.0
Baseline \(\colon\) tf-VAEGAN [36] 72.2 59.8 75.1 66.6 40.8 30.8 54.6 39.3
\(d = 256\) 70.0 57.8 68.2 62.6 36.4 25.5 42.2 31.8
\(d = 512\) 67.4 57.3 73.8 64.5 38.9 26.8 50.9 35.0
\(d = 1024\) 69.9 63.1 71.5 67.0 41.4 29.2 53.0 37.6
JE-ZSL (ours) Flickr30K \(d = 2048\) 69.9 63.1 61.5 67.0 40.2 29.9 47.1 36.8
\(d = 256\) 70.5 56.9 73.4 64.0 43.2 30.0 62.3 40.4
\(d = 512\) 72.3 60.6 64.0 66.0 43.7 30.6 59.7 40.5
\(d = 1024\) 71.8 62.8 63.8 66.8 40.8 30.8 53.6 38.5
JE-ZSL (ours) MSCOCO \(d = 2048\) 76.3 62.3 78.3 69.4 41.8 27.3 70.6 39.4
\(d = 256\) 71.9 61.0 73.6 66.8 41.8 29.3 51.9 37.5
\(d = 512\) 69.4 58.8 71.2 64.4 39.6 29.8 52.5 38.0
\(d = 1024\) 68.1 59.0 71.8 64.8 40.3 31.9 54.7 40.3
JE-ZSL (ours) ConcCapt \(d = 2048\) 70.6 63.0 75.6 68.7 42.1 32.1 49.5 39.0

4.1 Effect of the Embedding Size↩︎

In Table 1, we evaluate the impact of various embedding sizes applied to JE-ZSL. We take advantage of state-of-the-art methods (CDL [54], f-CLSWGAN [3] and tf-VAEGAN [36]) on coarse-grained benchmark datasets: AWA\(2\) [56] and aPY [57]. These methods are fed with off-the-shelves conventional visual features, exploiting the standard ResNet\(-101\) embeddings as provided by [3]. We then compare the very same zero-shot learning approaches as a baseline references to evaluate the impact in performance of having visual embeddings trained in a joint manner with text information, taking advantage of the architecture presented in Section 2.1. For the joint training, we take advantage of Flickr30K [13], MSCOCO [12] and ConcCapt [14] and, in all cases, we extract joint embedding of dimensions \(d=256,512,1024\) and \(2048\) to compare them with baseline visual embeddings.

Figure 3: Joint embeddings for zero-shot learning (JE-ZSL) to handle fine-grained datasets.

Discussion. Table 1 shows the results in bold text font and color which are superior to the respective baseline values: It is evident that the joint training produces a widespread improvement on performance, being consistent with respect to different baseline approaches and multimodal datasets used. Notably, the idea of performing joint training for the embedding has the peculiar trait of ensuring a stable performance even at low embedding sizes. No matter which is the input embedding size, in fact, in a few cases, joint training with \(d=256\), \(d=512\), \(d=1024\) and \(d=2048\) is capable of improving upon the baseline methods in both standard zero-shot learning (T\(1\) on aPY for both Flickr30K and MSCOCO with respect to CDL zero-shot learn method, T\(1\) on AWA\(2\) for MSCOCO with respect to f-CLSWGAN) and generalized zero-shot learning as well (\(H\) for MSCOCO and ConcCapt with respect to f-CLSWGAN and \(H\) for MSCOCO with respect to tf-VAEGAN). This is especially remarkable if considering that baseline approaches exploit \(2048-\)dimensional visual embeddings: Even if using lower dimensional embeddings, there are only very few cases in which severe drops are registered (such as for \(d=256\) on Flickr30K with respect to f-CLSWGAN) and performance are often better. Overall, methods such as CDL are improved in their standard and generalized zero-shot recognition by \(+2.9\%\) (T1) and \(+5\%\) (\(H\)), respectively using ConcCapt and \(d=2048\). Similarly, using the very same setup, we register analogous improvements of \(+0.5\%\) for T\(1\) and \(+3.0\%\) for \(H\) (with respect to f-CLSWAGAN), while we enhance tf-VAEGAN by \(+4.1\%\) (T1) on standard zero-shot learning and \(+2.8\%\) (\(H\)) for generalized zero-shot learning using \(d=2048\) and MSCOCO. These results indicate that the joint training improve representation with visual and semantic cues which in turn eases zero-shot learning recognition task.

Table 2: Comparison of our proposed JE-ZSL against state-of-the-art methods based on either compatibility functions or feature generation. Improvements scored by JE-ZSL over each of this class of methods is highlighted in blue and bolded.
AWA\(2\) [56] CUB [9] FLO [58] aPY [57]
T1 \(u\) \(s\) \(H\) T1 \(u\) \(s\) \(H\) T1 \(u\) \(s\) \(H\) T1 \(u\) \(s\) \(H\)
LATEM [59] 55.1 7.3 71.7 13.3 49.6 15.2 57.3 24 40.4 6.6 47.6 11.5 36.8 5.7 65.6 10.4
SynC [60] 49.3 8.9 87.3 16.2 53.0 11.5 70.9 19.8 \(-\) \(-\) \(-\) \(-\) 23.9 7.4 66.3 13.3
SJE [61] 65.6 11.3 74.6 19.6 53.9 23.5 59.2 33.6 53.4 13.9 47.6 21.5 31.7 1.3 71.4 2.6
DeViSE [62] 54.2 13.4 68.7 22.4 52.0 23.8 53.0 32.8 45.9 9.9 44.2 16.2 37.0 3.5 78.4 6.7
KerZSL [63] 70.5 18.9 82.7 30.8 51.7 21.6 52.8 30.6 \(-\) \(-\) \(-\) \(-\) 45.3 10.5 76.2 18.5
CDL [54] 69.9 28.1 73.5 40.6 54.5 23.5 55.2 32.9 59.6 32.0 64.8 42.8 43.0 19.8 48.6 28.1
JE-ZSL (ours) 71.0 29.3 77.1 42.5 54.1 25.6 70.2 37.5 62.2 43.5 62.2 51.2 45.9 24.5 51.1 33.1
f-CLSWGAN [3] 68.2 57.9 61.4 59.6 57.3 43.7 57.7 49.7 67.2 59.0 73.8 65.6 40.5 25.8 59.5 36.0
Cycle-WGAN [40] 66.8 63.4 59.6 59.8 58.6 59.3 47.9 53.0 70.3 61.6 69.2 65.2 \(-\) \(-\) \(-\) \(-\)
f-VAEGAN-D2 [38] 71.1 57.6 70.6 63.5 61.0 48.4 60.1 53.6 67.7 56.8 74.9 64.6 \(-\) \(-\) \(-\) \(-\)
CADA-VAE [51] 68.2 55.8 75.0 63.9 57.3 51.6 53.5 52.4 \(-\) \(-\) \(-\) \(-\) \(-\) \(-\) \(-\) \(-\)
GDAN [48] 68.1 32.1 67.5 43.5 58.8 39.3 66.7 49.5 \(-\) \(-\) \(-\) \(-\) 38.3 30.4 75.0 43.4
COSMO [46] \(-\) 52.8 80.0 63.6 \(-\) 44.4 57.8 50.2 \(-\) 59.6 81.4 68.8 \(-\) \(-\) \(-\) \(-\)
PGN [49] 71.2 48.0 83.6 61.0 68.3 48.5 57.2 52.5 81.4 63.6 77.8 70.0 \(-\) \(-\) \(-\) \(-\)
0-VAEGAN [64] 69.9 56.2 71.7 63.0 54.9 41.1 48.5 44.4 \(-\) \(-\) \(-\) \(-\) 36.3 31.7 53.2 39.7
tf-VAEGAN [36] 72.2 59.8 75.1 66.6 64.9 52.8 64.7 58.1 70.8 62.5 84.1 71.7 40.8 30.8 54.6 39.3
JE-ZSL (ours) 70.6 63.0 75.6 68.7 70.2 60.0 60.7 60.3 75.6 67.6 84.7 75.1 42.1 32.1 49.5 39.0

4.2 Fine-grained Joint Embeddings↩︎

Fig. 3 shows the comparison of the setup \(d=2048\) with Flickr30K [13], MSCOCO [12], ConcCapt [14] and fine-grained datasets (CUB [9] and FLO [58]) for which captions annotating the images are available on seen classes. This helps us in understanding to which extent a joint training is capable of enhancing results, while disentangling it from the intrinsic difficulty of the dataset on which the ZSL evaluation is carried out. In fact, on CUB and FLO datasets, categories are fine-grained in nature (bird and flower species, respectively) and, therefore, much harder to classify - and we will evaluate joint embeddings also in this playground.
Discussion. Despite the fine-grained nature of the classes to recognize, dataset such as Flickr30K are enough to improve \(s\) and \(H\) metrics with respect to the baseline model CDL (on CUB). Joint embeddings trained using ConcCapt improve the metric \(s\) scored by CDL on FLO. Using MSCOCO, joint embeddings boost the performance of f-CLSWGAN (T1 on FLO) and tf-VAEGAN is improved as well (T1 on FLO) using either Flickr30K or MSCOCO. Thus, despite the challenging nature of fine-grained recognition task, still the idea of joint training provides subtle improvements.

These preliminary improvements are furthermore enhanced as soon as the fine-grained textual information is exploited on CUB and FLO: We improve CDL, f-CLSWGAN and tf-VAEGAN. More specifically, our proposed approach improves the T1 score of f-CLSWGAN on CUB (\(+7.9\)). On FLO dataset, CDL, f-CLSWGAN and tf-VAEGAN baseline methods are improved by \(+2.6\%\), \(+8.4\%\) and \(+4.8\%\) in their zero-shot learning performance (T1). Similar improvements are registered in GZSL: the \(H\) value by CDL is improved by \(+4.6\%\) on CUB and by \(+8.4\%\) on FLO. The \(H\) value by f-CLSWGAN is improved by \(+3.1\%\) on CUB and \(+8.4\%\) on FLO. Finally, tf-VAEGAN achieves an improvement of \(H\) on both CUB (\(+2.2\%\)) and FLO (\(+3.4\%\)). The scored performance improvements on CUB and FLO datasets demonstrate that fine-grained textual information enhances visual embeddings when paired with our proposed joint training.

5 Comparison with the State-of-the-Art↩︎

In this section, we test our proposed joint embeddings against state-of-the-art zero-shot learning methods based on two mainstream paradigms: Compatibility functions and feature generation.
Compatibility functions. Among the state-of-the-art approaches, we included the idea of generating a latent representation on which visual and semantic information is projected (LATEM [59]) and the generation of synthetic classifiers for the unseen classes as a linear combination of classifiers of the seen ones (SynC [60]). We also compare against structured embedding obtained by combining different sources of side information (SJE [61]) and the deep visual and semantic embedding model known as DeVISE [62]. We include the kernelized approach to learn a compatibility function in max-margin sense (KerZSL [63]) and the coupled dictionary learning approach to learn and then match a set of visual and semantic atoms with which images and side information can be described (CDL [54]).
Feature generating approaches. We consider several methods to generate visual features for the unseen classes, known in terms of attributes only. Namely, the Wasserstein GAN trained with a classifier loss (f-CLSWGAN [34]) and its variant in which a cycle-consistency loss is added to predict attributes from synthesized features. (Cycle-WGAN [47]). We compare against the usage of confidence smoothing (COSMO [46]) which, combined with a feature generation approach, helps in balancing the recognition performance across seen and unseen classes. A similar effect is achieved by the adoption of dual learning to train feature generation and attribute prediction synchronously (GDAN [48]). We also compared against the idea of scheduling the generation of synthetic feature by means of episodic training (PGN [49]). In addition, we consider methods in which the feature generation stage is enhanced by the adoption of a variational autoencoder to pair a GAN: 0-VAE-GAN [50], f-VAEGAN-D2 [65], CADA-VAE [51], and tf-VAEGAN [36].

Table 2 shows the results of this analysis. We fix the dimensionality of the embedding to \(d=2048\) that were used to boost CDL when challenging other compatibility functions. When comparing against tf-VAEGAN, performance is enhanced with joint embedding while comparing against other feature generating approaches. The fine-grained setup (see Section 4.2) was used when handling both CUB and FLO datasets, while using Conceptual Captions for the joint training on AWA\(2\) and aPY.
Discussion. With our proposed semantically grounded embeddings, the performance previously scored by compatibility functions is considerably improved. We observed performance boosts with respect to the metric u over all datasets (AWA\(2\), CUB, FLO and aPY) along with s on FLO dataset. Additionally, on AWA\(2\), the best performance on zero-shot learning (KerZSL) is improved by \(+0.5\%\) and the \(H\) of the best scoring method on generalized zero-shot learning (CDL) is boosted by \(+1.9\%\). Similarly, the \(H\) metric is enhanced for generalized zero-shot learning on CUB (\(+5.9\%\) with respect to SJE) on FLO (\(+8.4\%\) with respect to CDL) and on aPY (\(+5\%\) with respect to CDL). The best scored T1 classification accuracy of prior methods is improved on FLO (\(+2.6\%\) with respect to CDL) and on aPY (\(+0.6\%\) with respect to KerZSL). While considering feature generating approaches, our proposed embedding boosts the \(H\) score on both AWA\(2\) and CUB (\(+2.1\%\) and \(+2.2\%\), respectively - both with respect to tf-VAEGAN). On aPY, we also improve f-CLSWGAN in the T1 score for ZSL (\(+1.6\%\)).

6 Conclusions↩︎

This paper presents joint embeddings for zero-shot learning tasks. Unlike existing methods which utilize fixed visual and semantic information, we proposed to learn semantically grounded visual embedding by capturing interactions between images and text clues with a two-stream network on a proxy task leveraging large-scale unlabelled data sources. We evaluated our embeddings with various state-of-the-art methods on two fine-grained (CUB and FLO) and two coarse-grained (AWA\(2\) and aPY) benchmark zero-shot learning datasets. Our evaluation showed that our proposed embeddings considerably improved standard and generalised zero-shot learning performance across various compatibility functions and GAN-based methods.

References↩︎

[1]
.
[2]
.
[3]
pp. 5542–5551, 2018.
[4]
pp. 7140–7148, 2017.
[5]
pp. 770–778, 2016.
[6]
.
[7]
.
[8]
pp. 3111–3119, 2013.
[9]
.
[10]
.
[11]
pp. 13–23, 2019.
[12]
pp. 740–755. Springer, 2014.
[13]
pp. 2641–2649, 2015.
[14]
vol. 1: Long Papers), pp. 2556–2565, 2018.
[15]
of computer vision , 123(1):32–73, 2017.
[16]
.
[17]
.
[18]
.
[19]
.
[20]
pp. 0–0, 2019.
[21]
pp. 36–41. IEEE, 2017.
[22]
.
[23]
pp. 2425–2433, 2015.
[24]
.
[25]
.
[26]
.
[27]
.
[28]
pp. 7670–7679, 2018.
[29]
.
[30]
.
[31]
.
[32]
of Computer Vision (IJCV) , 2019.
[33]
pp. 8360–8367, 2019.
[34]
.
[35]
.
[36]
.
[37]
.
[38]
.
[39]
.
[40]
.
[41]
pp. 10333–10342, 2019.
[42]
.
[43]
pp. 5005–5013, 2016.
[44]
.
[45]
no. of classes. In 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, pp. 722–729. IEEE, 2008.
[46]
.
[47]
.
[48]
.
[49]
.
[50]
.
[51]
.
[52]
.
[53]
pp. 1778–1785. IEEE, 2009.
[54]
.
[55]
pp. 49–58, 2016.
[56]
.
[57]
.
[58]
.
[59]
.
[60]
.
[61]
.
[62]
.
[63]
.
[64]
.
[65]
.

  1. *Equal contribution↩︎

  2. \(\dagger\) Current Affiliation: Deutsches Elektronen-Synchrotron (DESY)↩︎

  3. Email: shah.nawaz@desy.de↩︎