Abstract
- AAAI 2018
- human body skeleton sequence을 이용한 human action recognition
- GCN을 dynamic skeleton modeling에 적용한 첫 번째 시도
- skeleton model에 맞게 GCN을 design한 ST-GCN(Spatial-Temporal Graph Convolutional Network) 제안
- https://github.com/yysijie/st-gcn
Motivation
Fig. 1에서 볼 수 있듯이 skeleton sequence에서 GCN을 이용한다. edge는 두 type으로, joint의 natural connectivity를 반영하는 spatial edges가 있고, 같은 joint의 consecutive time step을 연결하는 temporal edges가 있다.
Tessetrack에서 사용한 heterogeneous graph하고 비슷한 개념인 것 같다.
Methods
Overview
spatial temporal graph를 만들기 위해서 ST-GCN의 input은 graph node의 coordinate vectors가 된다. 그 후 ST-GCN을 적용해서 higher-level feature map을 만든다. 이후 softmax classifier로 classify하는 간단한 형태이다.
Skeleton Graph Construction
spatiotemporal graph $G=(V,E)$는 node set $V=\{v_{ti}|t=1,\dots,T,i=1,dots,N\}$인데, $T$는 frames, $N$는 joints를 의미한다. 이때 feature는 coordinate vector와 estimation confidence로 구성된다.
이후 spatial edges와 temporal edges를 연결한다. 2D pose는 OpenPose의 것을 사용하고, 3D pose는 RGB+D dataset을 사용했다. joint의 개수가 다르지만, spatial edges와 temporal edges를 만드는 방식은 차이가 없다.
formal하게는, edge set $E$는 2개의 subset으로 구성된다. 첫 subset은 intra-skeleton connection at each frame으로 $E_S=\{v_{ti}v{tj}|(i,j)\in H\}$이다. ($H$는 naturally connected body joints)
두 번째 subset은 inter-frame edges로, $E_F=\{v_{ti}v_{(t+1)i}\}$이다. 이는 수식에서도 볼 수 있듯이 consecutive time에서의 same joint를 연결하여, 전체적으로는 one particular joint의 trajectory를 의미하게 된다.
Spatial Graph Convolutional Neural Network
input feature map의 channel이 $c$이고 convolution의 kernel size가 $K×K$라고 할 때, spatial location $x$에서의 output value는 다음과 같이 계산될 수 있다:
여기서의 $\textbf {p}: Z^2×Z^2\to Z^2$는 $x$의 neighbors를 enumerate한다. weight function $\textbf{w}: Z^2\to ℝ^c$ featre vector를 위한 weight vector이다.
이는 일반적인 convolution에 대한 정의이고, graph에 사용하기 위해서 sampling function과 weight function을 정의해야 한다.
- Sampling function
graph에서의 node $v_{ti}$의 neighbor set은 $B(v_{ti}=\{v_{tj}|d(v_{tj},v_{ti})\le D\}$로 정의된다. 이때 $d(v_{tj}, v_{ti})$는 shortest path를 의미한다. ST-GCN에서 $D=1$로 정의되어 사용되었다.
어차피 D=1이면 GCN을 multi-layer로 적용할 경우 multi-hop까지 반영하니까 별 차이는 없을 것 같다.
따라서 sampling function $\textbf{p} : B(v_{ti}\to V$는 다음과 같아진다.
- Weight function
weight function을 쓰기 위해서는 연산을 적용하는 순서가 필요하다. (Niepert, Ahmed, and Kutzkov 2016)[2] 에서 root node 근처의 neighbor를 labeling하는 방법을 사용한 것을 따라서, neighbor set $B(v_{ti})$를 $K$개의 subset으로 나누었다. 즉, labeling을 위한 mapping $l_{ti} : B(v_{ti})\to \{0,\dots,K-1\}$을 사용하였다. 이를 가지고 weight function은 다음과 같이 정의된다.
즉, 모든 neighbor이 unique한 weight를 받지 않고, neighbor의 subset들이 동일한 weight를 mapping받는 것을 의미한다.
- Spatial graph convolution
이를 종합하면, Eq. 1는 다음과 같이 rewrite된다:
나머지는 명료할 것이고, $Z_{ti}(v_{tj})=|\{v_{tk}|l_{ti}(v_{tk})=l_{ti}(v_{tj})|$은 corresponding subset의 cardinality와 같은 normalizing term이다.
이를 전개하면,
의미를 천천히 살펴보면, 모든 neighbor에 대해서 그 neighbor feature와, neighbor가 해당하는 subset의 weight를 inner product하여 더한다. 다만 이렇게 할 경우 같은 weight가 여러 번 곱해지는 문제가 있으니, 해당 subset의 원소 개수만큼 나누어 각 weight가 곱해지는 계수가 1이 되도록 보정한다고 해석할 수 있다.
또한 전체 구조가 image에서의 convolution과 완전히 동일하다는 점도 이 approach가 image convolution의 장점을 가져올 수 있다는 점을 뒷받침한다.
- Spatial temporal modeling
다만 위의 convolution은 spatial neighbor만 고려하기 때문에, temporal neighbor도 고려할 필요가 있다. 이를 위해서 neighborhood의 concept을 temporally connected joint로 확장한다:
$Γ$는 neighbor에 들어갈 temporal range를 의미하며 temporal kernel size라고 한다.
여기에서 사용할 sampling function은 spatial case와 동일하게 적용한다. 반면 labeling map은 temporal axis의 순서가 원래 존재하므로 다음과 같이 수정한다:
의미를 생각해보면, tj에서 같은 joint에 대해 시간이 다른 q의 label을 계산하는 식이다. root의 label $l_{ti}(v_{ti})$가 베이스이다. $(q-t+\lfloor Γ/2 \rfloor)$는 temporal kernel size가 6이고 현재 11, root가 8이라고 하자. 그럼 11-8+3으로 6이 나온다. 이 값은 temporal kernel [1, Γ]로 mapping하는 함수가 된다. 그리고 거기에 kernel size를 곱하면 예컨대 K=5인 경우 30이 나오게 된다.
즉, root가 2번째 subset이고, temporal kernel size가 6, kernel size가 5라고 하면 같은 joint의 temporal kernel 안의 neighbor들은 7, 12, 17, 22, 27, 32를 받게 된다.
직관적으로 무슨 의미인지는 알기 어렵다..
Partition Strategies
- Uni-labeling
subset을 하나만 가져서 모든 neighborhood가 같은 label을 갖는 것이다. 이 경우 neighborhood는 모두 same weight가 곱해진다. 이는 GCN의 방법과 유사하다. 즉, $K=1, l_{ti}(v_{tj})=0,\forall i,j\in V$인 것인데, 이 경우 skeleton sequence classification에 필요한 local differential properties가 소실될 수 있으므로 suboptimal하다.
- Distance partitioning
root node $v_{ti}$의 거리를 label로 설정하는 것이다. 즉, $K=2, l_{ti}(v_{ti})=d(v_{tj},v_{ti})$로 설정하는 것이다. 이 경우 local differential properties를 modeling하는 것이 가능하다.
- Spatial configuration partitioning
여기서는 neighbor를 세 group으로 나눈다. 한 frame의 average coordinate를 gravity center로 지정한 후, 이를 기준으로 neighborhood를 나눈다. 즉 다음 세 가지로 나뉘게 된다:
- the root node itself
- centripetal group; gravity center보다 root에 가까운 neighbor
- centrifugal group; gravity center보다 root에서 먼 neighbor
$r_i$가 training set의 모든 frame 안에서 gravity center로부터 joint $i$까지의 평균 거리이다.
이게 말이 좀 모호한데, 쉽게 생각하면 구심군(centripetal group)은 현재 node를 중심으로 신체 중심부에 있는 node, 원심군(centrifugal group)은 현재 node를 중심으로 말단에 위치한 node를 의미한다.
Learnable Edge Importance Weighting
temporal graph convolution에서 learnable mask $M$을 every layer에 적용했다. 이 mask는 node feature를 neighboring node까지 확장하는 역할을 한다.
단순히 대입해서 성능 향상이 된 것으로 봐야 할 듯. 자세한 설명이 없다.
Implementing ST-GCN
single frame case의 ST-GCN은 GCN을 이용하여 구현될 수 있다:
이때 $Λ^{ii}=\sum_j(A^{ij}+I^{ij})$이다. spatiotemporal case에서 $f_{in}\in ℝ^(C×V×T)$이다. (C: input channel, V: spatial dim, T: temporal dim)
graph convolution은 $1×Γ$ standard 2D convolution을 적용하고 나서 second dim에 normalized adjacency matrix $Λ^{-\frac{1}{2} (A+I)Λ^{-\frac{1}{2}}$을 곱하는 것이다.
여기서 partitioning strategy를 적용하면 adjacency matrix가 $A+I=\sum_j A_j$로 나눠진다. 이를 적용하면
이때 $Λ_j^{ii}=\sum_K(A_j^{ik})+α$이고, α=0.001으로 empty row를 피하기 위함이다.
learnable edge importance weighting을 구현하기 위해서 learnable weight matrix $M$을 추가하고, $A+I$를 $(A+I)\otimes M$ 로, $A_j$는 $A_j \otimes M$으로 변경하였다. $M$은 모든 값이 1인 matrix로 initialize된다.
Results
Discussion
References
[1] Yan, S., Xiong, Y., & Lin, D. (2018, April). Spatial temporal graph convolutional networks for skeleton-based action recognition. In Proceedings of the AAAI conference on artificial intelligence (Vol. 32, No. 1).
[2] Niepert, M.; Ahmed, M.; and Kutzkov, K. 2016. Learning convolutional neural networks for graphs. In International Conference on Machine Learning.
Footnotes
'DL·ML > Paper' 카테고리의 다른 글
GLA-GCN(ICCV 2023, 3D HPE) (0) | 2024.04.03 |
---|---|
AGCN (CVPR 2019, action recognition) (0) | 2024.04.02 |
CLIPSelf (ICLR 2024 spotlight, open-vocabulary dense prediction) (0) | 2024.03.29 |
FutureFoul (0) | 2024.03.27 |
TesseTrack (CVPR 2021) (1) | 2024.03.27 |