| With the development of the Internet+era,smart glasses are widely used in navigation,image capture,and message reminders.Face recognition systems based on smart glasses can be used to assist security personnel,police forces,or medical emergencies.Therefore,people have higher requirements for the face recognition algorithm applied on the mobile end.Face recognition is a non-mandatory and non-contact feature,and is a biotechnology that performs identity verification by extracting facial feature information.However,most of the current advanced face recognition algorithms are built on large deep convolutional neural networks,and even by using multiple neural network cascades to achieve higher recognition rates,this approach has brought millions The parameters and expensive computational costs make it extremely difficult to deploy models on mobile and embedded devices.In order to make the model better applied to the portable smart glasses,this paper mainly studies the optimization of the detection speed and recognition rate of the neural network structure,thereby reducing the model parameters and improving the efficiency of the model.Firstly,in the face detection module,Viola-Jones,a representative traditional face detector,and the face detector MTCNN based on deep learning are compared.The experimental results show that the MTCNN algorithm is superior to the traditional Viola.-Jones detector.However,the MTCNN network is prone to serious delay problems as the image increases and the face increases.In order to further optimize the detection speed of the MTCNN network and reduce the accuracy,the computational complexity is reduced as much as possible.This paper proposes to apply the depth separable convolution algorithm to the MTCNN network to solve the face detection delay of mobile devices.The defects make the face detection time greatly shortened.The experimental results show that the improved MTCNN network parameters account for only 11%of the original,and the detection speed of an image is increased by 32%.Secondly,in the face recognition module,this paper studies the face recognition method based on deep learning and analyzes the metric function in depth.Since the category of the face recognition test set is not in the training set,this shifts the core of the face recognition method to metric learning.The metric function plays a crucial role in face recognition,which makes the features of unknown classes better distinguishable.In order to reduce the distance between classes and increase the intra-class distance,so as to better classify faces,this paper proposes a method of combining L-softmax,CosFace and ArcFace metric learning and introduces attention mechanism in ResNet network structure.The loss function of the face recognition model is reduced to a lower level,and the generalization ability of the model is stronger.The experimental results show that the improved model can achieve 99.56%accuracy on the LFW dataset.Finally,because the face recognition model algorithm is complex and the parameter is large,it is not suitable for the smart glasses.Therefore,the model is compressed so that it can be embedded into the smart glasses system.In order to make the compressed model almost no loss of precision,this paper proposes to apply the Knowledge Distill algorithm to the L1 regular pruning retraining model,in which the pre-training model is used as a teacher,the pruned model is used as a student,and the teacher network softmax layer is extracted.Probability guides the student network and makes the heavily trained student model more compact.The experimental results show that the method can reduce the parameters by about 30%,and the accuracy is hardly decreased.In this paper,the PytorchConverter tool is used to convert the compressed Pytorch model into a mobile-operable ncnn model.After the ncnn model is encapsulated,it can be called through Java.The smart glasses device selected in this article is Google(Google)glasses designed based on the Android system.The device can be connected to the mobile phone through WIFI,and can also realize the stand-alone mode.The stand-alone mode adopted in this topic directly stocks the face on the glasses.The experimental results of the system prove the feasibility and timeliness of the system designed in this paper. |