Print

发布时间: 2022-08-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.210087
2022 | Volume 27 | Number 8




    图像分析和识别    




  <<上一篇 




  下一篇>> 





高性能整数倍稀疏网络行为识别研究
expand article info 臧影1,2,3, 刘天娇4, 赵曙光4, 杨东升1,2
1. 中国科学院大学计算机科学与技术学院, 北京 100049;
2. 中国科学院沈阳计算技术研究所,沈阳 110168;
3. 湖州师范学院信息工程学院,湖州 313000;
4. 烟台创迹软件有限公司,烟台 264000

摘要

目的 行为识别在人体交互、行为分析和监控等实际场景中具有广泛的应用。大部分基于骨架的行为识别方法利用空间和时间两个维度的信息才能获得好的效果。GCN(graph convolutional network)能够将空间和时间信息有效地结合起来,然而基于GCN的方法具有较高的计算复杂度,结合注意力模块和多流融合策略使整个训练过程具有更低的效率。目前大多数研究都专注于算法的性能,如何在保证精度的基础上减少算法的计算量是行为识别需要解决的关键性问题。对此,本文在轻量级Shift-GCN(shift graph convolutional network)的基础上,提出了整数倍稀疏网络IntSparse-GCN(integer sparse graph convolutional network)。方法 首先提出奇数列向上移动,偶数列向下移动,并将移出部分用0替代新的稀疏移位操作,并在此基础上,提出将网络每层的输入输出设置成关节点的整数倍,即整数倍稀疏网络IntSparse-GCN。然后对Shift-GCN中的mask掩膜函数进行研究分析,通过自动化遍历方式得到精度最高的优化参数。结果 消融实验表明,每次算法改进都能提高算法整体性能。在NTU RGB + D数据集的子集X-sub和X-view上,4流IntSparse-GCN + M-Sparse的Top-1精度分别为90.72%和96.57%。在Northwestern-UCLA数据集上,4流IntSparse-GCN + M-Sparse的Top-1精度达到96.77%,较原模型提高2.17%。相比代表性的其他算法,在不同数据集及4个流上的准确率均有提升,尤其在Northwestern-UCLA数据集上提升非常明显。结论 本文针对shift稀疏特征提出整数倍IntSparse-GCN网络,对Shift-GCN中的mask掩膜函数进行研究分析,并设计自动化遍历方式得到精度最高的优化参数,不但提高了精度,也为进一步的剪枝及量化提供了依据。

关键词

行为识别; 轻量级; 稀疏特征矩阵; 整数倍稀疏网络(IntSparse-GCN); mask掩膜函数

Action recognition analysis derived of integer sparse network
expand article info Zang Ying1,2,3, Liu Tianjiao4, Zhao Shuguang4, Yang Dongsheng1,2
1. School of Computer Science and Technology, University of Chinese Academy of Sciences, Beijing 100049, China;
2. Shenyang Institute of Computing Technology, Chinese Academy of Sciences, Shenyang 110168, China;
3. School of Information Engineering, Huzhou University, Huzhou 313000, China;
4. Trial Retail Engineering Co., Ltd., Yantai 264000, China
Supported by: National Science and Technology Major Project(2019ZX04014001-004)

Abstract

Objective The task of action recognition is focused on multi-frame images analysis like the pose of the human body from a given sensor input or recognize the in situ action of the human body through the obtained images. Action recognition has a wide range of applications in ground truth scenarios, such as human interaction, action analysis and monitoring. Specifically, some illegal human behaviors monitoring in public sites related to bus interchange, railway stations and airports. At present, most of skeleton-based methods are required to use spatio-temporal information in order to obtain good results. Graph convolutional network (GCN) can combine space and time information effectively. However, GCN-based methods have high computational complexity. The integrated strategies of attention modules and multi-stream fusion will cause lower efficiency in the completed training process. The issue of algorithm cost as well as ensuring accuracy is essential to be dealt with in action recognition. Shift graph convolutional network (Shift-GCN) is applied shift to GCN effectively. Shift-GCN is composed of novel shift graph operations and lightweight point-wise convolutions, where the shift graph operations provide flexible receptive fields for spatio-temporal graphs. Our proposed Shift-GCN has its priority with more than 10× less computational complexity based on three datasets for skeleton-based action recognition However, the featured network is redundant and the internal structural design of the network has not yet optimized. Therefore, our research analysis optimizes it on the basis of lightweight Shift-GCN and finally gets our own integer sparse graph convolutional network (IntSparse-GCN). Method In order to effectively solve the feature redundancy problem of Shift-GCN, we proposes to move each layer of the network on the basis of the feature shift operation that the odd-numbered columns are moved up and the even-numbered columns are moved down and the removed part is replaced with 0. The input and output of is set to an integer multiple of the joint point. First, we adopt a basic network structure similar to the previous network parameters. In the process of designing the number of input and output channels, try to make the 0 in the characteristics of each joint point balanced and finally get the optimization network structure. This network makes the position of almost half of the feature channel 0, which can express features more accurately, making the feature matrix a sparse feature matrix with strong regularity. The network can improve the robustness of the model and the accuracy of recognition more effectively. Next, we analyzed the mask function in Shift-GCN. The results are illustrated that the learned network mask is distributed in a range centered on 0 and the learned weights will focus on few features. Most of features do not require mask intervention. Finally, our experiments found that more than 80% of the mask function is ineffective. Hence, we conducted a lot of experiments and found that the mask value in different intervals is set to 0. The influence is irregular, so we designed an automated traversal method to obtain the most accurate optimized parameters and then get the optimal network model. Not only improves the accuracy of the network, but also reduces the multiplication operation of the feature matrix and the mask vector. Result Our ablation experiment shows that each algorithm improvement can harness the ability of the overall algorithm. On the X-sub dataset, the Top-1 of 1 stream(s) IntSparse-GCN reached 87.98%, the Top-1 of 1 s IntSparse-GCN+M-Sparse reached 88.01%; the Top-1 of 2 stream(s) IntSparse-GCN reached 89.80%, and the Top-1 of 2 s IntSparse-GCN+M-Sparse's Top-1 reached 89.82%; 4 stream(s) IntSparse-GCN's Top-1 reached 90.72%, 4 s IntSparse-GCN+M-Sparse's Top-1 reached 90.72%., Our evaluation is carried out on the NTU RGB + D dataset, X-view's 1 s IntSparse-GCN+M-Sparse's Top-1 reached 94.89%, and 2 s IntSparse-GCN+M-Sparse's Top-1 reached 96.21%, and the Top-1 of 4 s IntSparse-GCN+M-Sparse reached 96.57% through the ablation experiment, the Top-1 of 1s IntSparse-GCN+M-Sparse reached 92.89%, the Top-1 of 2 s IntSparse-GCN+M-Sparse reached 95.26%, and the Top of 4 s IntSparse-GCN+M-Sparse-1 reached 96.77%, which is 2.17% higher than the original model through the Northwestern-UCLA dataset evaluation. Compared to other representative algorithms, the multiple data sets accuracy and 4 streams have been improved. Conclusion We first proposed a novel method called IntSparse-GCN. A spatial shift algorithm is introduced based on integer multiples of the channel. Such feature matrix is a sparse feature matrix with strong regularity. The matrix facilitates the possibility to optimize the model pruning. To obtain the most accurate optimization parameters, our research analyzed the mask function in Shift-GCN and designed an automated traversal method. Sparse feature matrix and the mask parameter have potential to pruning and quantification further.

Key words

action recognition; lightweight; sparse feature matrix; integer sparse graph convolutional network (IntSparse-GCN); mask function

0 引言

人体行为识别已经在视频监控、人机交互、无人驾驶及虚拟现实中得到了广泛应用(Carreira和Zisserman,2017Martinez-Hernandez等,2018Wang和Wang,2017)。最初行为识别算法使用RGB图像序列(Zhu等,2018Sun等,2018)、深度图像序列(Xu等,2017Baek等,2017)或这些数据的融合(Feichtenhofer等,2016Wang等,2016)。由于视频序列数据量非常庞大,对于行为识别任务来说,存在大量信息冗余。如图 1所示,人体骨架数据具有轻量级及抗干扰性强等优点,仅包含人体关节点位置坐标信息,提供了高度抽象的信息,不受外界环境变化影响。骨架数据还可通过Openpose人体姿态估计算法(Cao等,2021)及Microsoft Kinect传感器(Zhang等,2012)轻松获得,所以基于骨骼的行为识别吸引了越来越多研究者的关注。

图 1 NTU RGB+D数据集中RGB图像序列与骨架序列
Fig. 1 RGB image sequence and skeleton sequence in NTU RGB+D dataset

基于卷积神经网络(convolutional neural networks,CNN)的行为识别算法通常专注于图像任务,而时间信息是行为识别性能提高的关键因素。如何在CNN中充分地利用空间和时间信息是行为识别的关键问题。Li等人(2018)提出了一种端到端的共现特征学习框架,使用CNN自动从骨架序列中学习分层的共现特征。在该框架中逐步汇总不同层级的上下文信息,在时域和空域将它们组合成语义表示,并总结出一个简单而又非常实用的方法来调节按需聚集的程度。Li等人(2019)为了更高效地表示骨架,对骨架信息进行编码,采用多流CNN模型对骨架数据进行识别。Caetano等人(2019a)引入一种新的骨架图像表示,作为CNN的输入,称为Skele-Motion。提出的方法通过显式计算骨架关节大小和方向值编码时间动态信息,采用不同时间尺度计算运动值,以将更多的时间动态信息聚集到表示中,从而使其能够捕获动作中涉及的远程关节交互以及过滤嘈杂的运动值。Caetano等人(2019b)对Skele-Motion进一步进行改进,引入树结构参考关节图像(tree structure reference joint image,TSRJI)作为一种新颖的骨架图像表示。

循环神经网络(rerrent neural network,RNN)(Zhang等,2018)是一种处理序列数据的有效方法,但是RNN结构缺乏空间建模能力,为了解决该问题,Wang和Wang(2017)提出一种新颖的双流RNN架构,对基于骨架的动作识别的时间动态和空间配置进行建模。针对时间流提出两种不同结构:堆叠RNN和分层RNN,其中分层RNN是根据人体运动学设计的。文章提出两种有效方法,通过将空间图转换成关节序列对空间结构进行建模,为了提高模型的通用性,进一步利用基于3D变换的数据增强技术,在训练过程中变换骨架的3D坐标。该方法为各种动作(即通用动作,互动活动和手势)带来了显著的改进。Xie等人(2018)提出一种端到端的内存注意网络(memory attention networks,mANs),该网络由一个时间注意力校准模块(time attention calibration module,TACM)和一个时空卷积模块(spatio-temporal convolution module,STCM)组成。并利用CNN进一步建模骨骼数据的时空信息。这两个模块(TACM和STCM)无缝地形成了可以以端到端的方式进行训练的单个网络体系结构。Zheng等人(2019)提出了注意力递归关系长短时记忆网络(attention recurrent relational network long-short term memory,ARRN-LSTM),同时对骨架中的空间和时间信息建模以进行动作识别。嵌入在单个骨架中的空间模式是通过递归关系网络学习的,然后使用多层LSTM-提取骨架序列中的时间特征。为了利用骨架中不同几何形状之间的互补性进行关系建模,设计了一种双流体系结构,学习关节之间的关系并同时探索流之间的潜在模式。同时,引入一种自适应注意模块用于关注针对特定动作的骨架潜在区分部分。

目前,基于骨架行为识别的大多数算法都是利用空间和时间两个维度的信息才能获得好的效果,而GCN(graph convolutional network)能够将空间和时间信息完美地结合起来。Yan等人(2018)提出一种动态骨架的新模型,称为时空图卷积网络(spatial temporal graph convolutional networks,ST-GCN),可以通过自动从数据中学习时空模式来超越之前方法的局限,具有更强的表达能力和泛化能力。Shi等人(2019a)提出一种新颖的两流自适应图卷积网络(two-stream adaptive graph convolutional networks,2 s-AGCN)用于基于骨骼的动作识别。BP(back propagation)算法以端到端的方式统一或单独学习模型中图的拓扑。这种数据驱动的方法增加了图构建模型的灵活性,并为适应各种数据样本带来了更多的通用性。Li等人(2019)引入称为A-link推理模块的编码器—解码器结构,直接从动作中捕获特定动作的潜在依赖关系,扩展现有骨架图以表示更高阶的依存关系,并将这两种类型的链接组合成广义骨架图,进一步提出了行动结构图卷积网络(action-structure graph convolutional network,AS-GCN),将行动结构图卷积网络和时间卷积网络(temporal convolutional network, TCN)作为基本构建块进行堆叠,学习时空动作识别功能。

然而,之前的方法都具有较高的计算复杂度,训练过程效率低下。目前的行为识别算法大多专注于算法的性能。如何在保证精度的同时减少算法计算量是行为识别需要解决的关键性问题。Cheng等人(2020)受Shift CNNs(generalized low-precision architecture for inference of convolutional neural networks)(Jeon和Kim,2018Wu等,2018Zhong等,2018)的启发,成功地将shift操作与轻量级的点卷积相结合,并引入到GCN中替代常规的卷积操作,不但降低了计算量,而且将感受野扩大到全局,提高了算法性能。在3个基于骨骼动作识别的数据集上,Shift-GCN明显超出现有方法,计算复杂度降低为原来的额1/10以上。

本文对Shift-GCN进行更加深入研究,发现网络的特征矩阵及注意力参数存在冗余,通过对网络结构的合理化设计及注意力参数详细分析,提出了精度更高的网络结构IntSparse-GCN(integer sparse graph convolutional network)。

本文主要贡献如下:1)在Shift-GCN基础上,对稀疏的shift操作进行改进,为尽量均衡每个关节点的特征向量中的0,改造了原始标准的网络结构,设计输入输出通道为关键点整数倍的网络结构,有效提高了识别准确率。2)对Shift-GCN注意力函数进行分析,发现大部分参数作用在关节点上的特征后,不但没有提高识别精度反而影响精度,为此设计了基于区间的自动搜索算法,满足区间范围内的参数不需要再进行乘法操作,不但提高了精度,速度也进一步提升。得到的关节点特征具有很强的稀疏性,为下一步的剪枝及量化提供了可能性。

1 相关工作

1.1 基于骨架的GCN行为识别算法

ST-GCN(Yan等,2018)将图神经网络扩展到时空图中,将空间中关节间自然连接的边和时间中连续时间步长上相同关节间的边输入到模型中,使信息能够沿空间维度和时间维度集成。首先将数据标准化,并构造9层空间时间图卷积单元(如图 2中B1~B9),前3层输出64个通道,中间3层输出128个通道,后3层输出256个通道。然后在每个单元中使用残差连接,使用dropout进行特征正则化处理。最后将输出的256个通道的输出进行全局平均池化,使用softmax进行分类,得到每个动作的预测得分。ST-GCN的分层结构增强了模型在大数据集上的表达能力,与传统手动分配部分或遍历规则的方法相比,体现了更优越的性能。

图 2 ST-GCN网络结构
Fig. 2 ST-GCN network structure

在ST-GCN基础上,Shi等人(2019a)提出一种自适应图卷积神经网络2 s-AGCN模型,能够在端到端网络中自适应地学习不同层和骨架样本的图拓扑结构。然而ST-GCN的注意力机制不够灵活,距离较远的关节点之间由于不存在直接连接而学习不到二者间的相关性。骨骼的长度和方向能够表达更丰富的运动信息。ST-GCN只使用骨架关节点的一阶特征,而2 s-AGCN使用骨骼的二阶特征,并与一阶信息相结合,显著提高了模型分类正确率。Shi等人(2019a)又进一步提出性能更高的MS-AAGCN(multi-stream attention enhanced adaptive graph convolutional neural network),将注意力模块嵌入图卷积层中,帮助模型选择性地提取更具区分性的节点和通道,并通过关节和骨骼信息,在时间维度构造运动信息,使用4流合并的性能大幅提高了模型性能。

1.2 shift卷积算法

传统卷积具有较强的计算复杂度,随着卷积核的增加计算量成倍增加,导致深度神经网络扩展困难。从本质而言,2维卷积主要是在空间域对特征进行层次化提取,在通道域对层叠的特征进行整合。Wu等人(2018)提出了shift方法,将空间域的特征进行不同方向平移,使用点卷积在通道域对特征进行融合,搭建端到端训练模型,附带一个超参控制准确率与效率的权衡。可以证明shift卷积层的输出和输入是关于通道排序无关的,并且shift卷积的感受野更加灵活,只需要通过简单地改变shift距离实现。Zhong等人(2018)将shift算子引入CNN,构造了3个基于shift的高效紧致的CNN网络,在保证预测精度的同时,减少了GPU(graphics processing unit)上的推理时间,shift操作避免了内存的复制,因此具有较快速度。Cheng等人(2020)将0参数的shift操作应用到空间模块和时间模块中,提出一种更轻量级的Shift-GCN模型,大幅减少了模型的计算复杂度。与传统shift操作一样,Shift-GCN可以分为shift操作和点卷积两个阶段,然而传统shift操作主要用在标准的图像数据中,骨架数据是非规则的图拓扑结构,因此构造了一种新的空间shift方法,根据感受野不同可以分为局部shift和非局部shift的方法,非局部的shift方法具有更大的感受野,能够更好地克服人体的空间结构的限制,使每个节点都能够接收到其他节点的信息。实验证明非局部的shift方法具有更优的性能。将shift算子引入GCN,不但构造了轻量级的动作识别算法,还有效提升了模型性能。

2 提出的方法

首先引入基于通道整数倍的空间shift算法,并借鉴SparseShift-GCN的shift算法,将部分通道位置置0,使特征通道接近一半的位置为0,使其成为具有强规律性的稀疏特征矩阵,为其他研究者的模型剪枝及量化提供了可能性。然后对Shift-GCN中的mask掩膜函数进行研究分析,发现其mask掩膜函数80%以上的参数未起作用,为此本文构建了新的自适应mask掩膜函数,使速度和精度均有提升。

2.1 关节点整数倍空间shift算法

虽然Shift-GCN在很大程度上减少了算法的计算量。但是网络特征存在冗余,网络内部结构设计还没有达到最优化程度。为了进一步解决特征冗余,本文提出首先将网络每层的输入输出设置成关节点的整数倍,然后采用将奇数列向上移动、偶数列向下移动的方式对特征矩阵进行移动操作。为了防止过拟合,提升模型泛化能力,将移出部分用0代替。这样设计使网络中每个关节点的特征中的0的个数几乎一样,有效提高了模型的鲁棒性和识别精度。

图 3为网络通道整数倍与非整数倍的结构对比。图中$N$为人体关节点的个数,$C$为网络某一层的输出通道数量,k为正整数,k=1, 2, …, n。图中的$N$= 7,当网络某一层的输出通道为10时,该层中的每个特征向量的0的个数是不相等的,0的个数从上到下分别为5、4、3、3、3、3、4,这样会导致每个特征向量的值不均衡。而当$C$=2kN-1时(k = 1时),即$C$=2×7-1,则每个特征向量中0的个数都是6,这样使每个特征向量中的0都是均衡的,能有效增加模型的稳定性。

图 3 网络通道整数倍与非整数倍的结构对比
Fig. 3 Structure comparison between integer multiples and non-integer multiples of network channels

图 3中可以看出,提取的特征矩阵是非常稀疏的,接近一半的特征值是0,这些值对识别率没有任何贡献,不需要对其进行任何计算,而这样的设计并没有降低分类精度,反而提高了精度。这样的稀疏特征矩阵为其他研究者压缩模型、加速网络提供了依据。所以专门针对整数倍的shift操作设计了高效的网络结构IntSparse-GCN。图 4展示关节点为25时的IntSparse-GCN结构图,。其各层网络输入输出如表 1所示。

图 4 关节点为25时的IntSparse-GCN结构图
Fig. 4 IntSparse-GCN structure diagram when key point is 25

表 1 关节点为25时的IntSparse-GCN各层网络输入输出
Table 1 The input and output description of each layer of IntSparse-GCN when the node is 25

下载CSV
网络层数 输入通道 输出通道 卷积步数
Data BN - - -
layer1 3 74 1
layer2 74 74 1
layer3 74 74 1
layer4 74 74 1
layer5 74 124 2
layer6 124 124 1
layer7 124 124 1
layer8 124 249 2
layer9 249 249 1
layer10 249 249 1
GAP - - -
softmax - - -
注:“-”表示此数据为空。

为了与Shift-GCN进行对比,基础网络依然为10层。为了保持总体参数量与Shift-GCN相当,将网络前4层输出设置为74,5—7层输出设置为124,8—10层输出设置为249。除了输出通道个数为74的特征中0的个数不太均衡,其他所有层都满足特征通道0的个数相等的条件。实验表明,这样设计不但提高了模型性能,而且由于整个网络0的数量庞大且具有规律性,为进一步的模型剪枝及优化提供了可能性。由于本文采用奇数列向上移动、偶数列向下移动的方式对特征矩阵进行移动,所以计算网络中某一层中0的个数要对奇数列和偶数列分别进行单独处理。

偶数列0的个数为

$ Z_{\text {even }}=\left\lfloor\frac{C}{2 N}\right\rfloor \sum\limits_{i=1}^{N-1} i+\sum\limits_{j=1}^{M_{\mathrm{even}}-1} j $ (1)

$ M_{\mathrm{even}}=\left\lfloor\frac{1}{2}\left(C-2 N\left[\frac{C}{2 N}\right\rfloor+2\right)\right\rfloor $ (2)

式中,$N$为人体关节点总数,$i$为第$i$个关节点,$C$为通道总数,$j$为第$j$个通道数。

$N$=7,$C$=13时,$M_{\mathrm{even}}$=7,式(1)前半部分为0,后半部分为1+2+3+4+5+6,所以偶数列中0的个数$Z_{\mathrm{even}}$= 21。

同理,奇数列0的个数为

$ Z_{\text {odd }}=\left\lfloor\frac{C}{2 N}\right\rfloor \sum\limits_{i=1}^{N-1} i+\sum\limits_{j=1}^{M_{\text {odd }}-1} j $ (3)

$M_{\text {odd }}=\left\lfloor\frac{1}{2}\left(C-2 N\left[\frac{C}{2 N}\right\rfloor+1\right)\right\rfloor $ (4)

最终整个网络的0的总个数为$Z_{\mathrm{even}}+Z_{\text {odd }}$。按上式计算的本文网络不同输出通道各层中0的个数在该层特征总数中的占比如表 2所示。

表 2 网络不同输出通道各层中0的个数在该层特征总数中的占比
Table 2 The proportion of number of 0 in each layer of different output channels of the network in the total number of features of this layer

下载CSV
通道数 0总个数 特征总数 0总占比/%
3 2 75 2.66
74 744 1 850 40.25
124 1 344 3 100 43.33
249 3 000 6 225 48.16

表 2可以看出,0在整个网络中的占比非常大,本文工作不但能提高网络精度,而且为进一步的网络优化提供了可能性。本文网络结构都是10层,针对不同关节点个数只需要修改IntSparse-GCN参数即可,不需要修改任何其他参数。本文设计的网络结构与关节点个数是无关的,只是网络中每层的输入输出通道数与关节点个数有关。不同关节点个数不需要修改网络结构,只需要修改网络输入输出通道数即可。由于Northwestern-UCLA数据集中人体关节点个数为20,所以需要将网络输入输出通道改为20的整数倍。表 3展示了适合于关节点个数为20的网络结构,描述了关节点为20时IntSparse-GCN各层网络输入输出情况。

表 3 关节点为20时IntSparse-GCN各层网络输入输出
Table 3 The input and output description of each layer of IntSparse-GCN when the node is 20

下载CSV
网络层数 输入通道 输出通道 卷积步数
Data BN - - -
layer1 3 79 1
layer2 79 79 1
layer3 79 79 1
layer4 79 79 1
layer5 79 139 2
layer6 139 139 1
layer7 139 139 1
layer8 139 279 2
layer9 279 279 1
layer10 279 279 1
GAP - - -
softmax - - -
注:“-”表示此数据为空。

2.2 Shift-GCN特征注意力机制优化

Shift-GCN提取关节点的特征shift之后,不同节点之间的连接强度是相同的。但由于人类骨骼的重要性不同,引入了一种自适应的非局部shift机制。计算shift特征和可学习掩码之间的元素乘积,通过一个可学习的自适应参数$M$增强重要关节部位的权重,具体计算为

$ \tilde{\boldsymbol{F}}_{M}=\tilde{\boldsymbol{F}} \circ \text { mask }=\tilde{\boldsymbol{F}} \circ(\tanh (M)+1) $ (5)

式中,$\tilde{\boldsymbol{F}}$为空间骨骼特征图,$\tilde{\boldsymbol{F}}_{M}$为原特征图与mask掩膜数值($mask$)逐点相乘($\circ $)后得到的新特征图,$M$为可学习的参数,由于tanh的值域范围为[-1.0, 1.0],所以mask的取值范围为[0.0, 2.0],且聚集在1.0附近。通过对$M$参数的学习,使网络能够有效增强对于分类起关键作用的关节点权重,提高网络性能。tanh($M$)+1数值的分布情况如图 5所示。可以看出,其数值分布在1.0附近。分布在1.0±$\alpha $范围内的值对模型分类精度影响都非常小,大量实验表明,删掉某些范围内的数值甚至会提高模型的识别精度,如表 4所示。

图 5 不同层的tanh($M$) + 1数据情况
Fig. 5 The tanh($M$)+1 distribution of different layers
((a)layer 1;(b)layer 3;(c)layer 5;(d)layer 7)

表 4 不同区间置0后的精度变化情况
Table 4 Accuracy changes after different intervals are set to 0

下载CSV
置0区间 占总参数比例 Top-1/% Top-5/%
0.99~1.01 29 87.89 97.74
0.95~1.00 40 87.89 97.74
0.95~1.10 77 87.89 97.77
0.90~1.10 86 87.89 97.73

原模型的Top-1精度为87.88%。图 6是Top-1精度为87.89%时网络第5层删除一定参数量后的数据分布情况。可以看出,删除不同程度的参数量后,精度都有所提升,删除的参数量越多,算法优化空间越大。

图 6 第5层删掉某些范围内的数值后不同置0空间的$M$的分布
Fig. 6 The distribution of $M$ in different spaces of setting 0 after deleting some values in the range in the 5th layer
((a)0.99~1.01;(b)0.95~1.00;(c)0.95~1.10;(d)0.90~1.10)

图 7显示的是4个不同区间的$M$值为0的参数值在网络各层中的比例,在将$M$值为0.90~1.10区间内的所有值都置0情况下,原始模型的Top-1精度为87.88%,Top-5精度为97.74%。从表 4可以看出,将77%的参数置0后,Top-1精度为87.89%,Top-5精度为97.77%,精度均有所提升。

图 7 不同区间为0的参数值在各层中的占比情况
Fig. 7 The proportion of parameter values with different intervals of 0 in each layer

为此,设计了一个带超参数的循环自动化删除一定范围内$M$值的程序——最优模型自动搜索算法,通过该程序可以自动选取删掉一定范围内的$M$值,不但提高了模型分类精度,而且删掉的这部分参数不必再做乘法操作,节省了计算量。最优模型自动搜索算法具体实现过程如下:

1) 输入Original Model;

2) for li in L = {l1, l2, …, ln} do;

3)  for rj in R = {r1, r2, …, rm} do;

4)  for each layer Lk∈Original Model do;

5)   if Lk is Feature Mask then;

6)    M = {x1, x2, …, xNV} is the value of Lk

7)    T = tanh(M) + 1;

8)    for tgT = {t1, t2, …, tNV} do;

9)    if tg > li and tg < rj then;

10)    update xg = 0;

11)  测试每个新模型精度;

12) 选择精度最高的模型作为最终模型。

在实现过程中,通过设置tanh($M$)+1的左右边界确定搜索范围,左边界搜索范围为0.90,0.91,…,1.00;右边界搜索范围为1.00,1.01,…,1.10。在不同区间内对所有$M$值置0,得到n个区间置0后的所有Top-1及Top-5的精度值,最终得到最高精度值更改后的模型。

3 实验

3.1 数据集和评估指标

3.1.1 数据集

实验在NTU RGB+D(Shahroudy等,2016)和Northwestern-UCLA(Wang等,2014a)数据集上进行。NTU RGB+D数据集由56 880个动作样本组成,包含RGB视频、深度图序列、3D骨架数据和红外视频,由3部Microsoft Kinect v2相机同时捕获。RGB视频分辨率为1 920 × 1 080像素,深度图和红外视频均为512 × 424像素,3D骨架数据包含每帧25个主要身体关节的3维位置。3D骨骼节点信息通过Kinect相机的骨骼跟踪技术获得,由人体25个主要身体关节的3维位置坐标构成。骨骼追踪技术通过处理深度数据建立人体各关节坐标,能够确定人体的各部分(如手、头部或身体)及所在的空间位置。Northwestern-UCLA数据集也是由3部Kinect相机捕获,包含1 494个视频剪辑,涵盖10个类别。每类动作分别由10人完成。本文将前两台摄像机的样本作为训练样本,另一台摄像机的样本作为测试样本。

3.1.2 评估指标

使用Top-1及Top-5作为评价指标来计算分类的准确率。

3.1.3 实现细节

为了与之前方法进行比较,使用带有Nesterov动量(0.9)的SGD(stochastic gradient descent)训练140个epoch后终止学习。学习率设置为0.1,在第60、80和100个epoch时,学习率除以10。对于NTU RGB + D数据集,batchsize设置为64。对于Northwestern-UCLA,batchsize设置为16。消融研究中的所有实验均使用上述设置。深度学习的框架是PyTorch(Paszke等,2017),本文网络使用NVIDIA 4 GeForce RTX 2080 Ti GPU进行训练。

3.2 消融实验

在NTU RGB + D数据集的X-sub上验证本文提出的IntSparse-GCN网络及最优模型自动搜索算法。分别对4流的精度提升情况进行对比分析,4流分别为joint、bone、joint motion和bone motion。不同改进模块对每个流的精度提升情况如表 5所示。可以看出,添加不同模块后对各个流产生的影响是不同的,joint、bone和joint motion的Top-1精度分别提高了0.15、0.51和0.09,bone motion的Top-1精度降低了0.09。虽然bone motion有轻微精度下降,但是其他3个流的精度都有提升,4流融合后的精度是提升的。

表 5 在NTU RGB+D数据集的X-sub上改进不同模块后各流精度对比效果
Table 5 The accuracy comparison effect of each stream after improving the different modules on the X-sub of NTU RGB+D  

下载CSV
/%
方法 Top-1
joint bone joint motion bone motion
Shift-GCN 87.86 88.00 86.34 86.61
IntSparse-GCN 87.98 88.46 86.40 86.50
IntSparse-GCN+M-Sparse 88.01 88.51 86.43 86.52
注:加粗字体表示各列最优结果。

为了更加详细地对本文算法进行验证,对4流融合后的精度情况进行验证分析,结果如表 6所示,可以看出,与Shift-GCN模型相比,IntSparse-GCN+ M-Sparse模型在4个流上的精度均有不同程度的提升,在1 s、2 s和4 s的Top-1精度上比Shift-GCN分别提升了0.15、0.03和0.06。

表 6 在NTU RGB+D数据集的X-sub上改进不同模块后4流融合的精度对比效果
Table 6 Improve the accuracy comparison effect of 4-stream fusion after different modules on the X-sub dataset of NTU RGB+D  

下载CSV
/%
方法 Top-1
1 s 2 s 4 s
Shift-GCN 87.86 89.79 90.66
IntSparse-GCN 87.98 89.80 90.72
IntSparse-GCN+M-Sparse 88.01 89.82 90.72
注:加粗字体表示各列最优结果。

3.3 与其他算法的对比分析

为了验证算法的有效性,在NTU RGB+D数据集的X-sub和X-view子集上及Northwestern-UCLA数据集上将本文算法与当前的先进方法进行对比分析,对比结果如表 7表 8所示。

表 7 本文算法与当前先进方法在NTU RGB+D数据集上对比结果
Table 7 The proposed algorithm is compared with the state-of-the-art methods on the NTU RGB+D dataset

下载CSV
方法 X-sub/% X-view/% FLOPs/G
Lie Group (Veeriah等,2015) 50.10 52.80 -
Deep-LSTM (Shahroudy等,2016) 60.70 67.30 -
VA-LSTM (Zhang等,2017) 79.20 87.70 -
TCN (Kim和Reiter,2017) 74.30 83.10 -
Synthesized CNN (Liu等,2017) 80.00 87.20 -
3 scale ResNet 152 (Li等,2017) 84.60 90.90 -
ST-GCN (Yan等,2018) 81.50 88.30 -
Motif+VTDB (Wen等,2019) 84.20 90.20 -
2 s AS-GCN (Li等,2019) 86.80 94.20 27.0
2 s Adaptive GCN (Shi等,2019a) 88.50 95.10 35.8
2 s AGC-LSTM (Si等,2019) 89.20 95.00 54.4
4 s Directed-GNN (Paszke等,2017) 89.90 96.10 126.8
1 s Shift-GCN (Cheng等,2020) 87.86 95.10 2.5
2 s Shift-GCN (Cheng等,2020) 89.79 96.00 5.0
4 s Shift-GCN (Cheng等,2020) 90.66 96.50 10.0
1 s IntSparse-GCN+M-Sparse (本文) 88.01 94.89 2.5
2 s IntSparse-GCN+M-Sparse (本文) 89.82 96.21 5.0
4 s IntSparse-GCN+M-Sparse (本文) 90.72 96.57 10.1
注:加粗字体表示各列最优结果,“-”表示此数据为空。Deep-LSTM(deep long short-term memory network); VA-LSTM(view adaptation LSTM); TCN(temporal convolutional neural networks); Synthesized CNN(synthesized convolutional neural network); 3 scale ResNet 152(3 scale deep residual network 152); ST-GCN(spatial temporal graph convolutional networks); Motif + VTDB(Motif + variable temporal dense block); AS-GCN(actional-structural graph convolutional networks); Adaptive GCN(adaptive graph convolutional networks); AGC-LSTM(attention enhanced graph convolutional LSTM); Directed-GNN(directed graph neural networks); Shift-GCN(shift graph convolutional network); IntSparse-GCN + M-Sparse(integer sparse graph convolutional network+mask-sparse)。

表 8 本文算法与state-of-the-art方法在Northwestern-UCLA数据集上对比结果
Table 8 The proposed algorithm is compared with the state-of-the-art methods on the Northwestern-UCLA dataset

下载CSV
方法 Top-1/%
Lie Group (Veeriah等,2015) 74.20
Actionlet ensemble (Wang等,2014b) 76.00
Ensemble TS-LSTM (Lee等,2017) 89.20
2 s AGC-LSTM (Si等,2019) 93.30
1 s Shift-GCN (Cheng等,2020) 92.50
2 s Shift-GCN (Cheng等,2020) 94.20
4 s Shift-GCN (Cheng等,2020) 94.60
1 s IntSparse-GCN+M-Sparse (本文) 92.89
2 s IntSparse-GCN+M-Sparse (本文) 95.26
4 s IntSparse-GCN+M-Sparse (本文) 96.77
注:加粗字体表示最优结果。

表 7可以看出,本文算法与原始的Shift-GCN算法相比,计算量(floating-point operations per second,FLOPs)虽然略有增加,但仍为同一个数量级。然而,本文网络的精度在各个流上均有不同程度提升,且本文的特征是稀疏的,有近一半的特征值是0,为下一步优化模型提供了基础。

表 8可以看出,在Northwestern-UCLA数据集上,与Shift-GCN相比,在Top-1精度上,本文方法的1 s、2 s和4 s分别提升了0.39、1.06和2.17,超过了所有之前算法的性能。

3.4 算法效果可视化

为了进行更进一步的比较,使用混淆矩阵与之前算法的精度对比曲线来可视化算法的结果。图 8显示了某些类别的混淆矩阵,可以看出,本文提出的IntSparse-GCN可以提高大多数类别的识别精度,尤其是对于一些容易混淆的类别,识别率得到了显著提高。例如,在Shift-GCN中pick up with one hand有9个样本识别成pick up with two hands,但是本文的IntSparse-GCN将错误识别的次数减少到1,识别正确个数明显增多。

图 8 Northwestern-UCLA分类的混淆矩阵
Fig. 8 Confusion matrix for Northwestern-UCLA classification
((a) confusion matrix of Shift-GCN; (b) confusion matrix of IntSparse-GCN)

本文算法与先进算法的对比分析结果如图 9所示。可以看出,本文算法在Northwestern-UCLA数据集上的精度提高最为明显,在NTU RGB+D数据集的joint和bone两个流上也有较明显的提高。

图 9 本文算法与先进算法在不同数据集上的对比分析结果
Fig. 9 The results of comparison and analysis among the state-of-the-art algorithms and ours on different datasets
((a) Northwestern-UCLA dataset; (b) NTU RGB+D dataset)

4 结论

针对GCN网络较高的计算复杂度及Shift-GCN的特征冗余问题,本文从两个方面对网络进行优化,主要贡献及结论如下:

1) 提出整数倍稀疏shift网络IntSparse-GCN。引入基于通道整数倍的空间shift算法,将移出通道部分的位置置0,使得特征通道中接近一半的特征值为0。这样的特征矩阵是具有强规律性的稀疏特征矩阵,不但提高了网络精度,还为进一步的模型剪枝优化提供了可能性。

2) 对Shift-GCN中的mask掩膜进行研究分析,发现80%以上的参数都未起到注意力的作用。提出了自适应mask掩膜获取方法,不但提高了速度,精度也有所提升。

3) 与现有一些经典的行为识别网络及Shift-GCN网络的对比实验表明,本文网络不但在各个流的性能上都有所提升,而且本文改进后得到的强稀疏性特征矩阵为模型速度的进一步提升提供了可能性。

虽然本文方法从两方面对Shift-GCN网络进行了优化,提高了识别精度,但通过混淆矩阵等实验发现,还是存在一定程度的错分及误分,主要是有一些类别的骨架信息不太准确,并且数据集中有一些非常相似的行为。因此,未来将尝试通过注意力机制等多种手段使相似行为能更好地区分,并利用特征矩阵的稀疏性对网络进行剪枝及量化,使网络能够移植到边缘计算设备上,优化后的网络在能源节约、信息安全和计算效率等方面将有较大的改善。

参考文献

  • Baek S, Shi Z Y, Kawade M and Kim T K. 2017. Kinematic-layout-aware random forests for depth-based action recognition//Proceedings of 2017 British Machine Vision Conference (BMVC). London, UK: BMVA Press: #13[DOI: 10.5244/C.31.13]
  • Caetano C, Brémond F and Schwartz W R. 2019b. Skeleton image representation for 3D action recognition based on tree structure and reference joints//Proceedings of the 32nd SIBGRAPI Conference on Graphics, Patterns and Images. Rio de Janeiro, Brazil: IEEE: 16-23 [DOI: 10.1109/SIBGRAPI.2019.00011]
  • Caetano C, Sena J, Brémond F, dos Santos J A and Schwartz W R. 2019a. SkeleMotion: a new representation of skeleton joint sequences based on motion information for 3D action recognition//Proceedings of the 16th IEEE International Conference on Advanced Video and Signal based Surveillance. Taipei, China: IEEE: 1-8 [DOI: 10.1109/AVSS.2019.8909840]
  • Cao Z, Hidalgo G, Simon T, Wei S E, Sheikh Y. 2021. OpenPose: realtime multi-person 2D pose estimation using part affinity fields. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(1): 172-186 [DOI:10.1109/TPAMI.2019.2929257]
  • Carreira J and Zisserman A. 2017. Quo vadis, action recognition? A new model and the kinetics dataset//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, USA: IEEE: 4724-4733 [DOI: 10.1109/CVPR.2017.502]
  • Cheng K, Zhang Y F, He X Y, Chen W H, Cheng J and Lu H Q. 2020. Skeleton-based action recognition with shift graph convolutional network//Proceedings of 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle, USA: IEEE: 180-189 [DOI: 10.1109/CVPR42600.2020.00026]
  • Feichtenhofer C, Pinz A and Zisserman A. 2016. Convolutional two-stream network fusion for video action recognition//Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas, USA: IEEE: 1933-1941 [DOI: 10.1109/CVPR.2016.213]
  • Jeon Y and Kim J. 2018. Constructing fast network through deconstruction of convolution//Proceedings of the 32nd International Conference on Neural Information Processing Systems. Montréal, Canada: Curran Associates Inc. : 5955-5965
  • Kim T S and Reiter A. 2017. Interpretable 3D human action analysis with temporal convolutional networks//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, USA: IEEE: 1623-1631 [DOI: 10.1109/CVPRW.2017.207]
  • Lee I, Kim D, Kang S and Lee S. 2017. Ensemble deep learning for skeleton-based action recognition using temporal sliding LSTM networks//Proceedings of 2017 IEEE International Conference on Computer Vision. Venice, Italy: IEEE: 1012-1020 [DOI: 10.1109/ICCV.2017.115]
  • Li C, Zhong Q Y, Xie D and Pu S L. 2017. Skeleton-based action recognition with convolutional neural networks//Proceedings of 2017 IEEE International Conference on Multimedia and Expo Workshops (ICMEW). [s. l. ]: IEEE: 597-600 [DOI: 10.1109/LSP.2017.2678539]
  • Li C, Zhong Q Y, Xie D and Pu S L. 2018. Co-occurrence feature learning from skeleton data for action recognition and detection with hierarchical aggregation//Proceedings of the 27th International Joint Conference on Artificial Intelligence. Stockholm, Sweden: IJCAI: 786-792 [DOI: 10.24963/ijcai.2018/109]
  • Li M S, Chen S H, Chen X, Zhang Y, Wang Y F and Tian Q. 2019. Actional-structural graph convolutional networks for skeleton-based action recognition//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach, USA: IEEE: 3590-3598 [DOI: 10.1109/CVPR.2019.00371]
  • Liu M Y, Liu H, Chen C. 2017. Enhanced skeleton visualization for view invariant human action recognition. Pattern Recognition, 68: 346-362 [DOI:10.1016/j.patcog.2017.02.030]
  • Martinez-Hernandez U, Dodd T J, Prescott T J. 2018. Feeling the shape: active exploration behaviors for object recognition with a robotic hand. IEEE Transactions on Systems, Man, and Cybernetics: Systems, 48(12): 2339-2348 [DOI:10.1109/TSMC.2017.2732952]
  • Paszke A, Gross S, Chintala S, Chanan G, Yang E, DeVito Z, Lin Z M, Desmaison A, Antiga L and Lerer A. 2017. Automatic differentiation in PyTorch//Proceedings of the 31st Conference on Neural Information Processing Systems. Long Beach, USA: Curran Associates Inc.
  • Shahroudy A, Liu J, Ng T T and Wang G. 2016. NTU RGB+D: a large scale dataset for 3D human activity analysis//Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas, USA: IEEE: 1010-1019 [DOI: 10.1109/CVPR.2016.115]
  • Shi L, Zhang Y F, Cheng J and Lu H Q. 2019a. Two-stream adaptive graph convolutional networks for skeleton-based action recognition//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach, USA: IEEE: 12018-12027 [DOI: 10.1109/CVPR.2019.01230]
  • Shi L, Zhang Y F, Cheng J and Lu H Q. 2019b. Skeleton-based action recognition with directed graph neural networks//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach, USA: IEEE: 7904-7913 [DOI: 10.1109/CVPR.2019.00810]
  • Si C Y, Chen W T, Wang W, Wang L and Tan T N. 2019. An attention enhanced graph convolutional LSTM network for skeleton-based action recognition//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach, USA: IEEE: 1227-1236 [DOI: 10.1109/CVPR.2019.00132]
  • Sun Y C, Wu X X, Yu W N, Yu F W. 2018. Action recognition with motion map 3D network. Neurocomputing, 297: 33-39 [DOI:10.1016/j.neucom.2018.02.028]
  • Veeriah V, Zhuang N F and Qi G J. 2015. Differential recurrent neural networks for action recognition//Proceedings of 2015 IEEE International Conference on Computer Vision. Santiago, Chile: IEEE: 4041-4049 [DOI: 10.1109/ICCV.2015.460]
  • Wang H S and Wang L. 2017. Modeling temporal dynamics and spatial configurations of actions using two-stream recurrent neural networks//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, USA: IEEE: 3633-3642 [DOI: 10.1109/CVPR.2017.387]
  • Wang J, Nie X H, Xia Y, Wu Y and Zhu S C. 2014a. Cross-view action modeling, learning, and recognition//Proceedings of 2014 IEEE Conference on Computer Vision and Pattern Recognition. Columbus, USA: IEEE: 2649-2656 [DOI: 10.1109/CVPR.2014.339]
  • Wang J, Liu Z C, Wu Y, Yuan J S. 2014b. Learning Actionlet ensemble for 3D human action recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(5): 914-927 [DOI:10.1109/TPAMI.2013.198]
  • Wang L M, Xiong Y J, Wang Z, Qiao Y, Lin D H, Tang X O and Van Gool L. 2016. Temporal segment networks: towards good practices for deep action recognition//Proceedings of the 14th European Conference on Computer Vision. Amsterdam, the Netherlands: Springer: 20-36 [DOI: 10.1007/978-3-319-46484-8_2]
  • Wen Y H, Gao L, Fu H B, Zhang F L, Xia S H. 2019. Graph CNNs with motif and variable temporal block for skeleton-based action recognition. Proceedings of the AAAI Conference on Artificial Intelligence, 33(1): 8989-8996 [DOI:10.1609/aaai.v33i01.33018989]
  • Wu B C, Wan A, Yue X Y, Jin P, Zhao S C, Golmant N, Gholaminejad A, Gonzalez J and Keutzer K. 2018. Shift: a zero FLOP, zero parameter alternative to spatial convolutions//Proceedings of 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City, USA: IEEE: 9127-9135 [DOI: 10.1109/CVPR.2018.00951]
  • Xie C Y, Li C, Zhang B C, Chen C, Han J G and Liu J Z. 2018. Memory attention networks for skeleton-based action recognition//Proceedings of the 27th International Joint Conference on Artificial Intelligence. Stockholm, Sweden: IJCAI: 1639-1645 [DOI: 10.24963/ijcai.2018/227]
  • Xu C, Govindarajan L N, Zhang Y, Cheng L. 2017. Lie-X: depth image based articulated object pose estimation, tracking, and action recognition on lie groups. International Journal of Computer Vision, 123(3): 454-478 [DOI:10.1007/s11263-017-0998-6]
  • Yan S J, Xiong Y J and Lin D H. 2018. Spatial temporal graph convolutional networks for skeleton-based action recognition//Proceedings of the 32nd AAAI Conference on Artificial Intelligence. New Orleans, USA: AAAI: 7444-7452
  • Zhang P F, Lan C L, Xing J L, Zeng W J, Xue J R and Zheng N N. 2017. View adaptive recurrent neural networks for high performance human action recognition from skeleton data//Proceedings of 2017 IEEE International Conference on Computer Vision. Venice, Italy: IEEE: 2136-2145 [DOI: 10.1109/ICCV.2017.233]
  • Zhang P F, Xue J R, Lan C L, Zeng W J, Gao Z N and Zheng N N. 2018. Adding attentiveness to the neurons in recurrent neural networks//Proceedings of the 15th European Conference on Computer Vision. Munich, Germany: Springer: 136-152 [DOI: 10.1007/978-3-030-01240-3_9]
  • Zhang Z Y. 2012. Microsoft kinect sensor and its effect. IEEE Multimedia, 19(2): 4-10 [DOI:10.1109/MMUL.2012.24]
  • Zheng W, Li L, Zhang Z X, Huang Y and Wang L. 2019. Relational network for skeleton-based action recognition//Proceedings of 2019 IEEE International Conference on Multimedia and Expo (ICME). Shanghai, China: IEEE: 826-831 [DOI: 10.1109/ICME.2019.00147]
  • Zhong H S, Liu X G, He Y H and Ma Y C. 2018. Shift-based primitives for efficient convolutional neural networks [EB/OL]. [2018-09-25]. https://arxiv.org/pdf/1809.08458.pdf
  • Zhu J G, Zou W and Zhu Z. 2018. End-to-end video-level representation learning for action recognition//Proceedings of the 24th International Conference on Pattern Recognition. Beijing, China: IEEE: 645-650 [DOI: 10.1109/ICPR.2018.8545710]