李存海,江浩俠,胡金磊,李桂昌,林孝斌
(1.廣東電網(wǎng)有限責(zé)任公司清遠(yuǎn)供電局,廣東清遠(yuǎn) 511500;2.廣州市奔流電力科技有限公司,廣東廣州 510670)
目前變電站的進(jìn)出監(jiān)控依賴于人為的核準(zhǔn)與監(jiān)督,其中人工核驗(yàn)需要用戶配合,不免存在效率低下和準(zhǔn)確率受限于檢驗(yàn)人員工作效能的問題[1-2]?;跈C(jī)器學(xué)習(xí)的人臉檢測技術(shù)具有不必用戶主動配合、準(zhǔn)確率高以及檢測效率不隨時(shí)間變化而降低的優(yōu)點(diǎn),對變電站的安全工作意義重大[3-5]。
在變電站進(jìn)出監(jiān)控中,人臉快速識別技術(shù)顯得不可或缺?,F(xiàn)有人臉檢測技術(shù)在待識別圖片尺寸較小的時(shí)候能夠滿足實(shí)時(shí)檢測需求,但變電站屬于開闊空間地帶,攝像頭需要覆蓋較大的視野范圍,因此圖片尺寸也會相應(yīng)地增加。此外,當(dāng)變電站的監(jiān)控視頻圖片尺寸較大時(shí),監(jiān)控系統(tǒng)往往無法在較短時(shí)間內(nèi)得出檢測結(jié)果,其原因是隨著圖片尺寸增加,其所包含的像素點(diǎn)會呈平方次數(shù)增加,所以在人臉檢測單位處理速度不變的情況下,處理的時(shí)間也會呈平方次數(shù)增加[6-8]。
在人臉識別技術(shù)方面,文獻(xiàn)[9]采用基于Discrete Ada?boost的人臉識別算法,在此基礎(chǔ)上研究改進(jìn)的Do?main-Partitioning Real Adaboost(DPR Adaboost),將其應(yīng)用在人臉識別檢測中,結(jié)果表明該方法具有分類能力提高、收斂速度快、錯(cuò)誤率低的優(yōu)點(diǎn)。文獻(xiàn)[10]研究了一種基于深度多模型融合的人臉識別方法,通過融合多個(gè)人臉識別模型提取的特征構(gòu)成組合特征,再利用深度神經(jīng)網(wǎng)絡(luò)訓(xùn)練組合特征構(gòu)建人臉識別分類器,得到了融合多個(gè)模型優(yōu)點(diǎn)的改進(jìn)模型,經(jīng)人臉識別權(quán)威測試集驗(yàn)證到識別精度相對基礎(chǔ)模型提高了0.57%,但該識別方法并未給出適應(yīng)場景以及是否需用戶主動配合。文獻(xiàn)[11]通過識別面部紋理來推測人臉的存在,提取皮膚、頭發(fā)等特征,建立SGLD(二階統(tǒng)計(jì)特征)模型,使用神經(jīng)網(wǎng)絡(luò)對紋理特征進(jìn)行監(jiān)督分類,并且使用Kohonen自組織特征圖對不同紋理類別進(jìn)行聚類,不足是該方法需要用戶主動配合以完成識別。
本文提出了一種適應(yīng)變電站進(jìn)出監(jiān)控需求的人臉快速識別方法。首先,將待識別圖像輸入?yún)?shù)已知的YOLO神經(jīng)網(wǎng)絡(luò)并輸出圖像中人物的邊界框;接著,從邊界框中提取出人物子圖片并對其進(jìn)行灰度化處理以及計(jì)算出待識別圖像的人臉特征值;最后,根據(jù)待識別的人臉特征值與人臉數(shù)據(jù)庫中各人臉特征值的距離以得出人臉識別結(jié)果。經(jīng)案例場景驗(yàn)證,所提方法具有較好實(shí)用效果。
神經(jīng)網(wǎng)絡(luò)可定義為一個(gè)函數(shù)Y=f(W,X),W是神經(jīng)網(wǎng)絡(luò)的參數(shù);神經(jīng)網(wǎng)絡(luò)的輸入X與輸出Y是一個(gè)張量,其參數(shù)通過梯度下降法求解得出。梯度下降法是一階優(yōu)化算法[12],求解過程為通過多次迭代尋找能夠使得函數(shù)取得局部極小值的參數(shù),具體流程如圖1所示。
圖1 梯度下降法求解流程
YOLO神經(jīng)網(wǎng)絡(luò)為眾多神經(jīng)網(wǎng)絡(luò)的一種[13],可接受一張608×608像素的圖像作為輸入,圖片像素與多個(gè)卷積池化層以及全連接層的參數(shù)進(jìn)行運(yùn)算,最后輸出檢測到的物體的邊界框。YOLO神經(jīng)網(wǎng)絡(luò)的參數(shù)可通過梯度下降法求解得到,YOLO神經(jīng)網(wǎng)絡(luò)的輸出為N個(gè)邊界框{Bbo xi|i∈0,1,2,…,N},其中第i個(gè)邊界框可表示為Bboxi=(xi,yi,wi,hi);邊界框指示了檢測到的人在輸入圖片Iw*h*3的位置,其中xi,yi為邊界框的中心坐標(biāo),wi,hi分別為邊界框的寬和高。
近年來,模式識別技術(shù)與計(jì)算機(jī)視覺技術(shù)受到專家學(xué)者們的關(guān)注[14-15],其中人臉識別技術(shù)也逐漸成了各領(lǐng)域的研究熱點(diǎn)。
目前影響到人臉識別效果的主要因素有:
人臉姿態(tài);遮蓋物;光照強(qiáng)度;面部表情。
將彩色圖像轉(zhuǎn)化成為灰度圖像的過程成為圖像的灰度化處理[16]。彩色圖像中的每個(gè)像素的顏色有R、G、B3個(gè)分量決定,而每個(gè)分量有255種值可取,這樣一個(gè)像素點(diǎn)可以有1 600多萬(255×255×255)種顏色的變化范圍。而灰度圖像是R、G、B3個(gè)分量相同的一種特殊的彩色圖像,這樣像素點(diǎn)的變化范圍為255種,所以在數(shù)字圖像處理中一般先將各種格式的圖像轉(zhuǎn)變成灰度圖像以使后續(xù)圖像的計(jì)算量變得少一些。
本文采用的圖片灰度化處理方法為根據(jù)RGB和YUV顏色空間的變化關(guān)系可建立亮度Y與R、G、B3個(gè)顏色分量的對應(yīng)關(guān)系,以這個(gè)亮度值表達(dá)圖像的灰度值。
對于每一幅待識別的人臉圖,首先進(jìn)行灰度化處理;接著將其縮放到150×150像素,得到If;然后使用神經(jīng)網(wǎng)絡(luò)f提取一個(gè)128維的特征值Y=f(WResNet-34,If)=(y0,y1,…,y127),其中WResNet-34是在ImageNet數(shù)據(jù)集上所學(xué)習(xí)到的ResNet-34網(wǎng)絡(luò)參數(shù)。
對于人臉數(shù)據(jù)庫中的人臉圖像Iface也用上述方法處理并提取特征X=(x0,x1,…,x127)。
一般基于廣義特征值的距離來計(jì)算兩幅人臉圖像的相似度,則兩幅人臉圖片的特征值距離L為:
此外,當(dāng)不等式L≤0.6成立時(shí),則表示兩幅人臉圖片匹配成功;否則表示匹配失敗。
圖2為人臉快速識別方法的流程圖,其主要目的旨在提供一種適應(yīng)變電站進(jìn)出監(jiān)控需求的人臉快速識別方法,以保證視頻監(jiān)控報(bào)警的有效性,更全面地提升變電站的安全系數(shù)。
本文所提出的人臉快速識別方法,具體包括以下步驟:
圖2 人臉快速識別方法流程圖
(1)將待識別圖像Iw*h*3輸入?yún)?shù)已知的YOLO神經(jīng)網(wǎng)絡(luò)并輸出圖像中每個(gè)人的邊界框;
(2)根據(jù)所得到的邊界框,將每個(gè)檢測到的人物從圖像Iw*h*3中提取出來,得到子圖片集合|i∈0,1,2,...,n};
(3)對所述子圖片進(jìn)行灰度化處理并計(jì)算得到待識別的人臉特征值;
(4)根據(jù)所述待識別的人臉特征值與人臉數(shù)據(jù)庫中各人臉特征值的距離L得出人臉識別結(jié)果。
根據(jù)人臉快速識別方法編寫對應(yīng)軟件模塊,選取合適場地搭建人臉識別案例場景,并準(zhǔn)備好參與識別的工作人員以及人臉數(shù)據(jù)庫。
經(jīng)場景模擬后,得到具體分析結(jié)果如下:
(1)針對監(jiān)控視頻中某一張輸入圖片并使用YOLO神經(jīng)網(wǎng)絡(luò)檢測,得到圖片中每個(gè)行人的邊界框,即圖3中的實(shí)線方框。
圖3 待識別圖像
圖4 所提取人物圖片
圖5 識別出的人臉圖片
(2)提取工作人員圖片,結(jié)果如圖4所示。
(3)檢測圖4的工作人員圖片中是否存在人臉信息,其中圖4(a)無法檢測到完整人臉信息,而對圖4(b)檢測到的人臉(圖5)進(jìn)行灰度化處理后,計(jì)算其人臉特征值為:
Y=[-0.0653979,0.0481431,0.0459506,-0.002976 55, -0.0784676, -0.0707229, 0.0017481, -0.129902,0.0899502,-0.0961162,0.18472,-0.04566,-0.177452,-0.119043,-0.00185613,0.123365,-0.101321,-0.0666 383,-0.0822533,-0.0954023,0.0388882,0.0508717,0.0408848,0.0335565,-0.048666,-0.263044,-0.0828 425, -0.0912373, 0.0823404, -0.022558, 0.0207027,0.0748649,-0.162295,-0.0786254,-0.00673984,0.034 479,-0.0504447,-0.0587812,0.283734,-0.0457539,-0.132397,-0.0031759,0.0189574,0.271597,0.2227 58,-0.0507444,-0.00261238,-0.0372537,0.147651,-0.213665,0.0485419,0.125421,0.116833,0.0580825,0.0118643,-0.092228,0.0441321,0.137712,-0.2031 44,0.0675892,0.0768298,-0.168619,-0.037038,-0.0 307111,0.145781,0.0454205,-0.0487946,-0.157138,0.140418,-0.18163,-0.0306611,0.0311677,-0.13422,-0.139509,-0.310455,0.0523049,0.299887,0.160369,-0.182182,0.0295619,-0.0594396,-0.00560254,0.131 522, 0.030557, -0.0181286, -0.0943769, -0.115649,0.0168677,0.160838,-0.0744993,-0.0537497,0.2409 62,0.0239171,-0.00718346,0.0277776,0.00476684,-0.0710697,0.0229204,-0.126025,0.0441402,0.08147 56,-0.113622,0.0699524,0.109151,-0.174594,0.176 26,-0.0370767,0.0387941,0.0300786,-0.0633792,-0.155115,-0.0208994,0.190634,-0.121869,0.197604,0.131385,0.0213304,0.151944,0.101643,0.104232,-0.0347045,-0.0272474,-0.172505,-0.0462738,0.076 5506,0.0254679,0.0702121,0.0738493]。
(4)計(jì)算圖6(a)和6(b)中人臉圖片的特征值,其中圖6(a)的特征值為:
X1=[-0.117174,0.0432565,0.0615167,-0.0455164,-0.0706958,-0.0455732,-0.0510033,-0.166344,0.075 0411,-0.131235,0.231625,-0.0978745,-0.196297,-0.163042,-0.0387142,0.198247,-0.165635,-0.09408 13, -0.0818975, 0.00266437, 0.097009, 0.00571842,0.0382776,0.0467014,-0.0377104,-0.343167,-0.1423 02, -0.0462031, 0.0399787, -0.0398614, -0.0901296,0.0863726,-0.138756,-0.102175,0.0238005,0.09194 69,0.0509093,-0.101035,0.16137,-0.0239519,-0.19 225,0.0776478,0.0727825,0.227224,0.25847,0.0510 676,0.033865,-0.11599,0.153841,-0.180689,0.0471 576,0.0887595,0.0761694,0.0240254,0.0222875,-0.1 23475, 0.0528614, 0.109238, -0.154681, 0.0114299,0.109626,-0.131581,-0.0354409,-0.0367509,0.1725 51,0.117364,-0.0914756,-0.234913,0.116833,-0.15 4709,-0.0901379,0.00995727,-0.212836,-0.0959615,-0.36433, 0.0252173, 0.399847, 0.113429, -0.17775,0.0973187,-0.0163856,0.0396124,0.172737,0.177377,-0.0107027,-0.0259293,-0.0973322,-0.00115101,0.1 66939,-0.0176149,-0.0846889,0.226914,-0.004714 37,0.0738132,0.0667178,0.0158959,-0.0309987,0.0 283487,-0.114391,0.0181091,0.0817547,-0.0177323,0.0326894,0.116774,-0.121201,0.112234,-0.0803487,0.10843,0.0436463,-0.0872214,-0.0972368,0.03262 81,0.0974472,-0.205026,0.155965,0.162803,0.0626 691,0.0859266,0.165243,0.100398,0.0339094,0.032 0152, -0.219555, -0.0229654, 0.125368, -0.0185362,0.124461,0.0339912]
圖6(b)的特征值為:
圖6 人臉數(shù)據(jù)庫中人臉圖片
X2=[-0.0886385,0.0549423,-0.00546047,-0.06525 26, -0.0734701, -0.0891774, -0.0802805, -0.107656,0.0891029,-0.0775417,0.223884,-0.0995733,-0.1820 51,-0.155407,-0.0623404,0.169066,-0.209147,-0.1 05432,-0.0768067,0.0224611,0.0916727,0.0154249,0.0561431,0.00278886,-0.0536536,-0.389321,-0.072 3899,-0.0686888,0.0249965,-0.0387781,0.0280211,0.0195251,-0.205907,-0.0690564,0.0598259,0.0457 73,-0.000860474,-0.047665,0.166677,-0.000445154,-0.222018,-0.000221765,0.0265393,0.212571,0.1734 07,0.0996724,0.0324839,-0.161677,0.152244,-0.15 1677, 0.0278293, 0.153962, 0.0366221, 0.0213522,0.013047,-0.0643532,0.0583508,0.143498,-0.139628,-0.0140229,0.11262,-0.0348965,-0.0218506,-0.1007 26, 0.203176, -0.00134878, -0.11952, -0.173758,0.0945559,-0.13104,-0.0708779,0.0354774,-0.12939,-0.165783,-0.316124,-0.00536548,0.363126,0.08117 48,-0.144772,0.0391074,-0.0603582,0.0201964,0.1 23615,0.112289,-0.0304388,0.01851,-0.0759722,-0.0475834,0.213184,-0.0673732,-0.0385347,0.1891 55,-0.0458143,0.0599411,0.0131644,-0.028812,-0.0700638, 0.057142, -0.0723014, 0.00542674,0.0530222,-0.050184,0.0077821,0.0820619,-0.12622,0.10774,-0.0368184,0.0628868,0.0506034,-0.01153 36, -0.0934998, -0.0939013, 0.0922058, -0.190224,0.232884, 0.183856, 0.110786, 0.120159, 0.135563,0.100329,-0.0339753,0.0397254,-0.180747,-0.05198 26,0.084807,0.0213815,0.0910269,-0.0357912]
分別計(jì)算Y與X1、X2的距離L,可得:‖X1-Y‖2=0.574211989425;‖X2-Y‖2=0.604223930903;由于‖X1-Y‖2小于0.6,說明當(dāng)前人臉數(shù)據(jù)庫中的人臉圖片圖6(a)與圖4(b)匹配。
本文鑒于當(dāng)前變電站進(jìn)出安全監(jiān)控的現(xiàn)狀問題以及為實(shí)現(xiàn)無人值班變電站提供技術(shù)指導(dǎo)的需求,提出了一種適應(yīng)變電站進(jìn)出監(jiān)控需求的人臉快速識別方法,并通過視頻監(jiān)控案例驗(yàn)證了該方法的實(shí)用效果。研究表明,所提人臉快速識別方法可對監(jiān)控視頻出現(xiàn)的人員進(jìn)行實(shí)時(shí)分析,能夠全面地提升變電站人員進(jìn)出安全系數(shù),對變電站的安全監(jiān)控工作意義重大。