Zero-shot Recognition via semantic embeddings and knowledege graphs
2018-03-31 15:38:39
【Abstract】
我們考慮 zero-shot recognition 的問題:學習一個類別的視覺分類器,並且不用 training data,僅僅依賴於 類別的單詞映射(the word embedding of the category)及其與其他類別的關系(its relationship to other categories),但是會提供 visual data。處理這種不熟悉的或者新穎的類別,從已有的類別中進行知識的遷移是成功的關鍵。本文,我們通過引入 GCN,然后提出一種方法同時利用 semantic embeddings 以及 categorical knowledge graph 來預測分類器。給定一個學習的知識圖譜(a learned knowledge graph (KG)),我們的方法將 semantic embeddings for each node (representing visual category)。在一系列的 graph convolutions 之后,我們對每一個種類預測 the visual predictor。在訓練的過程中,一些類別的 visual classifiers 是給定的,用來學習 the GCN parameters。在測試的時候,這些 filters 被用來預測未見種類的 visual classifiers。
【Introduction】
現有的物體分類的方法,都需要大量的訓練數據,然后針對每一類訓練一個分類器。但是,當新增加一個類別的時候,又需要再訓練一個 model,並且還需要收集大量的數據。為了解決這個問題,zero-shot learning 經常被用到。處理 unfamiliar 或者 novel category 的關鍵是:從熟悉的種類進行知識的遷移,來描述不熟悉的類別(generalization)。
有兩種遷移知識的方法。
第一種是利用 implicit knowledge representation,即:semantic embeddings。在這種方法中,one learns a vector representation of different categories using text data and then learns a mapping between the vector representation to visual classifier directly. 但是,這些方法受限於 the generalization power of the semantic models and the mapping models themselves. It is also hard to learn semantic embeddings from structured information.
另一種進行 zero-shot learning 的方法是:利用現有的知識庫或者知識圖譜(explicit knowledge bases or knowledge graphs)。在這個流程中,我們顯示的將知識圖譜表達為:rules or relationships between objects。這些關系可以進行 new categories 的 zero-shot classifiers 的學習。一個很有意思的問題是,我們想要探討:if we can use structured information and complex relationships to learn visual classifiers without seeing any examples。
在本文當中,我們提出提取 隱式的知識表示(the implicit knowledge representation,i.e. Word embedding)以及 顯示的表示(the explicit relationships, i.e. knowledge graph)來學習新穎種類的視覺分類器(for learning visual classifiers of novel classes)。我們構建一個知識圖譜,每一個節點代表了一個 semantic category。這些節點用 relationship edges 來進行連接。該graph 節點的輸入是:每一個種類的向量表示(the vector representation of each category)。我們然后用 Graph Convolutional Network(GCN)來進行不同種類之間的信息遷移(transfer information between different catrgories)。特別的,我們訓練一個 6-layer deep GCN 來輸出不同種類的類別(that outputs the classifiers of different categories)。
我們集中於 image classification,我們考慮兩種測試的設置:
(a)final test classes being only zero-shot classes (without training classes at test time) ;
(b)at test time the labels can be either the seen or the unseen classes, namely "generalized zero-shot learning"。
跟傳統方法對比,我們取得了令人驚奇的好結果,that is a whopping 18.7% improvement over the current state-of-the-art。
【Approach】
我們的目標是從顯示的和隱式的表達中進行信息提取,然后進行 zero-shot classification。我們在 GCN 的基礎上學習 visual classifiers。我們首先介紹 如何將 GCN 引入 NLP 領域進行分類任務,然后將詳細討論:applying the GCN with a regression loss for zero-shot learning。
3.1. Background: Graph Convolutional Network
GCN 被引入執行 semi-supervised entity classfication. 給定 object entities,用 Word embeddings or text features, 任務是進行分類。例如:將“dog” and "cat" 分類為 “mammal”;“chair” 以及 “couch”分類為“furniture”。我們也假設有這么一個 graph,其節點代表的是 entities。邊代表的是 entities 之間的關系。
正式的,給定一個數據集,有 n 個 entities (X, Y)= ${(xi, yi)}_{i=1}^n$,其中,xi 代表的是 entities i 的 Word embedding,yi 代表其 label。在半監督的設定下,我們知道 semi-supervised setting下,我們知道前 m 個 entities 的 ground truth labels。我們的目標是利用 Word embedding 以及 the relationships graph,去推斷 the remaining n-m entities,而這些是沒有標簽的。
我們用函數 F(*) 來表示 GCN。其將所有的映射后的 X 作為輸入,然后輸出所有的 softmax classification results F(X)。簡單起見,我們表示 第 i 個 entity 的輸出為 Fi(X),是一個 C維的 softmax probability vector。在訓練的時候,我們采用 softmax loss 進行訓練:
F(*) 的權重是利用該 loss 通過反向傳播算法進行訓練的。在測試的時候,我們利用學習到的權重來獲得剩下 n-m entities 的 label。
不像在圖像上局部區域進行卷積操作一樣,在 GCN 中,the convolutional operations 計算一個節點的相應,是基於定義在 the adjacency matrix 上的緊鄰節點的(compute the response at a node based on the neighboring nodes defined by the adjacency graph)。數學上來講,在 Graph 上進行網絡 F(*) 每一層的卷積操作可以表達為:
其中,$A^{^}$是 graph 的二元緊鄰矩陣A 的歸一化版本(the normalized version of the binary adjacency matrix A of the graph),其維度為:n*n dimension。X' 是來自上一層的 n*k feature matrix。W是 the weigth matrix of the layer with dimension k*c,其中,c 是輸出通道個數。所以,卷積層的輸入是 n*k,輸出是 n*c matrix Z。這些卷積操作可以一層一層的累積。在每一層之后,用 ReLU 進行非線性處理。對於最后的 convolutional layer,輸出通道的 channel 是 label classes (c = C)。
3.2. GCN for Zero-shot Learning :
我們的模型是在 GCN 的基礎上構建起來的,然而,不像是 entity classification,我們用一個 regression loss 來應用於 zero-shot recognition。我們框架的輸入是:the set of categories and their corresponding semantic-embedding vectors。輸出是:the visual classifier for each input category。
特別的,我們想用 GCN 去學習的 visual classifier 是:a logistic regression model on the fixed pre-trained ConvNet features. 如果 visual-feature 的維度是D,那么,每一個 classifier $w_i$ 也是 D-dimensional vector。所以,GCN 中每一個節點的輸出是 D 維,而不是 C 維。在 zero-shot learning 中,我們假設總共 n 類的 first m categories 擁有足夠的 visual examples 來預測他們的權重向量。對於剩下的 n-m種,輸入他們的 embedding vectors,我們想要預測他們各自的權重向量。
一種訓練 neural network(multi-layer perceptron)的方法是:將 xi 作為輸入,然后學習預測 wi 作為輸出。網絡的參數可以用 m 對訓練樣本進行預測。然而,總體上來說,m 總是小的(in the order of a few hundreds),我們想要顯示的利用 visual world 的結構,或者種類之間的關系來約束該問題。我們用知識圖譜(knowledge graph)來表示他們的關系。每一個節點代表了一個 semantic category。因為我們總共有 n 個種類,在 graph 中有 n 個節點。如果兩個節點之間存在某種關系,就將其連接起來。圖結構表示為 n*n 的鄰接矩陣,A。在本文中,我們用 undirected edges 代替 KG 中所有的 directed edges,這樣就得到了一個對稱的 adjacency matrix。
像圖2中所示,我們用一個 6-layer GCN,每一層輸入是 feature representation,輸出是一個新的 feature representation。對於第一層,輸入 X 是一個 n*k matrix ( k is the dimensionaltiy of the word-embedding vector)。對於最后一層,輸出的 feature vector W^,其維度為:n*D;D 是分類器或者視覺向量的維度。
Loss-function:對於前 m 個類別,我們預測分類器的權重 $\hat{W}_{1, 2, ... , m}$ ,從訓練數據中學習的 GT classifier weights。此處利用 MSE 來訓練:
在訓練的過程中,我們利用 m 個可見的類別得到的 loss 來預測 GCN 的參數。利用預測的參數,我們得到 the zero-shot categories 的分類器權重。在測試的時候,我們利用 pre-trained convnet 來提取 image feature representation,然后利用這些產生的分類器來進行圖像的分類。
3.3. Implementation Details :
我們的 GCN 由 6 個 convolutional layers 構成,輸出的 channel 分別為:2048->2048->1024->1024->512->D,其中 D 代表了物體分類器的維度。當訓練我們的 GCN 時,我們在網絡的輸出以及 GT classifier 上,執行 L2-Normalization。在測試的過程中,the unseen classes 產生的分類器也是 L2-Normalized。我們發現,添加該重要的約束,as it regularizes the weights of all the classifiers into similar magnitudes。
為了得到 GCN 輸入的 Word embeddings,我們利用 GloVe text model 在 Wikipedia dataset,which leads to 300-d vectors. 對於類別包含多個單詞的名字,我們在訓練模型上匹配所有的單詞,然后找到他們的映射。通過平均這些單詞映射,我們得到其類別映射(by averaging these word embeddings, we obtain the class embedding)。
【Experiments】