Face recognition method, device, electronic device and storage medium

By combining the dense connection network and resolution detection network in the pre-built face recognition model, combined with the face detection network, the problem of low-resolution face images affecting the accuracy of face recognition is solved, and high accuracy in actual scenarios is achieved. rate face recognition.

CN114241583BActive Publication Date: 2024-09-17CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210061759.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2024-09-17
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

In actual face recognition scenarios, due to the low resolution of the shooting equipment, long shooting distance, poor lighting conditions and other reasons, the acquired low-resolution face images lose a lot of details and feature information, which affects the accuracy of face recognition. Rate.

Method used

Use the dense connection network and resolution detection network in the pre-built face recognition model to extract the characteristic images of the training face images, and calculate the loss between the predicted resolution and the real resolution through the resolution detection network, combined with the face detection network recognition Predict face images, calculate face loss, adjust model parameters to reduce model loss, and improve the accuracy of face recognition.

Benefits of technology

It effectively improves the accuracy of face recognition, ensures the recognition ability of the face recognition model under low-resolution image conditions, and ensures the accuracy of face recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114241583B
    Figure CN114241583B
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence, and discloses a face recognition method, including: marking the real label of a training face image; extracting a feature image of the training face image using a pre-built face recognition model; detecting the predicted resolution of the feature image, and calculating the resolution loss between the predicted resolution and the real resolution in the real label; and according to the predicted resolution, identifying the predicted face image of the feature image, and calculating the face loss between the predicted face image and the real face image in the real label; according to the resolution loss and the face loss, calculating the model loss of the pre-built face recognition model, and when the model loss is less than the preset loss, obtaining a trained face recognition model, so as to perform face recognition on the face image to be recognized through the trained face recognition model, and obtain a face recognition result. In addition, the present invention also relates to blockchain technology, and the training face image can be stored in the blockchain. The present invention can improve the accuracy of face recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a face recognition method, device, electronic device and computer-readable storage medium. Background Art

[0002] As a unique biological information, human face is innate, relatively stable and not easy to be copied, and has strong recognition and differentiation. Face recognition is a technology that extracts facial feature information for identity recognition. It has been widely used in various aspects of life, such as public security monitoring, face recognition attendance, convenient payment, etc. The development and application of face recognition technology has provided great convenience to people's daily life.

[0003] The accuracy of face recognition depends on high-quality face images, but in actual scenarios, the conditions for acquiring face images are not controllable. For example, if the resolution of the shooting device is low, the shooting distance is far, the lighting conditions are poor, etc., what is often obtained is a degraded low-resolution face image, which loses a lot of details and feature information, thus affecting the accuracy of face recognition. Summary of the invention

[0004] The present invention provides a face recognition method, device, electronic device and computer-readable storage medium, the main purpose of which is to improve the accuracy of face recognition.

[0005] To achieve the above object, the present invention provides a face recognition method, comprising:

[0006] Obtaining a training face image and marking the real label of the training face image;

[0007] Extracting a feature image of the training face image using a densely connected network in a pre-built face recognition model;

[0008] Utilizing the resolution detection network in the pre-built face recognition model to detect the predicted resolution of the feature image, and calculating the resolution loss between the predicted resolution and the true resolution in the true label;

[0009] According to the predicted resolution, using the face detection network in the pre-built face recognition model to identify the predicted face image of the feature image, and calculating the face loss between the predicted face image and the real face image in the real label;

[0010] Calculating the model loss of the pre-built face recognition model according to the resolution loss and the face loss;

[0011] Determine whether the model loss is less than a preset loss;

[0012] If the model loss is not less than the preset loss, after adjusting the parameters of the pre-built face recognition model, return to the step of extracting the feature image of the training sample using the densely connected network in the pre-built face recognition model;

[0013] If the model loss is less than the preset loss, a trained face recognition model is obtained, and the trained face recognition model is used to perform face recognition on the face image to be recognized to obtain a face recognition result.

[0014] Optionally, the extracting the feature image of the training face image by using a densely connected network in a pre-built face recognition model includes:

[0015] Performing a convolution operation on the training face image, and performing a nonlinear transformation on the training face image after the convolution operation to obtain a transformed face image;

[0016] The transformed face image is subjected to feature splicing to obtain a feature image.

[0017] Optionally, the detecting the predicted resolution of the feature image using a resolution detection network in the pre-built face recognition model includes:

[0018] Upsampling the feature image using a sampling layer in the resolution detection network to obtain a sampled image;

[0019] Using a fusion layer in the resolution detection network to fuse the sampled image and the training face image to obtain a fused image;

[0020] The predicted resolution of the fused image is outputted using a fully connected layer in the resolution detection network.

[0021] Optionally, calculating the resolution loss between the predicted resolution and the actual resolution in the actual label includes:

[0022] The resolution loss between the predicted resolution and the actual resolution in the actual label is calculated using the following formula:

[0023] L1=|α p -α g |

[0024] Where L1 represents the resolution loss, α g represents the prediction resolution, α p Indicates the true resolution.

[0025] Optionally, the identifying the predicted face image of the feature image by using a face detection network in the pre-built face recognition model according to the predicted resolution includes:

[0026] According to the predicted resolution, using a regional detection layer in the face detection network to detect a face region of the feature image;

[0027] Using a batch normalization layer in the face detection network to perform a normalization operation on the face region to obtain a standard face region;

[0028] Outputting the detection result of the standard face area using the activation function in the face detection network;

[0029] According to the detection result, the output layer in the region detection network is used to output a predicted face image of the standard face region.

[0030] Optionally, the calculating the face loss between the predicted face image and the real face image in the real label includes:

[0031] The face loss between the predicted face image and the real face image in the real label is calculated using the following formula:

[0032]

[0033] Among them, Loss2 represents face loss, n represents the number of predicted face images, represents the i-th predicted face image, represents the i-th real face image.

[0034] Optionally, calculating the model loss of the pre-built face recognition model according to the resolution loss and the face loss includes:

[0035] The model loss of the pre-built face recognition model is calculated using the following formula:

[0036] L=αL1+βL2

[0037] Among them, L represents model loss, L1 represents resolution loss, LC represents face loss, α represents the weight of resolution loss, and β represents the weight of face loss.

[0038] In order to solve the above problem, the present invention further provides a face recognition device, the device comprising:

[0039] An image label marking module, used to obtain training face images and mark the real labels of the training face images;

[0040] A feature image extraction module, used to extract the feature image of the training face image using a densely connected network in a pre-built face recognition model;

[0041] A resolution loss calculation module, used to detect the predicted resolution of the feature image using the resolution detection network in the pre-built face recognition model, and calculate the resolution loss between the predicted resolution and the true resolution in the true label;

[0042] A face loss calculation module, used to identify the predicted face image of the feature image using the face detection network in the pre-built face recognition model according to the predicted resolution, and calculate the face loss between the predicted face image and the real face image in the real label;

[0043] A model loss calculation module, used to calculate the model loss of the pre-built face recognition model according to the resolution loss and the face loss;

[0044] A loss judgment module, used to judge whether the model loss is less than a preset loss;

[0045] A model retraining module, configured to, when the model loss is not less than the preset loss, adjust the parameters of the pre-built face recognition model and then return to the step of extracting the feature image of the training sample using the densely connected network in the pre-built face recognition model;

[0046] The face recognition module is used to obtain a trained face recognition model when the model loss is less than the preset loss, and use the trained face recognition model to perform face recognition on the face image to be recognized to obtain a face recognition result.

[0047] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0048] at least one processor; and,

[0049] a memory communicatively connected to the at least one processor; wherein,

[0050] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to implement the above-mentioned face recognition method.

[0051] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned face recognition method.

[0052] It can be seen that the embodiment of the present invention can obtain the global and local features of the training face image through the densely connected network in the pre-built face recognition model, improve the shortcomings of the traditional convolutional neural network that cannot fully mine and utilize face image information, and ensure the recognition ability of the face recognition model. By combining the resolution detection network and the face detection network to jointly train the pre-built face recognition model, the face detection process will not be affected by the low resolution of the image, and the recognition ability of the face recognition model is further improved, thereby ensuring the accuracy of face recognition. Therefore, a face recognition method, device, electronic device and computer-readable storage medium proposed in the embodiment of the present invention can improve the accuracy of face recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A schematic diagram of a flow chart of a face recognition method provided by an embodiment of the present invention;

[0054] Figure 2 A schematic diagram of a module of a face recognition device provided by an embodiment of the present invention;

[0055] Figure 3 A schematic diagram of the internal structure of an electronic device for implementing a face recognition method provided by an embodiment of the present invention;

[0056] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0057] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0058] The embodiment of the present application provides a face recognition method. The execution subject of the face recognition method includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the face recognition method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0059] Reference Figure 1FIG. 1 is a flow chart of a face recognition method provided by an embodiment of the present invention. In the embodiment of the present invention, the face recognition method includes:

[0060] S1. Obtain training face images and mark the real labels of the training face images.

[0061] In the embodiment of the present invention, the training face image refers to a face picture, which is used as training data for subsequent model training. The real label refers to the state label of the training face image, which includes a real face image and a real resolution. The real face image refers to a picture of real face features contained in the training face image. The real resolution refers to the resolution of the picture in the training face image. It should be understood that the image resolution is used to characterize the clarity of the image. Therefore, the embodiment of the present invention marks the real resolution of the training face image to supervise the training of the subsequent model image resolution, improve the clarity recognition ability of the face image, and ensure the accuracy of face recognition. Optionally, the training face image is obtained by searching a face database, and the real label of the training face image is achieved by manual annotation.

[0062] Furthermore, in order to ensure the privacy and security of the training facial images, the training facial images may also be stored in a blockchain node.

[0063] S2. Utilize a densely connected network in a pre-built face recognition model to extract a feature image of the training face image.

[0064] In an embodiment of the present invention, the pre-built face recognition model is constructed by a densely connected network + a resolution detection network + a face detection network. The densely connected network DenseNet network uses a dense connection mechanism to keep each feature map of the training face image at the same size during feature extraction, so that the training face image can maintain deep image information after feature extraction. The resolution detection network includes a YOLO3 network, which is used to detect the image resolution of the training face image. The face detection network includes an Inception network, which is used to realize face recognition of the training face image.

[0065] As an embodiment of the present invention, the method of extracting the feature image of the training face image by using a densely connected network in a pre-built face recognition model includes: performing a convolution operation on the training face image, and performing a nonlinear transformation on the training face image after the convolution operation to obtain a transformed face image, and performing feature splicing on the transformed face image to obtain a feature image.

[0066] Among them, the convolution operation of the training face image is implemented through the convolution layer in the densely connected network, which is used to identify the feature information of the training face image; the nonlinear transformation of the training face image after the convolution operation is implemented through the nonlinear function in the densely connected network, which is used to output the training face image after the feature information is extracted; the feature splicing of the transformed face image is implemented through the combination function in the densely connected network, which is used to perform feature fusion on the face image after the feature information is extracted, so that the output feature image contains all the feature information in the training face image.

[0067] S3. Utilize the resolution detection network in the pre-built face recognition model to detect the predicted resolution of the feature image, and calculate the resolution loss between the predicted resolution and the true resolution in the true label.

[0068] The embodiment of the present invention detects the predicted resolution of the feature image through the resolution detection network in the pre-built face recognition model to train the image resolution recognition capability of the pre-built face recognition model, so that in the subsequent face recognition process, the face recognition results will not be inaccurate due to the low image resolution.

[0069] As an embodiment of the present invention, the use of the resolution detection network in the pre-built face recognition model to detect the predicted resolution of the feature image includes: using the sampling layer in the resolution detection network to upsample the feature image to obtain a sampled image, using the fusion layer in the resolution detection network to fuse the sampled image and the training face image to obtain a fused image, and using the fully connected layer in the resolution detection network to output the predicted resolution of the fused image.

[0070] Among them, upsampling refers to sampling the feature image to a specified resolution size. For example, after a training face image of (216, 216, 4) is processed by a series of densely connected networks, a feature image of (32, 32, 8) is obtained. In order to compare this feature image with the corresponding training face image, it is necessary to convert this feature image to (216, 216, 4). This process is called upsampling. Furthermore, in order to better understand the feature semantic information of the sampled image, the embodiment of the present application fuses the sampled image and the training face image to obtain a fused image. Optionally, the upsampling can be implemented by a currently known linear interpolation algorithm, and the fusion of the sampled image and the training face image is implemented by a currently known image fusion algorithm, such as the Surf (Speeded Up Robust Features) algorithm, and the predicted resolution of the fused image is calculated by the activation function in the fully connected layer, such as the softmax function.

[0071] Furthermore, the embodiment of the present invention calculates the resolution loss between the predicted resolution and the actual resolution in the actual label as a training indicator of the pre-built face recognition model, thereby ensuring the training effect of the pre-built face recognition model.

[0072] In an optional embodiment of the present invention, the resolution loss between the predicted resolution and the actual resolution in the actual label is calculated using the following formula:

[0073] L1=|α p -α g |

[0074] Where L1 represents the resolution loss, α g represents the prediction resolution, α p Indicates the true resolution.

[0075] S4. According to the predicted resolution, the face detection network in the pre-built face recognition model is used to identify the predicted face image of the feature image, and the face loss between the predicted face image and the real face image in the real label is calculated.

[0076] The embodiment of the present invention uses the face detection network in the pre-built face recognition model to identify the predicted face image of the feature image according to the predicted resolution, so as to train the face detection capability of the pre-built face recognition model and improve the recognition capability of subsequent face recognition models.

[0077] As an embodiment of the present invention, the method of identifying the predicted face image of the feature image according to the predicted resolution using the face detection network in the pre-built face recognition model includes: detecting the face region of the feature image according to the predicted resolution using the regional detection layer in the face detection network, and performing a normalization operation on the face region using the batch normalization layer (Batch Normalization, BN) in the face detection network to obtain a standard face region; outputting the detection result of the standard face region using the activation function in the face detection network; and outputting the predicted face image of the standard face region according to the detection result using the output layer in the region detection network.

[0078] In another optional embodiment of the present invention, the face region of the feature image is realized by a detection algorithm of the region detection layer, such as an intersection-over-union algorithm.

[0079] In another optional embodiment of the present invention, the face region is normalized using the following formula:

[0080]

[0081] Among them, xi ′ represents the standard face area, x i represents the face area, μ represents the mean of the face area, σ 2 represents the variance of the face area, and ε represents a random number.

[0082] Furthermore, in another optional embodiment of the present invention, the detection result includes: x, y, height, width and category, etc., wherein x and y represent the center point of the detection area, and the category represents whether the detection area is a predicted face image, that is, category 0 represents that it is not a predicted face image, and category 1 represents that the predicted area is a target area. Therefore, the embodiment of the present invention selects the detection area with category 1 as the predicted face image.

[0083] Furthermore, an embodiment of the present invention calculates the face loss between the predicted face image and the real face image in the real label as another training indicator of the pre-built face recognition model, thereby further ensuring the training effect of the pre-built face recognition model.

[0084] In an optional embodiment of the present invention, the face loss between the predicted face image and the real face image in the real label is calculated using the following formula:

[0085]

[0086] Among them, Loss2 represents face loss, n represents the number of predicted face images, represents the i-th predicted face image, represents the i-th real face image.

[0087] S5. Calculate the model loss of the pre-built face recognition model according to the resolution loss and the face loss.

[0088] The embodiment of the present invention calculates the model loss of the pre-built face recognition model according to the resolution loss and the face loss to identify the training effect of the pre-built face recognition model, that is, the smaller the model loss is, the better the training effect of the pre-built face recognition model is.

[0089] In an optional embodiment of the present invention, the model loss of the pre-built face recognition model is calculated using the following formula:

[0090] L=αL1+βL2

[0091] Among them, L represents model loss, L1 represents resolution loss, LC represents face loss, α represents the weight of resolution loss, and β represents the weight of face loss. If the sum of the values ​​of α and β is 1, α can be set to 0.2 and β to 0.8, or it can be set according to the actual business scenario.

[0092] S6. Determine whether the model loss is less than a preset loss.

[0093] The embodiment of the present invention identifies whether the pre-built face recognition model has been trained by judging whether the model loss is less than a preset loss, wherein the preset loss can be set to 0.1 or can be set according to actual business scenarios.

[0094] S7. If the model loss is not less than the preset loss, after adjusting the parameters of the pre-built face recognition model, return to the step of extracting the feature image of the training sample using the densely connected network in the pre-built face recognition model.

[0095] It should be understood that when the model loss is not less than the preset loss, it means that the training effect of the face recognition model does not meet the needs of the actual business scenario. Therefore, the embodiment of the present invention returns to the step of extracting the feature image of the training sample using the densely connected network in the pre-built face recognition model after adjusting the parameters of the pre-built face recognition model, so that the training effect of the face recognition model meets the needs of the actual business scenario. Among them, the parameters include weights and biases, and the parameters of the pre-built face recognition model can be implemented by a back propagation algorithm, such as a stochastic gradient descent algorithm.

[0096] S8. If the model loss is less than the preset loss, a trained face recognition model is obtained, and the trained face recognition model is used to perform face recognition on the face image to be recognized to obtain a face recognition result.

[0097] It should be understood that when the model loss is not less than the preset loss, it means that the training effect of constructing the face recognition model meets the needs of actual business scenarios and has strong recognition capabilities. Therefore, the embodiment of the present invention uses the trained face recognition model to perform face recognition on the face image to be identified to obtain a face recognition result, wherein the face image to be identified refers to an image that needs to be recognized in an actual business scenario.

[0098] It can be seen that the embodiment of the present invention can obtain the global and local features of the training face image through the densely connected network in the pre-built face recognition model, improve the shortcomings of the traditional convolutional neural network that cannot fully mine and utilize face image information, and ensure the recognition ability of the face recognition model. By combining the resolution detection network and the face detection network to jointly train the pre-built face recognition model, the face detection process will not be affected by the low resolution of the image, and the recognition ability of the face recognition model is further improved, thereby ensuring the accuracy of face recognition. Therefore, a face recognition method proposed in the embodiment of the present invention can improve the accuracy of face recognition.

[0099] like Figure 2 , which is a functional module diagram of the face recognition device of the present invention.

[0100] The face recognition device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the face recognition device can include an image label marking module 101, a feature image extraction and recognition module 102, a resolution loss calculation module 103, a face loss calculation module 104, a model loss calculation module 105, a loss judgment module 106, a model retraining module 107 and a face recognition module 108. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, which are stored in the memory of the electronic device.

[0101] In this embodiment, the functions of each module / unit are as follows:

[0102] The image label marking module 101 is used to obtain training face images and mark the real labels of the training face images;

[0103] The feature image extraction module 102 is used to extract the feature image of the training face image using a densely connected network in a pre-built face recognition model;

[0104] The resolution loss calculation module 103 is used to detect the predicted resolution of the feature image using the resolution detection network in the pre-built face recognition model, and calculate the resolution loss between the predicted resolution and the true resolution in the true label;

[0105] The face loss calculation module 104 is used to identify the predicted face image of the feature image using the face detection network in the pre-built face recognition model according to the predicted resolution, and calculate the face loss between the predicted face image and the real face image in the real label;

[0106] The model loss calculation module 105 is used to calculate the model loss of the pre-built face recognition model according to the resolution loss and the face loss;

[0107] The loss judgment module 106 is used to judge whether the model loss is less than a preset loss;

[0108] The model retraining module 107 is used for, when the model loss is not less than the preset loss, adjusting the parameters of the pre-built face recognition model, and returning to the step of extracting the feature image of the training sample by using the densely connected network in the pre-built face recognition model;

[0109] The face recognition module 108 is used to obtain a trained face recognition model when the model loss is less than the preset loss, and use the trained face recognition model to perform face recognition on the face image to be recognized to obtain a face recognition result.

[0110] In detail, each module in the face recognition device 100 in the embodiment of the present invention is used in the same manner as described above. Figure 1 The face recognition method described in the invention has the same technical means and can produce the same technical effects, so I will not go into details here.

[0111] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device 1 for implementing a face recognition method according to the present invention.

[0112] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a face recognition program.

[0113] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device 1, and uses various interfaces and lines to connect various components of the entire electronic device 1, and executes or executes programs or modules stored in the memory 11 (for example, executing a face recognition program, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0114] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the face recognition program, etc., but also can be used to temporarily store data that has been output or is to be output.

[0115] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0116] The communication interface 13 is used for communication between the above-mentioned electronic device 1 and other devices, including a network interface and an employee interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices 1. The employee interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the employee interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual employee interface.

[0117] Figure 3 Only the electronic device 1 having components is shown, and those skilled in the art can understand that Figure 3The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0118] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0119] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0120] The face recognition program stored in the memory 11 of the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, it can achieve:

[0121] Obtaining a training face image and marking the real label of the training face image;

[0122] Extracting a feature image of the training face image using a densely connected network in a pre-built face recognition model;

[0123] Utilizing the resolution detection network in the pre-built face recognition model to detect the predicted resolution of the feature image, and calculating the resolution loss between the predicted resolution and the true resolution in the true label;

[0124] According to the predicted resolution, using the face detection network in the pre-built face recognition model to identify the predicted face image of the feature image, and calculating the face loss between the predicted face image and the real face image in the real label;

[0125] Calculating the model loss of the pre-built face recognition model according to the resolution loss and the face loss;

[0126] Determine whether the model loss is less than a preset loss;

[0127] If the model loss is not less than the preset loss, after adjusting the parameters of the pre-built face recognition model, return to the step of extracting the feature image of the training sample using the densely connected network in the pre-built face recognition model;

[0128] If the model loss is less than the preset loss, a trained face recognition model is obtained, and the trained face recognition model is used to perform face recognition on the face image to be recognized to obtain a face recognition result.

[0129] Specifically, the specific implementation method of the processor 10 for the above-mentioned computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0130] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0131] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of the electronic device 1, the computer program can implement:

[0132] Obtaining a training face image and marking the real label of the training face image;

[0133] Extracting a feature image of the training face image using a densely connected network in a pre-built face recognition model;

[0134] Utilizing the resolution detection network in the pre-built face recognition model to detect the predicted resolution of the feature image, and calculating the resolution loss between the predicted resolution and the true resolution in the true label;

[0135] According to the predicted resolution, using the face detection network in the pre-built face recognition model to identify the predicted face image of the feature image, and calculating the face loss between the predicted face image and the real face image in the real label;

[0136] Calculating the model loss of the pre-built face recognition model according to the resolution loss and the face loss;

[0137] Determine whether the model loss is less than a preset loss;

[0138] If the model loss is not less than the preset loss, after adjusting the parameters of the pre-built face recognition model, return to the step of extracting the feature image of the training sample using the densely connected network in the pre-built face recognition model;

[0139] If the model loss is less than the preset loss, a trained face recognition model is obtained, and the trained face recognition model is used to perform face recognition on the face image to be recognized to obtain a face recognition result.

[0140] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0141] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on 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.

[0142] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0143] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0144] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0145] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0146] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0147] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A face recognition method, characterized in that: The method comprises: Acquire a training face image, and mark the real label of the training face image, wherein the real label includes a label of the real face image and a real resolution; Generate a face recognition model using a densely connected network, a resolution detection network, and a face detection network, and extract a feature image of the training face image using the densely connected network in the face recognition model; Using the sampling layer in the resolution detection network to upsample the feature image to obtain a sampled image, using the fusion layer in the resolution detection network to fuse the sampled image with the training face image to obtain a fused image, using the fully connected layer in the resolution detection network to output the predicted resolution of the fused image, and calculating the resolution loss between the predicted resolution and the true resolution in the true label; According to the predicted resolution, using the face detection network in the face recognition model to identify the predicted face image of the feature image, and calculating the face loss between the predicted face image and the real face image in the real label; Calculating the model loss of the face recognition model according to the resolution loss and the face loss; Determine whether the model loss is less than a preset loss; If the model loss is not less than the preset loss, after adjusting the parameters of the face recognition model, return to the step of extracting the feature image of the training face image by using the densely connected network in the face recognition model; If the model loss is less than the preset loss, a trained face recognition model is obtained, and the trained face recognition model is used to perform face recognition on the face image to be recognized to obtain a face recognition result.

2. The face recognition method according to claim 1, characterized in that: The step of extracting the feature image of the training face image by using a densely connected network in a face recognition model includes: Performing a convolution operation on the training face image, and performing a nonlinear transformation on the training face image after the convolution operation to obtain a transformed face image; The transformed face image is subjected to feature splicing to obtain a feature image.

3. The face recognition method according to claim 1, characterized in that: The calculating the resolution loss between the predicted resolution and the actual resolution in the actual label includes: The resolution loss between the predicted resolution and the actual resolution in the actual label is calculated using the following formula: Where L1 represents the resolution loss, represents the prediction resolution, Indicates the true resolution.

4. The face recognition method according to claim 1, characterized in that: The step of identifying the predicted face image of the feature image by using the face detection network in the face recognition model according to the predicted resolution includes: According to the predicted resolution, using a regional detection layer in the face detection network to detect a face region of the feature image; Using a batch normalization layer in the face detection network to perform a normalization operation on the face region to obtain a standard face region; Outputting the detection result of the standard face area using the activation function in the face detection network; According to the detection result, the output layer in the region detection network is used to output the predicted face image of the standard face region.

5. The face recognition method according to claim 1, characterized in that: The calculating the face loss between the predicted face image and the real face image in the real label includes: The face loss between the predicted face image and the real face image in the real label is calculated using the following formula: Among them, Loss2 represents face loss, n represents the number of predicted face images, represents the i-th predicted face image, represents the i-th real face image.

6. The face recognition method according to any one of claims 1 to 5, characterized in that: The step of calculating the model loss of the face recognition model according to the resolution loss and the face loss includes: The model loss of the face recognition model is calculated using the following formula: L= + Among them, L represents model loss, L1 represents resolution loss, and L2 represents face loss. represents the weight of resolution loss, Represents the weight of face loss.

7. A face recognition device, characterized in that: The device comprises: An image labeling module, used to obtain training face images and label the training face images with real labels, wherein the real labels include labels of real face images and real resolutions; A feature image extraction module, used to generate a face recognition model using a densely connected network, a resolution detection network and a face detection network, and to extract a feature image of the training face image using the densely connected network in the face recognition model; A resolution loss calculation module, used to upsample the feature image using the sampling layer in the resolution detection network to obtain a sampled image, fuse the sampled image with the training face image using the fusion layer in the resolution detection network to obtain a fused image, output the predicted resolution of the fused image using the fully connected layer in the resolution detection network, and calculate the resolution loss between the predicted resolution and the true resolution in the true label; A face loss calculation module, used to identify the predicted face image of the feature image using the face detection network in the face recognition model according to the predicted resolution, and calculate the face loss between the predicted face image and the real face image in the real label; A model loss calculation module, used to calculate the model loss of the face recognition model according to the resolution loss and the face loss; A loss judgment module, used to judge whether the model loss is less than a preset loss; A model retraining module, configured to, when the model loss is not less than the preset loss, adjust the parameters of the face recognition model and then return to the step of extracting the feature image of the training face image using the densely connected network in the face recognition model; The face recognition module is used to obtain a trained face recognition model when the model loss is less than the preset loss, and use the trained face recognition model to perform face recognition on the face image to be recognized to obtain a face recognition result.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the face recognition method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the face recognition method according to any one of claims 1 to 6 is implemented.