3.2 Online behavior testing phase
![在这里插入图片描述](https://img-blog.csdnimg.cn/b21a74e7ce3d4b1ba78368428d56b5a6.png#pic_center)
![在这里插入图片描述](https://img-blog.csdnimg.cn/5ff13864476a4fc3b5c68a7a26d8e706.png#pic_center)
![在这里插入图片描述](https://img-blog.csdnimg.cn/9f97076fa1a14ee4b68f0b0dd3687f98.png#pic_center)
At this stage, the transmitter is responsible for collecting real-time CSI data of each testing area. Similarly, the sender sends data on different behaviors made by the tester to the receiving end. Then, the SVM classifier is applied to the physical position coordinate state, and the classification result is obtained. Finally, the state of the estimated position is obtained. The main steps are as follows:
在这个阶段,发射器负责收集每个测试区的实时CSI数据。同样,发送器将测试人员做出的不同行为的数据发送到接收端。然后,将SVM分类器应用于物理位置坐标状态,并获得分类结果。最后,获得估计位置的状态。主要步骤如下:
In the initialization phase, we divided the test area into 20 squares of the same size. Furthermore, we use these squares as reference points. The volunteers traverse the reference points one by one and perform different action states at each reference point, such as standing, jumping, squatting, sitting down, and other common actions.
在初始化阶段,我们将测试区域划分为20个大小相同的正方形。此外,我们使用这些正方形作为参考点。志愿者逐一遍历参考点,在每个参考点进行不同的动作状态,如站立、跳跃、蹲下、坐下和其他常见动作。
The obtained CSI data is transferred to the server. As can be observed from Fig. 6, the changes in CSI signals vary significantly when testers perform different operations. What is more, real-time test data are collected in real experiment environment.
获得的CSI数据被传输到服务器。从图6中可以观察到,当测试者执行不同的操作时,CSI信号的变化显著不同。更重要的是,实时测试数据是在真实的实验环境中收集的。
![在这里插入图片描述](https://img-blog.csdnimg.cn/4564decf0d444e33b4ff7a1ad49fd755.png#pic_center)
![在这里插入图片描述](https://img-blog.csdnimg.cn/29825fa98a3d464597a623928ed30f91.png#pic_center)
The next step is to apply the SVM classifier as follows:
下一步是应用SVM分类器,具体步骤如下:
Step 1: We assume that the sampling period for the CSI data at the receiving end is
T
T
T, which is usually 1.0 s. Firstly, we let a volunteer traverse all reference points and perform daily actions such as standing, jumping, squatting, and sitting at the refer- ence point. Assuming that the receiving end samples the sample training set is
{
(
x
i
,
y
i
)
}
\{ (x_i, y_i) \}
{(xi,yi)},
i
=
1
,
2
,
⋯
,
n
i=1, 2, \cdots, n
i=1,2,⋯,n.
步骤1:我们假设接收端的CSI数据的采样周期为
T
T
T,通常是1.0秒。首先,我们让一名志愿者遍历所有的参考点,并在参考点上进行日常动作,如站立、跳跃、蹲下和坐下。假设接收端采样的样本训练集是
(
x
i
,
y
i
)
{ (x_i, y_i) }
(xi,yi),
i
=
1
,
2
,
⋯
,
n
i=1, 2, \cdots, n
i=1,2,⋯,n。
The SVM regression function is
SVM回归函数是
(10)
f
(
X
)
=
w
⋅
x
+
b
f (X) = w \cdot x + b
f(X)=w⋅x+b
In the above formula,
W
W
W is the weight vector, and
b
b
b is the bias vector.
在上面的函数,
W
W
W是权重向量,
b
b
b是偏差向量。
Step 2: By solving the convex quadratic programming problem to solve
w
w
w and
b
b
b in Eq. (17), the predictive function is obtained, and the objective function is minimized:
步骤2: 通过求解凸二次规划问题求解式(17)中的
w
w
w 和
b
b
b,得到预测函数,最小化目标函数
(11)
Q
(
w
)
=
1
2
∥
w
∥
2
+
C
⋅
R
e
m
p
(
f
)
Q(w) = \frac{1}{2} \| w \|^2 + C \cdot R_{emp}(f)
Q(w)=21∥w∥2+C⋅Remp(f)
where C is the penalty factor,
R
e
m
p
(
f
)
R_{emp}(f)
Remp(f) is the loss function.
其中C是惩罚因子,
R
e
m
p
(
f
)
R_{emp}(f)
Remp(f)是损失函数。
![在这里插入图片描述](https://img-blog.csdnimg.cn/8d71c48c76ed4541bcab0df0a54ec535.png#pic_center)
Step 3: Using the relaxation factor to convert the optimization objective function of formula (11) into:
使用松弛因子将公式(11)的优化目标函数转化为:
(12)
min
1
2
∥
w
∥
2
+
C
∑
i
−
1
l
(
ξ
i
+
ξ
i
∗
)
\min \frac{1}{2} \| w \|^2 + C \sum_{i-1}^{l} (\xi_i + \xi_i^*)
min21∥w∥2+Ci−1∑l(ξi+ξi∗)
where
ξ
i
\xi_i
ξi;
ξ
i
∗
\xi_i^*
ξi∗ are the relaxation factors.
其中,
ξ
i
\xi_i
ξi;
ξ
i
∗
\xi_i^*
ξi∗ 是松弛因子。
![在这里插入图片描述](https://img-blog.csdnimg.cn/5954910d64674c42b1bf0fa848b5145d.png#pic_center)
Step 4: To speed up the solution, we choose to introduce the Lagrange function and solve the following dual form to obtain multipliers αi;αi , expressed as:
步骤4:为了加速解决方案,我们选择引入拉格朗日函数,并求解以下的对偶形式来获取乘子 αi;αi,表示为:
(13)
max
=
∑
i
=
1
l
(
a
i
−
a
i
∗
)
y
i
−
ε
∑
i
=
1
l
(
a
i
+
a
i
∗
)
−
1
2
∑
i
,
j
=
1
l
(
a
i
∗
−
a
i
)
(
a
j
∗
+
a
j
)
<
x
i
,
x
j
>
\max = \sum_{i=1}^l (a_i - a_i^*) y_i - \varepsilon \sum_{i=1}^{l} (a_i + a_i^*) - \frac{1}{2} \sum_{i,j=1}^{l} (a_i^* - a_i)(a_j^* + a_j) <x_i, x_j>
max=i=1∑l(ai−ai∗)yi−εi=1∑l(ai+ai∗)−21i,j=1∑l(ai∗−ai)(aj∗+aj)<xi,xj>
Step 5: For nonlinear predictive problems, SVM introduces the mapping function
ϕ
\phi
ϕ to map the original data into a new feature space. Then, we convert the nonlinear problem into a linear problem in the new feature space. At the same time, the SVM regression can be expressed as:
步骤5:对于非线性预测问题,SVM引入映射函数
ϕ
\phi
ϕ将原始数据映射到一个新的特征空间。然后,我们将新特征空间中的非线性问题转化为线性问题。与此同时,SVM回归可以表示为:
(14)
f
(
x
)
=
w
⋅
ϕ
(
x
)
+
b
f(x) = w \cdot \phi(x) + b
f(x)=w⋅ϕ(x)+b
Step 6: The optimization objective function of formula (13) is transformed into the following form:
步骤6:将公式(13)的优化目标函数转化为以下形式:
![在这里插入图片描述](https://img-blog.csdnimg.cn/b60c948499524d2d86e32ae6c1e31085.png#pic_center)
![在这里插入图片描述](https://img-blog.csdnimg.cn/79b32de013d14d5097ab346c9c0af1fb.png#pic_center)
(15)
max
=
∑
i
−
1
l
(
a
i
−
a
i
∗
)
y
i
−
ξ
∑
i
=
1
l
(
a
i
+
a
i
∗
)
−
1
2
∑
i
,
j
=
1
l
(
a
i
∗
−
a
i
)
(
a
j
∗
−
a
j
)
<
ϕ
(
x
i
)
,
ϕ
(
x
j
)
>
\max = \sum_{i-1}^l (a_i - a_i^*) y_i - \xi \sum_{i=1}^l (a_i + a_i^*) - \frac{1}{2} \sum_{i,j=1}^l (a_i^* - a_i) (a_j^* - a_j) <\phi (x_i), \phi(x_j)>
max=i−1∑l(ai−ai∗)yi−ξi=1∑l(ai+ai∗)−21i,j=1∑l(ai∗−ai)(aj∗−aj)<ϕ(xi),ϕ(xj)>
Step 7: In this step, we introduce kernel function
k
(
x
i
,
x
j
)
k(x_i, x_j)
k(xi,xj) instead of
(
ϕ
(
x
i
)
,
ϕ
(
x
j
)
)
(\phi (x_i), \phi (x_j))
(ϕ(xi),ϕ(xj)) formula. Additionally, (15) is transformed into the following form of optimization objective:
在此步骤中,我们引入核函数
k
(
x
i
,
x
j
)
k(x_i, x_j)
k(xi,xj) 替代
(
ϕ
(
x
i
)
,
ϕ
(
x
j
)
)
(\phi (x_i), \phi (x_j))
(ϕ(xi),ϕ(xj))。另外,(15) 转化为以下优化目标的形式:
(16)
max
=
∑
i
−
1
l
(
a
i
−
a
i
∗
)
y
i
−
ξ
∑
i
=
1
l
(
a
i
+
a
i
∗
)
−
1
2
∑
i
,
j
=
1
l
(
a
i
∗
−
a
i
)
(
a
j
∗
−
a
j
)
k
(
x
i
,
x
j
)
\max = \sum_{i-1}^{l} (a_i - a_i^*) y_i - \xi \sum_{i=1}^{l} (a_i + a_i^*) - \frac{1}{2} \sum_{i,j=1}^l (a_i^* - a_i)(a_j^* - a_j) k(x_i, x_j)
max=i−1∑l(ai−ai∗)yi−ξi=1∑l(ai+ai∗)−21i,j=1∑l(ai∗−ai)(aj∗−aj)k(xi,xj)
Step 8: What is more, the final SVM prediction function is:
步骤8:更进一步,最终的SVM预测函数为:
(17)
f
(
x
,
a
i
,
a
j
∗
)
=
∑
i
=
1
l
(
a
i
−
a
i
∗
)
k
(
x
i
,
x
j
)
+
b
f(x, a_i, a_j^*) = \sum_{i=1}^l (a_i - a_i^*) k(x_i, x_j) + b
f(x,ai,aj∗)=i=1∑l(ai−ai∗)k(xi,xj)+b
Step 9: We use real-time amplitude data collected and fingerprint data to match. When the testers conduct experiments on different actions in the test area, the amplitude characteristics change with the change of different conditions. It can be clearly seen from Fig. 6 that the amplitude changes corresponding to different actions are completely different.
步骤9:我们使用收集的实时幅度数据与指纹数据进行匹配。当测试者在测试区域对不同的动作进行实验时,幅度特性随着不同条件的变化而变化。从图6中可以清楚地看到,与不同动作相对应的幅度变化是完全不同的。
4 Experimental setup
4.1 Hardware testbed
Both the transmitter and the receiver have installed the Atheros AR 9380 NIC supporting the IEEE802.11n protocol to facilitate the acquisition of CSI from the device. As shown in Fig. 9. We have in- stalled an external antenna of about 1.5 m in length. And all transmitters are equipped with the Ubuntu 14.04 LTS 32-bit system and the 4.1.10 Linux kernel version. At the same time, we use open source drivers, Atheros-CSI-Tool, and Atheros NIC, developed by Hsieh and others.
发送器和接收器均安装了支持IEEE802.11n协议的Atheros AR 9380 NIC,以便从设备中获取CSI。如图9所示。我们安装了一个约1.5米长的外部天线。并且所有发射器都配备了Ubuntu 14.04 LTS 32位系统和4.1.10 Linux内核版本。同时,我们使用由Hsieh等人开发的开源驱动程序,Atheros-CSI-Tool和Atheros NIC。
The driver modules make it possible to obtain CSI from Linux kernel when it received signals and saved them for other process. One of the desktop computers equipped with Intel Core i3-4150 CPU works as a sender while another computer works as a receiver. In our system, the obtained data is processed using the PCA-Kalman algorithm in C program.
驱动模块使得在接收信号时从Linux内核获取CSI并保存它们以供其他进程使用成为可能。其中一台配备Intel Core i3-4150 CPU的桌面计算机作为发送器,而另一台计算机作为接收器。在我们的系统中,使用PCA-Kalman算法在C程序中处理获得的数据。
![在这里插入图片描述](https://img-blog.csdnimg.cn/31295772c4214ed9a5cddc7b8e2bedb6.png#pic_center)
4.2 Experimental scenarios
We conducted our experiments in a research laboratory (8m×9m) and a meeting room (6m×4m) both piled with desks and computers as well as a hall (10 m ×9 m) in our campus, which is piled with desks and computers in the laboratory and meeting room, thus creating a rather complex multipath environment, as shown in Figs. 7 and 8. We evaluated the performance of PCA-Kalman in three rooms’ surroundings (Tables 1 and 2).
我们在一个研究实验室(8m×9m)、一个会议室(6m×4m)以及我们校园内的一个大厅(10m×9m)进行了实验。实验室和会议室里堆放着桌子和计算机,大厅里也堆放了桌子和计算机,从而在图7和8中展示了一个相当复杂的多路径环境。我们评估了PCA-Kalman在三个房间环境中的性能(表1和表2)。
![在这里插入图片描述](https://img-blog.csdnimg.cn/aad3434a01ad44c087f8787e1a9c9b68.png#pic_center)
In order to construct an offline histogram fingerprint, we gathered data first thing in the morning when no one was in the lab. In addition, for the purpose of behavior detection, we generated three test sets, including three different test areas. The infrastructure of indoor human behavior detection is composed of wireless access points (AP) for data transmission, monitoring points (MP) for data retrieval, and a server for data processing. Each AP continuously broadcasts information to facilitate the Wi-Fi device to find an access point. For complete coverage of the area of interest, each pair of AP-MP is placed at the corners or edges, forming diagonal lines [48]. Each pair of transmitting-receiving anten- nas is a link (Fig. 9).
为了构建一个离线直方图指纹,我们在早上最早的时候收集了数据,当时实验室里没有人。另外,为了行为检测的目的,我们生成了三个测试集,包括三个不同的测试区域。室内人体行为检测的基础设施由无线接入点(AP)组成,用于数据传输,监测点(MP)用于数据检索,以及一个用于数据处理的服务器。每个AP不断地广播信息,以帮助Wi-Fi设备找到一个接入点。为了完全覆盖感兴趣的区域,每对AP-MP都放置在角落或边缘,形成对角线[48]。每对发送-接收天线是一个链接(图9)。