Low-power-consumption face recognition method based on TinyMLTechnical Field
The invention relates to a low-power-consumption face recognition method based on TinyML, and belongs to the technical field of face recognition.
Background
The face recognition application is explosively increased in recent years due to the development of digitalization and intellectualization and the general improvement of face recognition accuracy, and the face recognition application plays an important role in aspects such as intelligent security and protection, intelligent payment and the like. In the application similar to intelligent entrance guard, the camera continuously captures video stream data in real time, and the human face recognition model receives the real-time data and then performs human face recognition. And extracting the face features through the neural network model, comparing the face features with data in the database, and if the face data exist in the database, successfully identifying the face features, and further executing actions such as door opening and the like. At present, the mainstream face recognition models adopt a deep learning-based method and deeper neural network models, so that the model complexity is higher. In addition, data collected by the camera in most time is pedestrian-free, and data without human face is recognized in most time by the human face recognition model, so that waste of model operation resources is caused. In order to reduce the power consumption of equipment, one method is to use radar to perform living body detection, for example, after a living body target is captured by the radar, the data is transmitted to a face recognition model. This approach requires additional radar, increasing equipment costs.
Disclosure of Invention
The invention aims to provide a low-power-consumption face recognition method based on TinyML, which has low operation power consumption and is suitable for long-time continuous operation.
In order to achieve the purpose, the invention is realized by the following technical scheme:
a low-power-consumption face recognition method based on TinyML comprises the following steps:
a) training and deploying a pedestrian detection model, collecting data to train the pedestrian detection model, and quantizing and compressing the model so as to deploy the model on a microprocessor development board;
b) constructing a face database, collecting face data, and extracting and storing face features;
c) deploying a face recognition model, and deploying the face recognition model with higher operation power consumption to a server;
d) the camera collects face data, collects the data in real time and inputs video stream to the microprocessor development board;
e) running a pedestrian detection model, detecting whether data comprises pedestrians or not after the development board receives video stream data, if so, transmitting the data to a server, and if not, ending the flow;
f) the face recognition model is operated, after the server receives face data from the development board, the face recognition model is operated, when the similarity of the calculated face is higher than a set threshold value, a door opening action is executed, otherwise, the flow is ended;
preferably, the face recognition model in step f specifically comprises the following steps that the face recognition model is responsible for processing received video stream data, extracting face features, respectively calculating similarity with face database data, comparing with a preset threshold value, and outputting a comparison result.
Preferably, the pedestrian detection model is actually a two-classification model, that is, whether the predicted image includes a pedestrian or not, the training data is collected to train the model, the capacity of the model is reduced through a model quantization and compression mode, and the model is deployed on a microprocessor development board.
Preferably, the face recognition model adopts a neural network model to extract the face features, and stores the face features in a face database.
The invention has the advantages that: the invention reduces the equipment cost, has low operation power consumption, can operate the face recognition model only under the condition of the existence of pedestrians, can effectively reduce the operation power consumption of the face recognition model, and is suitable for long-time operation.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention.
FIG. 1 is a schematic view of the flow structure of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A low-power-consumption face recognition method based on TinyML is used for reducing the power consumption of continuous operation of a face recognition model. The adopted equipment comprises a development board loaded with a microprocessor, a camera and a server, and the technical scheme is that a pedestrian detection model is operated on the development board, a face recognition model is operated on the server, after video stream data is received, the pedestrian detection model is operated firstly, if a pedestrian is detected, the face recognition model is operated, otherwise, the face recognition model is not operated. The pedestrian detection model is actually a two-classification model, namely whether the predicted image comprises pedestrians or not, collects training data to train the model, reduces the capacity of the model through model quantization and compression, and deploys the model on a microprocessor development board. In addition, a face database is required to be constructed, face data are collected and preprocessed, face features are extracted by adopting a neural network model and stored in the face database. The face recognition model is responsible for processing the received video stream data, extracting face features, respectively calculating similarity with the face database data, comparing with a preset threshold, outputting a comparison result, and executing subsequent actions according to the comparison result.
The method specifically comprises the following steps:
a) training and deploying a pedestrian detection model, collecting data to train the pedestrian detection model, and quantizing and compressing the model so as to deploy the model on a microprocessor development board;
b) constructing a face database, collecting face data, and extracting and storing face features;
c) deploying a face recognition model, and deploying the face recognition model with higher operation power consumption to a server;
d) the camera collects face data, collects the data in real time and inputs video stream to the microprocessor development board;
e) running a pedestrian detection model, detecting whether data comprises pedestrians or not after the development board receives video stream data, if so, transmitting the data to a server, and if not, ending the flow;
f) the face recognition model is operated, after the server receives face data from the development board, the face recognition model is operated, when the similarity of the calculated face is higher than a set threshold value, a door opening action is executed, otherwise, the flow is ended;
and f, the face recognition model in the step f is specifically used for processing the received video stream data, extracting face features, respectively calculating similarity with the data of the face database, comparing with a preset threshold value, and outputting a comparison result.
The pedestrian detection model is actually a two-classification model, namely whether the predicted image comprises pedestrians or not, collects training data to train the model, reduces the capacity of the model through a model quantization and compression mode, and deploys the model to a microprocessor development board.
The face recognition model adopts a neural network model to extract face features and stores the face features in a face database.
The invention reduces the equipment cost, has low operation power consumption, can operate the face recognition model only under the condition of the existence of pedestrians, can effectively reduce the operation power consumption of the face recognition model, and is suitable for long-time operation.