CN116030525A - Human face recognition method based on artificial intelligence and related equipment - Google Patents

Human face recognition method based on artificial intelligence and related equipment Download PDF

Info

Publication number
CN116030525A
CN116030525A CN202310150334.6A CN202310150334A CN116030525A CN 116030525 A CN116030525 A CN 116030525A CN 202310150334 A CN202310150334 A CN 202310150334A CN 116030525 A CN116030525 A CN 116030525A
Authority
CN
China
Prior art keywords
network
face
face recognition
image
output
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.)
Pending
Application number
CN202310150334.6A
Other languages
Chinese (zh)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202310150334.6A priority Critical patent/CN116030525A/en
Publication of CN116030525A publication Critical patent/CN116030525A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The application provides a face recognition method, a device, electronic equipment and a storage medium based on artificial intelligence, wherein the face recognition method based on the artificial intelligence comprises the following steps: acquiring face images of the same face in different states to obtain image subsets, and storing all the image subsets to obtain a training image set; building a face recognition network; training a face recognition network based on the training image set to obtain a target face recognition network, wherein the output of the target face recognition network is an attention map and a remarkable feature map of the face image; respectively inputting a face image to be recognized and at least one reference image into a target face recognition network to obtain an output image, wherein the output image comprises an attention map to be recognized, a significant feature map to be recognized, a reference attention map and a reference significant feature map, and the reference image comprises a face recognition label; and acquiring the face recognition result of the face image to be recognized based on the output image and the face recognition label. The method and the device can improve the robustness and accuracy of face recognition.

Description

Human face recognition method based on artificial intelligence and related equipment
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a face recognition method, a face recognition device, electronic equipment and a storage medium based on artificial intelligence.
Background
In the scenes of electronic payment, financial wind control and the like needing face recognition, a face recognition result is usually obtained according to the collected face images, but the pose and the background environment of the face in the collected face images are often different, and meanwhile, a plurality of faces appear in one face image at the same time, so that the face recognition accuracy is affected.
At present, aiming at the problems, a face detection algorithm is generally utilized to obtain a region image of each face in a face image, and then the region image of each face is subjected to face recognition to obtain a face recognition result.
Disclosure of Invention
In view of the foregoing, there is a need for an artificial intelligence-based face recognition method and related devices, which solve the technical problem of how to improve the robustness and accuracy of face recognition, wherein the related devices include an artificial intelligence-based face recognition device, an electronic device and a storage medium.
The application provides a face recognition method based on artificial intelligence, which comprises the following steps:
Acquiring face images of the same face in different states to acquire image subsets of the face, and storing all the image subsets as training image sets;
building a face recognition network;
training the face recognition network based on the training image set to obtain a target face recognition network, wherein the input of the target face recognition network is a face image, and the input of the target face recognition network is output as an attention map and a remarkable feature map of the face image, and the remarkable feature map comprises common features of the same face in different states;
inputting a face image to be recognized into the target face recognition network to output a attention map to be recognized and a significant feature map to be recognized, and inputting a reference image into the target face recognition network to output a reference attention map and a reference significant feature map, wherein the reference image comprises a face recognition label;
and acquiring the face recognition result of the face image to be recognized based on the attention to be recognized force diagram, the reference attention force diagram, the significant feature diagram to be recognized, the reference significant feature diagram and the face recognition label.
In some embodiments, the acquiring face images of the same face in different states to acquire image subsets of the face, and storing all the image subsets as a training image set includes:
Collecting a plurality of face images of the same face in different states, wherein the different states at least comprise at least one of different face postures and different background environments;
storing a plurality of face images of the same face as an image subset of the face;
image subsets of different faces are acquired to obtain a training image set.
In some embodiments, the building of the face recognition network comprises:
the input of the face recognition network is a face image, and the face recognition network comprises a feature extraction layer, a self-attention layer and a fusion layer;
the feature extraction layer performs feature extraction on the input face image to obtain a feature map;
the self-attention layer divides an input face image into a preset number of equi-sized sub-images, and performs feature extraction on all the sub-images to obtain an attention map, wherein the attention map has the same size as the feature map;
the fusion layer fuses the attention map and the feature map to obtain a salient feature map of the input face image, wherein the salient feature map is used for reflecting the features of the face region in the input face image, and the salient feature map satisfies the relation:
R=F⊙A
wherein F is the feature map, A is the self-attention diagram, F.sub.A is the Hadamard product between F and A calculated, R is the salient feature map;
And taking the attention map and the salient feature map as output results of the face recognition network.
In some embodiments, the training the face recognition network based on the training image set to obtain a target face recognition network includes:
a1, building two face recognition networks, connecting a classification layer at the tail end of one face recognition network as a student network, and sequentially connecting a bias layer and a classification layer at the tail end of the other face recognition network as a teacher network, wherein the bias layer comprises a bias matrix;
a2, randomly selecting two face images from any image subset of the training image set without replacement to serve as training pairs, and respectively marking the two face images in the training pairs as a first face image and a second face image;
a3, respectively inputting the first face image into the student network and the teacher network to obtain a first student output and a first teacher output, and respectively inputting the second face image into the student network and the teacher network to obtain a second student output and a second teacher output;
a4, calculating a preset loss function value based on the first student output, the first teacher output, the second student output and the second teacher output, and updating network parameters in the student network based on the preset loss function value and a gradient descent method;
A5, updating network parameters except the bias layer in the teacher network based on the updated network parameters in the student network, wherein the updating process of the network parameters meets the relation:
Figure BDA0004091253050000021
wherein ,θt To update network parameters other than the bias layer in the teacher network before,
Figure BDA0004091253050000022
for updating network parameters except the bias layer in the teacher network, theta s For the updated network parameters in the student network, lambda is a parameter updating coefficient, and the value range is [0,1 ]];
A6, updating the bias matrix in the bias layer based on the first teacher output and the second teacher output, wherein the updating process of the bias matrix meets the relation:
Figure BDA0004091253050000023
wherein C is the bias matrix before updating,
Figure BDA0004091253050000024
c, inputting the first face image and the second face image into a face recognition network output salient feature map in the teacher network respectively * For the updated bias matrix, m is the bias update coefficient, and the value range is [0,1];/>
A7, repeating the steps A2 to A6, continuously selecting new training pairs from the training image set, and continuously updating network parameters in the student network and the teacher network until the preset loss function value is not changed any more, and stopping updating to obtain a trained student network and teacher network;
A8, respectively extracting face recognition networks in the trained student network and the teacher network, fusing network parameters of the two face recognition networks to obtain a target face recognition network, wherein the fusion process meets the following relation:
Figure BDA0004091253050000031
wherein ,
Figure BDA0004091253050000032
for the network parameters of face recognition network in the trained teacher network, < ->
Figure BDA0004091253050000033
For the network parameters theta of face recognition network in the trained student network final The epsilon is a fusion coefficient and the value range is [0,1 ] for the network parameters of the target face recognition network]。
In some embodiments, the bias layer is configured to add the bias matrix to the salient feature map output by the face recognition network in the teacher network, to obtain a bias feature map, where the bias feature map satisfies the relation:
Figure BDA0004091253050000034
wherein ,Rt A significant feature map output by a face recognition network in the teacher network, C is the bias matrix, the bias matrix is the same as the significant feature map in size,
Figure BDA0004091253050000035
-providing the bias profile; in the teacher network, the bias feature map is input into the classification layer to obtain an output result of the teacher network.
In some embodiments, the preset loss function value satisfies the relationship:
Figure BDA0004091253050000036
wherein ,
Figure BDA0004091253050000037
the value of the ith row in the first teacher output and the second teacher output respectively, +.>
Figure BDA0004091253050000038
And the values of the ith row in the first student output and the second student output are respectively, N is the number of rows of the first student output, the first teacher output, the second student output and the second teacher output, and Loss is the preset Loss function value.
In some embodiments, the number of the reference images is at least one, each reference image corresponds to a reference attention map and a reference salient feature map, and the obtaining the face recognition result of the face image to be recognized based on the attention map to be recognized, the reference attention map, the salient feature map to be recognized, the reference salient feature map and the face recognition label includes:
calculating the similarity between the attention to be identified and the reference attention map as a first similarity;
calculating the similarity between the to-be-identified salient feature map and the reference salient feature map to serve as second similarity;
the first similarity and the second similarity are weighted and summed to obtain target similarity of the face image to be identified and each reference image, and the maximum similarity of all the target similarities is obtained;
Comparing the maximum similarity with a preset threshold value, and if the maximum similarity is larger than the preset threshold value, taking a face recognition label of a reference image corresponding to the maximum similarity as a face recognition result of the face image to be recognized; and if the maximum similarity is not greater than the preset threshold value, sending an alarm in a preset mode.
The embodiment of the application also provides a face recognition device based on artificial intelligence, which comprises:
the acquisition unit is used for acquiring face images of the same face in different states to acquire image subsets of the face, and storing all the image subsets to serve as a training image set;
the construction unit is used for constructing a face recognition network;
the training unit is used for training the face recognition network based on the training image set to obtain a target face recognition network, wherein the input of the target face recognition network is a face image, and the input is an attention map and a remarkable feature map of the face image, and the remarkable feature map comprises common features of the same face in different states;
the input unit is used for inputting the face image to be recognized into the target face recognition network to output attention drawing to be recognized and the significant feature image to be recognized, inputting the reference image into the target face recognition network to output the reference attention drawing and the reference significant feature image, and the reference image comprises a face recognition label;
The face recognition unit is used for acquiring a face recognition result of the face image to be recognized based on the attention diagram to be recognized, the reference attention diagram, the significant feature diagram to be recognized, the reference significant feature diagram and the face recognition label.
The embodiment of the application also provides electronic equipment, which comprises:
a memory storing at least one instruction;
and the processor executes the instructions stored in the memory to realize the face recognition method based on artificial intelligence.
Embodiments of the present application also provide a computer-readable storage medium having at least one instruction stored therein, the at least one instruction being executed by a processor in an electronic device to implement the artificial intelligence-based face recognition method.
In sum, the common characteristics of the same face in different states can be extracted from the face image through the self-attention layer and the characteristic extraction layer in the target face recognition network, so that the influence of the face posture, background environment and other state factors on the face recognition result is avoided, and the robustness and accuracy of the face recognition are improved.
Drawings
Fig. 1 is a flow chart of a preferred embodiment of an artificial intelligence based face recognition method according to the present application.
Fig. 2 is a schematic structural diagram of a face recognition network according to the present application.
Fig. 3 is a schematic diagram of the structure of the student network and the teacher network according to the present application.
Fig. 4 is a functional block diagram of a preferred embodiment of an artificial intelligence based face recognition device according to the present application.
Fig. 5 is a schematic structural diagram of an electronic device according to a preferred embodiment of the artificial intelligence-based face recognition method according to the present application.
Detailed Description
In order that the objects, features and advantages of the present application may be more clearly understood, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, the described embodiments are merely some, rather than all, of the embodiments of the present application.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
The embodiment of the application provides a face recognition method based on artificial intelligence, which can be applied to one or more electronic devices, wherein the electronic devices are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware comprises, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, an ASIC), a programmable gate array (Field-Programmable Gate Array, an FPGA), a digital processor (Digital Signal Processor, a DSP), an embedded device and the like.
The electronic device may be any electronic product that can interact with a customer in a human-machine manner, such as a personal computer, tablet, smart phone, personal digital assistant (Personal Digital Assistant, PDA), gaming machine, interactive web television (Internet Protocol Television, IPTV), smart wearable device, etc.
The electronic device may also include a network device and/or a client device. Wherein the network device includes, but is not limited to, a single network server, a server group composed of a plurality of network servers, or a Cloud based Cloud Computing (Cloud Computing) composed of a large number of hosts or network servers.
The network in which the electronic device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
As shown in fig. 1, a flowchart of a preferred embodiment of the artificial intelligence based face recognition method of the present application is shown. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
The human face recognition method based on artificial intelligence provided by the embodiment of the application can be applied to any scene needing human face recognition, and the method can be applied to products of the scenes, such as electronic transactions, electronic payments, securities banks and the like.
S10, acquiring face images of the same face in different states to acquire image subsets of the face, and storing all the image subsets to serve as a training image set.
In an alternative embodiment, the capturing face images of the same face in different states to obtain image subsets of the face, and storing all the image subsets as a training image set includes:
Collecting a plurality of face images of the same face in different states, wherein the different states at least comprise at least one of different face postures and different background environments;
storing a plurality of face images of the same face as an image subset of the face;
image subsets of different faces are acquired to obtain a training image set.
In this alternative embodiment, multiple face images may be acquired for the same face by changing the face pose, e.g., head up, head down, head skew, head left turn, etc.; the background environment can be changed to collect a plurality of face images, the face pose and the background environment can be changed at the same time, and all the collected face images are used as the image subset of the face. Image subsets of different faces are acquired according to the same method, and all the image subsets are used as training image sets.
It should be noted that all face images of the same subset of images belong to the same face.
Thus, a training image set is obtained, the training image set comprises a plurality of image subsets, each image subset comprises a plurality of face images of the same face in different states, and a data base is provided for a subsequent training face recognition network.
S11, building a face recognition network.
In an alternative embodiment, the building a face recognition network includes:
the input of the face recognition network is a face image, and the face recognition network comprises a feature extraction layer, a self-attention layer and a fusion layer;
the feature extraction layer performs feature extraction on the input face image to obtain a feature map;
the self-attention layer divides an input face image into a preset number of equi-sized sub-images, and performs feature extraction on all the sub-images to obtain an attention map, wherein the attention map has the same size as the feature map;
the fusion layer fuses the attention map and the feature map to obtain a salient feature map of the input face image, wherein the salient feature map is used for reflecting the features of the face region in the input face image, and the salient feature map satisfies the relation:
R=F⊙A
wherein F is the feature map, A is the self-attention diagram, F.sub.A is the Hadamard product between F and A calculated, R is the salient feature map;
and taking the attention map and the salient feature map as output results of the face recognition network.
In this alternative embodiment, the schematic structural diagram of the face recognition network is shown in fig. 2, the feature extraction layer may use an existing convolutional neural network such as ResNet, reXNet, and the Self-Attention layer uses an existing feature extraction network based on Self-Attention mechanism (Self-Attention) such as Non-LocalNetwork, vision Transformer, and the like, which is not limited in this application.
In this alternative embodiment, in order to ensure that the attention map is the same as the size of the feature map, in the self-attention layer, when the input face image is divided into a preset number of equi-sized sub-images, the preset number is the same as the size of the feature map, and, for example, if the size of the feature map is 5×5, the preset number is 25.
Thus, the construction of the face recognition network is completed, and a network foundation is provided for the subsequent face recognition.
S12, training the face recognition network based on the training image set to obtain a target face recognition network, wherein the input of the target face recognition network is a face image, and the input is an attention map and a salient feature map of the face image, and the salient feature map comprises common features of the same face in different states.
In an optional embodiment, the training the face recognition network based on the training image set to obtain a target face recognition network includes:
a1, building two face recognition networks, connecting a classification layer at the tail end of one face recognition network as a student network, and sequentially connecting a bias layer and a classification layer at the tail end of the other face recognition network as a teacher network, wherein the bias layer comprises a bias matrix;
In this optional embodiment, the bias layer is configured to add the bias matrix to the salient feature map output by the face recognition network in the teacher network to obtain a bias feature map, where the bias feature map satisfies the relation:
Figure BDA0004091253050000071
wherein ,Rt A significant feature map output by a face recognition network in the teacher network, C is the bias matrix, the bias matrix is the same as the significant feature map in size,
Figure BDA0004091253050000072
-providing the bias profile; in the teacher network, the bias feature map is input into the classification layer to obtain an output result of the teacher network.
It should be noted that, a bias layer is added to the teacher network to encourage the output result of the teacher network to be approximately uniformly distributed, so as to avoid occurrence of a refund solution, and the structure diagrams of the student network and the teacher network are shown in fig. 3.
A2, randomly selecting two face images from any image subset of the training image set without replacement to serve as training pairs, and respectively marking the two face images in the training pairs as a first face image and a second face image;
the first face image and the second face image in the training pair are face images acquired by the same face in different states.
A3, respectively inputting the first face image into the student network and the teacher network to obtain a first student output and a first teacher output, and respectively inputting the second face image into the student network and the teacher network to obtain a second student output and a second teacher output;
the first student output, the first teacher output, the second student output and the second teacher output are all N row and 1 column category vectors, and N is related to the structure of the classification layer.
A4, calculating a preset loss function value based on the first student output, the first teacher output, the second student output and the second teacher output, and updating network parameters in the student network based on the preset loss function value and a gradient descent method;
in this alternative embodiment, the preset loss function value satisfies the relation:
Figure BDA0004091253050000073
wherein ,
Figure BDA0004091253050000074
the value of the ith row in the first teacher output and the second teacher output respectively, +.>
Figure BDA0004091253050000075
And the values of the ith row in the first student output and the second student output are respectively, N is the number of rows of the first student output, the first teacher output, the second student output and the second teacher output, and Loss is the preset Loss function value.
It should be noted that, the preset loss function value constrains the face images in different states in the training pair to have the same output result, so that the face recognition networks in the student network and the teacher network can learn the remarkable common characteristics of the same face in different states.
A5, updating network parameters except the bias layer in the teacher network based on the updated network parameters in the student network;
in this optional embodiment, the student network and the teacher network have the same network structure except for the bias layer, so that the network parameters except for the bias layer in the teacher network may be updated based on the updated network parameters in the student network, and the update process of the network parameters satisfies the relationship:
Figure BDA0004091253050000076
wherein ,θt To update network parameters other than the bias layer in the teacher network before,
Figure BDA0004091253050000077
for updating network parameters except the bias layer in the teacher network, theta s For the updated network parameters in the student network, lambda is a parameter updating coefficient, and the value range is [0,1 ]]. The parameter updating coefficient is used for controlling the updating speed of the network parameters in the teacher network, and the value of the parameter updating coefficient lambda is 0.5.
A6, updating the bias matrix in the bias layer based on the first teacher output and the second teacher output;
in this alternative embodiment, the updating process of the bias matrix satisfies the relation:
Figure BDA0004091253050000081
wherein C is the bias matrix before updating,
Figure BDA0004091253050000082
inputting faces in the teacher network for the first face image and the second face image respectivelyIdentifying salient feature patterns of network output, C * For the updated bias matrix, m is the bias update coefficient, and the value range is [0,1]. The bias update coefficient is used for controlling the update speed of the bias matrix in the bias layer, and the value of the bias update coefficient m is 0.5.
A7, repeating the steps A2 to A6, continuously selecting new training pairs from the training image set, and continuously updating network parameters in the student network and the teacher network until the preset loss function value is not changed any more, and stopping updating to obtain a trained student network and teacher network;
and A8, respectively extracting face recognition networks in the trained student network and the teacher network, and fusing network parameters of the two face recognition networks to obtain a target face recognition network.
In this optional embodiment, the trained student network and the face recognition network in the teacher network have the same network structure, but the network parameters of the face recognition networks are different, the network parameters of the two face recognition networks are fused to obtain the target face recognition network, and the fusion process satisfies the relation:
Figure BDA0004091253050000083
wherein ,
Figure BDA0004091253050000084
for the network parameters of face recognition network in the trained teacher network, < ->
Figure BDA0004091253050000085
For the network parameters theta of face recognition network in the trained student network final The epsilon is a fusion coefficient and the value range is [0,1 ] for the network parameters of the target face recognition network]. Wherein in this alternative embodiment, the fusion coefficient epsilon=0.5.
In the alternative embodiment, the target face recognition network can learn the obvious common characteristics of the same face in different states, so that the influence of the face gesture and the background environment in the face image on the face recognition is eliminated. In the attention diagram output by the target face recognition network, the pixel value of the position related to the common feature of the same face in different states is higher, and the pixel value of the position unrelated to the common feature is lower, so that the spatial distribution feature of the common feature of the face can be reflected; the salient feature map output by the target face recognition network comprises salient common features of the same face in different states.
Thus, the training process of the face recognition network is completed to obtain the target face recognition network, the target face recognition network can extract obvious common characteristics of the same face in different states, the influence of the face posture and the background environment in the face image on the face recognition is eliminated, and the accuracy and the robustness of the face recognition are improved.
S13, inputting a face image to be recognized into the target face recognition network to output attention drawing to be recognized and a significant feature image to be recognized, and inputting a reference image into the target face recognition network to output reference attention drawing and a reference significant feature image, wherein the reference image comprises a face recognition label.
In an optional embodiment, acquiring a face image to be recognized, inputting the face image to be recognized into the target face recognition network, and outputting a attention map to be recognized and a salient feature map to be recognized corresponding to the face image to be recognized; and inputting the reference image into the target face recognition network to output a reference attention map and a reference salient feature map corresponding to the reference image. The reference images are at least one, each reference image comprises a front-view image of a face acquired in advance, the reference images comprise face recognition labels, and the face recognition labels are identity information of the face in the reference images.
In this way, the attention diagram to be recognized and the salient feature diagram to be recognized corresponding to the face image to be recognized and the basic attention diagram and the basic salient feature diagram corresponding to at least one basic image are obtained by means of the target recognition network, and a data basis is provided for realizing face recognition.
S14, acquiring a face recognition result of the face image to be recognized based on the attention to be recognized force diagram, the reference attention force diagram, the significant feature diagram to be recognized, the reference significant feature diagram and the face recognition label.
In an alternative embodiment, the number of reference images is at least one, each corresponding to a reference attention map and a reference salient feature map. The obtaining the face recognition result of the face image to be recognized based on the attention to be recognized, the reference attention graph, the salient feature graph to be recognized, the reference salient feature graph and the face recognition label includes:
calculating the similarity between the attention to be identified and the reference attention map as a first similarity;
calculating the similarity between the to-be-identified salient feature map and the reference salient feature map to serve as second similarity;
The first similarity and the second similarity are weighted and summed to obtain target similarity of the face image to be identified and each reference image, and the maximum similarity of all the target similarities is obtained;
comparing the maximum similarity with a preset threshold value, and if the maximum similarity is larger than the preset threshold value, taking a face recognition label of a reference image corresponding to the maximum similarity as a face recognition result of the face image to be recognized; and if the maximum similarity is not greater than the preset threshold value, sending an alarm in a preset mode.
The preset mode at least comprises voice reminding and telephone reminding; the preset threshold value is 0.6.
In an alternative embodiment, the first similarity satisfies the relationship:
Sim 1 =exp(-D(A′,A j ))
wherein A' is attention diagram to be identified, A j Reference attention map corresponding to reference image j, D (a', a j ) Is A' and A j Is the distance of Sim 1 Is the firstA similarity. The distance may be a cosine distance, an euclidean distance, a hamming distance, or the like, which is not limited in this application.
In this alternative embodiment, the second similarity satisfies the relationship:
Sim 2 =exp(-D(R′,R j ))
wherein R' is a significant feature map to be identified, R j Reference salient feature map corresponding to reference image j, D (R', R j ) R' and R j Is the distance of Sim 2 Is a second degree of similarity. The distance may be a cosine distance, an euclidean distance, a hamming distance, or the like, which is not limited in this application.
In this alternative embodiment, the target similarity satisfies the relationship:
Sim * =δSim 1 +(1-δ)Sim 2
wherein ,Sim1 For the first similarity, sim 2 To a second degree of similarity, sim * For the target similarity, delta is a weighting coefficient, and the value range is [0,1]. Wherein in this alternative embodiment, the weighting factor takes on the value δ=0.4.
In this way, the face recognition result is obtained based on the reference attention map and the reference salient feature map of the reference image, and the attention map to be recognized and the salient feature map to be recognized of the face image to be recognized.
According to the technical scheme, the common characteristics of the same face in different states can be extracted from the face image through the self-attention layer and the characteristic extraction layer in the target face recognition network, the influence of the face posture, the background environment and other state factors on the face recognition result is avoided, and the robustness and the accuracy of face recognition are improved.
Referring to fig. 4, fig. 4 is a functional block diagram of a preferred embodiment of the artificial intelligence based face recognition device of the present application. The artificial intelligence based face recognition device 11 comprises an acquisition unit 110, a construction unit 111, a training unit 112, an input unit 113 and a face recognition unit 114. The module/unit referred to herein is a series of computer readable instructions capable of being executed by the processor 13 and of performing a fixed function, stored in the memory 12. In the present embodiment, the functions of the respective modules/units will be described in detail in the following embodiments.
In an alternative embodiment, the acquisition unit 110 is configured to acquire face images of the same face in different states to acquire image subsets of the face, and store all the image subsets as the training image set.
In an alternative embodiment, the capturing face images of the same face in different states to obtain image subsets of the face, and storing all the image subsets as a training image set includes:
collecting a plurality of face images of the same face in different states, wherein the different states at least comprise at least one of different face postures and different background environments;
storing a plurality of face images of the same face as an image subset of the face;
image subsets of different faces are acquired to obtain a training image set.
In this alternative embodiment, multiple face images may be acquired for the same face by changing the face pose, e.g., head up, head down, head skew, head left turn, etc.; the background environment can be changed to collect a plurality of face images, the face pose and the background environment can be changed at the same time, and all the collected face images are used as the image subset of the face. Image subsets of different faces are acquired according to the same method, and all the image subsets are used as training image sets.
It should be noted that all face images of the same subset of images belong to the same face.
In an alternative embodiment, the construction unit 111 is for constructing a face recognition network.
In an alternative embodiment, the building a face recognition network includes:
the input of the face recognition network is a face image, and the face recognition network comprises a feature extraction layer, a self-attention layer and a fusion layer;
the feature extraction layer performs feature extraction on the input face image to obtain a feature map;
the self-attention layer divides an input face image into a preset number of equi-sized sub-images, and performs feature extraction on all the sub-images to obtain an attention map, wherein the attention map has the same size as the feature map;
the fusion layer fuses the attention map and the feature map to obtain a salient feature map of the input face image, wherein the salient feature map is used for reflecting the features of the face region in the input face image, and the salient feature map satisfies the relation:
R=F⊙A
wherein F is the feature map, A is the self-attention diagram, F.sub.A is the Hadamard product between F and A calculated, R is the salient feature map;
And taking the attention map and the salient feature map as output results of the face recognition network.
In this alternative embodiment, the schematic structural diagram of the face recognition network is shown in fig. 2, the feature extraction layer may use an existing convolutional neural network such as ResNet, reXNet, and the Self-Attention layer uses an existing feature extraction network based on Self-Attention mechanism (Self-Attention) such as Non-LocalNetwork, vision Transformer, and the like, which is not limited in this application.
In this alternative embodiment, in order to ensure that the attention map is the same as the size of the feature map, in the self-attention layer, when the input face image is divided into a preset number of equi-sized sub-images, the preset number is the same as the size of the feature map, and, for example, if the size of the feature map is 5×5, the preset number is 25.
In an alternative embodiment, the training unit 112 is configured to train the face recognition network based on the training image set to obtain a target face recognition network, where an input of the target face recognition network is a face image, and an attention map and a salient feature map are output as the face image, and the salient feature map includes common features of the same face in different states.
In an optional embodiment, the training the face recognition network based on the training image set to obtain a target face recognition network includes:
a1, building two face recognition networks, connecting a classification layer at the tail end of one face recognition network as a student network, and sequentially connecting a bias layer and a classification layer at the tail end of the other face recognition network as a teacher network, wherein the bias layer comprises a bias matrix;
in this optional embodiment, the bias layer is configured to add the bias matrix to the salient feature map output by the face recognition network in the teacher network to obtain a bias feature map, where the bias feature map satisfies the relation:
Figure BDA0004091253050000111
wherein ,Rt A significant feature map output by a face recognition network in the teacher network, C is the bias matrix, the bias matrix is the same as the significant feature map in size,
Figure BDA0004091253050000112
-providing the bias profile; in the teacher network, the bias feature map is input into the classification layer to obtain an output result of the teacher network.
It should be noted that, a bias layer is added to the teacher network to encourage the output result of the teacher network to be approximately uniformly distributed, so as to avoid occurrence of a refund solution, and the structure diagrams of the student network and the teacher network are shown in fig. 3.
A2, randomly selecting two face images from any image subset of the training image set without replacement to serve as training pairs, and respectively marking the two face images in the training pairs as a first face image and a second face image;
the first face image and the second face image in the training pair are face images acquired by the same face in different states.
A3, respectively inputting the first face image into the student network and the teacher network to obtain a first student output and a first teacher output, and respectively inputting the second face image into the student network and the teacher network to obtain a second student output and a second teacher output;
the first student output, the first teacher output, the second student output and the second teacher output are all N row and 1 column category vectors, and N is related to the structure of the classification layer.
A4, calculating a preset loss function value based on the first student output, the first teacher output, the second student output and the second teacher output, and updating network parameters in the student network based on the preset loss function value and a gradient descent method;
In this alternative embodiment, the preset loss function value satisfies the relation:
Figure BDA0004091253050000121
wherein ,
Figure BDA0004091253050000122
the value of the ith row in the first teacher output and the second teacher output respectively, +.>
Figure BDA0004091253050000123
And the values of the ith row in the first student output and the second student output are respectively, N is the number of rows of the first student output, the first teacher output, the second student output and the second teacher output, and Loss is the preset Loss function value.
It should be noted that, the preset loss function value constrains the face images in different states in the training pair to have the same output result, so that the face recognition networks in the student network and the teacher network can learn the remarkable common characteristics of the same face in different states.
A5, updating network parameters except the bias layer in the teacher network based on the updated network parameters in the student network;
in this optional embodiment, the student network and the teacher network have the same network structure except for the bias layer, so that the network parameters except for the bias layer in the teacher network may be updated based on the updated network parameters in the student network, and the update process of the network parameters satisfies the relationship:
Figure BDA0004091253050000124
wherein ,θt To update network parameters other than the bias layer in the teacher network before,
Figure BDA0004091253050000125
for updating network parameters except the bias layer in the teacher network, theta s For the updated network parameters in the student network, lambda is a parameter updating coefficient, and the value range is [0,1 ]]. The parameter updating coefficient is used for controlling the updating speed of the network parameters in the teacher network, and the value of the parameter updating coefficient lambda is 0.5.
A6, updating the bias matrix in the bias layer based on the first teacher output and the second teacher output;
in this alternative embodiment, the updating process of the bias matrix satisfies the relation:
Figure BDA0004091253050000126
wherein C is the bias matrix before updating,
Figure BDA0004091253050000127
the first face image and the second face image are respectively input into a face recognition network output salient feature map in the teacher network,C * For the updated bias matrix, m is the bias update coefficient, and the value range is [0,1]. The bias update coefficient is used for controlling the update speed of the bias matrix in the bias layer, and the value of the bias update coefficient m is 0.5.
A7, repeating the steps A2 to A6, continuously selecting new training pairs from the training image set, and continuously updating network parameters in the student network and the teacher network until the preset loss function value is not changed any more, and stopping updating to obtain a trained student network and teacher network;
And A8, respectively extracting face recognition networks in the trained student network and the teacher network, and fusing network parameters of the two face recognition networks to obtain a target face recognition network.
In this optional embodiment, the trained student network and the face recognition network in the teacher network have the same network structure, but the network parameters of the face recognition networks are different, the network parameters of the two face recognition networks are fused to obtain the target face recognition network, and the fusion process satisfies the relation:
Figure BDA0004091253050000128
wherein ,
Figure BDA0004091253050000131
for the network parameters of face recognition network in the trained teacher network, < ->
Figure BDA0004091253050000132
For the network parameters theta of face recognition network in the trained student network final The epsilon is a fusion coefficient and the value range is [0,1 ] for the network parameters of the target face recognition network]. Wherein in this alternative embodiment, the fusion coefficient epsilon=0.5.
In the alternative embodiment, the target face recognition network can learn the obvious common characteristics of the same face in different states, so that the influence of the face gesture and the background environment in the face image on the face recognition is eliminated. In the attention diagram output by the target face recognition network, the pixel value of the position related to the common feature of the same face in different states is higher, and the pixel value of the position unrelated to the common feature is lower, so that the spatial distribution feature of the common feature of the face can be reflected; the salient feature map output by the target face recognition network comprises salient common features of the same face in different states.
In an alternative embodiment, the input unit 113 is configured to input the face image to be recognized into the target face recognition network to output the attention profile to be recognized and the salient feature map to be recognized, and input the reference image into the target face recognition network to output the reference attention profile and the reference salient feature map, where the reference image includes a face recognition tag.
In an optional embodiment, acquiring a face image to be recognized, inputting the face image to be recognized into the target face recognition network, and outputting a attention map to be recognized and a salient feature map to be recognized corresponding to the face image to be recognized; and inputting the reference image into the target face recognition network to output a reference attention map and a reference salient feature map corresponding to the reference image. The reference images are at least one, each reference image comprises a front-view image of a face acquired in advance, the reference images comprise face recognition labels, and the face recognition labels are identity information of the face in the reference images.
In an alternative embodiment, the face recognition unit 114 is configured to obtain the face recognition result of the face image to be recognized based on the attention to be recognized, the reference attention to be recognized, the salient feature map to be recognized, the reference salient feature map, and the face recognition tag.
In an alternative embodiment, the number of reference images is at least one, each corresponding to a reference attention map and a reference salient feature map. The obtaining the face recognition result of the face image to be recognized based on the attention to be recognized, the reference attention graph, the salient feature graph to be recognized, the reference salient feature graph and the face recognition label includes:
calculating the similarity between the attention to be identified and the reference attention map as a first similarity;
calculating the similarity between the to-be-identified salient feature map and the reference salient feature map to serve as second similarity;
the first similarity and the second similarity are weighted and summed to obtain target similarity of the face image to be identified and each reference image, and the maximum similarity of all the target similarities is obtained;
comparing the maximum similarity with a preset threshold value, and if the maximum similarity is larger than the preset threshold value, taking a face recognition label of a reference image corresponding to the maximum similarity as a face recognition result of the face image to be recognized; and if the maximum similarity is not greater than the preset threshold value, sending an alarm in a preset mode.
The preset mode at least comprises voice reminding and telephone reminding; the preset threshold value is 0.6.
In an alternative embodiment, the first similarity satisfies the relationship:
Sim 1 =exp(-D(A′,A j ))
wherein A' is attention diagram to be identified, A j Reference attention map corresponding to reference image j, D (a', a j ) Is A' and A j Is the distance of Sim 1 Is the first similarity. The distance may be a cosine distance, an euclidean distance, a hamming distance, or the like, which is not limited in this application.
In this alternative embodiment, the second similarity satisfies the relationship:
Sim 2 =exp(-D(R′,R j ))
wherein R' is a significant feature map to be identified, R j Reference salient feature map corresponding to reference image j, D (R', R j ) R' and R j Is the distance of Sim 2 Is a second degree of similarity. Wherein the distance may beFor cosine distance, euclidean distance, hamming distance, etc., the present application is not limited.
In this alternative embodiment, the target similarity satisfies the relationship:
Sim * =δSim 1 +(1-δ)Sim 2
wherein ,Sim1 For the first similarity, sim 2 To a second degree of similarity, sim * For the target similarity, delta is a weighting coefficient, and the value range is [0,1]. Wherein in this alternative embodiment, the weighting factor takes on the value δ=0.4.
According to the technical scheme, the common characteristics of the same face in different states can be extracted from the face image through the self-attention layer and the characteristic extraction layer in the target face recognition network, the influence of the face posture, the background environment and other state factors on the face recognition result is avoided, and the robustness and the accuracy of face recognition are improved.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 1 comprises a memory 12 and a processor 13. The memory 12 is configured to store computer readable instructions, and the processor 13 is configured to execute the computer readable instructions stored in the memory to implement the artificial intelligence based face recognition method according to any one of the above embodiments.
In an alternative embodiment, the electronic device 1 further comprises a bus, a computer program stored in said memory 12 and executable on said processor 13, such as an artificial intelligence based face recognition program.
Fig. 5 shows only an electronic device 1 with a memory 12 and a processor 13, it being understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In connection with fig. 1, the memory 12 in the electronic device 1 stores a plurality of computer readable instructions to implement an artificial intelligence based face recognition method, the processor 13 being executable to implement:
acquiring face images of the same face in different states to acquire image subsets of the face, and storing all the image subsets as training image sets;
Building a face recognition network;
training the face recognition network based on the training image set to obtain a target face recognition network, wherein the input of the target face recognition network is a face image, and the input of the target face recognition network is output as an attention map and a remarkable feature map of the face image, and the remarkable feature map comprises common features of the same face in different states;
inputting a face image to be recognized into the target face recognition network to output a attention map to be recognized and a significant feature map to be recognized, and inputting a reference image into the target face recognition network to output a reference attention map and a reference significant feature map, wherein the reference image comprises a face recognition label;
and acquiring the face recognition result of the face image to be recognized based on the attention to be recognized force diagram, the reference attention force diagram, the significant feature diagram to be recognized, the reference significant feature diagram and the face recognition label.
Specifically, the specific implementation method of the above instructions by the processor 13 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, the electronic device 1 may be a bus type structure, a star type structure, the electronic device 1 may further comprise more or less other hardware or software than illustrated, or a different arrangement of components, e.g. the electronic device 1 may further comprise an input-output device, a network access device, etc.
It should be noted that the electronic device 1 is only used as an example, and other electronic products that may be present in the present application or may be present in the future are also included in the scope of the present application and are incorporated herein by reference.
The memory 12 includes at least one type of readable storage medium, which may be non-volatile or volatile. The readable storage medium includes flash memory, a removable hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 12 may in some embodiments be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. The memory 12 may in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 1. The memory 12 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of artificial intelligence-based face recognition programs, but also for temporarily storing data that has been output or is to be output.
The processor 13 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, a combination of various control chips, and the like. The processor 13 is a Control Unit (Control Unit) of the electronic device 1, connects the respective components of the entire electronic device 1 using various interfaces and lines, and executes various functions of the electronic device 1 and processes data by running or executing programs or modules stored in the memory 12 (for example, executing an artificial intelligence-based face recognition program or the like), and calling data stored in the memory 12.
The processor 13 executes the operating system of the electronic device 1 and various types of applications installed. The processor 13 executes the application program to implement the steps of the various embodiments of the artificial intelligence based face recognition method described above, such as the steps shown in fig. 1.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules/units may be a series of computer readable instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program in the electronic device 1. For example, the computer program may be divided into an acquisition unit 110, a construction unit 111, a training unit 112, an input unit 113, a face recognition unit 114.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a Processor (Processor) to perform portions of the artificial intelligence-based face recognition methods described in various embodiments of the present application.
The integrated modules/units of the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by instructing the relevant hardware device by a computer program, where the computer program may be stored in a computer readable storage medium, and the computer program may implement the steps of each method embodiment described above when executed by a processor.
Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory, other memories, and the like.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain referred to in the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The bus may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one arrow is shown in FIG. 5, but only one bus or one type of bus is not shown. The bus is arranged to enable a connection communication between the memory 12 and at least one processor 13 or the like.
The embodiment of the application further provides a computer readable storage medium (not shown), in which computer readable instructions are stored, and the computer readable instructions are executed by a processor in an electronic device to implement the artificial intelligence based face recognition method according to any one of the embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. Several of the elements or devices described in the specification may be embodied by one and the same item of software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above embodiments are merely for illustrating the technical solution of the present application and not for limiting, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present application may be modified or substituted without departing from the spirit and scope of the technical solution of the present application.

Claims (10)

1. An artificial intelligence-based face recognition method, which is characterized by comprising the following steps:
acquiring face images of the same face in different states to acquire image subsets of the face, and storing all the image subsets as training image sets;
building a face recognition network;
training the face recognition network based on the training image set to obtain a target face recognition network, wherein the input of the target face recognition network is a face image, and the input of the target face recognition network is output as an attention map and a remarkable feature map of the face image, and the remarkable feature map comprises common features of the same face in different states;
Inputting a face image to be recognized into the target face recognition network to output a attention map to be recognized and a significant feature map to be recognized, and inputting a reference image into the target face recognition network to output a reference attention map and a reference significant feature map, wherein the reference image comprises a face recognition label;
and acquiring the face recognition result of the face image to be recognized based on the attention to be recognized force diagram, the reference attention force diagram, the significant feature diagram to be recognized, the reference significant feature diagram and the face recognition label.
2. An artificial intelligence based face recognition method according to claim 1, wherein the capturing face images of the same face in different states to obtain image subsets of the face and storing all the image subsets as training image sets includes:
collecting a plurality of face images of the same face in different states, wherein the different states at least comprise at least one of different face postures and different background environments;
storing a plurality of face images of the same face as an image subset of the face;
image subsets of different faces are acquired to obtain a training image set.
3. The artificial intelligence based face recognition method of claim 1, wherein the constructing a face recognition network comprises:
The input of the face recognition network is a face image, and the face recognition network comprises a feature extraction layer, a self-attention layer and a fusion layer;
the feature extraction layer performs feature extraction on the input face image to obtain a feature map;
the self-attention layer divides an input face image into a preset number of equi-sized sub-images, and performs feature extraction on all the sub-images to obtain an attention map, wherein the attention map has the same size as the feature map;
the fusion layer fuses the attention map and the feature map to obtain a salient feature map of the input face image, wherein the salient feature map is used for reflecting the features of the face region in the input face image, and the salient feature map satisfies the relation:
R=F⊙A
wherein F is the feature map, A is the self-attention diagram, F.sub.A is the Hadamard product between F and A calculated, R is the salient feature map;
and taking the attention map and the salient feature map as output results of the face recognition network.
4. The artificial intelligence based face recognition method of claim 1, wherein training the face recognition network based on the training image set to obtain a target face recognition network comprises:
A1, building two face recognition networks, connecting a classification layer at the tail end of one face recognition network as a student network, and sequentially connecting a bias layer and a classification layer at the tail end of the other face recognition network as a teacher network, wherein the bias layer comprises a bias matrix;
a2, randomly selecting two face images from any image subset of the training image set without replacement to serve as training pairs, and respectively marking the two face images in the training pairs as a first face image and a second face image;
a3, respectively inputting the first face image into the student network and the teacher network to obtain a first student output and a first teacher output, and respectively inputting the second face image into the student network and the teacher network to obtain a second student output and a second teacher output;
a4, calculating a preset loss function value based on the first student output, the first teacher output, the second student output and the second teacher output, and updating network parameters in the student network based on the preset loss function value and a gradient descent method;
a5, updating network parameters except the bias layer in the teacher network based on the updated network parameters in the student network, wherein the updating process of the network parameters meets the relation:
Figure FDA0004091253040000021
wherein ,θt To update network parameters other than the bias layer in the teacher network before,
Figure FDA0004091253040000022
for updating network parameters except the bias layer in the teacher network, theta s For the updated network parameters in the student network, lambda is a parameter updating coefficient, and the value range is [0,1 ]];
A6, updating the bias matrix in the bias layer based on the first teacher output and the second teacher output, wherein the updating process of the bias matrix meets the relation:
Figure FDA0004091253040000031
wherein C is the bias matrix before updating,
Figure FDA0004091253040000032
c, inputting the first face image and the second face image into a face recognition network output salient feature map in the teacher network respectively * For the updated bias matrix, m is the bias update coefficient, and the value range is [0,1];
A7, repeating the steps A2 to A6, continuously selecting new training pairs from the training image set, and continuously updating network parameters in the student network and the teacher network until the preset loss function value is not changed any more, and stopping updating to obtain a trained student network and teacher network;
a8, respectively extracting face recognition networks in the trained student network and the teacher network, fusing network parameters of the two face recognition networks to obtain a target face recognition network, wherein the fusion process meets the following relation:
Figure FDA0004091253040000033
wherein ,
Figure FDA0004091253040000034
for the network parameters of face recognition network in the trained teacher network, < ->
Figure FDA0004091253040000035
For the network parameters theta of face recognition network in the trained student network final The epsilon is a fusion coefficient and the value range is [0,1 ] for the network parameters of the target face recognition network]。
5. The artificial intelligence based face recognition method of claim 4, wherein the bias layer is configured to add the bias matrix to a salient feature map output by a face recognition network in a teacher network to obtain a bias feature map, where the bias feature map satisfies a relation:
Figure FDA0004091253040000036
wherein ,Rt A significant feature map output by a face recognition network in the teacher network, C is the bias matrix, the bias matrix is the same as the significant feature map in size,
Figure FDA0004091253040000037
-providing the bias profile; in the teacher network, the bias feature map is input into the classification layer to obtain an output result of the teacher network. />
6. The artificial intelligence based face recognition method of claim 4, wherein the preset loss function value satisfies the relation:
Figure FDA0004091253040000041
wherein ,
Figure FDA0004091253040000042
the value of the ith row in the first teacher output and the second teacher output respectively, +. >
Figure FDA0004091253040000043
And the values of the ith row in the first student output and the second student output are respectively, N is the number of rows of the first student output, the first teacher output, the second student output and the second teacher output, and Loss is the preset Loss function value.
7. The artificial intelligence based face recognition method of claim 1, wherein the number of reference images is at least one, each reference image corresponds to a reference attention profile and a reference salient feature map, and the obtaining the face recognition result of the face image to be recognized based on the attention profile to be recognized, the reference attention profile, the salient feature map to be recognized, the reference salient feature map and the face recognition label includes:
calculating the similarity between the attention to be identified and the reference attention map as a first similarity;
calculating the similarity between the to-be-identified salient feature map and the reference salient feature map to serve as second similarity;
the first similarity and the second similarity are weighted and summed to obtain target similarity of the face image to be identified and each reference image, and the maximum similarity of all the target similarities is obtained;
Comparing the maximum similarity with a preset threshold value, and if the maximum similarity is larger than the preset threshold value, taking a face recognition label of a reference image corresponding to the maximum similarity as a face recognition result of the face image to be recognized; and if the maximum similarity is not greater than the preset threshold value, sending an alarm in a preset mode.
8. An artificial intelligence based face recognition device, the device comprising:
the acquisition unit is used for acquiring face images of the same face in different states to acquire image subsets of the face, and storing all the image subsets to serve as a training image set;
the construction unit is used for constructing a face recognition network;
the training unit is used for training the face recognition network based on the training image set to obtain a target face recognition network, wherein the input of the target face recognition network is a face image, and the input is an attention map and a remarkable feature map of the face image, and the remarkable feature map comprises common features of the same face in different states;
the input unit is used for inputting the face image to be recognized into the target face recognition network to output attention drawing to be recognized and the significant feature image to be recognized, inputting the reference image into the target face recognition network to output the reference attention drawing and the reference significant feature image, and the reference image comprises a face recognition label;
The face recognition unit is used for acquiring a face recognition result of the face image to be recognized based on the attention diagram to be recognized, the reference attention diagram, the significant feature diagram to be recognized, the reference significant feature diagram and the face recognition label.
9. An electronic device, the electronic device comprising:
a memory storing computer readable instructions; a kind of electronic device with high-pressure air-conditioning system
A processor executing computer readable instructions stored in the memory to implement the artificial intelligence based face recognition method of any one of claims 1 to 7.
10. A computer readable storage medium having computer readable instructions stored thereon, which when executed by a processor, implement the artificial intelligence based face recognition method of any one of claims 1 to 7.
CN202310150334.6A 2023-02-09 2023-02-09 Human face recognition method based on artificial intelligence and related equipment Pending CN116030525A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310150334.6A CN116030525A (en) 2023-02-09 2023-02-09 Human face recognition method based on artificial intelligence and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310150334.6A CN116030525A (en) 2023-02-09 2023-02-09 Human face recognition method based on artificial intelligence and related equipment

Publications (1)

Publication Number Publication Date
CN116030525A true CN116030525A (en) 2023-04-28

Family

ID=86076243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310150334.6A Pending CN116030525A (en) 2023-02-09 2023-02-09 Human face recognition method based on artificial intelligence and related equipment

Country Status (1)

Country Link
CN (1) CN116030525A (en)

Similar Documents

Publication Publication Date Title
CN110222554A (en) Cheat recognition methods, device, electronic equipment and storage medium
CN108197532A (en) The method, apparatus and computer installation of recognition of face
Anirudh et al. Mimicgan: Robust projection onto image manifolds with corruption mimicking
CN113139628B (en) Sample image identification method, device and equipment and readable storage medium
EP4099217A1 (en) Image processing model training method and apparatus, device, and storage medium
CN110738219A (en) Method and device for extracting lines in image, storage medium and electronic device
CN111860377A (en) Live broadcast method and device based on artificial intelligence, electronic equipment and storage medium
CN113011387B (en) Network training and human face living body detection method, device, equipment and storage medium
CN115049878B (en) Target detection optimization method, device, equipment and medium based on artificial intelligence
CN115222427A (en) Artificial intelligence-based fraud risk identification method and related equipment
CN112837142A (en) Financial risk model training method and device
CN112861662A (en) Target object behavior prediction method based on human face and interactive text and related equipment
CN115063632A (en) Vehicle damage identification method, device, equipment and medium based on artificial intelligence
CN112163635A (en) Image classification method, device, server and medium based on deep learning
CN111104941B (en) Image direction correction method and device and electronic equipment
CN116543460A (en) Space-time action recognition method based on artificial intelligence and related equipment
CN116363365A (en) Image segmentation method based on semi-supervised learning and related equipment
CN116416632A (en) Automatic file archiving method based on artificial intelligence and related equipment
CN116012952A (en) Behavior recognition method based on artificial intelligence and related equipment
CN116030525A (en) Human face recognition method based on artificial intelligence and related equipment
CN112102205B (en) Image deblurring method and device, electronic equipment and storage medium
CN114972761B (en) Vehicle part segmentation method based on artificial intelligence and related equipment
CN113111833B (en) Safety detection method and device of artificial intelligence system and terminal equipment
CN113283421B (en) Information identification method, device, equipment and storage medium
CN116127041A (en) Text data enhancement method based on artificial intelligence and related equipment

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