基于人体骨架序列的视频行为识别
整体思路
Reference: Yan S, Xiong Y, Lin D. Spatial temporal graph convolutional networks for skeleton-based action recognition[C]//Thirty-Second AAAI Conference on Artificial Intelligence. 2018.
![](https://img.haomeiwen.com/i1877813/ae3e2748abe2d17c.png)
1. 基于 OpenPose 的 2D 多人 姿态/骨架 估计
- 输入:RGB image 或者 video sequence
- 输出:人体关节点位置和可信度
OpenPose 总共估计人体 18 个关节点,关节点顺序和名称如下图:
![](https://img.haomeiwen.com/i1877813/05b3ba5a880eb01e.png)
2. build Spatial-Temporal Graph on skeleton sequence
-
Nodes:
表示 skeleton sequence 帧数,即
个时刻,
表示
个人的骨架
表示 temporal 联系,inter-frame;
表示 spatial 联系,intra-skeleton
-
Feature vector on a node
-
Edges = spatial + temporal
intra-skeleton,
表示 joints in a skeleton,如 fig2 OpenPose 关节点的连接方式
inter-frame,连续帧之间的对应关节点连接起来
![](https://img.haomeiwen.com/i1877813/bd3717d01ec8669e.png)
注:spatial graph 理解为单帧中的骨架图,temporal graph 为多帧之间相应关节点的连接图
3. Graph Convolution details
3.1 传统图像在坐标点 x 位置的 conv
-
:input, output feature map
-
:表示位置
的
邻域
-
:表示邻域内相应位置点的权值
3.2 图卷积在顶点
位置的 conv
-
:input feature map
对于图卷积,表示 t 时刻输入的 feature map,即为
时刻的 spatial graph
,而
表示图中顶点的 feature vector 有
个通道。
定义完输入的 feature map 后,再定义邻域采样函数和权值函数
就能完成卷积运算了,这里
和
表示方法与传统 Conv 不同。
-
邻域采样函数
-
:
到
的最短路径 / 边数,hops
-
:只将直接相连的邻接点作为邻域
-
-
权值函数
- 邻域
分成
个子集(注意这里的
和前面传统卷积的
同样表示卷积的 kernel size)
- 子集中 nodes 分别赋上数值权值,这里为子集编号(图卷积中叫 labeling,即给每个 node 打分类标签)code 中用 size =
的 tensor 表示,类比传统卷积权值
- 邻域
注:划分
个子集,同一个子集内的节点采用相同的权重,从而实现权重共享。可按照邻域 path 划分,也可按照节点距离重心的远近划分,见 part 4
3.3 Spatial Graph Convolution 空域图卷积
-
:标准化因子,领域顶点
所在的子集中的顶点总个数
上述公式样式仍然偏向传统图像卷积,进一步转化为图卷积样式:
-
:邻域顶点
-
:给邻域顶点 打标签/赋权值 函数
3.4 Spatial Temporal Modeling 时空图卷积
时空邻域采样函数:空域连接 扩展到 时域连接,单帧扩展到多帧
- 邻域
→
,不限于单帧
- 上限
:
→
-
:temporal range, temporal kernel size,本文 = 9
时空邻域权值函数:划分子集 labeling 扩展到时域
4. 划分子集 & labeling
labeling 体现了 将邻域的特征聚合到当前节点 的一种规则。
![](https://img.haomeiwen.com/i1877813/18986f1cc12ffaf8.png)
![](https://img.haomeiwen.com/i1877813/ade3c1733f5ebf2b.png)
-
(b) Uni-labeling 同一标注权值
邻域内所有 nodes 权值一样,没有局部差异性 local differential properties
labeling:令,则
-
(c) Distance partitioning 距离划分 distance to root joint
具有局部差异性,但是缺乏子集 joints 相对全局的位置关系,即不能反应子集 joints 处于人体的哪块区域
labeling:令,则
可取值:0 或 1
-
(d) Spatial configuration partitioning
骨架 joints 运动可分为向心和离心,可将 nodes 分为 3 组:
其中
是邻域 joint 到黑色十字 × 的距离,
为 root joint
综上所述,邻域 joints 子集的划分特点:
- 既能保留局部信息,又能涵盖全局信息
- 邻域权重划分更加多样性
5. Implementing ST-GCN
5.1 邻接矩阵
对于 (c)(d) 划分,邻接矩阵 被分成了不同子集
-
(c):
-
(d):
添加 mask :
,学习不同邻接点对 root 的权重影响
5.2 网络结构
"9 ST-GCN units,temporal kernel size = 9 感受野"
# out 64 channels
ST-GCN
ST-GCN
ST-GCN
# out 128 channels
ST-GCN # stride = 2,时域下采样,2 frame -> 1frame
ST-GCN
ST-GCN
# out 256 channels
ST-GCN # stride = 2,时域下采样,2 frame -> 1frame
ST-GCN
ST-GCN
"Global Pooling, feature map -> 256 dimension feature vector"
GAP
"Softmax classifier"
softmax