Face image encryption method, device, computer equipment and storage medium

By performing feature extraction and recursive network prediction on chronological facial images, the problem of easy cracking of the encrypted format of facial recognition data is solved, and the security of facial images is improved.

CN113516723BActive Publication Date: 2025-09-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011306972.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-19
Publication Date
2025-09-12
Estimated Expiration
2040-11-19

AI Technical Summary

Technical Problem

In the existing technology, the encryption format of face recognition data is easy to crack, resulting in poor security of face recognition data.

Method used

By obtaining multiple face images in time sequence and performing feature extraction, the recursive network is used to output prediction information, and the face images are encrypted based on the prediction information.

Benefits of technology

The encryption security of facial images is improved, avoiding the risk of encryption format being cracked.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113516723B_ABST
    Figure CN113516723B_ABST
Patent Text Reader

Abstract

The present application relates to a facial image encryption method, device, computer equipment, and storage medium, and belongs to the field of artificial intelligence technology. The method includes: obtaining N facial images in a time sequence; performing feature extraction on the N facial images to obtain the image features corresponding to the N facial images; inputting the image features into the recursive network in the image prediction model in time sequence, and outputting the prediction information of each of the N facial images; the prediction information is used to indicate the prediction result of the corresponding facial image; the recursive network is a network that predicts the input image features through state information, and the state information is information updated based on the image features of the input facial image; based on the prediction information of each of the N facial images, the N facial images are encrypted. Through the above scheme, the situation where the encryption format of the facial image is easily cracked is avoided, and the security of the encrypted facial image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to a facial image encryption method, apparatus, computer equipment, and storage medium. Background Art

[0002] With the rapid development of artificial intelligence (AI), its applications in daily life are becoming more and more widespread, including in facial recognition technology. Facial recognition can be used in payment scenarios to realize "face-swiping" payment.

[0003] In related technologies, in order to ensure the security of facial data collected by face scanning, it is usually necessary to encrypt the facial data. The commonly used encryption method is to encrypt the facial data using an asymmetric algorithm according to a certain encryption format, where the encryption format usually introduces a timestamp or counter of the facial data.

[0004] However, when the above scheme is used to encrypt the face-scanning data, the encryption format of the face-scanning data may be easily cracked, resulting in poor security of the face-scanning data. Summary of the Invention

[0005] The present invention provides a facial image encryption method, apparatus, computer device, and storage medium that can improve the security of facial images. The technical solution is as follows:

[0006] In one aspect, a method for encrypting a face image is provided, the method comprising:

[0007] Get N face images in time order; N is an integer greater than or equal to 2;

[0008] Perform feature extraction on the N face images to obtain image features corresponding to the N face images respectively;

[0009] Inputting the image features corresponding to the N facial images into a recursive network in the image prediction model in the chronological order, obtaining prediction information for each of the N facial images as output by the recursive network; the prediction information is used to indicate a prediction result for the corresponding facial image; the recursive network is a network that predicts the input image features using state information, and the state information is information updated based on the image features of the input facial images;

[0010] The N face images are encrypted based on the prediction information of each of the N face images.

[0011] In one aspect, a facial image encryption device is provided, the device comprising:

[0012] The image acquisition module is used to acquire N face images in time sequence; N is an integer greater than or equal to 2;

[0013] A feature extraction module is used to extract features from the N face images and obtain image features corresponding to the N face images;

[0014] An information output module is configured to input the image features corresponding to the N facial images into a recursive network in the image prediction model in the chronological order, and obtain prediction information for each of the N facial images output by the recursive network; the prediction information is used to indicate a prediction result for the corresponding facial image; the recursive network is a network that predicts input image features using state information, and the state information is information updated based on the image features of the input facial image;

[0015] The picture encryption module is used to encrypt the N face pictures based on the prediction information of each of the N face pictures.

[0016] In a possible implementation, the apparatus further includes:

[0017] a block acquisition module for performing feature extraction on the N face images, and before obtaining the image features corresponding to each of the N face images, performing block processing on the N face images according to a target window size using a block network in the image prediction model to obtain M face blocks corresponding to each of the N face images; M is an integer greater than or equal to 1; and the target window size is a network parameter of the block network;

[0018] The feature extraction module includes:

[0019] The feature extraction submodule is used to extract features of the M face blocks corresponding to each of the N face images based on the attention weights corresponding to the M face blocks, so as to obtain the image features corresponding to the N face images.

[0020] In a possible implementation, the prediction information includes prediction sub-information of each of the M face blocks of the corresponding face image, and the prediction sub-information is used to indicate a prediction result of the corresponding face block.

[0021] In a possible implementation, the feature extraction submodule includes:

[0022] a preprocessing feature unit, configured to preprocess the M face image blocks corresponding to a target face image to obtain preprocessing features of each of the M face image blocks corresponding to the target face image; the target face image is any one of the N face images;

[0023] a target feature acquisition unit, configured to input preprocessed features of each of the M face image blocks corresponding to the target face image into an image feature extraction network in the image prediction model, and acquire image features of the target face image output by the image feature extraction network;

[0024] Among them, the image feature extraction network includes an attention mechanism layer; the attention mechanism layer is used to process the preprocessing features of each of the M face blocks using the attention weights of the M face blocks as parameters.

[0025] In a possible implementation, the pre-processing feature unit is used to:

[0026] Obtaining a grayscale value of a target face image block; the target face image block is any one of the M face image blocks corresponding to the target face image;

[0027] Obtaining a specified type of feature information of the target face image block based on a fast Fourier transform of a specified order of magnitude;

[0028] The grayscale value of the target face image block is combined with the specified type feature information of the target face image block to obtain the preprocessing feature of the target face image block.

[0029] In a possible implementation, the specified type feature information includes:

[0030] At least one of energy distribution feature information, high and low frequency distribution feature information, flatness feature information, and spectrum centroid feature information of the image spectrum.

[0031] In a possible implementation, the apparatus further includes:

[0032] A training data acquisition module is used to acquire training data before acquiring N face images in chronological order, wherein the training data includes K face image samples in chronological order and labeling information of each of the K face image samples;

[0033] A sample feature extraction module is used to extract features from the K face image samples to obtain the image features corresponding to the K face image samples;

[0034] a sample prediction information acquisition module, configured to input the image features corresponding to the K face image samples into the recursive network in the image prediction model in sequence according to the chronological order, and obtain prediction information of each of the K face image samples output by the recursive network;

[0035] A sample prediction result acquisition module, configured to acquire prediction results of each of the K face image samples based on the prediction information of each of the K face image samples;

[0036] A loss function value acquisition module, configured to acquire a loss function value based on the prediction results of each of the K face image samples and the annotation information of each of the K face image samples;

[0037] A model updating module is used to update the image prediction model based on the loss function value.

[0038] In a possible implementation, the model updating module includes:

[0039] A parameter updating submodule is used to update the parameters of the block network and the image feature extraction network based on the loss function value.

[0040] In one possible implementation, the recursive network includes:

[0041] At least one of a bidirectional gated recurrent unit (BGRU), a gated recurrent unit (GRU), and a long short-term memory (LSTM).

[0042] In one possible implementation, the image encryption module includes:

[0043] The picture encryption submodule is used to splice the N face pictures with the corresponding prediction information to generate encrypted picture data of the N face pictures.

[0044] In a possible implementation, the prediction information is used to indicate whether the corresponding face image contains a face.

[0045] In a possible implementation, the N face images are face images collected sequentially in chronological order during a single face recognition process.

[0046] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the facial image encryption method as described above.

[0047] On the other hand, a computer-readable storage medium is provided, which stores at least one instruction, at least one program, a code set or an instruction set. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the facial image encryption method as described above.

[0048] According to one aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the facial image encryption method provided in various optional implementations of the above aspects.

[0049] The technical solution provided by this application may have the following beneficial effects:

[0050] In the solution shown in the embodiment of the present application, after the features of each facial image in a time sequence are extracted, the prediction information corresponding to each facial image is output through a recursive network, and each facial image is encrypted based on the prediction information corresponding to each facial image. Among them, the prediction information of the image features of the currently input facial image can be output based on the status information updated by the image features of the input facial image. Through the above solution, the prediction information of the output facial image can be affected by considering the correlation of the image features of the facial image in the time dimension, thereby avoiding the situation where the encryption format of the facial image is easily cracked, thereby improving the security of the encrypted facial image.

[0051] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0053] Figure 1 is a schematic diagram of a face image encryption system according to an exemplary embodiment;

[0054] Figure 2 is a schematic diagram of a face collection terminal according to an exemplary embodiment;

[0055] Figure 3 is a flowchart of a face image encryption method according to an exemplary embodiment;

[0056] Figure 4 This is a flowchart of a face image encryption method according to an exemplary embodiment;

[0057] Figure 5 yes Figure 4 A schematic diagram of a BGRU structure involved in the illustrated embodiment;

[0058] Figure 6 yes Figure 4 A schematic diagram of continuous-time facial image acquisition according to the illustrated embodiment;

[0059] Figure 7 yes Figure 4 A schematic diagram of an image prediction model structure involved in the illustrated embodiment;

[0060] Figure 8 is a structural diagram of a face image encryption system according to an exemplary embodiment;

[0061] Figure 9 is a block diagram of a face image encryption device according to an exemplary embodiment;

[0062] Figure 10 is a structural diagram of a computer device according to an exemplary embodiment;

[0063] Figure 11 It is a structural block diagram of a computer device according to an exemplary embodiment. DETAILED DESCRIPTION

[0064] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0065] It should be understood that the term "several" in this document refers to one or more, and "multiple" refers to two or more. "And / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exists simultaneously, or B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0066] The solutions shown in the subsequent embodiments of this application can be implemented with the help of artificial intelligence (AI) during the face-swiping payment process. After obtaining the user's facial images in chronological order, the predicted information corresponding to each facial image is output through a recursive network after feature extraction. Each facial image is encrypted based on the predicted information corresponding to each facial image, thereby improving the security of the encrypted facial image. For ease of understanding, the terms involved in the embodiments of this disclosure are explained below.

[0067] 1) Artificial Intelligence (AI)

[0068] 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, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0069] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0070] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, robots, smart medical care, smart customer service, smart video services, etc. With the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0071] 2) Computer Vision (CV)

[0072] Computer vision is the study of how machines can "see." Specifically, it refers to machine vision, where cameras and computers replace the human eye in identifying and measuring objects, performing further image processing to create images more suitable for human observation or transmission to instrumentation. As a scientific discipline, computer vision studies related theories and technologies, aiming to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / action recognition, three-dimensional object reconstruction, 3D (3D) technology, virtual reality, augmented reality, and mapping.

[0073] 3) Machine Learning (ML)

[0074] Machine learning is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning through demonstration.

[0075] The solutions provided in the embodiments of this application involve artificial intelligence face recognition, machine learning and other technologies, which are specifically described through the following embodiments:

[0076] The solution of the embodiment of the present application includes a model training stage and an image processing stage. Figure 1 FIG. 1 is a schematic diagram of a face image encryption system according to an exemplary embodiment. Figure 1 As shown, in the model training stage, the model training device 110 trains a machine learning model by inputting each group of sample face images. In the image processing stage, the image processing device 120 can output the prediction results corresponding to the group of face images based on the trained machine learning model and the input groups of face images that need to be encrypted, and package the prediction results and the group of face images in a certain data format to complete the encryption of the group of face images.

[0077] Among them, the above-mentioned model training device 110 and image processing device 120 can be computer devices with machine learning capabilities. For example, the computer device can be a fixed computer device such as a personal computer, a server, and a fixed scientific research equipment, or the computer device can also be a mobile computer device such as a tablet computer and an e-book reader.

[0078] In one possible implementation, the model training device 110 and the image processing device 120 are the same device, or the model training device 110 and the image processing device 120 are different devices. Furthermore, when the model training device 110 and the image processing device 120 are different devices, the model training device 110 and the image processing device 120 can be the same type of device, such as the model training device 110 and the image processing device 120 can both be personal computers; or the model training device 110 and the image processing device 120 can also be different types of devices, such as the model training device 110 can be a server, and the image processing device 120 can be a fixed scientific research experimental device, etc. The embodiment of the present application does not limit the specific types of the model training device 110 and the image processing device 120.

[0079] Among them, the face collection terminal 130 can be a smart phone, tablet computer, laptop computer, desktop computer, cash register device, etc. with face recognition function, but is not limited to this.

[0080] The image processing device 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also 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, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0081] In one possible implementation, the facial image encryption system is applied to a smart payment platform, wherein the facial collection terminal 130 may be a large-screen self-service checkout device. When a user uses the large-screen self-service checkout device, facial images of the user over a period of time may be collected on one side of the large-screen self-service checkout device. The facial images include a number of facial images in time sequence, which are uploaded to the image processing device 120 through a transmission network. The image processing device 120 performs feature extraction and calculation on each facial image in time sequence through a machine learning model, and finally outputs a prediction result corresponding to each facial image. Each facial image and the corresponding prediction result are encrypted in a specified data format to generate an encrypted facial image.

[0082] The face acquisition terminal 130 and the image processing device 120 are connected via a communication network. Optionally, the communication network is a wired network or a wireless network.

[0083] Optionally, the above-mentioned wireless network or wired network uses standard communication technology and / or protocol. The network is typically the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network). In some embodiments, technologies and / or formats including Hypertext Markup Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged over the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec), etc. can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above-mentioned data communication technologies. This application is not limited here.

[0084] When face recognition technology is applied in smart payment, facial images are collected through a face collection terminal. Figure 2 FIG. 1 is a schematic diagram of a face collection terminal according to an exemplary embodiment. Figure 2 As shown, the face acquisition terminal 20 includes a camera component 21, a display screen 22, a voucher printing area 23 and a product scanning area 24.

[0085] The camera assembly 21 can capture the user's facial image, and the captured facial image and the capture result can be displayed on the display screen 22.

[0086] During the payment process, the user can enter the product information of the product to be paid in the product scanning area 24 and then start the face recognition payment process.

[0087] The display screen 22 can support displaying interface information and performing touch operations by the user.

[0088] Figure 3 This is a flowchart of a face image encryption method according to an exemplary embodiment. The face image encryption method can be executed by a computer device. The computer device can be a server. For example, the computer device can be Figure 1 The image processing device 120 shown. Figure 3 As shown, the face image encryption method includes the following steps:

[0089] In step 301, N face pictures in time sequence are obtained; N is an integer greater than or equal to 2.

[0090] In an embodiment of the present application, a computer device obtains an image video uploaded by a face acquisition terminal within a specified time period, and obtains N face images arranged in chronological order from the image video, where N is an integer greater than or equal to 2.

[0091] In a possible implementation, the time intervals between the N face images in time sequence are the same.

[0092] The computer device may obtain each frame of the face image in the image video as N face images.

[0093] In step 302, feature extraction is performed on the N face images to obtain image features corresponding to the N face images.

[0094] In an embodiment of the present application, a computer device performs feature extraction on the N facial images obtained through an image feature extraction network in a trained image prediction model to obtain image features corresponding to the N facial images.

[0095] In one possible implementation, the image prediction model is a neural network model trained by a gradient descent algorithm based on the TensorFlow machine learning library with cross entropy as the loss function.

[0096] Among them, feature extraction of N face images can be performed through an image feature extraction network in an image prediction model, and the image feature extraction network may include a convolution layer and a pooling layer.

[0097] In step 303, the image features corresponding to the N face images are input into the recursive network in the image prediction model in chronological order to obtain prediction information of each of the N face images output by the recursive network; the prediction information is used to indicate the prediction result of the corresponding face image; the recursive network is a network that predicts the input image features through state information, and the state information is information updated based on the image features of the input face image.

[0098] In an embodiment of the present application, a computer device inputs the image features corresponding to the N facial images obtained through feature extraction into the recursive network in the image prediction model in sequence according to the time sequence of the N facial images, and outputs the prediction information of each of the N facial images through calculation of the recursive network.

[0099] In the image prediction model, a recursive network can be added after the image feature extraction network. The recursive network can determine the current state of the recursive network based on the image features of the input face image. Based on the current state of the recursive network, the features of the current input image can be predicted and the prediction result can be output.

[0100] In step 304, the N face images are encrypted based on the prediction information of each of the N face images.

[0101] In an embodiment of the present application, a computer device encrypts N face images respectively based on the respective prediction information output after the image features of the N face images are input into a recursive network.

[0102] In one possible implementation, the prediction results corresponding to the N face images are combined with the image data of the N face images according to a specified data structure to generate the N encrypted face images.

[0103] In summary, in the solution shown in the embodiment of the present application, after the features of each face image in time sequence are extracted, the prediction information corresponding to each face image is output through a recursive network, and each face image is encrypted based on the prediction information corresponding to each face image. Among them, the prediction information of the image features of the currently input face image can be output by the state information updated by the image features of the input face image. Through the above solution, the prediction information of the output face image can be affected by considering the correlation of the image features of the face image in the time dimension, thereby avoiding the situation where the encryption format of the face image is easily cracked, thereby improving the security of the encrypted face image.

[0104] Figure 4 This is a flowchart of a face image encryption method according to an exemplary embodiment. The face image encryption method can be executed by a computer device. The computer device can be a server. For example, the computer device can be Figure 1 The image processing device 120 shown. Figure 4 As shown, the face image encryption method includes the following steps:

[0105] In step 401, training data is obtained.

[0106] In an embodiment of the present application, a model training device obtains training data for model training.

[0107] The training data includes K face image samples in time sequence and the labeling information of each of the K face image samples.

[0108] The annotation information may be used to indicate whether the face image belongs to the target face, or the label of the face image.

[0109] For example, multiple facial image segments are collected, each of which contains half positive sample facial images and half negative sample facial images. The facial images used as positive sample facial images are of relatively good quality. The facial images used as negative sample facial video data are non-face images or of poor quality. The collected training data is preprocessed, i.e., cleaned, to remove invalid facial images from the training data.

[0110] Invalid facial images may include facial images that are too dark or too black, resulting in the inability to extract facial data from the images.

[0111] In step 402, feature extraction is performed on the K face image samples to obtain image features corresponding to the K face image samples.

[0112] In an embodiment of the present application, a computer device used for model training performs block processing on K face image samples to obtain L face block samples corresponding to each of the K face image samples, and then performs feature extraction on the L face block samples corresponding to each of the K face images based on the attention weights corresponding to the L face block samples to obtain image features corresponding to the K face images.

[0113] Wherein, K is an integer greater than or equal to 2. L is an integer greater than or equal to 1.

[0114] Exemplarily, a computer device divides each face image sample in each face image sample into blocks using multiple window sizes, and converts the RGB three-color face block samples into gray face block samples, and then extracts feature information using different fast Fourier transform orders of magnitude to obtain at least one of the energy distribution feature information, high and low frequency distribution feature information, flatness feature information, and spectrum centroid feature information of the image spectrum corresponding to each face block sample, splices the grayscale value of each face block sample and the corresponding obtained feature information of the specified type, and inputs them into the input layer of the image prediction model, and then passes through the convolution layer, the pooling layer, and the attention mechanism layer to perform feature extraction on each face block sample to obtain the image features corresponding to the K face images.

[0115] In step 403, the image features corresponding to the K face image samples are sequentially input into the recursive network in the image prediction model in chronological order to obtain the prediction information of each of the K face image samples output by the recursive network.

[0116] In an embodiment of the present application, a computer device inputs the image features corresponding to the K facial image samples output by the image feature extraction network into the recursive network in the image prediction model in chronological order to obtain the prediction information of each of the K facial image samples output by the recursive network.

[0117] Among them, the prediction information is used to indicate the prediction result of the corresponding face image sample; the recursive network is a network that predicts the input image features through state information, and the state information is information updated based on the image features of the input face image sample.

[0118] In one possible implementation, L face block samples corresponding to each of K face image samples are input into a recursive network in chronological order, and prediction information corresponding to the K face image samples is output, where the prediction information corresponding to the face image sample is a vector containing the prediction results of the L face block samples.

[0119] In one possible implementation, the recursive network includes at least one of a bidirectional gated recurrent unit (BGRU), a gated recurrent unit (GRU), and a long short-term memory (LSTM) network.

[0120] for example, Figure 5 This is a schematic diagram of a BGRU structure involved in an embodiment of the present application, such as Figure 5 As shown in the figure, BGRU is a commonly used bidirectional gated recurrent neural network. Its input is the image feature x[t] input at the current moment and the hidden state h[t-1] at the previous moment. That is, the output prediction result y[t] will be affected by the image feature at the current moment t and the hidden state at the previous t-1 moment.

[0121] In step 404, based on the prediction information of each of the K face image samples, prediction results of each of the K face image samples are obtained.

[0122] In one possible implementation, the computer device determines whether the group of training samples is the target face image based on the prediction information of each of the K face image samples.

[0123] In step 405, a loss function value is obtained based on the prediction results of each of the K face image samples and the annotation information of each of the K face image samples.

[0124] In one possible implementation, a computer device counts the prediction results of K facial image samples, and determines the loss function value of the model based on whether the respective prediction results are predicted to be the target face and whether the pre-labeled information of the K facial image samples is the target face.

[0125] In step 406, the image prediction model is updated based on the loss function value.

[0126] In an embodiment of the present application, the computer device updates the model parameters in the image prediction model based on the calculated loss function value until the model training is completed.

[0127] In one possible implementation, parameters of the block network and the image feature extraction network are updated based on the loss function value.

[0128] The updated model parameters include but are not limited to attention weights and target window sizes.

[0129] In a possible implementation, after the image prediction model is trained, the image prediction model is evaluated using a test set.

[0130] Among them, the computer equipment can obtain each group of face images in the test set, convert each group of face images into each group of gray images, then divide each group of gray images into blocks, extract the feature information of each group of gray images, extract the features of several block-by-block face blocks, and then predict them through a recursive network. The prediction results of each face block are counted by voting. If the face block is predicted to be the target face, one vote is cast for the positive sample, otherwise one vote is cast for the negative sample.

[0131] In step 407, N face pictures in time sequence are obtained.

[0132] In one possible implementation, a face acquisition device acquires face images within a specified time period and uploads them to a server. The server obtains N face images from the face images, where N is an integer greater than or equal to 2.

[0133] The specified time period may be a pre-set time length or a time length determined by the face acquisition terminal based on face recognition conditions.

[0134] For example, the developer can directly set the time length for the face acquisition terminal to acquire facial images to 5s. When the face acquisition terminal starts to acquire facial images for 5s, the acquired 5s facial images are uploaded to the server. Alternatively, the face acquisition terminal determines the acquisition time length based on the quality of the currently acquired facial images. The quality of the facial images acquired by the face acquisition terminal may be negatively correlated with the acquisition time length.

[0135] The N facial images obtained from the facial image may be obtained in units of frames, that is, the N facial images include obtaining each frame of the facial image in the facial image.

[0136] In a possible implementation, the N face images are face images collected sequentially in chronological order during a single face recognition process.

[0137] for example, Figure 6 This is a schematic diagram of continuous time face image acquisition involved in the embodiment of the present application, such as Figure 6 As shown, when the user faces the face acquisition terminal, the face acquisition terminal displays a first status screen 61 to prompt the user to make adjustments. When the face image acquisition starts, the second status screen 62 is displayed on the face acquisition terminal. There is a countdown indication in the display area. When the countdown is completed, the acquisition of N face images is completed.

[0138] In step 408, the N face images are divided into blocks according to the target window size through the block network in the image prediction model to obtain M face blocks corresponding to each of the N face images.

[0139] In an embodiment of the present application, a computer device inputs N face images into a block network in an image prediction module, and the block network blocks the N face images according to target windows to obtain M face blocks corresponding to each of the N face images.

[0140] Where M is an integer greater than or equal to 1; the target window size is a network parameter of the block network.

[0141] In one possible implementation, the target window size is a model parameter that is updated during the image prediction model training phase.

[0142] For example, when the target window size is 2·2, if the face image is a 4·4 size image, the face image can be divided into 4 face blocks after passing through the block network.

[0143] In step 409, based on the attention weights corresponding to the M facial blocks, feature extraction is performed on the M facial blocks corresponding to the N facial images to obtain the image features corresponding to the N facial images.

[0144] In an embodiment of the present application, a computer device performs feature extraction on the M face blocks corresponding to each of the N face images based on the attention weights corresponding to the M face blocks, and obtains image features corresponding to the N face images.

[0145] In one possible implementation, a computer device preprocesses M facial blocks corresponding to a target facial image to obtain preprocessed features of each of the M facial blocks corresponding to the target facial image, and then inputs the preprocessed features of each of the M facial blocks corresponding to the target facial image into an image feature extraction network in an image prediction model to obtain image features of the target facial image output by the image feature extraction network.

[0146] Among them, the target face image is any one of N face images, and the image feature extraction network includes an attention mechanism layer; the attention mechanism layer is used to process the preprocessed features of each of the M face blocks with the attention weights of the M face blocks as parameters.

[0147] In one possible implementation, a computer device obtains the grayscale value of a target facial image block, and then obtains a specified type of feature information of the target facial image block based on a fast Fourier transform of a specified order of magnitude, and combines the grayscale value of the target facial image block with the specified type of feature information of the target facial image block to obtain preprocessing features of the target facial image block.

[0148] The target face block is any one of the M face blocks corresponding to the target face image.

[0149] Exemplarily, a computer device inputs M facial tiles corresponding to each of N facial images into an image feature extraction network. The network then extracts features from each of the M facial tiles to obtain tile features corresponding to each of the M facial tiles. The network includes an attention mechanism layer, which can be used to assign attention weights to each facial tile. Based on the tile features, image features for the N facial images corresponding to each of the M facial tiles are obtained.

[0150] Among them, the image feature extraction network can include convolution layers and pooling layers.

[0151] For example, the first layer of the image prediction model is the input layer, and then a convolution layer with 64 convolution kernels, a convolution kernel size of 3.3, a stride of 1, and a padding of 1 can be used as the second layer, a pooling layer with a window size of 2.2 and a stride of 2 can be used as the third layer, a convolution layer with 128 convolution kernels, a convolution kernel size of 3.3, a stride of 1, and a padding of 1 can be used as the fourth layer, a pooling layer with a window size of 2.2 and a stride of 2 can be used as the fifth layer, a convolution layer with 256 convolution kernels, a convolution kernel size of 3.3, a stride of 1, and a padding of 1 can be used as the sixth layer, a pooling layer with a window size of 2.2 and a stride of 2 can be used as the seventh layer, and a batch normalization layer can be added to the eighth layer. Normalization), and a maximum pooling layer (MaxPooling) is added in the ninth layer. The attention mechanism layer can be placed before the convolutional layer or the pooling layer.

[0152] In a possible implementation, the specified type of feature information includes at least one of energy distribution feature information, high and low frequency distribution feature information, flatness feature information, and spectrum centroid feature information of the image spectrum.

[0153] For example, the computer device can extract the energy distribution features of the image spectrum when the order of magnitude of the fast Fourier transform (FFT Size) is 4096, and standardize the energy distribution features of the image spectrum. The computer device can extract the distribution features of high and low frequencies when the order of magnitude of the fast Fourier transform (FFT Size) is 2048, and standardize the distribution features of high and low frequencies. The computer device can extract the flatness feature when the order of magnitude of the fast Fourier transform (FFT Size) is 1024, and standardize the flatness feature. The computer device can extract the spectrum centroid feature when the order of magnitude of the fast Fourier transform (FFT Size) is 1024, and standardize the spectrum centroid feature.

[0154] In step 410, the image features corresponding to the N face images are sequentially input into the recursive network in the image prediction model in chronological order to obtain prediction information of each of the N face images output by the recursive network.

[0155] In an embodiment of the present application, a computer device inputs the image features corresponding to N facial images output by the image feature extraction network into the recursive network in the image prediction model in chronological order to obtain the prediction information of each of the N facial images output by the recursive network.

[0156] In one possible implementation, each of the M facial image blocks is sequentially input into a recursive network in the chronological order of the corresponding N facial images. The recursive network outputs a prediction result corresponding to each facial block. Based on the prediction results for each of the M facial image blocks, prediction information for each of the N facial images is obtained.

[0157] Among them, the prediction information is used to indicate the prediction result of the corresponding face image; the recursive network is a network that predicts the input image features through state information, and the state information is information updated based on the image features of the input face image.

[0158] In a possible implementation, the prediction information is information indicating whether the corresponding face image contains a face.

[0159] In one possible implementation, the recursive network includes at least one of a bidirectional gated recurrent unit (BGRU), a gated recurrent unit (GRU), and a long short-term memory (LSTM) network.

[0160] For example, the tenth layer of the image prediction model can include a bidirectional gated recurrent unit (BGRU) with 256 hidden units. When two face images each correspond to two face patches, they are fed into the recurrent network in chronological order, starting with the two face patches corresponding to the first face image sample. If the face patch is predicted to contain facial information, the prediction result for that patch is 1; otherwise, it is 0. If both face patches are predicted to contain facial information, the prediction for the first face image is a (1, 1) vector.

[0161] In one possible implementation, the prediction results of each of the M face blocks in the N face images are output through the sigmoid function used in the last layer of the image prediction model.

[0162] The prediction information can be an output logits value of M·Y, where M is the number of blocks the model input image is divided into, and Y is the prediction result value of each block, which is 0 or 1.

[0163] for example, Figure 7 This is a schematic diagram of the structure of the image prediction model involved in the embodiment of this application. Figure 7 As shown, the spectrum graph 71 corresponding to the face image is input into each convolutional layer for feature extraction, and then the extracted features are output in the time dimension through the recursive network 72, and the predicted label 73 corresponding to the spectrum graph 71 is output through the fully connected layer.

[0164] In a possible implementation, the prediction information includes prediction sub-information of each of the M face blocks of the corresponding face image, where the prediction sub-information is used to indicate a prediction result of the corresponding face block.

[0165] In step 411, N face images and their corresponding prediction information are spliced ​​together to generate encrypted image data of the N face images.

[0166] In an embodiment of the present application, a computer device splices N face images with their corresponding prediction information to generate encrypted image data of the N face images.

[0167] In one possible implementation, based on the target data structure, N face images and their respective prediction information are concatenated to generate N encrypted face images.

[0168] Exemplarily, the target data structure may be an encrypted face image generated by splicing in the format of {prediction information}{payload}, where payload is the face data corresponding to the face image.

[0169] In another possible implementation, based on the target data structure, N face images are concatenated with their respective prediction information and face data attribute information to generate N encrypted face images.

[0170] In one possible implementation, the facial data attribute information includes at least one of timestamp information (timestamp), counter information (counter), magic word information (magic_num), device model information (device_info), signature algorithm version information (sign_version), and random number information (random).

[0171] Exemplarily, the target data structure may be an encrypted face image generated by splicing in the format of {magic_num}{device_info}{sign_version}{timestamp}{counter}{prediction information}{random}{payload}.

[0172] In summary, in the solution shown in the embodiment of the present application, after the features of each face image in time sequence are extracted, the prediction information corresponding to each face image is output through a recursive network, and each face image is encrypted based on the prediction information corresponding to each face image. Among them, the prediction information of the image features of the currently input face image can be output by the state information updated by the image features of the input face image. Through the above solution, the prediction information of the output face image can be affected by considering the correlation of the image features of the face image in the time dimension, thereby avoiding the situation where the encryption format of the face image is easily cracked, thereby improving the security of the encrypted face image.

[0173] Figure 8 FIG. 1 is a structural diagram of a face image encryption system according to an exemplary embodiment. Figure 8As shown, N face pictures of the user in time sequence are collected by the face collection terminal 81, namely face picture 1 corresponding to time t1, face picture 2 corresponding to time t2, and face picture N corresponding to time tN. N face images are transmitted to the server 82, and the N face images are divided into blocks through the block network 821, and each face block has an attention weight. Each face block with an attention weight is input into the image feature extraction network 822. The image feature extraction network 822 includes a convolution layer and a pooling layer. The extracted features corresponding to the N extracted face images are input into the recursive network 823 in chronological order. Based on the extracted features corresponding to face image 1 and the hidden state of the current BGRU unit, the hidden state corresponding to the next moment and the prediction information corresponding to face image 1 are output. Then, based on the extracted features corresponding to face image 2 and the hidden state after processing of face image 1, the hidden state corresponding to the next moment and the prediction information corresponding to face image 2 are output, until the prediction information corresponding to face image N is output. The image data of the N face images are spliced ​​with the corresponding prediction information to generate encrypted face images.

[0174] In summary, in the solution shown in the embodiment of the present application, after the features of each face image in time sequence are extracted, the prediction information corresponding to each face image is output through a recursive network, and each face image is encrypted based on the prediction information corresponding to each face image. Among them, the prediction information of the image features of the currently input face image can be output by the state information updated by the image features of the input face image. Through the above solution, the prediction information of the output face image can be affected by considering the correlation of the image features of the face image in the time dimension, thereby avoiding the situation where the encryption format of the face image is easily cracked, thereby improving the security of the encrypted face image.

[0175] Figure 9 is a block diagram of a face image encryption device according to an exemplary embodiment. Figure 9 As shown, the face picture encryption device can be implemented as all or part of a computer device through hardware or a combination of hardware and software to perform Figure 3 or Figure 4 All or part of the steps of the method shown in the corresponding embodiment. The face image encryption device may include:

[0176] The picture acquisition module 910 is used to acquire N face pictures in time sequence; N is an integer greater than or equal to 2;

[0177] A feature extraction module 920 is configured to extract features from the N face images to obtain image features corresponding to the N face images.

[0178] Information output module 930 is configured to input the image features corresponding to the N facial images into a recursive network in the image prediction model in the chronological order, and obtain prediction information for each of the N facial images output by the recursive network; the prediction information is used to indicate the prediction result for the corresponding facial image; the recursive network is a network that predicts the input image features using state information, and the state information is information updated based on the image features of the input facial images;

[0179] The picture encryption module 940 is used to encrypt the N face pictures based on the prediction information of each of the N face pictures.

[0180] In a possible implementation, the apparatus further includes:

[0181] a block acquisition module for performing feature extraction on the N face images, and before obtaining the image features corresponding to each of the N face images, performing block processing on the N face images according to a target window size using a block network in the image prediction model to obtain M face blocks corresponding to each of the N face images; M is an integer greater than or equal to 1; and the target window size is a network parameter of the block network;

[0182] The feature extraction module 920 includes:

[0183] The feature extraction submodule is used to extract features of the M face blocks corresponding to each of the N face images based on the attention weights corresponding to the M face blocks, so as to obtain the image features corresponding to the N face images.

[0184] In a possible implementation, the prediction information includes prediction sub-information of each of the M face blocks of the corresponding face image, and the prediction sub-information is used to indicate a prediction result of the corresponding face block.

[0185] In a possible implementation, the feature extraction submodule includes:

[0186] a preprocessing feature unit, configured to preprocess the M face image blocks corresponding to a target face image to obtain preprocessing features of each of the M face image blocks corresponding to the target face image; the target face image is any one of the N face images;

[0187] a target feature acquisition unit, configured to input preprocessed features of each of the M face image blocks corresponding to the target face image into an image feature extraction network in the image prediction model, and acquire image features of the target face image output by the image feature extraction network;

[0188] Among them, the image feature extraction network includes an attention mechanism layer; the attention mechanism layer is used to process the preprocessing features of each of the M face blocks using the attention weights of the M face blocks as parameters.

[0189] In a possible implementation, the pre-processing feature unit is used to:

[0190] Obtaining a grayscale value of a target face image block; the target face image block is any one of the M face image blocks corresponding to the target face image;

[0191] Obtaining a specified type of feature information of the target face image block based on a fast Fourier transform of a specified order of magnitude;

[0192] The grayscale value of the target face image block is combined with the specified type feature information of the target face image block to obtain the preprocessing feature of the target face image block.

[0193] In a possible implementation, the specified type feature information includes:

[0194] At least one of energy distribution feature information, high and low frequency distribution feature information, flatness feature information, and spectrum centroid feature information of the image spectrum.

[0195] In a possible implementation, the apparatus further includes:

[0196] A training data acquisition module is used to acquire training data before acquiring N face images in chronological order, wherein the training data includes K face image samples in chronological order and labeling information of each of the K face image samples;

[0197] A sample feature extraction module is used to extract features from the K face image samples to obtain the image features corresponding to the K face image samples;

[0198] a sample prediction information acquisition module, configured to input the image features corresponding to the K face image samples into the recursive network in the image prediction model in sequence according to the chronological order, and obtain prediction information of each of the K face image samples output by the recursive network;

[0199] A sample prediction result acquisition module, configured to acquire prediction results of each of the K face image samples based on the prediction information of each of the K face image samples;

[0200] A loss function value acquisition module, configured to acquire a loss function value based on the prediction results of each of the K face image samples and the annotation information of each of the K face image samples;

[0201] A model updating module is used to update the image prediction model based on the loss function value.

[0202] In a possible implementation, the model updating module includes:

[0203] A parameter updating submodule is used to update the parameters of the block network and the image feature extraction network based on the loss function value.

[0204] In one possible implementation, the recursive network includes:

[0205] At least one of a bidirectional gated recurrent unit (BGRU), a gated recurrent unit (GRU), and a long short-term memory (LSTM).

[0206] In one possible implementation, the image encryption module 940 includes:

[0207] The picture encryption submodule is used to splice the N face pictures with the corresponding prediction information to generate encrypted picture data of the N face pictures.

[0208] In a possible implementation, the prediction information is used to indicate whether the corresponding face image contains a face.

[0209] In a possible implementation, the N face images are face images collected sequentially in chronological order during a single face recognition process.

[0210] In summary, in the solution shown in the embodiment of the present application, after the features of each face image in time sequence are extracted, the prediction information corresponding to each face image is output through a recursive network, and each face image is encrypted based on the prediction information corresponding to each face image. Among them, the prediction information of the image features of the currently input face image can be output by the state information updated by the image features of the input face image. Through the above solution, the prediction information of the output face image can be affected by considering the correlation of the image features of the face image in the time dimension, thereby avoiding the situation where the encryption format of the face image is easily cracked, thereby improving the security of the encrypted face image.

[0211] Figure 101 is a schematic diagram illustrating the structure of a computer device according to an exemplary embodiment. The computer device 1000 includes a central processing unit (CPU) 1001, a system memory 1004 including a random access memory (RAM) 1002 and a read-only memory (ROM) 1003, and a system bus 1005 connecting the system memory 1004 and the CPU 1001. The computer device 1000 also includes a basic input / output system (I / O system) 1006 for facilitating information transmission between various components within the computer device, and a mass storage device 1007 for storing an operating system 1013, application programs 1014, and other program modules 1015.

[0212] The basic input / output system 1006 includes a display 1008 for displaying information and an input device 1009, such as a mouse or keyboard, for user input. Both the display 1008 and the input device 1009 are connected to the central processing unit 1001 via an input / output controller 1010 connected to the system bus 1005. The basic input / output system 1006 may also include an input / output controller 1010 for receiving and processing input from a variety of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1010 also provides output to a display screen, printer, or other types of output devices.

[0213] The mass storage device 1007 is connected to the central processing unit 1001 via a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1007 and its associated computer-readable medium provide non-volatile storage for the computer device 1000. In other words, the mass storage device 1007 may include a computer-readable medium (not shown) such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.

[0214] Without loss of generality, the computer device readable medium may include computer device storage media and communication media. Computer device storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer device readable instructions, data structures, program modules or other data. Computer device storage media include RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), CD-ROM, Digital Video Disc (DVD) or other optical storage, tape cassettes, magnetic tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer device storage media are not limited to the above-mentioned ones. The above-mentioned system memory 1004 and mass storage device 1007 can be collectively referred to as memory.

[0215] According to various embodiments of the present disclosure, the computer device 1000 may also be connected to a remote computer device on a network such as the Internet for operation. That is, the computer device 1000 may be connected to the network 1012 via the network interface unit 1011 connected to the system bus 1005, or the network interface unit 1011 may be used to connect to other types of networks or remote computer device systems (not shown).

[0216] The memory also includes one or more programs, which are stored in the memory. The CPU 1001 executes the one or more programs to implement Figure 3 or Figure 4 All or part of the steps of the method shown.

[0217] Figure 11 is a block diagram of a computer device 1100 according to an exemplary embodiment. The computer device 1100 may be Figure 1 The terminal in the face recognition system shown.

[0218] Typically, the computer device 1100 includes a processor 1101 and a memory 1102 .

[0219] The processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1101 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1101 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0220] Memory 1102 may include one or more computer-readable storage media, which may be non-transitory. Memory 1102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 1102 is used to store at least one instruction, which is used to be executed by processor 1101 to implement the method provided in the method embodiment of the present application.

[0221] In some embodiments, computer device 1100 may optionally include a peripheral device interface 1103 and at least one peripheral device. Processor 1101, memory 1102, and peripheral device interface 1103 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1103 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1104, a display screen 1105, a camera assembly 1106, an audio circuit 1107, and a power supply 1109.

[0222] The peripheral device interface 1103 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 1101 and the memory 1102. In some embodiments, the processor 1101, the memory 1102, and the peripheral device interface 1103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1101, the memory 1102, and the peripheral device interface 1103 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0223] The RF circuit 1104 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1104 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1104 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the RF circuit 1104 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The RF circuit 1104 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1104 may also include circuitry related to Near Field Communication (NFC), although this application does not limit this.

[0224] The display screen 1105 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1105 is a touch screen display, the display screen 1105 also has the ability to collect touch signals on the surface or above the surface of the display screen 1105. The touch signal can be input as a control signal to the processor 1101 for processing. In this case, the display screen 1105 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, there can be one display screen 1105, which is set on the front panel of the computer device 1100; in other embodiments, there can be at least two display screens 1105, which are respectively set on different surfaces of the computer device 1100 or in a folding design; in still other embodiments, the display screen 1105 can be a flexible display screen, which is set on the curved surface or folding surface of the computer device 1100. Even more, the display screen 1105 can be set into a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1105 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0225] The camera assembly 1106 is used to capture images or videos. Optionally, the camera assembly 1106 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1106 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0226] The audio circuit 1107 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 1101 for processing, or input into the radio frequency circuit 1104 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the computer device 1100. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 1101 or the radio frequency circuit 1104 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as distance measurement. In some embodiments, the audio circuit 1107 may also include a headphone jack.

[0227] Power supply 1109 is used to power various components in computer device 1100. Power supply 1109 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 1109 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0228] In some embodiments, the computer device 1100 further includes one or more sensors 1110 , including but not limited to an acceleration sensor 1111 , a gyroscope sensor 1112 , a pressure sensor 1113 , an optical sensor 1115 , and a proximity sensor 1116 .

[0229] The accelerometer 1111 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the computer device 1100. For example, the accelerometer 1111 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 1101 can control the touch screen display 1105 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 1111. The accelerometer 1111 can also be used to collect game or user motion data.

[0230] The gyroscope sensor 1112 can detect the orientation and rotation angle of the computer device 1100. It can also work with the accelerometer 1111 to collect 3D motions of the user on the computer device 1100. Based on the data collected by the gyroscope sensor 1112, the processor 1101 can implement the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0231] The pressure sensor 1113 can be installed on the side frame of the computer device 1100 and / or below the touch screen display 1105. When the pressure sensor 1113 is installed on the side frame of the computer device 1100, it can detect the user's grip signal of the computer device 1100, and the processor 1101 can perform left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 1113. When the pressure sensor 1113 is installed below the touch screen display 1105, the processor 1101 controls the operational controls on the UI interface based on the user's pressure operation on the touch screen display 1105. The operational controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0232] Optical sensor 1115 is used to detect ambient light intensity. In one embodiment, processor 1101 can control the display brightness of touchscreen display 1105 based on the ambient light intensity detected by optical sensor 1115. Specifically, when the ambient light intensity is high, the display brightness of touchscreen display 1105 is increased; when the ambient light intensity is low, the display brightness of touchscreen display 1105 is decreased. In another embodiment, processor 1101 can also dynamically adjust the shooting parameters of camera assembly 1106 based on the ambient light intensity detected by optical sensor 1115.

[0233] Proximity sensor 1116, also known as a distance sensor, is typically located on the front panel of computer device 1100. Proximity sensor 1116 is used to detect the distance between the user and the front of computer device 1100. In one embodiment, when proximity sensor 1116 detects that the distance between the user and the front of computer device 1100 is gradually decreasing, processor 1101 controls touchscreen display 1105 to switch from the screen-on state to the screen-off state. When proximity sensor 1116 detects that the distance between the user and the front of computer device 1100 is gradually increasing, processor 1101 controls touchscreen display 1105 to switch from the screen-off state to the screen-on state.

[0234] Those skilled in the art will understand that Figure 11 The structure shown in the figure does not constitute a limitation on the computer device 1100, and the computer device 1100 may include more or fewer components than shown in the figure, or combine some components, or adopt a different component arrangement.

[0235] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including at least one instruction, at least one program, code set, or instruction set, which can be executed by a processor to perform the above-mentioned Figure 3 or Figure 4All or part of the steps of the method shown in any embodiment. For example, the non-transitory computer-readable storage medium may be a ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

[0236] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present disclosure can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer device.

[0237] According to one aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the facial image encryption method provided in various optional implementations of the above aspects.

[0238] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0239] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A face image encryption method, characterized in that: The method comprises: Get N face images in time order; N is an integer greater than or equal to 2; Using a block network in an image prediction model, the N face images are divided into blocks according to a target window size to obtain M face blocks corresponding to each of the N face images; M is an integer greater than or equal to 1; Based on a fast Fourier transform of a specified order of magnitude, obtaining specified type feature information of a target face block; combining the grayscale value of the target face block with the specified type feature information of the target face block to obtain preprocessing features of the target face block; the target face block is any one of the M face blocks corresponding to the target face image; the target face image is any one of the N face images; inputting the preprocessing features of the M face blocks corresponding to the target face image into an image feature extraction network in an image prediction model, and obtaining image features of the target face image output by the image feature extraction network; the image feature extraction network includes an attention mechanism layer; the attention mechanism layer is used to process the preprocessing features of the M face blocks using the attention weights of the M face blocks as parameters; Inputting the image features corresponding to the N facial images into a recursive network in the image prediction model in the chronological order, obtaining prediction information for each of the N facial images as output by the recursive network; the prediction information is used to indicate a prediction result for the corresponding facial image; the recursive network is a network that predicts the input image features using state information, and the state information is information updated based on the image features of the input facial images; The N face images are encrypted based on the prediction information of each of the N face images.

2. The method according to claim 1, characterized in that The target window size is a network parameter of the block network.

3. The method according to claim 2, characterized in that The prediction information includes prediction sub-information of each of the M face blocks of the corresponding face image, and the prediction sub-information is used to indicate the prediction result of the corresponding face block.

4. The method according to claim 1, wherein The specified type feature information includes: At least one of energy distribution feature information, high and low frequency distribution feature information, flatness feature information, and spectrum centroid feature information of the image spectrum.

5. The method according to claim 1, wherein Before obtaining N face images in time sequence, the method further includes: Acquire training data, where the training data includes K face image samples in chronological order and labeling information of each of the K face image samples; Perform feature extraction on the K face image samples to obtain image features corresponding to the K face image samples; Inputting the image features corresponding to the K face image samples into the recursive network in the image prediction model in the chronological order, and obtaining prediction information of each of the K face image samples output by the recursive network; Based on the prediction information of each of the K face image samples, obtaining a prediction result for each of the K face image samples; Obtaining a loss function value based on the prediction results of each of the K face image samples and the annotation information of each of the K face image samples; Based on the loss function value, the image prediction model is updated.

6. The method according to claim 5, characterized in that The updating of the image prediction model based on the loss function value includes: Based on the loss function value, parameters of the block network and the image feature extraction network are updated.

7. The method according to any one of claims 1 to 6, characterized in that: The recursive network includes: At least one of a bidirectional gated recurrent unit (BGRU), a gated recurrent unit (GRU), and a long short-term memory (LSTM).

8. The method according to any one of claims 1 to 6, characterized in that: The encrypting the N face images based on the respective prediction information of the N face images comprises: The N face images are concatenated with the corresponding prediction information to generate encrypted image data of the N face images.

9. The method according to any one of claims 1 to 6, characterized in that: The prediction information is used to indicate whether the corresponding face image contains a face.

10. The method according to any one of claims 1 to 6, characterized in that: The N face images are face images collected in chronological order during a single face recognition process.

11. A facial image encryption device, characterized in that: The device comprises: The image acquisition module is used to acquire N face images in time sequence; N is an integer greater than or equal to 2; a block acquisition module, configured to perform block processing on the N face images according to a target window size through a block network in an image prediction model, and obtain M face blocks corresponding to each of the N face images; where M is an integer greater than or equal to 1; A feature extraction module is configured to obtain, based on a fast Fourier transform of a specified order of magnitude, feature information of a target face block of a specified type; combine the grayscale value of the target face block with the feature information of the specified type of the target face block to obtain preprocessing features of the target face block; the target face block is any one of the M face blocks corresponding to the target face image; the target face image is any one of the N face images; input the preprocessing features of the M face blocks corresponding to the target face image into an image feature extraction network in an image prediction model, and obtain image features of the target face image output by the image feature extraction network; the image feature extraction network includes an attention mechanism layer; the attention mechanism layer is configured to process the preprocessing features of the M face blocks using the attention weights of the M face blocks as parameters; An information output module is configured to input the image features corresponding to the N facial images into a recursive network in the image prediction model in the chronological order, and obtain prediction information for each of the N facial images output by the recursive network; the prediction information is used to indicate a prediction result for the corresponding facial image; the recursive network is a network that predicts input image features using state information, and the state information is information updated based on the image features of the input facial image; The picture encryption module is used to encrypt the N face pictures based on the prediction information of each of the N face pictures.

12. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the facial image encryption method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the facial image encryption method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Face recognition apparatus and recognition method thereof

    CN105023005A

  • Image processing method and device

    CN110751767A