-
文中实验提出的动作识别算法的流程图如图8所示,首先对一组PIR传感器采集的数据进行预处理,去除其他热源干扰,并将数据进行特征融合构建数据集。然后利用深度学习神经网络学习并建立了动作检测模型,最后使用机器学习分类算法来完成动作的识别。
-
以实验采集志愿者在PIR传感器下做指定动作时的实时输出信号作为数据集。为保证实验的多样性,排除偶然性,招募五名志愿者(3名男性,2名女性)协助测量数据。要求志愿者在两个PIR传感器视场路径的中心区域完成指定动作,每位志愿者依次进行坐、站、走、跑和摔倒这五种动作。在检测现场无规则摆放各种障碍物,并且让每位志愿者以不同的速度、动作幅度和方向做上面五种动作。传感器节点采集一次数据的时间长度为6 s,采样频率为100 Hz,并通过计算机的Matlab软件来查看和保存实时数据。将两传感器的实时输出数据拼接形成数据集中的一个样本数据,该数据集中包含1500组样本数据,五种动作样本各300组。选取每种样本中的200组数据组成容量1000组的训练集,剩下的500组作为测试集来验证网络结构的有效性。图9为某一志愿者五种动作的原始数据。
-
由于五位志愿者行为习惯及体型都不同,导致样本数据的数值变化范围存在差异,需要对每个样本数据进行标准化处理。处理方法采用最大最小标准化,将样本数据映射到(0,1)区间之中,转换函数用公式表示为:
式中:
$ x_{t} $ 表示某一样本数据;$x_{t}^{\prime} $ 表示预处理后的样本数据;$min \left(x_{t}\right) $ 表示一组样本数据的最小值;$max \left(x_{t}\right) $ 表示一组样本数据的最大值。经过归一化之后再对数据进行网络训练可以加快梯度下降求最优解的速度,减少训练时间。将经过归一化处理的两路信号进行特征融合,即将特征向量进行连接。若有
$ n $ 个输入特征向量$ {x}_{1},{x}_{2},\cdots ,{x}_{n} $ ,其维数分别为${p_1},{p_2}, \cdots ,{p_n}$ ,则输出特征向量$y$ 的维数为$\displaystyle \sum\limits_{i = 1}^n {{p_i}} $ 。最后将数据集加上标签,用训练集输入神经网络中进行训练,并用测试集测试模型训练效果。 -
实验中网络设计采用的是Tensorflow+Keras框架,表1是具体网络结构设置。文字模型使用自适应性矩估计(adaptive moment estimation,Adam)优化函数更新模型的权重与偏置。为防止过拟合,设置GRU层的dropout值[20]为0.05。
Layer(type) Output shape Parameter Conv1 d_1(Conv1D) (None,1200,256) 1536 Max_poolingld_1 (None,300,256) 0 Conv1 d_2(Conv1D) (None,300,128) 98432 Max_poolingld_2 (None,75,128) 0 Conv1 d_3(Conv1D) (None,75,64) 24640 Max_poolingld_3 (None,18,64) 0 gru_1(GRU) (None,256) 246528 Dense_1(Dense) (None,32) 8224 dense_2(Dense) (None,5) 165 Table 1. Parameter settings for 1DCNN-GRU model
神经网络学习训练的过程将参数epochs设置为300,即训练300轮。图10是经过300次迭代之后得到的模型损失函数,图11是模型的训练准确度。训练结果显示:随着神经网络训练的进行,损失函数逐渐减小,训练精度逐渐提高,未发生过拟合,并且在迭代150次左右损失值下降到零,训练精度达到百分之百。在变化过程中出现的波动表示模型并不是在向着同一个方向学习,因此会出现波动。但最终准确率和损失都趋于平稳,即模型收敛。
表2是利用测试集在1DCNN-GRU模型下进行测试的准确率。实验结果显示:该模型的平均分类准确率达到了98.6%,达到了较好的识别效果。其中可以看出摔倒动作的识别率偏低,因为摔倒动作是一种复杂的全身动作,会导致PIR传感器采集热辐射信号变化的特征信息较多,因此识别率偏低。实验结果说明1DCNN-GRU网络模型对于文中的五种基础动作能够进行有效的区分。
Action category Recognition accuracy Run 98% Walk 100% Sit 100% Stand 100% Fall 95% Table 2. Accuracy of 5 types of action classification
在文中的研究中也对不同模型的性能进行了对比研究,表3所示为不同模型识别动作的训练时长及识别准确率的对比结果。GRU网络与传统的LSTM网络相比较具有更好的优势,在保证识别准确率几乎相同的前提下,GRU网络模型可以减少训练参数,加快收敛速度。尽管1DCNN的训练时长最短,但其识别的准确率还是较低的。因此在将特征向量输入到GRU网络之前,可利用卷积和池化进一步简化计算,在保证不丢失信号特征的同时得到性能最佳的训练模型。最终实验结果表明:通过结合1DCNN和RNN网络之后的模型既减小了运算负荷,又更能捕获实验数据的时序特征。因此文中提出的方法达到了较好的动作识别效果。
Network model Accuracy Training time/s 1DCNN 93.8% 178 GRU 88.6% 467 LSTM 91.8% 543 1DCNN-LSTM 98.6% 245 1DCNN-GRU 98.8% 195 Table 3. Performance comparison of different models
Human motion recognition method based on pyroelectric infrared sensor
doi: 10.3788/IRLA20210188
- Received Date: 2021-03-19
- Rev Recd Date: 2021-04-12
- Publish Date: 2022-05-06
-
Key words:
- pyroelectric infrared sensor /
- action recognition /
- one-dimensional convolutional neural network /
- gated recurrent unit
Abstract: Aiming at the privacy exposure, high technical complexity, and low recognition accuracy existing in the current human motion recognition technology, this paper proposed a human motion recognition method based on a pyroelectric infrared (PIR) sensor. Firstly, a set of PIR sensors placed on the ceiling and modulated by the field of view were used to collect the infrared heat radiation signal emitted by the human body when moving, and the voltage analog signal output by the sensor was filtered and amplified, and then transmitted to the PC through the ZigBee wireless module and packaged into raw data. Secondly, the two-way sensor output data of the original data feature was fused, and the fused data was standardized and packaged into training dataset and test dataset. Then, a two-layer cascaded hybrid deep learning network was proposed to be a classification algorithm of human motion based on the characteristics of the data. The first layer used one-dimensional convolutional neural network (1DCNN) to extract features from the data, and the second layer used gated recurrent unit (GRU) to save historical input information to prevent loss of valid features. Finally, the training dataset was used to train the network model to obtain a classification model with the best parameters, and the correctness of the model was verified through the test dataset. The experimental results show that the accuracy of the proposed motion recognition technology model for basic motion classification is higher than 98%. Compared with image motion recognition or wearable device motion recognition, it realizes high-precision human motion recognition with real-time, convenience, low cost and strong confidentiality.