Videos as Space-Time Region Graphs
ECCV 2018 Xiaolong Wang
2018-08-03 11:16:01
Paper:arXiv
本文利用視頻中時空上的 proposal 之間的關系,來進行行為識別的建模。
如上圖所示,本文將 video 看做是 a graph of objects,然后在該 graph 上進行行為識別的推理。整體的模型如圖 2 所示,該方法將視頻連續 5 秒的視頻作為輸入,傳遞給 3D-CNN。3D CNN 的輸出是一個四維的特征圖,維度為:T*H*W*d,其中,T 代表時間維度,H*W 代表了空間維度,d 代表了 channel number。
除了提取視頻的特征之外,我們采用 RPN 來提取物體的 proposals。給定 T feature frames 的每一個 BBox,我們采用 RoIAlign 來提取每一個 BBox 的 feature。RoIAlign 是獨立的在每一個 feature map 上進行特征提取的。有了 graph representations, 我們采用 GCN 來進行推理。我們執行 average pooling 來獲取 d-dimensional feature。除了 GCN features,我們也采用 average pooling 來獲得 the same d-dimension feature as a global feature。這兩個特征被 concatenate 到一起,進行 video level classification。
Graph Representations in Videos:
1). Video representation:
Video Backbone Model:(略)
Region Proposal Network:(略)
2). Similarity Graph:
我們通過在特征空間衡量 objects 之間的相似性,來構建 similarity graph。在這個 graph 當中,我們構建語義上相關的物體對。具體來說,我們會給予下面兩種 instances 較高的 edge:
(1)the same object in different states in different video frames ;
(2)highly correlated for recognizing the actions.
注意到:相似的 edges,在任何兩對 objects 之間都會進行計算。
正式的來說,假設我們已經有了所有的 object proposals 的 feature,那么,兩個 proposal 之間的相似性可以表達為:
其中,這兩個函數分別代表了原始 features 的不同轉換。特別的,其中參數 W 和 W' 都是 d * d 維的 weights,並且都是可以通過反向傳播進行學習的。通過添加轉換權重 W 和 W’,這允許我們不但可以學習到 the correlations between different states of the same object instance across frame,也可以學習到 不同 objects 之間的關系。
在計算出 affinity matrix 之后,我們在矩陣的每一行執行 normalization,使得:the sum of all the edge values connected to one proposal i will be 1. 我們利用 softmax 來執行這個 normalization:
歸一化之后的 G,被認為是 the adjacency matrix 代表 similarity graph。
3). Spatial-Temporal Graph:
雖然,similarity graph 捕獲了 the long term dependencies between any two object proposals,但是它依然沒有捕獲到 object 和 the ordering of the state change 之間的 the relative spatial relation。為了編碼 objects 之間 spatial 和 temporal relations,我們提出利用 spatial-temporal graphs,來將時間和空間位置附近的 proposal 也聯系起來。
給定第 t 幀的 object proposals,我們計算 當前 BBox 跟下一幀 BBox 的 IoUs。如果重合度大於 0,那么,我們將這兩個 object 用有向邊 i -> j 連接起來。在賦予 edge values 之后,我們也對這個 graph 進行歸一化:
注意到,這里僅僅是 front 的 graph,作者還構建了 backward 的 graph,以得到更多有有效的結構上的信息。
Convolutions on Graphs:
本文采用 gcn 的圖卷積網絡:Kipf, T.N., Welling, M.: Semi-supervised classification with graph convolutional networks. In: International Conference on Learning Representations (ICLR). (2017)
為了在 graph 上進行推理,我們采用了 GCN 模型。與傳統標准的 convolutional network 不同,他們是在 局部規則的網格數據上進行操作(which operates on a local regular grid),而 graph convolutions 允許我們通過 graph relations,根據其近鄰的情況,計算一個 node 的響應(allow us to compute the response of a node based on its neighbors defined by the graph relations)。所以,執行圖卷積就等價於執行 graph 內部的信息傳遞。GCNs 的輸出是每一個節點更新之后的 feature,這個 feature 可以被整合起來用於視頻分類。正式的,我們將 graph convolutional layer 可以定義為:
Z = GXW, (4)
其中,G 代表近鄰 graph (the adjacency graph),維度為:N*N,X 是 graph 中每一個節點的 feature,大小為 N * d,W 是權重矩陣(weight matrix,大小為 d*d)。所以,一個 graph convolutional layer 的輸出 Z 仍然是 N * d 維的。而且,這種 graph convolutional layers 可以被堆疊多層。在每一層 GC 之后,在將 Z 正式傳輸到下一層之前,我們采用兩個非線性激活函數(the Layer Normalization and ReLU)。
為了結合 GCNs 的多個 graphs,我們簡單的將公式(4)進行拓展,即:
其中,Gi 代表不同種類的 graph,而不同的圖,權重是不共享的。但是,作者發現:直接通過公式(5)組合三個 graph($G^{sim}, G^{front}, G^{back}$)缺讓精度降低了(相對於 單個 similarity graph 的情況)。
作者分析了原因:我們的 similarity graph $G^{sim}$ 包含需要學習的參數,在更新的時候是需要反向傳播的,但是另外兩個 graps 是不需要學習的。在每一個 GCN layer 上融合這些 feature,優化起來是非常困難的。所以,我們構建了 GCN 的兩個分支,然后僅僅在最后將這兩個 GCNs 進行融合。這兩支 GCNs 分別進行卷積操作(L layers),卷積的最后一層,疊加起來,行成 N*d 維度的輸出。
Video Classification.
作者將 GCNs 的輸出和未進行圖卷積的特征,進行 concatenate,然后輸入給分類器,進行分類,如圖所示:
Experiments: