CN111652021B - BP neural network-based face recognition method and system - Google Patents

BP neural network-based face recognition method and system Download PDF

Info

Publication number
CN111652021B
CN111652021B CN201910364884.1A CN201910364884A CN111652021B CN 111652021 B CN111652021 B CN 111652021B CN 201910364884 A CN201910364884 A CN 201910364884A CN 111652021 B CN111652021 B CN 111652021B
Authority
CN
China
Prior art keywords
face image
neural network
feature vector
registered
layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910364884.1A
Other languages
Chinese (zh)
Other versions
CN111652021A (en
Inventor
吴英平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Re Sr Information Technology Co ltd
Original Assignee
Shanghai Re Sr Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Re Sr Information Technology Co ltd filed Critical Shanghai Re Sr Information Technology Co ltd
Priority to CN201910364884.1A priority Critical patent/CN111652021B/en
Publication of CN111652021A publication Critical patent/CN111652021A/en
Application granted granted Critical
Publication of CN111652021B publication Critical patent/CN111652021B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Abstract

The invention relates to the technical field of face recognition, and discloses a face recognition method based on a BP neural network, which comprises the following steps: according to a face recognition model, obtaining a feature vector of a face image to be recognized, and calculating an initial cosine distance between the feature vector of the face image to be recognized and the feature vector of each registered face image; acquiring the reinforced feature vector of the face image to be identified according to a BP neural network model, and calculating the reinforced cosine distance between the reinforced feature vector of the face image to be identified and the reinforced feature vector of each registered face image; calculating a plurality of total cosine distances corresponding to the face image to be recognized; and the category of the registered face image corresponding to the minimum total cosine distance among the total cosine distances is the category of the face image to be identified. Correspondingly, the invention also discloses a face recognition system based on the BP neural network. The invention improves the face recognition effect.

Description

BP neural network-based face recognition method and system
Technical Field
The invention relates to the technical field of face recognition, in particular to a face recognition method and system based on a BP neural network.
Background
The face recognition technology is a biological recognition technology for carrying out identity recognition based on facial feature information of a person, and a camera is used for collecting images or video streams containing the face and automatically detecting and tracking the face in the images so as to further recognize the detected face. The model initially used by the face recognition system is a recognition model trained for a training set of 10575 face class numbers, and matching recognition of faces is completed through processes of extracting features, calculating cosine distances and the like. In the patent application with publication number of CN 108182427A, a face recognition method based on a deep learning model and transfer learning is disclosed, and the method comprises the following steps: preprocessing a source image and a target image, and setting corresponding labels, wherein the number of the source images is M, and the number of the target images is N, and M is more than N; establishing a source neural network with the output dimension of M; constructing a source data set based on the source image characteristics and the labels, training a source neural network by using the source data set, and optimizing model parameters through a neural network BP algorithm to obtain a source training model; establishing a target neural network with the output dimension of N of the classifier, initializing the target neural network by using parameters of a training model, constructing a target data set based on target image characteristics and labels, training the target neural network by using the target data set to obtain a model parameter optimized by a dynamic-K updating algorithm through a gradient descent method, and further obtaining a target training model; and carrying out image recognition through the target training model. The BP (back propagation) neural network is a concept proposed by scientists such as Rumelhart and McClellland in 1986, is a multi-layer feedforward neural network trained according to an error reverse propagation algorithm, and is one of the neural networks widely used at present.
In the use of the face recognition system, the user registers a new face, and the initial model of the face recognition system has good effect on the new face registered by the user, but how to further improve the face recognition effect in the use process of the face recognition system is the technical problem to be solved by the invention.
Disclosure of Invention
The invention aims to provide a face recognition method and a face recognition system based on a BP neural network so as to improve the face recognition effect.
In order to achieve the above purpose, the present invention provides a face recognition method based on a BP neural network, the method comprising: extracting features of a face image to be recognized according to a preset face recognition model, obtaining feature vectors of the face image to be recognized, and calculating initial cosine distances between the feature vectors of the face image to be recognized and feature vectors of each registered face image in a face registration library; acquiring the reinforced feature vector of the face image to be identified according to a preset BP neural network model, and calculating the reinforced cosine distance between the reinforced feature vector of the face image to be identified and the reinforced feature vector of each registered face image in the face registry; calculating a plurality of total cosine distances corresponding to the face image to be recognized according to each initial cosine distance and each reinforced cosine distance; and the category of the registered face image corresponding to the minimum total cosine distance among the total cosine distances is the category of the face image to be identified. According to the technical scheme, the generalization capability of the face recognition model can be reserved, and the recognition capability for registered face images is enhanced.
Preferably, the step of constructing the BP neural network model preset in step S2 includes: extracting features of the registered face image by using the face recognition model to obtain feature vectors of the registered face image; constructing a BP neural network model, wherein the BP neural network model comprises an input layer, an hidden layer and an output layer, the feature vector of the registered face image is used as the input layer, the hidden layer comprises 2 layers of full-connection layers, and the last layer of the hidden layer is an enhanced feature extraction layer; the BP neural network model is trained by combining the Softmax_loss function and the center_loss function based on Euclidean distance as a final Loss function. The number of nodes of the input layer of the BP neural network model is the same as the dimension of the feature vector of the registered face image, and the number of nodes of the output layer is the same as the number of categories in the face registration library. Training of the BP neural network model includes a forward propagation process, the forward propagation process including: taking the difference value between the category confidence coefficient of the registered face image and the category label of the registered face image output by the output layer as a softmax_loss function; performing enhanced feature extraction on the feature vector of the registered face image through the enhanced feature extraction layer to obtain an enhanced feature vector of the registered face image; acquiring the center of the strengthening feature vector corresponding to each category; calculating the Euclidean distance between the strengthening feature vector of the registered face image and the Center of the strengthening feature vector of the corresponding class, and taking the square of the Euclidean distance as a center_loss function; calculating a final loss function, wherein the final loss function formula is as follows: final Loss function = softmax_loss + λcenter_loss, where λ is the hyper-parameter. Training of the BP neural network model includes a back-propagation process, the back-propagation process including: and calculating the partial derivative of the final loss function according to the final loss function, and updating the weight parameters in the BP neural network model. Based on the technical scheme, the classification effect of the facial image features among different categories is enhanced by training the BP neural network model and extracting the enhanced feature vector of the facial image through the BP neural network model, the characteristics of the facial image in the same category are not easy to be confused, and the clustering effect is achieved; the BP neural network model for training based on the registered face image is small, and the training process is fast.
Preferably, the step S3 further includes: based on each initial cosine distance and each enhanced cosine distance, a total cosine distance is calculated by the following equation:
total cosine distance = a initial cosine distance + (1-a) enhanced cosine distance;
wherein alpha is a weight parameter.
To achieve the above object, the present invention provides a face recognition system based on a BP neural network, the system comprising: the feature vector module is used for extracting features of a face image to be identified according to a preset face identification model, obtaining feature vectors of the face image to be identified, and calculating initial cosine distances between the feature vectors of the face image to be identified and the feature vectors of each registered face image in the face registration library; the enhanced feature vector module is used for acquiring the enhanced feature vector of the face image to be identified according to a preset BP neural network model, and calculating the enhanced cosine distance between the enhanced feature vector of the face image to be identified and the enhanced feature vector of each registered face image of the face registry; the computing module is used for computing a plurality of total cosine distances corresponding to the face image to be recognized according to each initial cosine distance and each reinforced cosine distance; and the category module is used for determining the category of the registered face image corresponding to the minimum total cosine distance from the total cosine distances as the category of the face image to be identified. According to the technical scheme, the generalization capability of the face recognition model can be reserved, and the recognition capability for registered face images is enhanced.
Preferably, the enhanced feature vector module includes: the extraction unit is used for extracting the characteristics of the registered face image by using the face recognition model to obtain the characteristic vector of the registered face image; the building unit is used for building a BP neural network model, the BP neural network model comprises an input layer, an implicit layer and an output layer, the feature vector of the registered face image is used as the input layer, the implicit layer comprises 2 full-connection layers, and the last layer of the implicit layer is an enhanced feature extraction layer; and the training unit is used for combining the Softmax_loss Loss function and the center_loss function based on the Euclidean distance as a final Loss function and training the BP neural network model. The number of nodes of the input layer of the BP neural network model is the same as the dimension of the feature vector of the registered face image, and the number of nodes of the output layer is the same as the number of categories in the face registration library.
Preferably, the computing module specifically includes: based on each initial cosine distance and each enhanced cosine distance, a total cosine distance is calculated by the following equation:
total cosine distance = a initial cosine distance + (1-a) enhanced cosine distance;
wherein alpha is a weight parameter.
Compared with the prior art, the face recognition method and system based on the BP neural network have the beneficial effects that: by training the BP neural network model and extracting the strengthening feature vector of the face image through the BP neural network model, the classification effect of the face image features among different categories is strengthened, the categories are not easy to be confused, and the features of the face images in the same category have a clustering effect; the BP neural network model for training based on the registered face image is small, and the training process is fast. The generalization capability of the face recognition model can be reserved, and the recognition capability of the registered face image is enhanced. The method has better recognition effect on the registered face image and improves the face recognition effect.
Drawings
Fig. 1 is a flowchart of a face recognition method based on a BP neural network according to an embodiment of the present invention.
Fig. 2 is a block diagram illustrating a face recognition system based on a BP neural network according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to specific embodiments shown in the drawings. In the drawings, like structural elements are referred to by like reference numerals and components having similar structure or function are referred to by like reference numerals. The dimensions and thickness of each component shown in the drawings are arbitrarily shown, and the present invention is not limited to the dimensions and thickness of each component. The thickness of the components is exaggerated in some places in the drawings for clarity of illustration.
In one embodiment of the present invention as shown in fig. 1, the present invention provides a face recognition method based on a BP neural network, the method comprising:
s1, extracting features of a face image to be identified according to a preset face identification model, obtaining feature vectors of the face image to be identified, and calculating initial cosine distances between the feature vectors of the face image to be identified and feature vectors of each registered face image in a face registration library;
s2, acquiring the reinforced feature vector of the face image to be identified according to a preset BP neural network model, and calculating the reinforced cosine distance between the reinforced feature vector of the face image to be identified and the reinforced feature vector of each registered face image in the face registry;
s3, calculating a plurality of total cosine distances corresponding to the face image to be recognized according to each initial cosine distance and each reinforced cosine distance;
s4, in the total cosine distances, the category of the registered face image corresponding to the minimum total cosine distance is the category of the face image to be identified.
Step S1, extracting features of a face image to be identified according to a preset face identification model, obtaining feature vectors of the face image to be identified, and calculating initial cosine distances between the feature vectors of the face image to be identified and feature vectors of each registered face image in a face registration library. The preset face recognition model is trained, the face image is recognized through the face recognition model, and the feature vector of the face image is extracted. And extracting features of the face image to be identified through the face identification model, and obtaining feature vectors of the face image to be identified. The face registration library stores the feature vector of each registered face image and the category corresponding to each registered face image. And calculating the initial cosine distances between the feature vector of the face image to be recognized and the feature vector of each registered face image in the face registration library, and correspondingly obtaining a plurality of initial cosine distances.
Step S2, according to a preset BP neural network model, the reinforced feature vector of the face image to be identified is obtained, and the reinforced cosine distance between the reinforced feature vector of the face image to be identified and the reinforced feature vector of each registered face image in the face registry is calculated. The BP neural network is a multi-layer feedforward neural network, and the basic structure of the BP neural network comprises an input layer, an hidden layer and an output layer. The BP neural network process is mainly divided into two stages, wherein the first stage is forward propagation of signals, the signals pass through the hidden layer from the input layer and finally reach the output layer, the second stage is reverse propagation of errors, the weights and the biases from the hidden layer to the output layer, preferably from the output layer to the input layer are sequentially adjusted, and the weights and the biases from the input layer to the hidden layer are sequentially adjusted. The basic principle of the BP neural network is as follows: the input signal acts on the output node through the hidden layer point, the output signal is generated through nonlinear transformation, each sample of the network training comprises an input vector and an expected output vector, the deviation between the network output value and the expected output value is achieved, the error is reduced along the gradient direction through adjusting the connection strength value of the input node and the hidden layer node and the connection strength and the threshold value between the hidden layer node and the output node, the network parameter (weight and threshold value) opposite to the minimum error is determined through repeated learning training, and the training is stopped. According to the technical scheme, the BP neural network is utilized to train the registered face image, so that a BP neural network model is formed.
According to a specific embodiment of the present invention, the step of constructing the BP neural network model preset in step S2 includes:
s210, extracting features of a registered face image by using the face recognition model, and obtaining feature vectors of the registered face image;
s211, constructing a BP neural network model, wherein the BP neural network model comprises an input layer, an implicit layer and an output layer, the feature vector of the registered face image is used as the input layer, the implicit layer comprises 2 full-connection layers, and the last layer of the implicit layer is an enhanced feature extraction layer;
s212, combining the Softmax_loss Loss function and the center_loss function based on Euclidean distance as a final Loss function, and training the BP neural network model.
Step S210 is: the BP neural network model is used for training the registered face images, acquiring the registered face images from the registration library, and extracting the characteristics of the registered face images by using the face recognition model to acquire the characteristic vectors of the registered face images. In one application scenario of the invention, the face recognition model is a recognition model trained on the training set of 10575 face class numbers, and the matching recognition of the faces is completed through the processes of extracting features, calculating cosine distances and the like. In a small-scale face recognition model application scenario, such as a family, a small community, a small company and the like, the number of face registered users is small, such as the face registered users are within 20. In the process that the user uses the face recognition model, more face images registered by the user are acquired. A BP neural network model is constructed by training registered face images registered by a user. BP neural network model training is carried out on the registered face images, the reinforced feature vectors of the registered face images are extracted through model training, the reinforced feature vectors have reinforced action on face recognition of registered users, and the increase of the feature distance of the images between the categories is achieved through the reinforced action, so that the features between the two categories are obviously different, and confusion between the categories is not easy. The feature distance of the images in the same category is reduced through the strengthening effect, so that the features in the same category are similar and are easy to identify.
Step S211 is: the BP neural network model is constructed, the BP neural network model comprises an input layer, an hidden layer and an output layer, the feature vector of the registered face image is used as the input layer, the hidden layer comprises 2 layers of full-connection layers, and the last layer of the hidden layer is an enhanced feature extraction layer. The number of nodes of the input layer of the BP neural network model is the same as the dimension of the feature vector of the registered face image, and the number of nodes of the output layer is the same as the number of categories in the face registration library. For example, the number of nodes of the input layer is 128, the number of nodes of the first fully connected layer is 1024, and the number of nodes of the second fully connected layer is 128. The strengthening characteristic extraction layer can extract strengthening characteristics of the face image. And the output result of the output layer is the category of the registered face image.
Step S212 is: the BP neural network model is trained by combining the Softmax_loss function and the center_loss function based on Euclidean distance as a final Loss function. The training of the BP neural network model comprises two stages: a forward propagation phase and a backward propagation phase. The forward propagation proceeds from the input layer through the hidden layer and finally to the output layer. And taking the feature vector of the registered face image as input, propagating forward through the BP neural network model, and obtaining an actual output result at an output layer through 2 full-connection layers. According to an embodiment of the present invention, the step S212 includes: training of the BP neural network model includes a forward propagation process, the forward propagation process including: taking the difference value between the category confidence coefficient of the registered face image and the category label of the registered face image output by the output layer as a softmax_loss function; inputting the feature vector of the registered face image into the BP neural network model, transmitting the feature vector forward through the BP neural network model, and carrying out enhanced feature extraction on the feature vector of the registered face image through the enhanced feature extraction layer to obtain an enhanced feature vector of the registered face image; acquiring the center of the strengthening feature vector corresponding to each category; calculating the Euclidean distance between the strengthening feature vector of the registered face image and the Center of the strengthening feature vector of the corresponding class, and taking the square of the Euclidean distance as a center_loss function; calculating a final loss function, wherein the final loss function formula is as follows:
the final Loss function = Softmax _ Loss + lambda Center _ Loss,
wherein λ is the hyper-parameter.
According to an embodiment of the present invention, the step S212 further includes: training of the BP neural network model includes a back-propagation process, the back-propagation process including: and calculating the partial derivative of the final loss function according to the final loss function, and updating the weight parameters in the BP neural network model. The back propagation process is to adjust the weight matrix, and according to the error between the actual output value and the ideal output value of the network, the back propagation process is carried out to the input layer by utilizing the minimum value error, and the weight matrix of each layer of the network is adjusted.
And acquiring the intensified feature vector of each registered face image in the face registration library according to the BP neural network model. And carrying out intensified feature extraction on the face image to be identified according to the BP neural network model, acquiring intensified feature vectors of the face image to be identified, and calculating intensified cosine distances between the intensified feature vectors of the face image to be identified and the intensified feature vectors of each registered face image in the face registry.
According to the technical scheme, the classification effect of the facial image features among different categories is enhanced by training the BP neural network model and extracting the enhanced feature vector of the facial image through the BP neural network model, the characteristics of the facial image in the same category are not easy to confuse, and the clustering effect is achieved. The BP neural network model for training based on the registered face image is small, and the training process is fast.
The step S3 is as follows: and calculating a plurality of total cosine distances corresponding to the face image to be recognized according to each initial cosine distance and each enhanced cosine distance. According to an embodiment of the present invention, the step S3 includes: based on each initial cosine distance and each enhanced cosine distance, a total cosine distance is calculated by the following equation:
total cosine distance = a initial cosine distance + (1-a) enhanced cosine distance;
wherein alpha is a weight parameter. According to an embodiment of the present invention, the α has a value of 0.9. And calculating each total cosine distance corresponding to the face image to be recognized according to the above formula, and further obtaining a plurality of corresponding total cosine distances. According to the technical scheme, the generalization capability of the face recognition model can be reserved, and the recognition capability for registered face images is enhanced.
The step S4 is as follows: and the category of the registered face image corresponding to the minimum total cosine distance among the total cosine distances is the category of the face image to be identified. And acquiring the minimum total cosine distance according to the calculated total cosine distance, wherein the category of the registered face image corresponding to the minimum total cosine distance is the category of the face image to be identified.
According to the technical scheme, the classification effect of the facial image features among different categories is enhanced by training the BP neural network model and extracting the enhanced feature vector of the facial image through the BP neural network model, the characteristics of the facial image in the same category are not easy to be confused, and the clustering effect is achieved; the BP neural network model for training based on the registered face image is small, and the training process is fast. The generalization capability of the face recognition model can be reserved, and the recognition capability of the registered face image is enhanced. The method has better recognition effect on the registered face image and improves the face recognition effect.
As shown in fig. 2, in another embodiment, the present invention further provides a face recognition system based on a BP neural network, where the system includes:
the feature vector module 20 is configured to perform feature extraction on a face image to be identified according to a preset face identification model, obtain a feature vector of the face image to be identified, and calculate an initial cosine distance between the feature vector of the face image to be identified and the feature vector of each registered face image in the face registration library;
the enhanced feature vector module 21 is configured to obtain an enhanced feature vector of the face image to be identified according to a preset BP neural network model, and calculate an enhanced cosine distance between the enhanced feature vector of the face image to be identified and the enhanced feature vector of each registered face image in the face registry;
the calculating module 22 is configured to calculate a plurality of total cosine distances corresponding to the face image to be identified according to each initial cosine distance and each enhanced cosine distance;
the category module 23 is configured to, among the plurality of total cosine distances, determine a category of the registered face image corresponding to the smallest total cosine distance as the category of the face image to be identified.
The feature vector module 20 is configured to perform feature extraction on a face image to be identified according to a preset face recognition model, obtain a feature vector of the face image to be identified, and calculate an initial cosine distance between the feature vector of the face image to be identified and the feature vector of each registered face image in the face registration library. The preset face recognition model is trained, the face image is recognized through the face recognition model, and the feature vector of the face image is extracted. The face registration library stores the feature vector of each registered face image and the category corresponding to each registered face image. The feature vector module calculates the initial cosine distances between the feature vector of the face image to be recognized and the feature vector of each registered face image in the face registration library, and accordingly obtains a plurality of initial cosine distances.
The enhanced feature vector module 21 is configured to obtain an enhanced feature vector of the face image to be identified according to a preset BP neural network model, and calculate an enhanced cosine distance between the enhanced feature vector of the face image to be identified and the enhanced feature vector of each registered face image of the face registry. By training the BP neural network model and extracting the strengthening feature vector of the face image through the BP neural network model, the classification effect of the face image features among different categories is strengthened, the categories are not easy to be confused, and the features of the face images in the same category have a clustering effect.
According to a specific embodiment of the present invention, the enhanced feature vector module includes an extraction unit, a construction unit, and a training unit. And the extraction unit performs feature extraction on the registered face image by using the face recognition model to acquire a feature vector of the registered face image. The building unit builds a BP neural network model, wherein the BP neural network model comprises an input layer, an implicit layer and an output layer, the feature vector of the registered face image is used as the input layer, the implicit layer comprises 2 full-connection layers, and the last layer of the implicit layer is an enhanced feature extraction layer. The number of nodes of the input layer of the BP neural network model is the same as the dimension of the feature vector of the registered face image, and the number of nodes of the output layer is the same as the number of categories in the face registration library. The strengthening characteristic extraction layer can extract strengthening characteristics of the face image. And the output result of the output layer is the category of the registered face image. The training unit combines the Softmax_loss Loss function and the center_loss function based on Euclidean distance as a final Loss function, and trains the BP neural network model. The training method of the training unit is identical to the method in the method embodiment and will not be described in detail here.
The calculating module 22 is configured to calculate a plurality of total cosine distances corresponding to the face image to be identified according to each initial cosine distance and each enhanced cosine distance. The calculation module specifically comprises:
based on each initial cosine distance and each enhanced cosine distance, a total cosine distance is calculated by the following equation:
total cosine distance = a initial cosine distance + (1-a) enhanced cosine distance;
wherein alpha is a weight parameter. According to an embodiment of the present invention, the α has a value of 0.9. According to the above formula, the calculation module calculates each total cosine distance corresponding to the face image to be recognized, and further obtains a plurality of corresponding total cosine distances. According to the technical scheme, the generalization capability of the face recognition model can be reserved, and the recognition capability for registered face images is enhanced.
The category module 23 is configured to, among the plurality of total cosine distances, determine a category of the registered face image corresponding to the smallest total cosine distance as the category of the face image to be identified. And acquiring the minimum total cosine distance according to the calculated total cosine distance, wherein the category of the registered face image corresponding to the minimum total cosine distance is the category of the face image to be identified.
According to the technical scheme, the classification effect of the facial image features among different categories is enhanced by training the BP neural network model and extracting the enhanced feature vector of the facial image through the BP neural network model, the characteristics of the facial image in the same category are not easy to be confused, and the clustering effect is achieved; the BP neural network model for training based on the registered face image is small, and the training process is fast. The generalization capability of the face recognition model can be reserved, and the recognition capability of the registered face image is enhanced. The method has better recognition effect on the registered face image and improves the face recognition effect.
While the invention has been described in detail in the foregoing drawings and embodiments, such illustration and description are to be considered illustrative or exemplary and not restrictive. The invention is not limited to the disclosed embodiments. In the claims, the word "comprising" does not exclude other elements or steps, and the "a" or "an" or "a particular" plurality should be understood as at least one or at least a particular plurality. Any reference signs in the claims shall not be construed as limiting the scope. Other variations to the above-described embodiments can be understood and effected by those skilled in the art in light of the figures, the description, and the appended claims, without departing from the scope of the invention as defined in the claims.

Claims (7)

1. The face recognition method based on the BP neural network is characterized by comprising the following steps of:
s1, extracting features of a face image to be identified according to a preset face identification model, obtaining feature vectors of the face image to be identified, and calculating initial cosine distances between the feature vectors of the face image to be identified and feature vectors of each registered face image in a face registration library;
s2, acquiring the reinforced feature vector of the face image to be identified according to a preset BP neural network model, and calculating the reinforced cosine distance between the reinforced feature vector of the face image to be identified and the reinforced feature vector of each registered face image in the face registry;
s3, calculating a plurality of total cosine distances corresponding to the face image to be recognized according to each initial cosine distance and each reinforced cosine distance;
s4, in the total cosine distances, the category of the registered face image corresponding to the minimum total cosine distance is the category of the face image to be identified;
the step of constructing the BP neural network model preset in the step S2 includes:
s210, extracting features of a registered face image by using the face recognition model, and obtaining feature vectors of the registered face image;
s211, constructing a BP neural network model, wherein the BP neural network model comprises an input layer, an implicit layer and an output layer, the feature vector of the registered face image is used as the input layer, the implicit layer comprises 2 full-connection layers, and the last layer of the implicit layer is an enhanced feature extraction layer;
s212, combining the Softmax_loss Loss function and the center_loss function based on Euclidean distance as a final Loss function, and training the BP neural network model;
wherein, the step S212 includes:
training of the BP neural network model includes a forward propagation process, the forward propagation process including:
taking the difference value between the category confidence coefficient of the registered face image and the category label of the registered face image output by the output layer as a softmax_loss function;
performing enhanced feature extraction on the feature vector of the registered face image through the enhanced feature extraction layer to obtain an enhanced feature vector of the registered face image;
acquiring the center of the strengthening feature vector corresponding to each category;
calculating the Euclidean distance between the strengthening feature vector of the registered face image and the Center of the strengthening feature vector of the corresponding class, and taking the square of the Euclidean distance as a center_loss function;
calculating a final loss function, wherein the final loss function formula is as follows:
the final Loss function = Softmax _ Loss + lambda Center _ Loss,
wherein λ is the hyper-parameter.
2. The BP neural network-based face recognition method of claim 1, wherein the step S211 comprises:
the number of nodes of the input layer of the BP neural network model is the same as the dimension of the feature vector of the registered face image, and the number of nodes of the output layer is the same as the number of categories in the face registration library.
3. The BP neural network-based face recognition method of claim 2, wherein the step S212 further comprises:
training of the BP neural network model includes a back-propagation process, the back-propagation process including:
and calculating the partial derivative of the final loss function according to the final loss function, and updating the weight parameters in the BP neural network model.
4. The BP neural network-based face recognition method of claim 1, wherein the step S3 further comprises:
based on each initial cosine distance and each enhanced cosine distance, a total cosine distance is calculated by the following equation:
total cosine distance = a initial cosine distance + (1-a) enhanced cosine distance;
wherein alpha is a weight parameter.
5. A BP neural network-based face recognition system, the system comprising: the feature vector module is used for extracting features of a face image to be identified according to a preset face identification model, obtaining feature vectors of the face image to be identified, and calculating initial cosine distances between the feature vectors of the face image to be identified and the feature vectors of each registered face image in the face registration library;
the enhanced feature vector module is used for acquiring the enhanced feature vector of the face image to be identified according to a preset BP neural network model, and calculating the enhanced cosine distance between the enhanced feature vector of the face image to be identified and the enhanced feature vector of each registered face image in the face registry;
the computing module is used for computing a plurality of total cosine distances corresponding to the face image to be recognized according to each initial cosine distance and each reinforced cosine distance;
the class module is used for judging the class of the registered face image corresponding to the minimum total cosine distance in the total cosine distances as the class of the face image to be identified;
wherein the enhanced feature vector module comprises:
the extraction unit is used for extracting the characteristics of the registered face image by using the face recognition model to obtain the characteristic vector of the registered face image;
the building unit is used for building a BP neural network model, the BP neural network model comprises an input layer, an implicit layer and an output layer, the feature vector of the registered face image is used as the input layer, the implicit layer comprises 2 full-connection layers, and the last layer of the implicit layer is an enhanced feature extraction layer;
the training unit is configured to combine the softmax_loss function and the center_loss function based on the euclidean distance as a final Loss function, and train the BP neural network model, where the training unit is specifically configured to:
training of the BP neural network model includes a forward propagation process, the forward propagation process including:
taking the difference value between the category confidence coefficient of the registered face image and the category label of the registered face image output by the output layer as a softmax_loss function;
performing enhanced feature extraction on the feature vector of the registered face image through the enhanced feature extraction layer to obtain an enhanced feature vector of the registered face image;
acquiring the center of the strengthening feature vector corresponding to each category;
calculating the Euclidean distance between the strengthening feature vector of the registered face image and the Center of the strengthening feature vector of the corresponding class, and taking the square of the Euclidean distance as a center_loss function;
calculating a final loss function, wherein the final loss function formula is as follows:
the final Loss function = Softmax _ Loss + lambda Center _ Loss,
wherein λ is the hyper-parameter.
6. The BP neural network-based face recognition system of claim 5, wherein the construction unit specifically comprises:
the number of nodes of the input layer of the BP neural network model is the same as the dimension of the feature vector of the registered face image, and the number of nodes of the output layer is the same as the number of categories in the face registration library.
7. The BP neural network-based face recognition system of claim 5, wherein the computing module specifically comprises:
based on each initial cosine distance and each enhanced cosine distance, a total cosine distance is calculated by the following equation:
total cosine distance = a initial cosine distance + (1-a) enhanced cosine distance;
wherein alpha is a weight parameter.
CN201910364884.1A 2019-04-30 2019-04-30 BP neural network-based face recognition method and system Active CN111652021B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910364884.1A CN111652021B (en) 2019-04-30 2019-04-30 BP neural network-based face recognition method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910364884.1A CN111652021B (en) 2019-04-30 2019-04-30 BP neural network-based face recognition method and system

Publications (2)

Publication Number Publication Date
CN111652021A CN111652021A (en) 2020-09-11
CN111652021B true CN111652021B (en) 2023-06-02

Family

ID=72346298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910364884.1A Active CN111652021B (en) 2019-04-30 2019-04-30 BP neural network-based face recognition method and system

Country Status (1)

Country Link
CN (1) CN111652021B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112257672A (en) * 2020-11-17 2021-01-22 中国科学院深圳先进技术研究院 Face recognition method, system, terminal and storage medium
CN113536938A (en) * 2021-06-18 2021-10-22 云南电网有限责任公司 5G-fused intelligent early warning method and system for forest fire of power transmission line

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006003270A1 (en) * 2004-06-04 2006-01-12 France Telecom Method for recognising faces by means of a two-dimensional linear discriminant analysis
CN109165566A (en) * 2018-08-01 2019-01-08 中国计量大学 A kind of recognition of face convolutional neural networks training method based on novel loss function

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7127087B2 (en) * 2000-03-27 2006-10-24 Microsoft Corporation Pose-invariant face recognition system and process

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006003270A1 (en) * 2004-06-04 2006-01-12 France Telecom Method for recognising faces by means of a two-dimensional linear discriminant analysis
CN109165566A (en) * 2018-08-01 2019-01-08 中国计量大学 A kind of recognition of face convolutional neural networks training method based on novel loss function

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
华顺刚 ; 曾令宜 ; 苏铁明 ; 周羽 ; .基于线性降维技术和BP神经网络的热红外人脸图像识别.大连理工大学学报.2010,(01),全文. *
谢志文 ; 吴玉香 ; 刘少军 ; .基于小波和余弦变换的神经网络人脸识别法.电子技术应用.2008,(09),全文. *

Also Published As

Publication number Publication date
CN111652021A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
CN108133188B (en) Behavior identification method based on motion history image and convolutional neural network
CN111695415B (en) Image recognition method and related equipment
CN111161315B (en) Multi-target tracking method and system based on graph neural network
CN110378281A (en) Group Activity recognition method based on pseudo- 3D convolutional neural networks
CN109858390A (en) The Activity recognition method of human skeleton based on end-to-end space-time diagram learning neural network
CN111583263A (en) Point cloud segmentation method based on joint dynamic graph convolution
CN110796057A (en) Pedestrian re-identification method and device and computer equipment
CN113159283B (en) Model training method based on federal transfer learning and computing node
CN111709311A (en) Pedestrian re-identification method based on multi-scale convolution feature fusion
CN111292195A (en) Risk account identification method and device
Arora et al. Handwriting recognition using deep learning in keras
CN111652021B (en) BP neural network-based face recognition method and system
CN112633154B (en) Method and system for converting heterogeneous face feature vectors
CN112927266B (en) Weak supervision time domain action positioning method and system based on uncertainty guide training
CN113343814A (en) Handwritten digital image recognition method based on single-node photon reserve pool calculation
CN112507893A (en) Distributed unsupervised pedestrian re-identification method based on edge calculation
CN116206327A (en) Image classification method based on online knowledge distillation
Liu et al. Uncertainty-aware graph reasoning with global collaborative learning for remote sensing salient object detection
CN112052795B (en) Video behavior identification method based on multi-scale space-time feature aggregation
CN116994295A (en) Wild animal category identification method based on gray sample self-adaptive selection gate
CN110674265B (en) Unstructured information oriented feature discrimination and information recommendation system
CN112347965A (en) Video relation detection method and system based on space-time diagram
CN113255543B (en) Facial expression recognition method based on graph convolution network
CN112765989B (en) Variable-length text semantic recognition method based on representation classification network
JPH08305855A (en) Method and device for pattern recognition of image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant