Face recognition methodTechnical Field
The invention relates to a face recognition method.
Background
The 5G era comes, the technology of big data gradually matures along with the Internet of things, the information transmission rate is accelerated continuously, and the range of the intelligent terminal which can help us in life is wider and wider. The intelligent recognition, intelligent classification and intelligent operation are most widely applied. The intelligent recognition of images and videos is an indispensable part of our lives.
Face recognition is an important information source for capturing human activities, and the development of face recognition technology is promoted. The system is increasingly widely applied to daily life, such as a commercial face payment system, a law enforcement system and the like. Many methods of face pattern recognition have been followed, such as: principal Component Analysis (PCA), Linear Discriminant Analysis (LDA) Back Propagation Neural Network (BPNN), Convolutional Neural Network (CNN), and the like. In recent years, convolutional neural networks have constantly refreshed the identification records of ImageNet data sets on the large-scale visual identification challenge race (ILSV RC),
the characteristic of high target picture recognition rate between the convolutional neural network is applied to face recognition. A face recognition method based on a lightweight convolutional neural network is created, effective help is provided for correct recognition of a face, the face data are diverse in posture, so that very much face data are needed in the model training process, usually, a training set of face images is established, a large amount of face data are trained by using a deep learning method through a model, the trained model is produced, and then a new image verification set is established to verify the model to obtain a final classification recognition result. However, due to the characteristics of the neural network, in order to obtain higher accuracy, the depth and complexity of the network are continuously increased, the number of internal parameters is increased, and nonlinear mapping is increasingly huge, so that a very deep network structure may have a good operation result in competition and data representation, but in practical application, the operation result is often limited by the storage space, the operation capability, the calculation speed and the like of a terminal.
However, in the daily face recognition algorithm, a learning result is often obtained in milliseconds, and the devices have limited processor performance and cannot train operation like spending a lot of time in a laboratory. Therefore, the practicability of the convolutional neural network in face recognition is greatly limited.
Disclosure of Invention
The invention aims to provide a face recognition method.
In order to solve the above problem, the present invention provides a face recognition method, including:
acquiring a face training test resource from a public data set;
acquiring a face image from the face training test resource, and performing preprocessing or data expansion on the acquired face image to obtain a face data set;
inputting the face data set into a convolutional neural network formed by an NVM (non-volatile memory) module to obtain a trained lightweight convolutional neural network;
and inputting the face images in the test set into the trained lightweight convolutional neural network model to obtain an output result, and performing comparative analysis on the output result.
Further, in the above method, the common data set includes a PubFig, a Multi-Task Facial Landmark dataset or an ORL face data set.
Further, in the above method, the preprocessing or data expansion of the acquired face image includes:
and amplifying or reducing the acquired face image.
Further, in the above method, the preprocessing or data expansion of the acquired face image includes:
and translating the acquired face image.
Further, in the above method, the preprocessing or data expansion of the acquired face image includes:
and carrying out radiation change on the acquired face image.
Further, in the above method, before inputting the face data set into a convolutional neural network formed by an NVM module to obtain a trained lightweight convolutional neural network, the method further includes:
and setting the convolutional neural network formed by the NVM modules.
Further, in the above method, setting the convolutional neural network formed by the NVM modules includes:
an NVM module is composed of a compression layer and an expansion layer, 1 × 1 conventional convolution is replaced by grouping convolution to achieve model simplification, and the number of input channels is reduced through the 1 × 1 grouping convolution in the compression layer;
batch normalization is added after 1 × 1 convolution to accelerate the training process;
enabling data and packet training information to flow in different channels through Channel Shuffel;
in the structure of NVM convolutional neural network, the classification for face data set using Center Loss as Loss function is:
the mixing loss function is:
L=Ls+γL。
further, in the above method, after the pre-processing or data expansion is performed on the obtained face image to obtain the face data set, the method further includes:
and dividing the face data set into a training set, a verification set and a test set.
Compared with the prior art, the invention has the following advantages and beneficial effects:
1. the data set is expanded by adopting an efficient method, the training effectiveness is improved, and the fitting capacity of the model is improved.
2. The convolutional neural network structure of the NVM module adopting the packet convolution can effectively reduce the parameter quantity and the calculated quantity of the network, greatly improve the portability of the mobile terminal of the network and improve the application scene of the network. The Center Loss is adopted as a Loss function for face recognition, so that the intra-class distance becomes smaller, the inter-class distance becomes larger, and the face recognition method is more beneficial to classifying some complex face images.
3. Based on a back propagation algorithm and regularization algorithms such as Dropout and Bagging, the convolutional neural network model can adaptively improve the learning efficiency of the network and improve the reconstruction capability of the network.
Drawings
FIG. 1 is a diagram of a lightweight convolutional neural network architecture according to an embodiment of the present invention;
FIG. 2 is a block diagram of an NVM module employing packet convolution that makes up the network architecture in accordance with one embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
As shown in fig. 1 and 2, the present invention provides a face recognition method, including:
step S1: acquiring a face training test resource from a public data set;
step S2: acquiring a face image from the face training test resource, and performing preprocessing or data expansion on the acquired face image to obtain a face data set;
step S3: inputting the face data set into a convolutional neural network formed by an NVM (non-volatile memory) module to obtain a trained lightweight convolutional neural network;
step S4: and inputting the face images in the test set into the trained lightweight convolutional neural network model to obtain an output result, and performing comparative analysis on the output result.
And inputting the face images in the test set into the trained lightweight convolutional neural network model, and judging whether the lightweight convolutional neural network model is accurately identified and whether the lightweight neural network model can effectively classify the face data set.
The invention provides a light face recognition convolutional network structure, aiming at solving the problem that the portability of a mobile terminal is not high due to too large parameter and calculation amount of a convolutional neural network in face recognition. The quality of the network can be lighter and smaller during face recognition.
The invention improves the original convolutional neural network structure and provides a lightweight convolutional neural network structure to enable deep learning to be more widely applied to daily face classification.
In an embodiment of the face recognition method of the present invention, the common data set includes PubFig: public firm Face Database (university of Columbia Public people Face Database), 4.Multi-Task Face Landmark (MTFL) Database, or ORL Face dataset.
In an embodiment of the face recognition method of the present invention, the preprocessing or data expansion of the acquired face image includes:
and amplifying or reducing the acquired face image.
Here, the images in the training set may be enlarged or reduced.
In an embodiment of the face recognition method of the present invention, the preprocessing or data expansion of the acquired face image includes:
and translating the acquired face image.
Here, the images in the training set may be translated.
In an embodiment of the face recognition method of the present invention, the preprocessing or data expansion of the acquired face image includes:
and carrying out radiation change on the acquired face image.
Here, the images of the training set may be subjected to radial variations.
In an embodiment of the face recognition method of the present invention, before inputting the face data set into a convolutional neural network formed by an NVM module to obtain a trained lightweight convolutional neural network, the method further includes:
and setting the convolutional neural network formed by the NVM modules.
In an embodiment of the face recognition method of the present invention, setting the convolutional neural network formed by the NVM modules includes:
step S31: an NVM module is composed of a compression layer and an expansion layer, 1 × 1 conventional convolution is replaced by grouping convolution to achieve model simplification, and the number of input channels is reduced through the 1 × 1 grouping convolution in the compression layer;
step S32: batch normalization is added after 1 × 1 convolution to accelerate the training process;
step S33: and then, the data and the packet training information are circulated in different channels through the Channel Shuffel.
Step S34: in the structure of the NVM convolutional neural network, the classification of the face data set using Center Loss as the Loss function is:
the mixing loss function is:
L=Ls+γL。
in an embodiment of the face recognition method of the present invention, after the preprocessing or the data expansion is performed on the obtained face image to obtain the face data set, the method further includes:
and dividing the face data set into a training set, a verification set and a test set.
In the training stage, a training set is input into a convolutional neural network, a back propagation algorithm is adopted, the purpose is to continuously adjust model parameters to improve the fitting capability of the model, meanwhile, regularization algorithms such as Dropout and Bagging are adopted to train the model, and the purpose is to optimize the fitting capability of the model to prevent the model from being over-fitted.
And inputting the trained convolutional neural network by using the picture of the test set on the test set to compare and analyze the accuracy of the network.
In conclusion, the invention has the following advantages and beneficial effects:
1. the data set is expanded by adopting an efficient method, the training effectiveness is improved, and the fitting capacity of the model is improved.
2. The convolutional neural network structure of the NVM module adopting the packet convolution can effectively reduce the parameter quantity and the calculated quantity of the network, greatly improve the portability of the mobile terminal of the network and improve the application scene of the network. The Center Loss is adopted as a Loss function for face recognition, so that the intra-class distance becomes smaller, the inter-class distance becomes larger, and the face recognition method is more beneficial to classifying some complex face images.
3. Based on a back propagation algorithm and regularization algorithms such as Dropout and Bagging, the convolutional neural network model can adaptively improve the learning efficiency of the network and improve the reconstruction capability of the network.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.