-
所设计的反无人机系统将无人机识别跟踪与干扰拦截进行融合,从而实现对入侵无人机的跟随式干扰。因此,系统算法实现分成探测和反制两大部分。无人机探测部分主要实现无人机运动目标检测、特征提取与分类和目标跟踪与坐标数据发送。无人机反制部分主要实现接收目标位置数据、生成控制信号、旋转拦截平台及发送干扰信号。
无人机探测子系统的算法流程如图2所示。摄像头对目标空域实时画面进行采集,随后利用ViBe算法分割出画面中正在运动的前景目标。若未检测到运动目标,则继续对下一帧图像进行检测。若检测到画面中存在运动目标,则框定目标,记录运动目标所在画面中的位置信息。然后,根据位置信息在原图像中提取相应区域的子图像,将子图像送入HOG算法中提取特征向量,将特征向量送入预先完成训练的非线性SVM进行识别。若识别结果判定该目标不是无人机时,则中止后续工作并重新进行下一帧图像的前景目标提取工作;若识别结果表示该运动目标为无人机目标时,进行KCF算法的初始化,构建滤波模板。最后,读取下一帧图像,进行KCF跟踪,解析无人机当前坐标并将其输出,同时更新滤波模板。重复读取图像、执行KCF跟踪算法便可完成对无人机的跟踪并输出其在画面中的实时位置。
无人机反制子系统算法流程如图3所示。其中,树莓派为计算、控制的中枢,完成无人机坐标接收、舵机驱动信号计算、控制舵机旋转及控制干扰信号的发射等任务。若依次进行上述任务,将导致反制子系统滞后于检测子系统,无法实现反制设备的实时瞄准。因此,考虑采用多线程方法解决上述问题。将上述三个过程独立,让程序并行运行,保证控制算法能获得最新的坐标值,从而输出合适的驱动信号,跟踪伺服系统也就能及时瞄准、跟随目标。
-
像素梯度是统计方向梯度直方图的基础。像素梯度包含两部分信息,即梯度的幅值和方向,二者表征物体的轮廓边缘信息。像素点梯度可根据相邻像素点值计算得出:
$$ {G_x}(x,y) = V(x + 1,y) - V(x - 1,y) $$ (1) $$ {G_y}(x,y) = V(x,y + 1) - V(x,y - 1) $$ (2) 式中:
$ {G_x}(x,y) $ 、$ {G_y}(x,y) $ 分别为坐标$ (x,y){\text{ }} $ 处像素水平和垂直方向的梯度幅值;$ V(x,y) $ 为坐标$ (x,y) $ 处像素值。根据公式(1)、(2)可得该像素点的梯度幅值和方向:$$ G(x,y) = \sqrt {{G_x}{{(x,y)}^2} - {G_y}{{(x,y)}^2}} $$ (3) $$ \alpha (x,y) = \arctan ({G_y}(x,y)/{G_x}(x,y)) $$ (4) 梯度信息省略了图像许多不重要的信息,如颜色分布一致的背景等,但是突出了前景的轮廓边缘信息。如图4所示,梯度分布图可以很清晰地辨认出图片中的前景目标。
-
HOG特征提取的基本流程如图5所示,主要有:
(1) 对输入图像进行预处理,调整图像尺寸和进行伽马校正;
(2) 计算各像素点的梯度,梯度信息可表征局部图像的轮廓形状;
(3) 组合一定区域内的若干个像素点构成最小统计单位cell,统计每个单元(cell)的梯度分布信息,形成各自的特征描述子;
(4) 将若干个单元组合成块(blocks),串联块内所有的特征描述子便可得到基于块的特征信息,即HOG特征描述子;
(5) 串连组合图像所有块的特征信息后,就此生成图像的HOG特征向量。
-
HOG特征向量是判定目标是否为无人机的依据。为了实现对无人机的识别,还需要建立决策函数评估特征向量的结果,该设计采用非线性支持向量机实现对无人机图像的分类识别。
SVM实质上就是对凸二次规划问题进行求解优化。若假设特征空间存在线性不可分的数据集:
$$ T = \{ ({x_1},{y_1}),({x_2},{y_2}), \cdots ,({x_n},{y_n})\} $$ (5) 式中:
$ {x_i} $ 、$ {y_i} $ $ {\text{(}}i{\text{ = 1,\;2,\; }}\cdots,\; n{\text{) }} $ 分别表示第$ i $ 个样本的特征向量和分类标签。且当$ {x_i} $ 向量为正例时,$ {y_i} = + 1 $ ,反之,$ {x_i} $ 向量为负例时,$ {y_i} = - 1 $ 。支持向量机的求解就是寻找分离超平面,即解析带约束的最优化问题[17]:
$$ \begin{split} &\mathop {\min }\limits_{^{{w^{\rm{T}}},b}} {\text{ }}\frac{1}{2}{\left\| {{\omega ^{\rm{T}}}} \right\|^2} \;{\rm{s.t.}}{\text{ }}{y_i}({\omega ^{\rm{T}}} \cdot {x_i} + b) - 1 \geqslant 0{\text{ }} \\ &{\text{ }}i = 1,2,\cdots ,n \\[-8pt] \end{split} $$ (6) 根据上述问题得到分离超平面和分类决策函数:
$$ {\omega ^{\rm{T}}} \cdot x + b = 0 $$ (7) $$ f(x) = {\rm{sign}}({\omega ^{\rm{T}}} \cdot x + b) $$ (8) 首先,根据公式(6)构建拉格朗日函数形式:
$$ \begin{split} L({\omega ^{\rm{T}}},b,\alpha ) = \frac{1}{2}{\left\| \omega \right\|^2} + \sum\limits_{i = 1}^N {{\alpha _i}} - \sum\limits_{i = 1}^N {{\alpha _i}{y_i}({\omega ^{\rm{T}}} \cdot {x_i} + b)} \end{split} $$ (9) 式中:
$\alpha \text{=}({\alpha }_{\text{1}},{\alpha }_{2},\text{ }\mathrm{...}\text{ },{\alpha }_{N}{)}^{{\rm{T}}}$ 为拉格朗日乘子向量。根据拉格朗日对偶性质,可在公式(9)中先对
$ \alpha $ 极大化、再对${\omega ^{\rm{T}}},b$ 极小化的原始问题变成先对${\omega ^{\rm{T}}},b$ 极小化、再对$ \alpha $ 极大化的对偶问题:$$ \begin{split} &\mathop {\min }\limits_\alpha {\text{ }}\frac{1}{2}\sum\limits_{i = 1}^N {\sum\limits_{j = 1}^N {{\alpha _i}} } {\alpha _j}{y_i}{y_j}({x_i} \cdot {x_j}) - \sum\limits_{i = 1}^N {{\alpha _i}} \;{\rm{s.t.}}{\text{ }}\sum\limits_{i = 1}^N {{\alpha _i}} {y_i} = 0 \\ &{\text{ }}{\alpha _i} \geqslant 0,{\text{ }}i = 1,2, \cdots ,N \\[-8pt] \end{split} $$ (10) 当数据线性不可分时,考虑引入核函数将输入空间的样本向量映射对应到希尔伯特空间,使映射向量集在希尔伯特空间中呈现线性分布。
设
$ \chi $ 为欧氏空间(输入空间),$ \gamma $ 为希尔伯特空间(特征空间),对于样本$ x $ 存在一映射关系:$$ \phi (x) = \chi \to \gamma $$ (11) 且对于所有的
$ x,z \in \chi $ ,满足:$$ K(x,z) = \phi (x) \cdot \phi (z) $$ (12) 故非线性SVM拉格朗日对偶问题为[17]:
$$\begin{split} &\mathop {\min }\limits_\alpha {\text{ }}\frac{1}{2}\sum\limits_{i = 1}^N {\sum\limits_{j = 1}^N {{\alpha _i}} } {\alpha _j}{y_i}{y_j}K({x_i} \cdot {x_j}) - \sum\limits_{i = 1}^N {{\alpha _i}} \;{\rm{s.t.}}{\text{ }}\sum\limits_{i = 1}^N {{\alpha _i}} {y_i} = 0 \\ &{\text{ }}{\alpha _i} \geqslant 0,{\text{ }}i = 1,2, \cdots ,N \\[-8pt] \end{split}$$ (13) 解析上述对偶问题后可得SVM的超平面:
$$ \begin{split} f(x) = & \sum\limits_{i = 1}^N {\alpha _i^*} K(x,{x_j}) + {y_j} - \sum\limits_{i = 1}^N {\alpha _i^*} {y_i}K({x_i},{x_j}) \\ \end{split} $$ (14) -
为检测运动目标,需要先对图像进行背景建模。以含有无人机的一帧图像为例,位置为
$ x $ 的像素点的像素值为$ v(x) $ ,则对于任意位置的像素点的背景模型可表示为:$$ M(x) = \{ {v_1},{v_2},\cdots,{v_N}\} $$ (15) 式中:
$ {v_i} $ 为位置$ x $ 的像素点的背景模型中的第$ i $ 个背景样本点值;$ N $ 表示每个背景模型的样本量。该模型本质上是一个背景像素点集合,该集合可用来判断当前帧中各像素点的类别,即为前景点还是背景点。为了根据背景模型判断相应像素点的类属,需要建立一套对应的评价体系。该体系主要处理过程为先计算当前帧像素点值与背景模型中各样本值的差值,利用差值表征当前像素点与各背景像素点之间的距离,如下式所示:
$$ D(x) = \{ \left| {v(x) - {v_1}} \right|,\cdots,\left| {v(x) - {v_N}} \right|\} $$ (16) 然后设定统计阈值
$ {N_{\min }} $ 和度量半径$ R $ ,统计$ D(x) $ 集合中满足$ \left| {v(x) - {v_1}} \right|{\text{ < }}R $ 的个数$ N $ 。若$ N > {N_{\min }} $ ,则将当前像素点判定为背景像素点,否则为前景点。 -
ViBe算法利用初始的单帧图像便可完成背景模型的初始化。在起始帧中,假设
$ {N_G}(x) $ 是位置为x的像素点邻域内所有像素点集合,那么该像素点的背景模型可初始化为:$$ {M^o}(x) = \{ {v^o}(y\left| {y \in } \right.{N_G}(x))\} $$ (17) 其中,位置为
$ y $ 的像素点是在位置为$ x $ 的像素点的邻域内均匀分布抽样得到的,因此,对于邻域内某一个特定的像素点可能会被多次选定加入背景模型,也有可能一次都未被选中。对于运动目标检测,背景模型并不是一成不变的。为了保证实时准确检测画面中运动目标,背景模型的更新是至关重要的一步。ViBe算法采用保守更新的同时又利用空间信息,将背景演变的信息融入到被前景遮掩的背景像素模型中,这种策略可以规避保守更新策略所带来的缺点。
系统采用ViBe算法进行无人机运动目标检测,使识别范围缩小至子图像区域,从而提高识别速度和准确率。
-
为了获取无人机目标的实时位置信息,采用KCF算法实现对无人机运动目标进行跟踪。KCF算法考虑采用循环矩阵生成样本集,循环矩阵的优势主要有两点:一是不需要花费较多的时间通过滑窗采样方式生成样本集,二是循环矩阵可通过快速傅里叶变换实现加速计算。
循环矩阵就是根据一个
$ n \times 1 $ 维向量每次向右移动一个单位组成的含有$ n $ 个向量的$ n \times n $ 维矩阵。考虑一训练样本为$x = {[{x_1},{x_2},{x_3},{\text{ }}\cdots{\text{ , }}{x_n}]^{\rm{T}}}$ ,将原始样本向量和移位得到的$ n{{ - 1}} $ 个向量组合在一起就得到了循环矩阵:$$ X = C(x) = \left[ {\begin{array}{*{20}{c}} {{x_1}}&{{x_2}}& \cdots &{{x_{n - 1}}}&{{x_n}} \\ {{x_n}}&{{x_1}}& \cdots &{{x_{n - 2}}}&{{x_{n - 1}}} \\ {{x_{n - 1}}}&{{x_n}}& \cdots &{{x_{n - 3}}}&{{x_{n - 2}}} \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ {{x_2}}&{{x_3}}& \cdots &{{x_n}}&{{x_1}} \end{array}} \right] $$ (18) 循环矩阵中的真实样本只有构建该矩阵的原始向量,其余的样本均是虚构出来。值得注意的是,循环矩阵在频域内具有很好的对角化特性,这个特性使得滤波器在频率空间只需根据一个原始样本就能完成构建,与在图像空域等效地训练滤波器需采用
$ n $ 个样本相比,此举极大地提高了计算效率。任意的循环矩阵
$ C(x) $ ,在频域空间可用原始向量$x = {[{x_1},{x_2},{x_3},{\text{ }}\cdots{\text{ }},{x_n}]^{\rm{T}}}$ 借助离散傅里叶矩阵表示,如下式所示:$$ X = C(x) = Fdiag(\hat x){F^{\rm{H}}} $$ (19) 式中:
$ F $ 为离散傅里叶变换矩阵。 -
KCF滤波模板的构建本质上就是求解一个线性回归函数,这个回归函数便是脊回归。脊回归是在普通的线性回归目标损失函数的基础上引入一个正则项,那么它的损失函数便有:
$$ J(\omega ) = \mathop {\min }\limits_\omega \sum\limits_{i = 1}^n {{{({\omega ^{\rm{T}}}{x_i} - {y_i})}^2}} + \lambda {\left\| \omega \right\|^2} $$ (20) 式中:
$ \lambda (\lambda {\text{ > 0}}) $ 为惩罚参数,为平衡平方损失和正则项的系数。KCF可通过对
$ \omega $ 求导来求解损失函数,从而训练得到分类函数(滤波模板)$f({x_i}) = {\omega ^{\rm{T}}}{x_i}$ 的回归系数:$$ \omega = {({X^{\rm{H}}}X + \lambda )^{ - 1}}{X^{\rm{H}}}y $$ (21) 式中:
${X^{\rm{H}}}$ 为关于$ X $ 的厄米特转置。利用循环矩阵可对角化性质,那么回归系数
$ \omega $ 可以表示为:$$ \omega = {\mathcal{F}^{ - 1}}\left( {\frac{{\hat x \odot \hat y}}{{\hat x \odot {{\hat x}^*} + \lambda }}} \right) $$ (22) 式中:
$ \hat x $ 为$ x $ 的离散傅里叶变换结果;$ {\hat x^*} $ 为$ \hat x $ 的共轭形式;$ \odot $ 代表元素间相乘;$ {\mathcal{F}^{ - 1}} $ 表示离散傅里叶逆变换。回归系数
$ \omega $ 经过循环矩阵$ X $ 离散傅里叶变换对角化后有效避免了求逆过程,计算复杂度明显降低,计算效率大大提高。采用上述线性模板实现目标跟踪,跟踪水平极其有限。针对非线性问题,引入核技巧与核函数,旨在将非线性问题转换为线性问题后再进行求解[18]。
引入核技巧将问题线性化,所以回归系数
$ \omega $ 可用输入样本$x = {[{x_1},{x_2},{\text{ }}\cdots {\text{ }},{x_n}]^{\rm{T}}}$ 线性表示为:$$ \omega = \sum\limits_{i = 0}^n {{\alpha _i}} \phi {({x_i})^*} $$ (23) 将公式(23)代入公式(22)并结合核函数可解得:
$$ \begin{split} \alpha = & {(\phi (X){\phi ^{\rm{T}}}(X) + \lambda I)^{ - 1}}y = {(K + \lambda I)^{ - 1}}y \end{split} $$ (24) 根据傅里叶变换对角化性质可将上式转化为[19]:
$$ \hat \alpha = \frac{{\hat y}}{{{{\hat k}_{xx}} + \lambda }} $$ (25) 式中:
$ {\hat k_{xx}} $ 为$ {k_{xx}} $ 的离散傅里叶变换。 -
KCF快速检测阶段主要是根据上一帧目标信息所训练的滤波模板对当前帧目标进行相关滤波运算,得到目标区域各点的响应值,其中最大值所对应的坐标就是跟踪目标的当前位置。检测过程如图6所示。
模板更新也是KCF算法必不可少的过程,因为KCF算法是根据前一帧训练的滤波模板计算响应目标在当前帧中的具体坐标,所以KCF在每帧完成检测阶段后还需进行滤波的模板更新,为下一帧进行目标检测做准备。KCF算法采取用线性插值的手段设置一定的更新步长对模板参数进行更新:
$$ {\alpha _{now}} = (1 - \lambda ){\alpha _{now}} + \lambda {\alpha _{new}} $$ (26) $$ {x_{now}} = (1 - \lambda ){x_{now}} + \lambda {x_{new}} $$ (27) 这样的更新策略一定程度上保留了历史样本值,也实现了滤波模板的进化,提升了滤波模板的可靠性和跟踪效果。
Design and implementation of intelligent UAV intrusion detection, tracking and interception system
-
摘要: 近年来民用无人机领域发展迅猛,导致无人机“黑飞”事件频出,给国家安全及社会稳定带来了不小的挑战,迫切需要发展反无人机技术。对此,提出一种跟随式定向干扰方案,设计了一套基于视觉的无人机入侵检测与自动跟踪拦截系统。采用HOG+非线性SVM方案来识别无人机,加入ViBe运动目标检测算法来提高识别速度,并通过KCF算法实现无人机目标跟踪。设计制作无人机拦截系统的硬件设备主要包括跟踪伺服系统、底座和托盘等。实验表明,该系统的识别准确率达到90.54%,识别速度为20.56 fps,拦截平台能够在0.5 s内实现对目标无人机的瞄准,跟踪效果良好。在搭建的实物平台上进行系统测试,结果表明,该系统可实现对入侵无人机的运动检测、识别、跟踪与干扰,且识别准确率高,实时性好,能够对入侵的无人机进行自动拦截。Abstract: In recent years, the field of civilian unmanned aerial vehicles has developed rapidly, leading to the frequent occurrence of unmanned aerial vehicle "black flying" incidents, which has brought considerable challenges to national security and social stability, and there is an urgent need to develop anti-UAV technology. In this regard, this paper proposes a follow-type directional jamming method and designs a vision-based UAV intrusion detection and automatic tracking and interception system. The HOG+nonlinear SVM scheme is used to identify the UAV, the ViBe moving target detection algorithm is added to improve the recognition speed, and UAV target tracking is realized through the KCF algorithm. Design and manufacture the hardware equipment of the UAV interception system, mainly including the tracking servo system, base and tray. Experiments show that the recognition accuracy of the system reaches 90.54%, the recognition speed is 20.56 fps, the interception platform can achieve the aim of the target UAV within 0.5 s, and the tracking effect is good. The system is tested on the built physical platform, and the results show that the system can realize the movement detection, recognition, tracking and interference of invading UAVs. The recognition accuracy is high, the real-time performance is good, and the system can automatically intercept the invading UAVs.
-
Key words:
- anti-UAV /
- image recognition /
- artificial intelligence /
- motion detection /
- automatic interception
-
[1] Zhan Guoxiang, Kang Lifang, Duanmu Helin. The testing and analysis on flight prevention effect of rice pests and diseases of Jifei P20 UAV [J]. Agricultural Equipment & Technology, 2020, 46(1): 18-19. (in Chinese) [2] Xu Jing, Zhang Zhiqiang, Ma Fengyi. Device automatic unloading device design for drone-based intelligent logistics systems [J]. Electronic Measurement Technology, 2021, 44(7): 128-132. (in Chinese) [3] Zhang Xiang. Analysis of China's UAV countermeasures technology and industry development [J]. China New Telecommunication, 2020, 22(17): 83-84. (in Chinese) [4] Zhu Mengzhen, Chen Xia, Liu Xu, et al. Situation and key technology of tactical laser anti-UAV [J]. Infrard and Laser Engineering, 2021, 50(7): 20200230. (in Chinese) [5] Shi X, Yang C, Xie W. Anti-drone system with multiple surveillance technologies: Architecture, implementation and challenges [J]. IEEE Communications Magazine, 2018, 56(4): 68-74. doi: 10.1109/MCOM.2018.1700430 [6] Farlik J, Kratky M, Casar J. Radar cross section and detection of small unmanned aerial vehicles [C]//International Conference on Mechatronics-mechatronika. Prague, Czech Republic, 2017: 1-7. [7] Hoffmann F, Ritchie M, Fioranelli F, et al. Micro-Doppler based detection and tracking of UAVs with multistatic radar [C]//2016 IEEE Radar Conference. IEEE, 2016: 1-6. [8] Yang Donghai. Research and implementation of four rotor drone detection technology based on sound recognition[D]. Xiangtan: Xiangtan University, 2017. (in Chinese) [9] Mezei J, Molnar A. Drone sound detection by correlation [C]//2016 IEEE 11th International Symposium on Applied Computational Intelligence and Informatics (SACI). IEEE, 2016. [10] Azari M M, Sallouha H, Chiumento A. Key technologies and system trade-offs for detection and localization of amateur drones [J]. IEEE Communications Magazine, 2018, 56(1): 51-57. doi: 10.1109/MCOM.2017.1700442 [11] Huang Xiangpeng, Huang Xiaogang. A UAV recognition method based on deep learning [J]. Radar & ECM, 2020, 40(2): 20-25. (in Chinese) [12] Xue Shan, Zhang Zhen, Lv Qiongying et al. Image recognition mrthod of anti UAV system based on convolutional neural network [J]. Infrard and Laser Engineering, 2020, 49(7): 20200154. (in Chinese) [13] Yang Yong, Wang Xuesong, Zhang Bin. Radar detection of unmanned aerial vehicles based on time-frequency detection and polarization matching [J]. Journal of Electronics & Information Technology, 2021, 43(3): 509-515. (in Chinese) [14] Wang C, Wang T, Wang E, et al. Flying small target detection for anti-UAV based on a Gaussian mixture model in a compressive sensing domain [J]. Sensors, 2019, 19(9): 21-68. [15] Tao Lei, Hong Tao, Chao Xu. Drone identification and location tracking based on YOLOv3 [J]. Chinese Journal of Engineering, 2020, 42(4): 463-468. (in Chinese) [16] Ma Wen, Chigan Xiaoxuan. Research on development of anti-UAV technology [J]. Aero Weaponry, 2020, 27(6): 19-64. (in Chinese) [17] Li Hang. Statistical Learning Methods [M]. 2nd ed. Beijing: Tsinghua University Press, 2019. (in Chinese) [18] Gao Zheng. UAV visual object tracking based on keypoints[D]. Harbin: Harbin Institute of Technology, 2019. (in Chinese) [19] Henriques J F, Caseiro R, Martins P, et al. High-speed tracking with kernelized correlation filters [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2014, 37(3): 583.