# Hybrid Relative Attributes Based on Sparse Coding for Zero-Shot Image Classification

Authors: Nannan Lu; Yanjing Sun; Xiao Yun
Journal: Mathematical Problems in Engineering
 (2019)

---

## Abstract

As a specific case of image recognition, zero-shot image classification is difficult to solve since its training set cannot cover all the categories of the testing set. From the view point of human vision recognition, the objects can be recognized through the visible and nameable description to the properties. To be the semantic description of the object property, attributes can be taken as a bridge between the seen and unseen categories, which are capable of using into zero-shot image classification. There are mainly binary attributes and relative attributes for zero-shot classification, where the relative attributes have the ability to catch more general sematic relationship than the binary ones. But relative attributes do not always work in zero-shot classification for those categories having similar relative strength attributes. Aiming at solving the defect of the relative attributes in describing the similar categories, we propose to construct the Hybrid Relative Attributes based on Sparse Coding (SC-HRA). First, sparse coding is implemented on low-level features to get nonsemantic relative attributes, which are the necessary complement to the existing relative attributes. After that, they are integrated with the relative attributes to form the hybrid relative attributes (HRA). HRA ranking functions are then learned by the relative attribute learning. Finally, the class label is obtained according to the predicted ranking results of HRA and the ranking relations of HRA among the categories. To verify the effectiveness of SC-HRA, the extensive experiments are conducted on the datasets of faces and natural scenes. The results show that SC-HRA acquires the higher classification accuracy and AUC value.


---

## Body

## 1. Introduction

Image recognition has attracted the attention of many researchers and made a lot of progress in recent years. In general, the methods applied to image recognition problems include supervised learning, semisupervised learning and unsupervised learning. However, due to the high cost of the procedure of labeling images, it is not enough to cover all the categories to discriminate merely by the labeled images. Also no labeled image can be obtained. Zero-shot image classification is therefore proposed to solve the problem where the unseen categories of the training set exist in the testing set. To solve zero-shot classification problems, traditional image recognition approaches build the relations between low-level features and object category labels. However, the recent approaches prefer to use semantic attributes.As it is well known, attribute [1] is the property that can be described by semantics or tagged by persons (e.g., with wings, black hair). Thus, attribute and feature are used to describe image contents from different levels. In low-level description of the image content, feature can be recognized by machines but cannot be understood by humans. However, attribute is the high-level description of the image content which can be understood by humans as well as machines. This is because attribute learning has shown excellent characteristic in describing objects, usability in face recognition [2], image retrieval [3, 4], image description [5, 6], and image classification [7, 8]. An object usually has various properties. For example, the hawks have wings, Asians have black hair, the road is open, and high-heeled shoes have high heel, etc. Through these attributes, people can recognize the objects’ appearance and describe them in a semantic way. Besides, different categories may have the same attributes which can be regarded as the middle level description of objects in the classifier to be shared between different categories. In this way, the known knowledge can be transferred from one category to other new categories to make classifiers identify the categories even without any training samples.The relative attribute [9], also named semantic relative attribute, indicates the attribute strength in an image compared to that in other image. The range of relative attribute is -∞,+∞, while the absolute value of it has no meaning because of its comparability between different categories. In such a way, relative attribute has many visual applications to help visual tasks understand the image contents as humans prefer to understand objects in the comparative way. Compared to the binary attribute, relative attribute has a richer language description for objective contents. Therefore, relative attribute has a strong ability in image description and human-computer interaction, which can effectively bridge the semantic gap between the low-level image feature and the high-level semantic feature.Owing to the advantage of comparative description ability, relative attributes are used to zero-shot image classification [10–13]. Parikh et al. [9] demonstrated that the relative attribute learning could acquire higher classification accuracy in zero-shot image classification than the binary attributes. In relative attributes-based zero-shot classification, the relative strengths of the attributes are considered, which comparatively describe the samples in attributes like “greater than”, “less than”, or “equal to”. By this way, the sample has distinguishable location in the attribute space, and the class label of the sample can be further determined. However, for those categories whose attributes have similar relative strengths (that is the attribute locations are close to each other in the attribute space), it is difficult to distinguish them only by the relative attributes. To solve this problem, a hybrid relative attribute model is constructed using sparse coding. Firstly, the model utilizes sparse coding to reconstruct the low-level feature of the image [14] and then obtain the low dimensional and compact representation of the image. Furthermore, the relative relations among the reconstructed features are regarded as a new kind of relative attributes. Due to its no semantic character, the reconstructed feature is named as nonsemantic relative attribute, which can be taken as the complement of the relative attributes and further increase the distinguishability of the relative attributes. Therefore, it is easy to distinguish the categories with the attributes having the similar relative relation strengths [15]. Finally, the constructed hybrid relative attributes are used to improve the performance of zero-shot image classification.The rest of the paper is organized as follows. The related works are reviewed in Section2. Section 3 describes the hybrid relative attribute learned by sparse coding in detail. In Section 4, the experiments are implemented on the zero-shot image classification. Finally, the conclusion is given in Section 5.


## 2. Related Works

Among the image recognition problems, zero-shot classification is comparably difficult to deal with. As training set and testing set have different label space, some researchers considered it as a special case of transfer learning [16] and then find the sharable low-level feature subspace by minimizing the discrimination between training set and testing set. On the other aspect, images naturally have rich linguistic meaning. For the cases without labeled training samples, the visual attributes bridge the gap between low-level features and labels. Attribute learning has excellent performance on object description [12] and knowledge transfer [17], which can be successfully applied to zero-shot image classification.Attribute learning mainly contains binary attribute learning and relative attribute learning. The binary attribute learning focuses on those attributes with Boolean values 0 and 1. 0 denotes the absence of the attribute in an object, whereas 1 means the existence of the attribute in the object. Commonly, support vector machine [18] is used to train the binary classifier. For the images with plural attributes, the binary classifier is trained on the extracted low-level feature for each attribute, where the binary attributes could assist the classifier to semantically understand image contents. However, humans always learn about the objects in a relative way. For example, Karen and Mark are smiling and Karen is smiling more than Mark, which covey different information. Therefore, even a simple relative statement about an attribute could convey distinguishable meaning and abundant information of the image content [19]. Generally, the relative attribute mainly focuses on comparatively describing images through the relative strengths of the attribute in different samples [9]. The relative attribute has been used to search images using the feedback mechanism. Once the image search started, the relevance function was updated, and the image pool was reranked based on the accumulated constraints [20]. Moreover, the attribute feedback was used in active learning, which further prompted its classification ability [21]. Sandeep et al. [22] proposed the local parts instead of global description to jointly represent pairs of images. The part was a block around the detected point by the domain specific method. Taking “smiling” as an example, the area of mouth should be located as the significant part with important information to distinguish images since it is highly correlated with image categories. But for “eyes-open”, the best local part is definitely different from “smiling”. However, neither binary attributes nor relative attributes make sense all the time. Thus, they could be used together to learn the relationship between attributes and the statements in a more natural way [19].In general, the relative attributes can describe the objects more naturally, which conform to human language. In the case of the attributes having similar relative strengths, the relative attribute learning does not work. Inspired by the landmark point of local part, it is feasible to implement sparse coding on the low-level feature to acquire more important information as the nonsemantic attributes for the zero-shot image classification. Therefore, we propose the hybrid relative attribute model to get the compact representation of images. Combining the semantic and nonsemantic attributes, the zero-shot classification is prompted to get the higher performance.


## 3. SC-HRA Model Based Zero-Shot Image Classification

SC-HRA model for zero-shot image classification is mainly divided into IV stages. Stage I is to construct the hybrid relative attributes. The nonsemantic attributes of training and testing samples are obtained by sparse coding based on the training and testing samples, respectively. And the relationship between the nonsemantic relative attribute and the class label is obtained simultaneously. Then the semantic relative attributes and the nonsemantic relative attributes are integrated as the hybrid relative attributes. Stage II is to learn the ranking function for each hybrid relative attribute. We use the ranking SVM to train the ordered pairs of the attributes as well as the unordered pairs of the attributes. Thus, each hybrid relative attribute has its own ranking function. Stage III is to build the Gaussian class model. For the training category, the ranking functions learned by stage II are used to build the Gaussian class model. But, for the testing category, the Gaussian class model is built by the relationship between the hybrid relative attributes of the training category and those of the testing category. Then, in terms of the established Gaussian class models, all categories can be located in the attribute space, which assist to distinguish the relative strength of the attributes in different categories. In Stage IV, the zero-shot image classification is implemented. The hybrid relative attributes of the testing samples are predicted by the attribute ranking functions of stage II. Then, Maximum Likelihood Estimation (MLE) is used to calculate the similarity between the hybrid relative attributes of the testing samples and the Gaussian models of each category to predict the class label of the testing sample.In order to implement SC-HRA model based zero-shot image classification, the key points of the above five stages are to construct the hybrid relative attributes by learning the nonsemantic relative attributes and learn the ranking functions for hybrid relative attributes. The detailed realization is described in this section.


### 3.1. Hybrid Relative Attributes

In this section, we take the Outdoor Scene Recognition (OSR) [23] dataset as an example to explain the construction of the hybrid relative attribute. As shown in Figure 1, five semantic relative attributes r1,r2,r3,r4,r5∈R are given to describe 3 categories, which are “Tall building”, “Street”, and “Coast”. “Tall building” and “Street” have similar ranks on all the semantic relative attributes except the attribute “Perspective”. So the generative model [9] of “Tall building” built on the semantic attributes is extremely similar to that of “Street”. Therefore, when the generative model is used to classify the zero-shot images, it is difficult to distinguish “Tall building” and “Street” by the classifier only depending on the semantic relative attributes. But for the category “Coast”, the semantic relative attributes are far different from those describing “Tall building” and “Street”. Thereby, the generative model of “Coast” is obviously distinguished from those of “Tall building” and “Street”. Naturally, it is easy for the classifier to identify “Coast” from “Tall building” and “Street”. Therefore, considering the limitation of the semantic relative attributes, the nonsemantic relative attributes e1,e2,e3∈E acquired by sparse coding are taken as the supplement of the semantic attributes to construct the hybrid relative attributes H=R;E, which aim at classifying those categories with high similarity. On the other hand, the auxiliary nonsemantic relative attributes cannot mislead the classifier which has obtained the correct results by the semantic relative attributes, such as “Coast”.Figure 1
The hybrid relative attribute.


### 3.2. Nonsemantic Relative Attribute Learning Based on Sparse Coding

The main idea of the nonsemantic attribute learning by sparse encoding is described in this part. At first, the features of the unlabeled training samples are used to learn a set of basis vectors. After, the features of all the training samples can be linearly represented by the learned basis vector set. Besides, the features of the testing samples can also be encoded by the learned basis vectors.X = x 1 , x 2 , … , x K ∈ R d × K is a set of input vectors, where xiΤ∈R1×d, i=1,2,…,K denotes the ith input vector and d is its dimensions. Basis vectors Φ=φ1,φ2,…,φN are learned by sparse coding, which are used to reconstruct the initial input features Xi~≈∑j=1Nejφj later. ej is the activation value, which is named as the nonsemantic attribute in this paper. Generally, sparse coding has two steps: training and coding.In the training stage, a set of basis vectors are generated using the training samples. Then, the linear combination of the set of basis vectors is used to express input vectors. Thus, the generation of the basis vectors can be regarded as an optimization problem, which can be described by the following objective function [24]:(1)minφ,e∑i=1Kxi-∑j=1Nei,jφj2+λ∑i=1K∑j=1Nei,js.t.φj2≤c,∀j=1,2,…,Nwhere ei,j is thejth sparse coding representation of the training sample xi. λ denotes the weight attenuation coefficient. eij can be taken as a sparse regularization term, which potentially obliges the constraint function to have the unique solution and ensures the distinct features to represent it. By solving the optimization problem in (1), we can obtain the activation value ei,j and the basis vector φj of the input feature vector xi. When ei,j and φj vary simultaneously, the objective function is not always the convex optimization problem, whereas, with the basis vector φj fixed, it turns to be the convex optimization problem about the activation value ei,j. If ei,j is fixed, it becomes the convex optimization problem about the basis vector φj. Therefore, it is feasible to implement the sparse coding as the alternately iterative optimization problem, which can fix one variable to get the solution of the other variable [25, 26]. Each iteration has two steps. The first step is to fix the basis vector φ and adjust the activation value e to minimize (1). The second step is to fix the activation value e and adjust the basis vector φ to minimize the objective constraint function. Till it is converged, the set of basis vectors can be obtained.The coding stage is to calculate the sparse representation of a new sample. As the basis vectorφ has been obtained in the training stage, in order to obtain the sparse representation of the new sample, it is just needed to adjust the activation value ei,j to minimize (2). Hence, the activation vector e1,e2,…,eN is the sparse representation of the sample, which is the nonsemantic relative attributes as well.(2)mine∑i=1Kxi-∑j=1Nei,jφj2+λ∑i=1K∑j=1Nei,jAfter that, the relative relations ofN nonsemantic attributes among the different samples are determined by comparing the nonsemantic relative attributes e=e1,e2,…,eN between the different samples. Algorithm 1 shows the specific procedure to obtain the nonsemantic relative attributes by sparse coding.Algorithm 1:Nonsemantic relative attribute learning based on sparse coding.
Input: the low level features x of the training samples and the testing samples, the weight attenuation coefficient λ. Output: the non-semantic relative attributes e of the training samples and the testing samples. ( 1 ) Step 1: bring the low level features x of the training samples into Equation (1), and initialize the basis vector φ; ( 2 ) Repeat; ( 3 )  Fix the basis vector φ in the last step, update the activation value e to minimize Equation (1). ( 4 )  Fix the activation value e in the last step, update the basis vector φ to minimize Equation (1). ( 5 )  Repeat the above procedure till convergence is reached, obtain the basis vector φ to represent the sample features well. ( 6 ) Step 2: bring the basis vector φ and the low level feature x of the testing samples into Equation (2). ( 7 ) Step 3: adjust the activation value to minimize Equation (2), the adjusted activation value e is the non-semantic relative attributes of the testing sample.


### 3.3. Ranking Function Learning Based on Hybrid Relative Attributes

The ranking functions are learned based on the hybrid relative attributesh1,h2,…,hf=r1,r2,…,rM,e1,e2,…,eN. For each hybrid relative attribute hff=1,2,…,M+N of the training samples, the ordered pairs of attributes Of=i,j and the unordered pairs of attributes Sf=i,j are given, respectively, where i,j∈Of⇒i>j means image i has a stronger presence of attribute hf than imagej and i,j∈Sf⇒i≈j means that image i and j have the similar relative strengths of hf. As an example “open” shown in Figure 2, Om denotes the ordered pairs. And the pair of the images above correspondingly is an example of the ordered pairs, where the left image looks opener than the right. Sm denotes the unordered pairs. The image pair below is hard to say which image is much more enlarged.Figure 2
Ordered pairs and unordered pairs.In order to obtain the relative relations between the attributes, we use Ranking SVM to learn the ranking functionsθfxi of (M+N) attributes [27]:(3)θfxi=wfTxi,f=1,2,…,M+Nwhere wf is the projection vector. For f=1,2,…,M+N, the conditions shown in (4) and (5) should be satisfied:(4)∀i,j∈Of:θfxi>θfxj(5)∀i,j∈Sf:θfxi≈θfxjLearning the ranking attribute functions is to find the optimal projection direction in the low-level feature space, so that all the samples have the right orders in the projection direction. Consequently, (4) and (5) are transformed into (6)∀i,j∈Of:wfTxi-xj>0(7)∀i,j∈Sf:wfTxi-xj=0As shown in (5) and (6), the ranking relation i>j between the samples can be represented as i-j. The ordered relation between any two samples in the sharable feature space can be represented by the new vector xi-xj and its corresponding new label, which is shown in (8)xi-xj,gi,j=1L,g=+1ifi>j-1otherwiseTherefore, we can correctly rank attributes by solving the standard binary classification in (8), where its optimization objective is shown as (9)w∗=argmin12wf22+C∑i,jξij2+∑i,jρij2s.t.wfTxi-xj≥1-ξij;∀i,j∈OfwfTxi-xj≤ρij;∀i,j∈Sfξij≥0;γij≥0Herein,ξij is the nonnegative relaxation factor of the ordered pairs Of=i,j; ρij is the nonnegative relaxation factor of the unordered pairs Sf=i,j; and C is a trade-off constant to balance between the maximization of the margin distance and the satisfaction of the relative relation of the attribute pair. By maximizing the ranking margin 1/wf and minimizing the relaxation factors ξij and ρij simultaneously, we can obtain the optimal projection vector wf∗. Then, the attribute ranking function is represented as (10)θfxi=wf∗T·xiAs to our knowledge of machine learning, binary classifier is to perfectly separate the positive and negative samples, where the margin restriction is to maximize the distance of the nearest two samples from the two different categories, whereas learning the ranking functions is to rank the training samples in terms of the attribute strengths, so its margin restriction is to maximize the distance of the nearest two samples during the ranking [28, 29]. Therefore, the ranking functions are better to reflect the relationships of the relative strengths between the attributes of the different categories.


### 3.4. Zero-Shot Image Classification Based on SC-HRA

Due to the zero-shot learning without known samples, the classification model is built based on the relative relations of the attributes between the training and testing samples by the method in [9]. Specifically, the images are given from Q categories, of which K categories are the “seen” categories as the training samples to learn the ranking functions of the hybrid relative attributes, and L=Q-K categories are the “unseen” categories as the testing samples not involved in learning the ranking functions. In the modelling procedure, μs,Σis and μu,Σiu are used to represent the models of the training category and the testing category, respectively.The procedure of zero-shot image classification is explained in the following.( 1 ) Building the model of the training category: first, the attribute ranking scores θi1,θi2,…,θif,…,θiM+N of the training samples are predicted by the ranking functions of the hybrid relative attributes, in which θif is the ranking score of thefth hybrid relative attribute in the ith training sample. After that, based on the ranking scores of the hybrid relative attributes in the training samples, the mean value μis∈RM+N and the covariance matrix Σis are estimated for the training categories. Finally, the Gaussian model of the training category is obtained, which is cis~Nμis,Σis, i=1,…,K.( 2 ) Building the model of the testing category: for the hybrid relative attribute hf, the testing category cju can be expressed into three cases based on the “seen” cis and cks:① in the case ofcis>cju>cks, the mean value of the model is μf,ju=1/2μf,is+μf,ks, and the covariance of the model is Σju=1/K∑i=1KΣis; ② in the case of cis>cju, the mean value of the model is μf,ju=μf,is-df,is, and the covariance of the model is Σju=1/K∑i=1KΣis; ③in the case of cju>cks, the mean value of the model is μf,ju=μf,ks+df,js, and the covariance of the model is Σju=1/K∑i=1KΣis.From the above,μf,is=1/L∑i=1Lθf,is represents the mean value of thefth hybrid relative attribute, and df,is=1/L∑i=1Lθf,is-μf,is represents the average difference among the ranking scores of the hybrid relative attributes in the training category. It is reasonable to assume that the relation distributions of the hybrid relative attributes of all the categories are same.In the testing, we first compute the attribute ranking scoreθi of the ith testing sample by the ranking function of the hybrid relative attribute. Then, the class label is given by the similarity between θi and the category models, which is shown as (11)c∗=arg⁡minj∈1,…,N⁡pθi∣μj,ΣjWe also concludes the implementation of zero-shot image classification based on SC-HRA, which is shown as Algorithm2.Algorithm 2:Zero-shot image classification based on SC-HRA.
Input: the attribute ranking scores of the training and testing samples Output: the label of the testing sample ( 1 ) Building of the training models; ( 2 ) Calculate mean value μis and covariance matrix Σis based on θif of training sample, obtaincis~Nμis,Σis ( 3 ) Building of the testing models; ( 4 ) If cis>cju>cks is satisfied, then the mean value of model is μf,ju= 1 / 2 μ f , i s + μ f , k s, and the covariance matrix is Σjs=1/K∑i=1KΣi(s). ( 5 ) If cis>cju is satisfied, then the mean value of model is μf,ju=μf,is-df,is, and the covariance matrix isΣj(u)=1/K∑i=1KΣi(s). ( 6 ) If cju>cksis satisfied, then the mean value of model is μf,ju=μf,ks+df,js, and the covariance matrix isΣju=1/K∑i=1KΣis. ( 7 ) Testing; ( 8 ) By calculating the attribute ranking score θi of the testing sample, the class label is determined asc∗=arg⁡minj∈1,…,Npθi∣μj,Σj


## 3.1. Hybrid Relative Attributes

In this section, we take the Outdoor Scene Recognition (OSR) [23] dataset as an example to explain the construction of the hybrid relative attribute. As shown in Figure 1, five semantic relative attributes r1,r2,r3,r4,r5∈R are given to describe 3 categories, which are “Tall building”, “Street”, and “Coast”. “Tall building” and “Street” have similar ranks on all the semantic relative attributes except the attribute “Perspective”. So the generative model [9] of “Tall building” built on the semantic attributes is extremely similar to that of “Street”. Therefore, when the generative model is used to classify the zero-shot images, it is difficult to distinguish “Tall building” and “Street” by the classifier only depending on the semantic relative attributes. But for the category “Coast”, the semantic relative attributes are far different from those describing “Tall building” and “Street”. Thereby, the generative model of “Coast” is obviously distinguished from those of “Tall building” and “Street”. Naturally, it is easy for the classifier to identify “Coast” from “Tall building” and “Street”. Therefore, considering the limitation of the semantic relative attributes, the nonsemantic relative attributes e1,e2,e3∈E acquired by sparse coding are taken as the supplement of the semantic attributes to construct the hybrid relative attributes H=R;E, which aim at classifying those categories with high similarity. On the other hand, the auxiliary nonsemantic relative attributes cannot mislead the classifier which has obtained the correct results by the semantic relative attributes, such as “Coast”.Figure 1
The hybrid relative attribute.


## 3.2. Nonsemantic Relative Attribute Learning Based on Sparse Coding

The main idea of the nonsemantic attribute learning by sparse encoding is described in this part. At first, the features of the unlabeled training samples are used to learn a set of basis vectors. After, the features of all the training samples can be linearly represented by the learned basis vector set. Besides, the features of the testing samples can also be encoded by the learned basis vectors.X = x 1 , x 2 , … , x K ∈ R d × K is a set of input vectors, where xiΤ∈R1×d, i=1,2,…,K denotes the ith input vector and d is its dimensions. Basis vectors Φ=φ1,φ2,…,φN are learned by sparse coding, which are used to reconstruct the initial input features Xi~≈∑j=1Nejφj later. ej is the activation value, which is named as the nonsemantic attribute in this paper. Generally, sparse coding has two steps: training and coding.In the training stage, a set of basis vectors are generated using the training samples. Then, the linear combination of the set of basis vectors is used to express input vectors. Thus, the generation of the basis vectors can be regarded as an optimization problem, which can be described by the following objective function [24]:(1)minφ,e∑i=1Kxi-∑j=1Nei,jφj2+λ∑i=1K∑j=1Nei,js.t.φj2≤c,∀j=1,2,…,Nwhere ei,j is thejth sparse coding representation of the training sample xi. λ denotes the weight attenuation coefficient. eij can be taken as a sparse regularization term, which potentially obliges the constraint function to have the unique solution and ensures the distinct features to represent it. By solving the optimization problem in (1), we can obtain the activation value ei,j and the basis vector φj of the input feature vector xi. When ei,j and φj vary simultaneously, the objective function is not always the convex optimization problem, whereas, with the basis vector φj fixed, it turns to be the convex optimization problem about the activation value ei,j. If ei,j is fixed, it becomes the convex optimization problem about the basis vector φj. Therefore, it is feasible to implement the sparse coding as the alternately iterative optimization problem, which can fix one variable to get the solution of the other variable [25, 26]. Each iteration has two steps. The first step is to fix the basis vector φ and adjust the activation value e to minimize (1). The second step is to fix the activation value e and adjust the basis vector φ to minimize the objective constraint function. Till it is converged, the set of basis vectors can be obtained.The coding stage is to calculate the sparse representation of a new sample. As the basis vectorφ has been obtained in the training stage, in order to obtain the sparse representation of the new sample, it is just needed to adjust the activation value ei,j to minimize (2). Hence, the activation vector e1,e2,…,eN is the sparse representation of the sample, which is the nonsemantic relative attributes as well.(2)mine∑i=1Kxi-∑j=1Nei,jφj2+λ∑i=1K∑j=1Nei,jAfter that, the relative relations ofN nonsemantic attributes among the different samples are determined by comparing the nonsemantic relative attributes e=e1,e2,…,eN between the different samples. Algorithm 1 shows the specific procedure to obtain the nonsemantic relative attributes by sparse coding.Algorithm 1:Nonsemantic relative attribute learning based on sparse coding.
Input: the low level features x of the training samples and the testing samples, the weight attenuation coefficient λ. Output: the non-semantic relative attributes e of the training samples and the testing samples. ( 1 ) Step 1: bring the low level features x of the training samples into Equation (1), and initialize the basis vector φ; ( 2 ) Repeat; ( 3 )  Fix the basis vector φ in the last step, update the activation value e to minimize Equation (1). ( 4 )  Fix the activation value e in the last step, update the basis vector φ to minimize Equation (1). ( 5 )  Repeat the above procedure till convergence is reached, obtain the basis vector φ to represent the sample features well. ( 6 ) Step 2: bring the basis vector φ and the low level feature x of the testing samples into Equation (2). ( 7 ) Step 3: adjust the activation value to minimize Equation (2), the adjusted activation value e is the non-semantic relative attributes of the testing sample.


## 3.3. Ranking Function Learning Based on Hybrid Relative Attributes

The ranking functions are learned based on the hybrid relative attributesh1,h2,…,hf=r1,r2,…,rM,e1,e2,…,eN. For each hybrid relative attribute hff=1,2,…,M+N of the training samples, the ordered pairs of attributes Of=i,j and the unordered pairs of attributes Sf=i,j are given, respectively, where i,j∈Of⇒i>j means image i has a stronger presence of attribute hf than imagej and i,j∈Sf⇒i≈j means that image i and j have the similar relative strengths of hf. As an example “open” shown in Figure 2, Om denotes the ordered pairs. And the pair of the images above correspondingly is an example of the ordered pairs, where the left image looks opener than the right. Sm denotes the unordered pairs. The image pair below is hard to say which image is much more enlarged.Figure 2
Ordered pairs and unordered pairs.In order to obtain the relative relations between the attributes, we use Ranking SVM to learn the ranking functionsθfxi of (M+N) attributes [27]:(3)θfxi=wfTxi,f=1,2,…,M+Nwhere wf is the projection vector. For f=1,2,…,M+N, the conditions shown in (4) and (5) should be satisfied:(4)∀i,j∈Of:θfxi>θfxj(5)∀i,j∈Sf:θfxi≈θfxjLearning the ranking attribute functions is to find the optimal projection direction in the low-level feature space, so that all the samples have the right orders in the projection direction. Consequently, (4) and (5) are transformed into (6)∀i,j∈Of:wfTxi-xj>0(7)∀i,j∈Sf:wfTxi-xj=0As shown in (5) and (6), the ranking relation i>j between the samples can be represented as i-j. The ordered relation between any two samples in the sharable feature space can be represented by the new vector xi-xj and its corresponding new label, which is shown in (8)xi-xj,gi,j=1L,g=+1ifi>j-1otherwiseTherefore, we can correctly rank attributes by solving the standard binary classification in (8), where its optimization objective is shown as (9)w∗=argmin12wf22+C∑i,jξij2+∑i,jρij2s.t.wfTxi-xj≥1-ξij;∀i,j∈OfwfTxi-xj≤ρij;∀i,j∈Sfξij≥0;γij≥0Herein,ξij is the nonnegative relaxation factor of the ordered pairs Of=i,j; ρij is the nonnegative relaxation factor of the unordered pairs Sf=i,j; and C is a trade-off constant to balance between the maximization of the margin distance and the satisfaction of the relative relation of the attribute pair. By maximizing the ranking margin 1/wf and minimizing the relaxation factors ξij and ρij simultaneously, we can obtain the optimal projection vector wf∗. Then, the attribute ranking function is represented as (10)θfxi=wf∗T·xiAs to our knowledge of machine learning, binary classifier is to perfectly separate the positive and negative samples, where the margin restriction is to maximize the distance of the nearest two samples from the two different categories, whereas learning the ranking functions is to rank the training samples in terms of the attribute strengths, so its margin restriction is to maximize the distance of the nearest two samples during the ranking [28, 29]. Therefore, the ranking functions are better to reflect the relationships of the relative strengths between the attributes of the different categories.


## 3.4. Zero-Shot Image Classification Based on SC-HRA

Due to the zero-shot learning without known samples, the classification model is built based on the relative relations of the attributes between the training and testing samples by the method in [9]. Specifically, the images are given from Q categories, of which K categories are the “seen” categories as the training samples to learn the ranking functions of the hybrid relative attributes, and L=Q-K categories are the “unseen” categories as the testing samples not involved in learning the ranking functions. In the modelling procedure, μs,Σis and μu,Σiu are used to represent the models of the training category and the testing category, respectively.The procedure of zero-shot image classification is explained in the following.( 1 ) Building the model of the training category: first, the attribute ranking scores θi1,θi2,…,θif,…,θiM+N of the training samples are predicted by the ranking functions of the hybrid relative attributes, in which θif is the ranking score of thefth hybrid relative attribute in the ith training sample. After that, based on the ranking scores of the hybrid relative attributes in the training samples, the mean value μis∈RM+N and the covariance matrix Σis are estimated for the training categories. Finally, the Gaussian model of the training category is obtained, which is cis~Nμis,Σis, i=1,…,K.( 2 ) Building the model of the testing category: for the hybrid relative attribute hf, the testing category cju can be expressed into three cases based on the “seen” cis and cks:① in the case ofcis>cju>cks, the mean value of the model is μf,ju=1/2μf,is+μf,ks, and the covariance of the model is Σju=1/K∑i=1KΣis; ② in the case of cis>cju, the mean value of the model is μf,ju=μf,is-df,is, and the covariance of the model is Σju=1/K∑i=1KΣis; ③in the case of cju>cks, the mean value of the model is μf,ju=μf,ks+df,js, and the covariance of the model is Σju=1/K∑i=1KΣis.From the above,μf,is=1/L∑i=1Lθf,is represents the mean value of thefth hybrid relative attribute, and df,is=1/L∑i=1Lθf,is-μf,is represents the average difference among the ranking scores of the hybrid relative attributes in the training category. It is reasonable to assume that the relation distributions of the hybrid relative attributes of all the categories are same.In the testing, we first compute the attribute ranking scoreθi of the ith testing sample by the ranking function of the hybrid relative attribute. Then, the class label is given by the similarity between θi and the category models, which is shown as (11)c∗=arg⁡minj∈1,…,N⁡pθi∣μj,ΣjWe also concludes the implementation of zero-shot image classification based on SC-HRA, which is shown as Algorithm2.Algorithm 2:Zero-shot image classification based on SC-HRA.
Input: the attribute ranking scores of the training and testing samples Output: the label of the testing sample ( 1 ) Building of the training models; ( 2 ) Calculate mean value μis and covariance matrix Σis based on θif of training sample, obtaincis~Nμis,Σis ( 3 ) Building of the testing models; ( 4 ) If cis>cju>cks is satisfied, then the mean value of model is μf,ju= 1 / 2 μ f , i s + μ f , k s, and the covariance matrix is Σjs=1/K∑i=1KΣi(s). ( 5 ) If cis>cju is satisfied, then the mean value of model is μf,ju=μf,is-df,is, and the covariance matrix isΣj(u)=1/K∑i=1KΣi(s). ( 6 ) If cju>cksis satisfied, then the mean value of model is μf,ju=μf,ks+df,js, and the covariance matrix isΣju=1/K∑i=1KΣis. ( 7 ) Testing; ( 8 ) By calculating the attribute ranking score θi of the testing sample, the class label is determined asc∗=arg⁡minj∈1,…,Npθi∣μj,Σj


## 4. Experiments

### 4.1. Experimental Datasets

In this section, the proposed method is evaluated on OSR dataset and Public Figure Face (Pub Fig) [9, 30] dataset. The two datasets are from the distinctive areas of landscape and human faces, which can sufficiently validate the effects of the proposed method. OSR dataset contains 2688 images, 6 attributes, and 8 scenes (tall building (T), inside-city (I), street (S), highway (H), coast (C), Open-country (O), mountain (M), and forest (F)), and use 512-dimensional gist [31] descriptor to represent the images. In the paper, 2648 images of images are selected as testing set. Pub Fig dataset consist of 772 images with 11 semantic attributes from 8 identities (Alex (A), Clive (C), Hugh (H), Jared (J), Miley (M), Scarlett (S), Viggo (V), and Zac (Z)), which is 512-dimensional gist descriptor and 30-dimensional global color features extracted from each image [32]. 560 images from Pub Fig dataset are selected as the testing set. According to the empirical values, the parameters λ and c are set as 0.5 and 1, respectively.Tables1 and 2 show the relative attribute rankings and the description of OSR and Pub Fig datasets, respectively. The relative attributes can be ranked by the relative strengths.Table 1
Description of the relative attributes of OSR dataset.
Attribute name Relative attribute natural T<I~S<H<C~O~M~F open T~F<I~S<M<H~C~O perspective O<C<M~F<H<I<S<T Large-objects F<O~M<I~S<H~C<T Diagonal-plane F<O~M<C<I~S<H<T Depth-close C<M<O<T~I~S~H~FTable 2
Description of the relative attributes of Pub Fig dataset.
Attribute name Relative attribute Masculine-looking S<M<Z<V<J<A<H<C White A<C<H<Z<J<S<M<V Young V<H<C<J<A<S<Z<M Smiling J<V<H<A~C<S~Z<M Chubby V<J<H<C<Z<M<S<A Visible-forehead J<Z<M<S<A~C~H~V Bushy-eyebrows M<S<Z<V<H<A<C<J Narrow-eyes M<J<S<A<H<C<V<Z Pointy-nose A<C<J~M~V<S<Z<H Big-lips H<J<V<Z<C<M<A<S Round-face H<V<J<C<Z<A<S<M


### 4.2. Attribute Ranking Prediction

To verify the effects of the hybrid attributes on the ranking performance, we predict the ranking scores of 2648 testing images from OSR dataset and 560 testing images from Pub Fig dataset. For each pairi,j of one attribute, we calculate θfxi to get the strengths of attributes. i>j means that the strength of i is higher than that of j, while i<j denotes the strength of i is smaller than j. In this section, 6 learning methods are compared with the proposed method, which are B-SVM [33], RFUA [34], HAP [35], CSHAPH, CSHAPG [35], and RA [9]. The attribute rankings predicted by the different methods are compared with the truly relative relations of the samples. Based on the comparisons of the predicted relations with the real ones, the attributes’ ranking accuracy can be calculated.Tables3 and 4 illustrate the performance of attribute ranking prediction by different methods. Table 3 shows the comparisons of attributes’ ranking accuracy on OSR dataset. Specifically, SC-HRA obtains the best ranking accuracy for all the attributes. Table 4 shows the comparisons of attributes’ ranking accuracy on Pub Fig dataset. The attribute ranking accuracy on Pub Fig is higher than other methods except for the attributes “young” and “Visible Forehead”, which are not as good as than RA but better than others. Moreover, the average accuracy of ranking prediction is 89.15% and 82.29%, respectively. As compared to the performance of other methods, SC-HRA gets the best performance on attribute ranking prediction, which confirms the advantage of HRA during the attribute ranking.Table 3
Comparisons of attributes’ ranking accuracy on OSR dataset (%).
B-SVM RFUA HAP C S H A P H C S H A P G RA SC-HRA Natural 88.23 86.66 87.04 88.12 87.72 90.68 91.94 Open 87.15 83.22 83.6 84.68 83.38 87.33 89.78 Perspective 80.02 83.42 83.26 84.7 83.58 86.54 90.02 Large 77.28 81.1 80.49 82.47 81.26 85.21 86.43 Diagonal 63.43 83.94 83.87 84.95 84.10 87.06 90.33 Close 85.29 80.05 81.29 82.01 81.61 84.57 86.41 Average 80.23 83.065 83.26 84.49 83.61 86.90 89.15Table 4
Comparisons of attributes’ ranking accuracy for Pub Fig dataset (%).
B-SVM RFUA HAP C S H A P H C S H A P G RA SC-HRA Male 80.41 80.92 81.6 82.91 81.39 85.10 90.34 White 71.03 76.93 77.91 78.6 77.62 80.25 88.72 Young 74.62 78.45 79.42 80.72 79.47 82.56 81.15 Smiling 70.59 71.48 72.46 73.77 72.97 75.96 80.75 Chubby 58.45 68.78 69.71 69.03 69.5 71.49 75.92 Visible Forehead 68.92 84.92 85.28 87.48 86.15 90.03 87.76 Bushy Eyebrows 63.22 67.72 66.46 67.67 66.97 69.95 74.57 Narrow Eyes 80.53 77.82 78.82 79.59 78.61 81.78 84.16 Pointy Nose 70.19 70.29 71.28 73.13 72.15 75.32 78.35 Big Lips 68.97 71.55 72.52 72.83 72.58 74.67 78.89 Round Face 75.56 74.12 75.11 76.42 75.44 78.61 84.54 Average 71.14 74.82 75.51 76.56 75.71 78.70 82.29


### 4.3. Zero-Shot Image Classification Results

In this part, the effects of SC-HRA on the zero-shot image classification are checked. In each dataset, a series of experiments are carried out on zero-shot image classification. And for each experiment, selected are the different training (“seen”) and testing (“unseen”) categories to realize the classification. We adoptCTt fold cross-validation (T is the total number of the dataset categories, and t is the number of the training categories) to eliminate the influence of the experiment randomness. So, the results based on the cross-validation are reliable since all the samples are almost considered during training. Specifically, 5 cross-validation experiments are implemented on the bench mark datasets, which are C86=28 fold, C85=56 fold, C84=70 fold, C83=56 fold, and C85=28 fold.Figure3 shows the results of the different number of the training categories t as we increase the nonsemantic relative attribute dimension N, where N ranges from 0 to 14. In general, the classification accuracy declines with the training categories t decreasing. The reason is that, when the number of the training categories t reduces, the fewer ordered pairs and unordered pairs are used to learn the ranking functions of the hybrid relative attributes, which impacts the ranking accuracy of the hybrid relative attributes. Thus, too low proportion of the training category can result in the worse performance of zero-shot classification. Besides, with the training categories reducing, the proportion of the categories to build “unseen” model also decreases, which is another factor for the worse performance of the classifier. Without nonsemantic relative attribute (that is, N=0), HRA and RA are equivalent.Figure 3
Zero-shot learning performance of training categories t as the nonsemantic relative attribute dimension N increases.
(a)
OSR dataset (b)
Pub Fig datasetAn additional phenomenon in Figure3 is that all the curves grow first and then decline. And in the condition oft=6, the proposed method obtains the better performance on both OSR dataset and Pub Fig dataset than the other cases (t=2,t=3,t=4,t=5). Next, we calculate the average accuracy of zero-shot classification shown as Tables 5 and 6 to concretely analyse that fact. With the increase of the nonsemantic relative attribute dimensionN, the average classification accuracy on OSR dataset grows to 48.02% atN = 10 firstly and then declines. On the other hand, the average classification accuracy of Pub Fig dataset reaches to 47.33% atN=6 and then reduces, too. As to the reason, the nonsemantic relative attributes contribute to the difference of the relative attribute space, which impacts on the classification accuracy. However, due to the increase of the nonsemantic relative attribute dimensionN, too many nonsemantic relative attributes make the relative attributes redundant, which results in the decrease of the classification accuracy. Therefore, according the analysis based on the experiments, parameter N is set as 10 for OSR dataset and 6 for Pub Fig dataset when t equals 6, which can acquire the highest average accuracy.Table 5
Average accuracy of zero-shot image classification on OSR dataset.
Model Average Accuracy (%) RA 42.75 SC-HRA N=1 43.24 N=2 43.77 N=3 44.40 N=4 44.95 N=5 46.00 N=6 46.46 N=7 47.19 N=8 47.55 N=9 47.73 N=10 48.02 N=11 47.32 N=12 46.03 N=13 45.56 N=14 44.95Table 6
Average accuracy of zero-shot image classification on Pub Fig dataset.
Model Average Accuracy (%) RA 44.38 SC-HRA N=1 45.05 N=2 45.59 N=3 46.04 N=4 46.69 N=5 47.05 N=6 47.33 N=7 47.14 N=8 46.59 N=9 45.97 N=10 45.21 N=11 44.71 N=12 44.35 N=13 44.11 N=14 43.86Although the proportion of the correct classified samples to the whole testing set can be illustrated by the classification accuracy, it neglects the relation between false positive rate (the probability of negative samples wrongly categorized as positive) and true positive rate (the probability of positive samples correctly categorized as negative). Therefore, we further use AUC (Area Under Curve) [36, 37] to evaluate the classification performance. AUC denotes the area under the receiver operating characteristic (ROC) curve which provides another way to evaluate the performance of the proposed model. If the model is ideal, its AUC value equals 1. The AUC value of a random model equals 0.5. On the other hand, regarding the results of Tables 5 and 6, SC-HRA acquires the highest classification accuracy on OSR dataset atN=10. When N equals 6, SC-HRA acquires the highest average classification accuracy on Pub Fig dataset. When N rises to 14, the classification accuracy of SC-HRA on both OSR and Pub Fig is lower than that of SC-HRA with other 13 different N values. Even worse, it is lower than that of RA. Thus, we choose the representative results of SC-HRA as well as RA, which areN=6,N=10, andN=14. Figure 4 shows the AUC values of zero-shot classification on OSR and Pub Fig datasets. In general, all the three cases of SC-HRA (N=6,N=10, andN=14) illustrated in Figure 4 have higher AUC values than the random tested AUC value (0.5) on OSR dataset as well as Pub Fig dataset. Specifically, as toN=6 andN=10, AUC values of SC-HRA are higher than RA. But as toN=14, the AUC value decreases since the redundant nonsemantic relative attributes deteriorate the performance of zero-shot image classification.Figure 4
AUC value of zero-shot image classification.
(a)
OSR dataset (b)
Pub Fig datasetNext, we demonstrate the proposed method using the confusion matrix. Figures5 and 6 show the classification performance of RA and SC-HRA on OSR and Pub Fig illustrated by confusion matrix. In the confusion matrix, the blocks distributed on the diagonal line denote the number of the samples correctly classified. The darker the color of the block, the larger the number of the correctly classified samples. As shown in Figure 5, due to the high similarity of the semantic relative attributes between Tall building and Street, it is difficult for RA to distinguish them. For example, 260 images of Tall building are mistaken as Street category. When the nonsemantic relative attributes are introduced into zero-shot classification, SC-HRA can distinguish Tall building and Street partially, which is better than RA. Concluded from Figures 5 and 6, in the case of N=6 and N=10, the samples correctly classified by SC-HRA are more than those correctly classified by RA on the diagonal lines of OSR and Pub Fig confusion matrix. The reason is that a certain amount of nonsemantic relative attributes can improve the performance of the classifier. In the case of N=14, the number of samples correctly classified by SC-HRA decreases, which is caused by the redundant nonsemantic relative attributes. Therefore, a certain amount of nonsemantic relative attributes can benefit zero-shot classification to ameliorate its performance, yet too many of them bring much redundant information that may confuse the classification procedure.Figure 5
Classification results on OSR dataset represented as confusion matrix.
(a)
RA (b)
SC-HRA (N=6) (c)
SC-HRA (N=10) (d)
SC-HRA (N=14)Figure 6
Classification results on Pub Fig dataset represented as confusion matrix.
(a)
RA (b)
SC-HRA (N=6) (c)
SC-HRA (N=10) (d)
SC-HRA (N=14)


### 4.4. Comparisons of Zero-Shot Image Classification Methods

To further verify the classification performance of the proposed method, we compare the zero-shot image classification accuracy of it with the other 6 methods, which are DAP [38], RFUA-SRA, HAP-SRA, CSHAPH-SRA, CSHAPG-SRA, and MLE-RA. The baseline DAP is a direct attribute prediction model. Based on RA approach, RFUA-SRA (RFUA score-based relative attributes) replaces rank values with the RFUA classifier output score; HAP-SRA (HAP score-based relative attributes) replaces rank values with the HAP classifier output score; CSHAPH-SRA (CSHAPH score-based relative attributes) replaces rank values with the RFUA classifier output score; and CSHAPG-SRA (CSHAPG score-based relative attributes) replaces rank values with the CSHAPG classifier output score. MLE-RA utilizes maximum likelihood estimation to predict the testing sample label.To avoid the randomness during the simulations, the cross-validation is adopted to compare the proposed model with other baseline models. The comparisons are illustrated as Tables7 and 8. As the proportion of training category decreases, the classification accuracies of all the models decline. Thus, each model can obtain the highest accuracy when the number of training category is 6. Further, as we expected, our method significantly outperforms DAP, RFUA-SRA, HAP-SRA, CSHAPH-SRA, and CSHAPG-SRA and slightly exceeds the baseline model MLE-RA. This validates the power of the hybrid relative attribute jointly combined semantic relative attribute and nonsemantic attribute for zero-shot image classification.Table 7
Comparisons of zero-shot image classification accuracies on OSR dataset (%).
Taining categories DAP RFUA-SRA HAP-SRA C S H A P H-SRA C S H A P G-SRA MLE-RA SC-HRA 6 54.15 55.29 56.87 58.16 57.11 60.50 62.92 5 37.64 44.41 46.99 48.28 47.32 50.71 54.97 4 27.37 38.14 40.63 42.01 40.69 43.99 47.04 3 24.48 27.02 27.69 29.87 28.29 31.76 35.65 2 20.80 22.30 23.52 24.90 23.58 26.79 29.13 Average 32.888 37.432 39.14 40.644 39.40 42.75 45.94Table 8
Comparisons of zero-shot image classification accuracies on Pub Fig dataset (%).
Taining categories DAP RFUA-SRA HAP-SRA C S H A P H-SRA C S H A P G-SRA MLE-RA SC-HRA 6 63.40 61.57 62.83 63.72 62.57 65.92 66.24 5 46.91 48.15 49.49 51.48 50.12 54.50 55.12 4 37.18 40.60 41.24 42.31 41.43 44.80 47.47 3 21.01 28.44 29.62 30.48 29.65 33.13 34.85 2 16.80 19.94 20.58 20.69 20.77 23.54 24.35 Average 37.06 39.74 40.75 41.74 40.91 44.38 45.61


## 4.1. Experimental Datasets

In this section, the proposed method is evaluated on OSR dataset and Public Figure Face (Pub Fig) [9, 30] dataset. The two datasets are from the distinctive areas of landscape and human faces, which can sufficiently validate the effects of the proposed method. OSR dataset contains 2688 images, 6 attributes, and 8 scenes (tall building (T), inside-city (I), street (S), highway (H), coast (C), Open-country (O), mountain (M), and forest (F)), and use 512-dimensional gist [31] descriptor to represent the images. In the paper, 2648 images of images are selected as testing set. Pub Fig dataset consist of 772 images with 11 semantic attributes from 8 identities (Alex (A), Clive (C), Hugh (H), Jared (J), Miley (M), Scarlett (S), Viggo (V), and Zac (Z)), which is 512-dimensional gist descriptor and 30-dimensional global color features extracted from each image [32]. 560 images from Pub Fig dataset are selected as the testing set. According to the empirical values, the parameters λ and c are set as 0.5 and 1, respectively.Tables1 and 2 show the relative attribute rankings and the description of OSR and Pub Fig datasets, respectively. The relative attributes can be ranked by the relative strengths.Table 1
Description of the relative attributes of OSR dataset.
Attribute name Relative attribute natural T<I~S<H<C~O~M~F open T~F<I~S<M<H~C~O perspective O<C<M~F<H<I<S<T Large-objects F<O~M<I~S<H~C<T Diagonal-plane F<O~M<C<I~S<H<T Depth-close C<M<O<T~I~S~H~FTable 2
Description of the relative attributes of Pub Fig dataset.
Attribute name Relative attribute Masculine-looking S<M<Z<V<J<A<H<C White A<C<H<Z<J<S<M<V Young V<H<C<J<A<S<Z<M Smiling J<V<H<A~C<S~Z<M Chubby V<J<H<C<Z<M<S<A Visible-forehead J<Z<M<S<A~C~H~V Bushy-eyebrows M<S<Z<V<H<A<C<J Narrow-eyes M<J<S<A<H<C<V<Z Pointy-nose A<C<J~M~V<S<Z<H Big-lips H<J<V<Z<C<M<A<S Round-face H<V<J<C<Z<A<S<M


## 4.2. Attribute Ranking Prediction

To verify the effects of the hybrid attributes on the ranking performance, we predict the ranking scores of 2648 testing images from OSR dataset and 560 testing images from Pub Fig dataset. For each pairi,j of one attribute, we calculate θfxi to get the strengths of attributes. i>j means that the strength of i is higher than that of j, while i<j denotes the strength of i is smaller than j. In this section, 6 learning methods are compared with the proposed method, which are B-SVM [33], RFUA [34], HAP [35], CSHAPH, CSHAPG [35], and RA [9]. The attribute rankings predicted by the different methods are compared with the truly relative relations of the samples. Based on the comparisons of the predicted relations with the real ones, the attributes’ ranking accuracy can be calculated.Tables3 and 4 illustrate the performance of attribute ranking prediction by different methods. Table 3 shows the comparisons of attributes’ ranking accuracy on OSR dataset. Specifically, SC-HRA obtains the best ranking accuracy for all the attributes. Table 4 shows the comparisons of attributes’ ranking accuracy on Pub Fig dataset. The attribute ranking accuracy on Pub Fig is higher than other methods except for the attributes “young” and “Visible Forehead”, which are not as good as than RA but better than others. Moreover, the average accuracy of ranking prediction is 89.15% and 82.29%, respectively. As compared to the performance of other methods, SC-HRA gets the best performance on attribute ranking prediction, which confirms the advantage of HRA during the attribute ranking.Table 3
Comparisons of attributes’ ranking accuracy on OSR dataset (%).
B-SVM RFUA HAP C S H A P H C S H A P G RA SC-HRA Natural 88.23 86.66 87.04 88.12 87.72 90.68 91.94 Open 87.15 83.22 83.6 84.68 83.38 87.33 89.78 Perspective 80.02 83.42 83.26 84.7 83.58 86.54 90.02 Large 77.28 81.1 80.49 82.47 81.26 85.21 86.43 Diagonal 63.43 83.94 83.87 84.95 84.10 87.06 90.33 Close 85.29 80.05 81.29 82.01 81.61 84.57 86.41 Average 80.23 83.065 83.26 84.49 83.61 86.90 89.15Table 4
Comparisons of attributes’ ranking accuracy for Pub Fig dataset (%).
B-SVM RFUA HAP C S H A P H C S H A P G RA SC-HRA Male 80.41 80.92 81.6 82.91 81.39 85.10 90.34 White 71.03 76.93 77.91 78.6 77.62 80.25 88.72 Young 74.62 78.45 79.42 80.72 79.47 82.56 81.15 Smiling 70.59 71.48 72.46 73.77 72.97 75.96 80.75 Chubby 58.45 68.78 69.71 69.03 69.5 71.49 75.92 Visible Forehead 68.92 84.92 85.28 87.48 86.15 90.03 87.76 Bushy Eyebrows 63.22 67.72 66.46 67.67 66.97 69.95 74.57 Narrow Eyes 80.53 77.82 78.82 79.59 78.61 81.78 84.16 Pointy Nose 70.19 70.29 71.28 73.13 72.15 75.32 78.35 Big Lips 68.97 71.55 72.52 72.83 72.58 74.67 78.89 Round Face 75.56 74.12 75.11 76.42 75.44 78.61 84.54 Average 71.14 74.82 75.51 76.56 75.71 78.70 82.29


## 4.3. Zero-Shot Image Classification Results

In this part, the effects of SC-HRA on the zero-shot image classification are checked. In each dataset, a series of experiments are carried out on zero-shot image classification. And for each experiment, selected are the different training (“seen”) and testing (“unseen”) categories to realize the classification. We adoptCTt fold cross-validation (T is the total number of the dataset categories, and t is the number of the training categories) to eliminate the influence of the experiment randomness. So, the results based on the cross-validation are reliable since all the samples are almost considered during training. Specifically, 5 cross-validation experiments are implemented on the bench mark datasets, which are C86=28 fold, C85=56 fold, C84=70 fold, C83=56 fold, and C85=28 fold.Figure3 shows the results of the different number of the training categories t as we increase the nonsemantic relative attribute dimension N, where N ranges from 0 to 14. In general, the classification accuracy declines with the training categories t decreasing. The reason is that, when the number of the training categories t reduces, the fewer ordered pairs and unordered pairs are used to learn the ranking functions of the hybrid relative attributes, which impacts the ranking accuracy of the hybrid relative attributes. Thus, too low proportion of the training category can result in the worse performance of zero-shot classification. Besides, with the training categories reducing, the proportion of the categories to build “unseen” model also decreases, which is another factor for the worse performance of the classifier. Without nonsemantic relative attribute (that is, N=0), HRA and RA are equivalent.Figure 3
Zero-shot learning performance of training categories t as the nonsemantic relative attribute dimension N increases.
(a)
OSR dataset (b)
Pub Fig datasetAn additional phenomenon in Figure3 is that all the curves grow first and then decline. And in the condition oft=6, the proposed method obtains the better performance on both OSR dataset and Pub Fig dataset than the other cases (t=2,t=3,t=4,t=5). Next, we calculate the average accuracy of zero-shot classification shown as Tables 5 and 6 to concretely analyse that fact. With the increase of the nonsemantic relative attribute dimensionN, the average classification accuracy on OSR dataset grows to 48.02% atN = 10 firstly and then declines. On the other hand, the average classification accuracy of Pub Fig dataset reaches to 47.33% atN=6 and then reduces, too. As to the reason, the nonsemantic relative attributes contribute to the difference of the relative attribute space, which impacts on the classification accuracy. However, due to the increase of the nonsemantic relative attribute dimensionN, too many nonsemantic relative attributes make the relative attributes redundant, which results in the decrease of the classification accuracy. Therefore, according the analysis based on the experiments, parameter N is set as 10 for OSR dataset and 6 for Pub Fig dataset when t equals 6, which can acquire the highest average accuracy.Table 5
Average accuracy of zero-shot image classification on OSR dataset.
Model Average Accuracy (%) RA 42.75 SC-HRA N=1 43.24 N=2 43.77 N=3 44.40 N=4 44.95 N=5 46.00 N=6 46.46 N=7 47.19 N=8 47.55 N=9 47.73 N=10 48.02 N=11 47.32 N=12 46.03 N=13 45.56 N=14 44.95Table 6
Average accuracy of zero-shot image classification on Pub Fig dataset.
Model Average Accuracy (%) RA 44.38 SC-HRA N=1 45.05 N=2 45.59 N=3 46.04 N=4 46.69 N=5 47.05 N=6 47.33 N=7 47.14 N=8 46.59 N=9 45.97 N=10 45.21 N=11 44.71 N=12 44.35 N=13 44.11 N=14 43.86Although the proportion of the correct classified samples to the whole testing set can be illustrated by the classification accuracy, it neglects the relation between false positive rate (the probability of negative samples wrongly categorized as positive) and true positive rate (the probability of positive samples correctly categorized as negative). Therefore, we further use AUC (Area Under Curve) [36, 37] to evaluate the classification performance. AUC denotes the area under the receiver operating characteristic (ROC) curve which provides another way to evaluate the performance of the proposed model. If the model is ideal, its AUC value equals 1. The AUC value of a random model equals 0.5. On the other hand, regarding the results of Tables 5 and 6, SC-HRA acquires the highest classification accuracy on OSR dataset atN=10. When N equals 6, SC-HRA acquires the highest average classification accuracy on Pub Fig dataset. When N rises to 14, the classification accuracy of SC-HRA on both OSR and Pub Fig is lower than that of SC-HRA with other 13 different N values. Even worse, it is lower than that of RA. Thus, we choose the representative results of SC-HRA as well as RA, which areN=6,N=10, andN=14. Figure 4 shows the AUC values of zero-shot classification on OSR and Pub Fig datasets. In general, all the three cases of SC-HRA (N=6,N=10, andN=14) illustrated in Figure 4 have higher AUC values than the random tested AUC value (0.5) on OSR dataset as well as Pub Fig dataset. Specifically, as toN=6 andN=10, AUC values of SC-HRA are higher than RA. But as toN=14, the AUC value decreases since the redundant nonsemantic relative attributes deteriorate the performance of zero-shot image classification.Figure 4
AUC value of zero-shot image classification.
(a)
OSR dataset (b)
Pub Fig datasetNext, we demonstrate the proposed method using the confusion matrix. Figures5 and 6 show the classification performance of RA and SC-HRA on OSR and Pub Fig illustrated by confusion matrix. In the confusion matrix, the blocks distributed on the diagonal line denote the number of the samples correctly classified. The darker the color of the block, the larger the number of the correctly classified samples. As shown in Figure 5, due to the high similarity of the semantic relative attributes between Tall building and Street, it is difficult for RA to distinguish them. For example, 260 images of Tall building are mistaken as Street category. When the nonsemantic relative attributes are introduced into zero-shot classification, SC-HRA can distinguish Tall building and Street partially, which is better than RA. Concluded from Figures 5 and 6, in the case of N=6 and N=10, the samples correctly classified by SC-HRA are more than those correctly classified by RA on the diagonal lines of OSR and Pub Fig confusion matrix. The reason is that a certain amount of nonsemantic relative attributes can improve the performance of the classifier. In the case of N=14, the number of samples correctly classified by SC-HRA decreases, which is caused by the redundant nonsemantic relative attributes. Therefore, a certain amount of nonsemantic relative attributes can benefit zero-shot classification to ameliorate its performance, yet too many of them bring much redundant information that may confuse the classification procedure.Figure 5
Classification results on OSR dataset represented as confusion matrix.
(a)
RA (b)
SC-HRA (N=6) (c)
SC-HRA (N=10) (d)
SC-HRA (N=14)Figure 6
Classification results on Pub Fig dataset represented as confusion matrix.
(a)
RA (b)
SC-HRA (N=6) (c)
SC-HRA (N=10) (d)
SC-HRA (N=14)


## 4.4. Comparisons of Zero-Shot Image Classification Methods

To further verify the classification performance of the proposed method, we compare the zero-shot image classification accuracy of it with the other 6 methods, which are DAP [38], RFUA-SRA, HAP-SRA, CSHAPH-SRA, CSHAPG-SRA, and MLE-RA. The baseline DAP is a direct attribute prediction model. Based on RA approach, RFUA-SRA (RFUA score-based relative attributes) replaces rank values with the RFUA classifier output score; HAP-SRA (HAP score-based relative attributes) replaces rank values with the HAP classifier output score; CSHAPH-SRA (CSHAPH score-based relative attributes) replaces rank values with the RFUA classifier output score; and CSHAPG-SRA (CSHAPG score-based relative attributes) replaces rank values with the CSHAPG classifier output score. MLE-RA utilizes maximum likelihood estimation to predict the testing sample label.To avoid the randomness during the simulations, the cross-validation is adopted to compare the proposed model with other baseline models. The comparisons are illustrated as Tables7 and 8. As the proportion of training category decreases, the classification accuracies of all the models decline. Thus, each model can obtain the highest accuracy when the number of training category is 6. Further, as we expected, our method significantly outperforms DAP, RFUA-SRA, HAP-SRA, CSHAPH-SRA, and CSHAPG-SRA and slightly exceeds the baseline model MLE-RA. This validates the power of the hybrid relative attribute jointly combined semantic relative attribute and nonsemantic attribute for zero-shot image classification.Table 7
Comparisons of zero-shot image classification accuracies on OSR dataset (%).
Taining categories DAP RFUA-SRA HAP-SRA C S H A P H-SRA C S H A P G-SRA MLE-RA SC-HRA 6 54.15 55.29 56.87 58.16 57.11 60.50 62.92 5 37.64 44.41 46.99 48.28 47.32 50.71 54.97 4 27.37 38.14 40.63 42.01 40.69 43.99 47.04 3 24.48 27.02 27.69 29.87 28.29 31.76 35.65 2 20.80 22.30 23.52 24.90 23.58 26.79 29.13 Average 32.888 37.432 39.14 40.644 39.40 42.75 45.94Table 8
Comparisons of zero-shot image classification accuracies on Pub Fig dataset (%).
Taining categories DAP RFUA-SRA HAP-SRA C S H A P H-SRA C S H A P G-SRA MLE-RA SC-HRA 6 63.40 61.57 62.83 63.72 62.57 65.92 66.24 5 46.91 48.15 49.49 51.48 50.12 54.50 55.12 4 37.18 40.60 41.24 42.31 41.43 44.80 47.47 3 21.01 28.44 29.62 30.48 29.65 33.13 34.85 2 16.80 19.94 20.58 20.69 20.77 23.54 24.35 Average 37.06 39.74 40.75 41.74 40.91 44.38 45.61


## 5. Conclusions

Zero-shot image classification primarily solves the challenge of how to identify the “unseen” categories accurately when the labeled samples cannot cover all the objective categories. In that the semantic relative attributes become the key to solve zero-shot image classification. However, the existing zero-shot image classifiers based on semantic relative attributes ignore the low-level features. In other words, the class labels of the samples in the testing categories are decided only depending on the semantic relative attributes of the samples. But for the categories having similar semantic relative attributes, it is difficult to distinguish them. Therefore, considering the restriction of the semantic relative attributes, the nonsemantic relative attributes are obtained by sparse coding the low-level features of the samples and treated as the supplement of the semantic relative attributes to construct the hybrid relative attributes. Further, the hybrid relative attributes are applied to zero-shot image classification. So a zero-shot image classification based on the hybrid relative attributes is proposed. The proposed SC-HRA is demonstrated and compared with the baseline methods by the experiments on OSR and Pub Fig datasets. The experimental results validate that SC-HRA has powerful ranking and classification ability in zero-shot learning due to the distinguishability of the nonsemantic relative attributes in classification.



---

*Source: 7390327-2019-02-21.xml*