{'fraction_non_alphanumeric': 0.03975954439991563, 'fraction_numerical': 0.013868382197848556, 'mean_word_length': 4.569750367107195, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Zero-Shot Learning with Multi-Battery Factor Analysis

Zero-shot learning (ZSL) extends the conventional image classification technique to a more challenging situation where the test image categories are not seen in the training samples. Most studies on ZSL utilize side information such as attributes or word vectors to bridge the relations between the seen classes and the unseen classes. However, existing approaches on ZSL typically exploit a shared space for each type of side information independently, which cannot make full use of the complementary knowledge of different types of side information. To this end, this paper presents an MBFA-ZSL approach to embed different types of side information as well as the visual feature into one shared space. Specifically, we first develop an algorithm named Multi-Battery Factor Analysis (MBFA) to build a unified semantic space, and then employ multiple types of side information in it to achieve the ZSL. The close-form solution makes MBFA-ZSL simple to implement and efficient to run on large datasets. Extensive experiments on the popular AwA, CUB, and SUN datasets show its significant superiority over the state-of-the-art approaches.


Introduction and Related Work
Zero-shot learning (ZSL) aims at solving the problem when the new test image categories are not seen in the training samples [1]. Different from the open set recognition and novelty detection which only distinguish abnormalities in the testing data, ZSL seeks to classify the unseen testing classes [2]. This is a practical problem setting in image classification, as there are thousands of categories of objects we intend to recognize, but only a few of them may have been appropriately annotated. Consequently, it is more challenging than the conventional image classification problems. The key ideas of ZSL are to choose better side information (also known as modalities) and to develop an effective common semantic space. The side information provides a bridge to transfer knowledge from the seen classes for which we have training data to the unseen classes for which we do not, and the common space offers a fusion feasibility for the visual features and the side information.
Two types of commonly used side information in ZSL are attributes [3,4,5,6] and word vectors [7], [8]. Particularly, attributes act as intermediate representations shared across multiple classes, indicating the presence or absence of several predefined properties. Direct attribute prediction (DAP) [3] is one of the first efforts to exploit the attributes to ZSL. It learns attribute-specific classifiers with the seen data and infers the unseen class with the learned estimators. However, attribute-based approaches suffer from a poor scalability as the attributes ontology for each class is generally manually defined. Word-vector-based approaches [9,10,11,12] avoid this limitation since word vectors are extracted from a linguistic corpus with neural language models such as GolVe [7] and Word2Vec [8]. Therefore, word vectors have become another popular side information in ZSL. For instance, Socher et al. [10] construct a two layer neural network to project images into the word vector space. In [12], Frome et al. present a deep visual-semantic embedding model with a hinge loss function, which trains a linear mapping to link the image visual space to the word vector space.
Besides attributes and word vectors, some other side information, such as WordNet [13], visual prototypical concepts [14], class co-occurrence statistics [15], is also applied in ZSL. Further, since different types of side information captures different aspects of the structure of the semantic space, several studies have been made to combine them to achieve higher classification performance [13], [16], [17]. For example, in [13], Akata et al. first learn the joint embedding weight matrices corresponding to different types of side information, then perform a grid search over the coefficients on a validation set to get the joint compatibility model. In [16], semantic projections are trained for attributes and word vectors independently, followed by a transductive multi-view semantic embedding space to alleviate the projection domain shift problem. These efforts demonstrate that different types of side information complement each other and construct a better embedding space for knowledge transfer. However, although multiple types of side information are utilized, they still exploit each type of side information in its own semantic space independently, and then just combine the predicted scores together [13], [16]. This cannot make full use of the complementary knowledge of different types of side information. A more efficient and robust solution is to investigate multiple types of side information in a unified space. Unfortunately, to the best of our knowledge, there has been little previous work exploiting this idea. To this end, we present a novel approach called MBFA-ZSL to employ multiple types of side information in a unified space, as shown in Fig. 1.
It is worth highlighting several aspects of the proposed MBFA-ZSL approach. (1) It develops an advanced multi-view embedding algorithm named Multi-Battery Factor Analysis (MBFA), which extends Tucker's Inter-Battery Factor Analysis (IBFA) [18]. (2) As far as we know, it represents one of the first attempts that embeds both the image visual features and multiple types of side information into one unified semantic space, which fully utilizes the interrela-   tions among different types of information.
(3) The close-form solution makes it simple to implement and efficient to run on large datasets. (4) Extensive experiments on popular datasets demonstrate its significant superiority over the existing state-of-the-art approaches. The reminder of this paper is structured as follows. Section 2 introduces the proposed Multi-Battery Factor Analysis (MBFA) algorithm, and Section 3 describes the proposed MBFA-ZSL approach in detail. Experimental results are presented in Section 4, and conclusions are drawn in the final section.

Multi-Battery Factor Analysis
Multi-Battery Factor Analysis (MBFA) is developed to provide a unified semantic space for both the visual features and multiple types of side information. It originates from Tucker's Inter-Battery Factor Analysis (IBFA) [18], which transforms two modalities into a shared space where they are not only well explained but also as much correlated as possible with each other. Thus, we first briefly introduce the IBFA algorithm, and then extend it to a multi-view version, i.e., MBFA.
Given a set of N instances from two modalities, where p 1 and p 2 are their dimensionalities, respectively. With X 1 , X 2 centered, IBFA finds two projection matrices, W 1 and W 2 , by the following constrained maximization: where I is an identity matrix. IBFA maximizes the total covariance between the two modalities, which can be seen plainly by rewriting tr With the Lagrange multiplier method, (1) can be solved analytically through the eigenvalue decomposition.
Compared with Canonical Correlation Analysis (CCA) [19], (1) can be rewritten as: where corr(a, b) denotes the Pearson correlation, and var(a) = a T a is the variance. It can be seen from (2) that IBFA attempts to capture both the correlation and variation of X 1 and X 2 . This is different from CCA that only aims at maximizing their correlation. In particular, the maximized correlation and variance in (2) depict the relationship between X 1 and X 2 and strengthen their own discriminant capabilities, respectively.
To broaden IBFA to a multi-view scenario, we develop the MBFA algorithm on the basis of IBFA. Given a set of N instances from c modalities, . . , c, where p i denotes the dimensionality, with X i centered, the objective function of MBFA is expressed as: Similar to IBFA, MBFA tries to find a set of projection matrices that maximize the total covariance in the common space. Equation (3) can be rewritten as: where W and M are as follows: Equation (4) can be solved via the eigenvalue decomposition; thus each projection matrix W i can be obtained. It is obvious that IBFA can be considered as a special case of MBFA when c is 2.
In addition, the main difference between MBFA and Multi-view Canonical Correlation Analysis (MCCA) [20], [21] is worth highlighting. Both of them find a set of linear transformations to project multiple modalities into one common space. However, MCCA seeks to maximize the total correlation in the common space, whereas MBFA maximizes the total covariance, which is equivalent to maximize the total correlation and variance simultaneously. To the best of our knowledge, there is no previous work using MCCA on ZSL. In this paper, we also implement MCCA on ZSL as a comparative approach (we call this approach as MCCA-ZSL).

Zero-Shot Learning with MBFA
In a ZSL setting, we are given N s labeled training instances S = {X, Y k , z} and N u unlabeled testing instances U = { X, Y k , z}. X ∈ R p×Ns and X ∈ R p×Nu are the p-dimensional visual feature vectors of training and testing instances respectively. z and z are the seen and unseen class label vectors, and z ∩ z = ∅. We have K different types of side information, Y k ∈ R q k ×Ns and Y k ∈ R q k ×Nu denote the k-th type of q k -dimensional side information for training and testing datasets respectively. Note that for the testing dataset, Y k is missing as testing instances are unlabeled. The task of ZSL is to predict the class labels z.
The proposed MBFA-ZSL algorithm mainly contains the following two steps: Step 1: Build a MBFA space with the seen data. The MBFA algorithm provides an unified semantic space Z for different types of side information as well as the visual features. With the seen images together with the side information, we can train the MBFA model to obtain a set of projection matrices W i (i = 1, . . . , c), where c is the sum of all the types of side information and the visual features, such that c = K + 1. For example, if we use both attributes and word vectors as the side information, then c is 3.
Step 2: Unseen category Inference. With the projection matrix W 1 learned from the seen data, the unseen image features x j ∈ X can be embedded into the common space Z by θ( x j ) = W T 1 x j . Typically, the unseen category of x j can be inferred by searching for the nearest output embedding vector that corresponds to one of the unseen classes, if there is only single side information available in Z. Since there are multiple types of side information used in the MBFA-ZSL approach, we introduce a multi-modality fusion method to predict the unseen category of the x j with: where α k is a weight associated with each type of side information, which can be determined by a grid search on the validation set. Each type of side information that corresponds to the l-th unseen class is denoted as y k l , and it can be embedded into the common space Z by ϕ k ( y k l ) = W T k+1 y k l . The similarity between two vectors can be represented as the common distance measurements, such as dot product similarity and Euclidean distance. In this paper, the cosine distance is utilized, i.e., sim(a, b) = a T b/( a · b ) Moreover, MBFA-ZSL has an explicit, close-form solution, which makes it simple to implement and efficient to run on large datasets. Algorithm 1 outlines the procedures of the proposed MBFA-ZSL approach.

Datasets and Settings
We evaluate the proposed MBFA-ZSL approach on three publicly popular datasets: Animals with Attributes (AwA) [3], Caltech-UCSD-Birds-200-2011 (CUB) [22], and SUN Attribute [23]. Specifically, AwA is a collection of 30,475 images on 50 classes of animals, with 85 associated class-level attributes. We use the standard training/test (seen/unseen) split as that in [3], which chooses 40 classes for training and validation and 10 classes for testing. CUB provides 200 classes of birds (11,788 images), and each class is annotated with 312 attributes. Particularly, CUB is a much more challenging dataset in that it is designed for fine-grained image classification and contains more classes but fewer images.

Algorithm 1 MBFA-ZSL approach
Input: A labeled seen data set S = {X, Y k , z}, an unlabeled unseen data set U = { X, Y k , z}, and the dimensionality d of the unified embedding space. Output: Labels of the unseen data U.
1: Construct the covariance matrix M with the labeled visual features X and the corresponding side information Y k . 2: Solve the eigenvalue decomposition problem in (4), and the eigenvectors corresponding to the largest d eigenvalues form the projection matrices W. 3: Learn the weight parameters of the category inference function (7) in the validation set. 4: Project the unseen visual feature X and the side information of the unseen classes into the unified space with projection matrices W. 5: Predict the labels of U with (7).
Similar to [13], we use 150 classes as training and validation set, leaving 50 disjoint classes as test set. SUN Attribute dataset consists of 14,340 images from 717 scene categories, and each category is annotated with a taxonomy of 102 discriminate attributes. We adopt the popular training/test (seen/unseen) split as that in [24], which selects 707 classes for training and validation, and takes the remaining 10 classes as testing set. We cross-validate the parameters α k in (7). The example images in these datasets are shown in Fig. 2.
On the AwA dataset, we use the VGG (very deep 19-layer CNN) features provided in [25] as visual features. On the CUB and SUN dataset, we use a pre-trained VGG model to extract visual features [26]. For each image, the 4,096 dimensional top-layer hidden unit activations (fc7) of VGG are taken as visual features.
We use both the word vectors (T) and attributes (A) as the side information in MBFA-ZSL. Specifically, we train the Word2Vec model [8] on a corpus of Wikipedia documents to form 1000-D word vectors for the three datasets. Meanwhile, we use the attribute information provided by the datasets. The average per-class top-1 accuracy on the test sets is reported.
The performance of MBFA-ZSL are taken via ten times of cross validation. It should be noticed that when only T or A is avaliable, the single parame-  ter α k in (7) does not need to be tuned, thus there is no standard deviation for the corresponding results. Furthermore, the standard deviations of some comparative results are absent as they are not avaliable in the original papers.
The comparative results are summarized in Table 1, from which we can observe that MBFA-ZSL achieves the amazingly best performance in all cases for all the three datasets. Besides, we also have the following observations: (1) For AwA dataset, the second-best approaches are MCCA-ZSL, SSE-ReLU, and MCCA-ZSL in the cases of T, A, and T+A, respectively. MBFA-ZSL outperforms them in 6.7%, 1.5%, and 4.6%, respectively. For CUB dataset, MBFA-ZSL outperforms the second-best approaches, MCCA-ZSL in 0.3%, ESZSL in 0.9%, and SJE in 1.2% in the three cases, respectively. For SUN dataset, in the three cases, MBFA-ZSL outperforms the second-best approaches, MCCA-ZSL in 2.0%, ESZSL in 0.5%, and MCCA-ZSL in 2.3%, respectively. These are very promising results.
(2) For MBFA-ZSL, the performance on AwA in T+A is better than those in T and A in 7.4% and 2.1%, respectively. On CUB, the performance in T+A is better than those in T and A in 19.8% and 0.5%, respectively. On SUN, the promotions are 25.9% and 2.4%, respectively. Similar observation can also be found in MCCA-ZSL. The excellent performance in T+A of MBFA-ZSL and MCCA-ZSL demonstrates that it is effective to embed multiple types of side information into a unified space. It also confirms that different types of side information complement each other in transferring knowledge.
(3) In the situation of "T+A", it can be found that MBFA-ZSL outperforms the others significantly. Take the AwA for example, the performance improvements of MBFA-ZSL over SJE, AMP and TMV-HLP are 6.4%, 13.9%, and 6.4%, respectively. This demonstrates that embedding the visual features and multiple types of side information in a unified space is more promising than the conventional methods that projecting the visual features to each type of side information space independently at first, and then combining them together.
(4) When only single type of side information is available, attributes often help achieve a higher accuracy than word vectors. This is due to that attributes are manually defined for a specific dataset, so they are able to describe category relationship of the dataset more effectively; nevertheless, word vectors are extracted from the corpus in an unsupervised manner, whose capacity is con-strained by the size or specific domain of the corpus, as well as the polysemy issue.
(5) Interestingly, the performance on CUB is inferior to that on AwA and SUN. The reason may lie in the fine-grained characteristic of CUB. Both the visual appearance and the class names in it are similar to each other, which make it hard to recognize.
To clearly evaluate the performance of MBFA-ZSL on each class, we present the confusion matrix of AwA with T+A, as illustrated in Fig. 3. The diagonal elements denotes the correct prediction accuracy of each class, from which we can see that the proposed MBFA-ZSL can achieve relatively high performance on every class.

Parameter Sensitivity
There are two types of parameters in MBFA-ZSL: the weights α k in (7) and the dimensionality d of the unified space that multiple modalities are projected into. The weights are decided by the cross validation. The impact of dimensionalities d is shown in Fig. 4. The optimal dimensionalities for AwA, CUB, and SUN are 40, 50, and 120, respectively. It can be observed that a higher dimensionality has no performance improvement.

Speed Evaluation
Finally, as shown in Table 2, we report the running times of the training and testing stages for AwA, CUB, and SUN, respectively. Our implementation is based on an unoptimized Matlab code. On our computer with i5 4590 CPU and 12G memory, the training times for the three datasets are 18.8s, 22.2s, and 17.4s, respectively. The test times on each image for the three datasets  are 0.006ms, 0.010ms, and 0.019ms, respectively. Therefore, MBFA-ZSL is extremely efficient.

Conclusions
In this paper, we have proposed the MBFA-ZSL approach to projecting both the visual features and multiple types of side information into one unified semantic space to perform ZSL. It can also be applied to the situation where only a single type of side information is available. The results on the three popular datasets show its superior performance over the state-of-the-art approaches on the cases of utilizing A (attributes), T (word vectors), and A+T (attributes + word vectors) as an effective and efficient method. Moreover, it has a close-form solution.